Changeset 18193 for trunk/ippMonitor/raw/ipp.php
- Timestamp:
- Jun 19, 2008, 6:15:23 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippMonitor/raw/ipp.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/raw/ipp.php
r18143 r18193 315 315 $sortKey = "&sort=" . $_POST['sort']; 316 316 } 317 if ($_SERVER[REQUEST_METHOD] == 'GET') { 318 $sortKey = "&rsort=" . $_GET['rsort']; 319 } else { 320 $sortKey = "&rsort=" . $_POST['rsort']; 321 } 317 322 318 323 if ($rowStart > 0) { … … 410 415 if ($value != "") { 411 416 $where = $where . " ORDER BY $value"; 417 return $where; 418 } 419 if ($_SERVER[REQUEST_METHOD] == 'GET') { 420 $value = $_GET['rsort']; 421 } else { 422 $value = $_POST['rsort']; 423 } 424 if ($value != "") { 425 $where = $where . " ORDER BY $value DESC"; 426 return $where; 412 427 } 413 428 return $where; … … 432 447 } 433 448 434 // for numerical fields, test for both 'min' and 'max'values449 // for numerical fields, test for both 'min' and plain values 435 450 function button_restrict_min ($key, $line) { 436 451 $htmlkey = preg_replace ('|\.|', '_', $key); … … 470 485 } 471 486 472 function write_table_header ($class, $name, $value, $buttonLink, $ID, $file) { 473 474 $link = "$file" . "?" . $ID['link'] . "&sort=$value"; 487 function write_header_cell ($class, $name) { 488 489 echo "<th class=\"$class\">$name</th>\n"; 490 } 491 492 // write a table cell with the up and down sort arrows 493 function write_sort_cell ($class, $value, $buttonLink, $ID, $file) { 494 495 echo "<td class=\"$class\">"; 496 497 // base link 498 $baselink = "$file" . "?" . $ID['link']; 499 if ($buttonLink != "") { 500 $baselink = $baselink . "&$buttonLink"; 501 } 502 503 if ($_SERVER[REQUEST_METHOD] == 'GET') { 504 $up = $_GET['sort']; 505 $down = $_GET['rsort']; 506 } else { 507 $up = $_POST['sort']; 508 $down = $_POST['rsort']; 509 } 510 511 // up button link 512 $link = "$baselink" . "&sort=$value"; 513 if ($up == $value) { 514 echo "<a href=\"$link\"><img src=\"up.png\"></a>"; 515 } else { 516 echo "<a href=\"$link\"><img src=\"left.png\"></a>"; 517 } 518 519 // down button link 520 $link = "$baselink" . "&rsort=$value"; 521 if ($down == $value) { 522 echo "<a href=\"$link\"><img src=\"down.png\"></a>"; 523 } else { 524 echo "<a href=\"$link\"><img src=\"right.png\"></a>"; 525 } 526 527 echo "</td>\n"; 528 } 529 530 function write_write_sort_down ($class, $name, $value, $buttonLink, $ID, $file) { 531 532 $link = "$file" . "?" . $ID['link'] . "&rsort=$value"; 475 533 if ($buttonLink != "") { 476 534 $link = $link . "&$buttonLink"; … … 483 541 function write_query_row ($key, $width, $mode) { 484 542 $htmlkey = preg_replace ('|\.|', '_', $key); 543 544 // optional bits by mode 485 545 if ($mode == 'min') { 486 546 $htmlkey = $htmlkey . "_min"; … … 494 554 $value = $_POST[$htmlkey]; 495 555 } 496 // XXX need to modify $key (should it be htmlkey here?) 556 557 // full table element includes optionally the <= or >= words 558 echo "<td class=\"list\"> <input type=\"text\" name=\"$htmlkey\" size=\"$width\""; 497 559 if ($value != "") { 498 echo "<td class=\"list\"> <input type=\"text\" name=\"$htmlkey\" size=\"$width\" value=\"$value\"> </td>\n"; 499 } else { 500 echo "<td class=\"list\"> <input type=\"text\" name=\"$htmlkey\" size=\"$width\"> </td>\n"; 501 } 560 echo "value=\"$value\">"; 561 } 562 echo "</td>\n"; 502 563 } 503 564 504 565 function write_table_cell ($class, $format, $link, $value) { 566 567 if ($format == '%T') { 568 $format = '%s'; 569 } 570 if ($format == '%t') { 571 $format = '%s'; 572 if ($value == 0) { 573 $value = 'N'; 574 } else { 575 $value = 'Y'; 576 } 577 } 578 505 579 $myValue = sprintf ($format, $value); 506 580 if ($myValue == "") { $myValue = " "; }
Note:
See TracChangeset
for help on using the changeset viewer.
