]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Changing background color
authorJean-Marc Pigeon <jmp@safe.c>
Mon, 22 Sep 2025 20:19:03 +0000 (16:19 -0400)
committerJean-Marc Pigeon <jmp@safe.c>
Mon, 22 Sep 2025 20:19:03 +0000 (16:19 -0400)
www/lvlmai.php

index 56c52c19eed13d959493ca2c20e90b83f4a91f58..6cb0dfff1d576c92b77b84c428f4ae8948fbe346 100644 (file)
@@ -37,13 +37,18 @@ $line="";
 $count=$offset+1;
 foreach($actions as $action) {
   $info=substr($action['info'],3,1);
-  //if ($info=="-")
-   // continue;
-  $bgcolor="white";
-  if ($count & 1 ) {
-    $bgcolor="green";
-    }
   $status=$action['status'];
+  switch ($status) {
+    case 250    :
+      $bgcolor="#90EE90";       //light green
+      break;
+    case 555    :
+      $bgcolor="#D3D3D3";       //light gray
+      break;
+    default     :
+      $bgcolor="yellow";
+      break;
+    }
   $date=$action['creation'];
   $reverse=$action['reverse'];
   $smtpfrom=$action['smtpfrom'];
@@ -53,7 +58,7 @@ foreach($actions as $action) {
   if (($subject==NULL) || (strlen($subject)==0)) 
     $subject=htmlspecialchars($action['info'],ENT_QUOTES);
   //generating the table contents
-  $line=$line."<TR>\r\n";
+  $line=$line."<TR bgcolor=\"$bgcolor\">\r\n";
   $line=$line."<TD align=left>$count $status</TD>\r\n";
   $line=$line."<TD align=left>$date</TD>\r\n";
   $line=$line."<TD align=left>$reverse</TD>\r\n";
@@ -73,19 +78,6 @@ $STR  = <<<EOT
 
 $start
 $top
-  <style type="text/css">
-.table-userlist tr:nth-child(odd)
-  {
-  background-color: #66ff99;    /*light green   */
-  color: black ;
-  }
-
-.table-userlist tr:nth-child(even)
-  {
-  background-color: white;
-  color: black ;
-  }
-</style>
 <CENTER>
 <table WIDTH="100%" BORDER="0" CellSpacing="0">
 <table class="table-userlist" WIDTH="100%" BORDER="1" CellSpacing="0">