Changeset 8182 for trunk/MagicSoft/Mars/datacenter/db
- Timestamp:
- 10/31/06 18:22:33 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/db
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/include.php
r8123 r8182 24 24 $checked = ""; 25 25 26 printf(" <input type= \"checkbox\" name=\"%s\" value=\"On\"%s>%s\n", $name, $checked, $text);26 printf(" <input type='checkbox' name='%s' value='On' %s>%s\n", $name, $checked, $text); 27 27 printf("<BR>"); 28 28 29 printf(" <select name= \"%s\">\n", $var);29 printf(" <select name='%s'>\n", $var); 30 30 31 31 $status = array … … 40 40 { 41 41 if ($stat==$i) 42 printf("<option value= \"%d\"selected>%s</option>\n", $i, $status[$i]);42 printf("<option value='%d' selected>%s</option>\n", $i, $status[$i]); 43 43 else 44 printf("<option value= \"%d\">%s</option>\n", $i, $status[$i]);44 printf("<option value='%d'>%s</option>\n", $i, $status[$i]); 45 45 } 46 46 … … 78 78 $checked = ""; 79 79 80 printf(" <input type= \"checkbox\" name=\"%s\" value=\"On\"%s>%s\n", $name, $checked, $text);80 printf(" <input type='checkbox' name='%s' value='On' %s>%s\n", $name, $checked, $text); 81 81 printf("<BR>"); 82 82 83 printf(" <select name= \"%s\">\n", $var);83 printf(" <select name='%s'>\n", $var); 84 84 85 85 $status = array … … 98 98 { 99 99 if ($stat==$i) 100 printf("<option value= \"%d\"selected>%s</option>\n", $i, $status[$i]);100 printf("<option value='%d' selected>%s</option>\n", $i, $status[$i]); 101 101 else 102 printf("<option value= \"%d\">%s</option>\n", $i, $status[$i]);102 printf("<option value='%d'>%s</option>\n", $i, $status[$i]); 103 103 } 104 104 … … 144 144 $checked = ""; 145 145 146 printf(" <input type= \"checkbox\" name=\"%s\" value=\"On\" %s><A HREF=\"printtable.php?fTable=%s\">%s</A>\n", $name, $checked, $table, $descr);146 printf(" <input type='checkbox' name='%s' value='On' %s><A HREF='printtable.php?fTable=%s'>%s</A>\n", $name, $checked, $table, $descr); 147 147 148 148 printf(" <BR>\n"); 149 149 150 printf(" <select name= \"%s\" size=\"1\" class=\"Width\">\n", $index);150 printf(" <select name='%s' size='1' class='Width'>\n", $index); 151 151 152 152 if (empty($_GET[$index]) || $_GET[$index]==0) 153 printf(" <option value= \"0\"selected>--- ALL ---</option>\n");154 else 155 printf(" <option value= \"0\">--- ALL ---</option>\n");153 printf(" <option value='0' selected>--- ALL ---</option>\n"); 154 else 155 printf(" <option value='0'>--- ALL ---</option>\n"); 156 156 157 157 if (!empty($_GET[$index]) && $_GET[$index]==-1) 158 printf(" <option value= \"-1\"selected>--- GROUP BY ---</option>\n");159 else 160 printf(" <option value= \"-1\">--- GROUP BY ---</option>\n");158 printf(" <option value='-1' selected>--- GROUP BY ---</option>\n"); 159 else 160 printf(" <option value='-1'>--- GROUP BY ---</option>\n"); 161 161 162 162 while ($row = mysql_fetch_row($result)) 163 163 { 164 164 if (!empty($_GET[$index]) && $_GET[$index]==$row[0]) 165 printf(" <option value= \"%s\"selected>%s</option>\n", $row[0], $row[1]);165 printf(" <option value='%s' selected>%s</option>\n", $row[0], $row[1]); 166 166 else 167 printf(" <option value= \"%s\">%s</option>\n", $row[0], $row[1]);167 printf(" <option value='%s'>%s</option>\n", $row[0], $row[1]); 168 168 } 169 169 printf(" </select>\n"); … … 258 258 $checked = ""; 259 259 260 printf(" <td><input type=\"checkbox\" name=\"%s\" value=\"On\" %s>%s</td>\n", $value, $checked, $text); 260 printf(" <td><input type='checkbox' name='%s' value='On' %s>%s</td>\n", $value, $checked, $text); 261 } 262 263 function Checkbox2($val, $set, $text) 264 { 265 $value=$val.$set; 266 switch ($set) 267 { 268 case "ON": 269 if (!isset($_POST["submit"]) && ereg(" ".$val." ", $_GET["Set"])) 270 $_POST[$value]="On"; 271 break; 272 case "Off": 273 if (!isset($_POST["submit"]) && ereg(" ".$val." ", $_GET["Set2"])) 274 $_POST[$value]="On"; 275 break; 276 } 277 278 if ($_POST[$value]=="On") 279 $checked = "checked"; 280 else 281 $checked = ""; 282 283 printf(" <td><input type='checkbox' name='%s' value='On' %s>%s</td>\n", $value, $checked, $text); 261 284 } 262 285 … … 400 423 } 401 424 402 function PrintMagicTable($result0, $alias, $rightalign, $limitsmean, $limitsmin, $limitsmax, $ _GET)425 function PrintMagicTable($result0, $alias, $rightalign, $limitsmean, $limitsmin, $limitsmax, $form, $_GET) 403 426 { 404 427 $col = FALSE; … … 418 441 419 442 printf("\n<center>\n"); 443 if ($form) 444 printf("<form method='POST'>"); 420 445 if (empty($_GET["fPrintTable"])) 421 446 printf("<p>%s<P>\n", $menu); 422 printf("<table BORDER= \"0\">\n");447 printf("<table BORDER='0'>\n"); 423 448 while ($row0 = mysql_fetch_assoc($result0)) 424 449 { … … 427 452 printf(" <tr BGCOLOR='#C0C0C0'>\n"); 428 453 $first = FALSE; 454 if ($form) 455 printf("<td>ON</td><td>Off</td>"); 429 456 foreach ($row0 as $key => $element) 430 457 { … … 455 482 $col = !$col; 456 483 484 if ($form) 485 { 486 // printf("<td>%s</td>",$row0["Sequ"]."ON"); 487 // printf("<td>%s</td>",$row0["Sequ"]."Off"); 488 CheckBox2($row0["Sequ"], "ON",""); 489 CheckBox2($row0["Sequ"], "Off",""); 490 } 457 491 foreach ($row0 as $key => $element) 458 492 { 459 493 if (empty($rightalign[$key])) 460 printf(" <td align= \"left\">");494 printf(" <td align='left'>"); 461 495 else 462 printf(" <td align= \"right\">");496 printf(" <td align='right'>"); 463 497 464 498 //determine color of text in cell … … 551 585 printf("%s\n", $menu); 552 586 printf("<P>\n"); 553 printf("</center>\n"); 554 printf("</td>\n"); 555 printf("</tr>\n"); 587 588 if (!$form) 589 { 590 printf("</center>\n"); 591 printf("</td>\n"); 592 printf("</tr>\n"); 593 } 556 594 } 557 595
Note:
See TracChangeset
for help on using the changeset viewer.