Changeset 39498
- Timestamp:
- Mar 31, 2016, 6:26:07 AM (10 years ago)
- Location:
- trunk/ippMonitor
- Files:
-
- 24 edited
-
configure.tcsh (modified) (1 diff)
-
def/autocode.php (modified) (6 diffs)
-
def/autocodeImage.php (modified) (2 diffs)
-
def/detInputExp.d (modified) (1 diff)
-
def/detRun.d (modified) (1 diff)
-
def/detRunActive.d (modified) (1 diff)
-
def/detRunSummary.d (modified) (1 diff)
-
def/keptDetrendFrames.d (modified) (1 diff)
-
def/masterDetrendFrames.d (modified) (1 diff)
-
raw/columns_in_db.php (modified) (1 diff)
-
raw/czartool_exposures.php (modified) (13 diffs)
-
raw/czartool_ipptopsps.php (modified) (3 diffs)
-
raw/czartool_labels.php (modified) (10 diffs)
-
raw/diskUsage.php (modified) (1 diff)
-
raw/getimage.php (modified) (3 diffs)
-
raw/histogram.php (modified) (2 diffs)
-
raw/ipp.php (modified) (33 diffs)
-
raw/masterDetrendImfiles.php (modified) (1 diff)
-
raw/nightSummary.php (modified) (1 diff)
-
raw/simplePlot.php (modified) (2 diffs)
-
raw/simplePlotcam.php (modified) (2 diffs)
-
raw/simplePlotraw.php (modified) (2 diffs)
-
raw/warpProcessedExp.php (modified) (2 diffs)
-
raw/warpProcessedExp_Images.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/configure.tcsh
r38208 r39498 227 227 228 228 Fine tuning of the installation directories: 229 --useMDB2 use MDB2 interface instead of DB 230 229 231 --bindir=DIR user executables [PREFIX/bin/$ARCH] 230 232 --libdir=DIR object code libraries [PREFIX/lib/$ARCH] -
trunk/ippMonitor/def/autocode.php
r34014 r39498 26 26 27 27 // define restrictions to the queries 28 $WHERE = ""; 28 29 // ** TABLE RESTRICTIONS ** 29 30 … … 40 41 41 42 // get the result table count 42 if ( $MODE== "basic") {43 if ("$MODE" == "basic") { 43 44 $sql = "SELECT count(*) FROM $TABLE $WHERE"; 44 45 } 45 if ( $MODE== "summary") {46 if ("$MODE" == "summary") { 46 47 $sql = "SELECT count(*) FROM (SELECT $FIELDS FROM $TABLE $WHERE) as TEMP"; 47 48 } … … 53 54 menu_end(); 54 55 } 55 if (! $qry->fetchInto($row)) {56 if (!dbFetchInto($qry, $row)) { 56 57 echo "<b>error reading $TABLE table count</b><br>\n"; 57 58 echo "<br><small><b> count query : $sql </b></small><br>\n"; … … 78 79 79 80 // query the database 80 if ( $MODE== "basic") {81 if ("$MODE" == "basic") { 81 82 $sql = "SELECT $FIELDS FROM $TABLE $WHERE LIMIT $dTABLE OFFSET $rowStart"; 82 83 } 83 if ( $MODE== "summary") {84 if ("$MODE" == "summary") { 84 85 $sql = "SELECT $FIELDS FROM $TABLE $WHERE LIMIT $dTABLE OFFSET $rowStart"; 85 86 } … … 94 95 // ** HEAD CODE ** 95 96 97 $buttonLink = ""; 96 98 // ** BUTTON RESTRICTIONS ** 97 99 navigate_buttons ($rowStart, $rowLast, $dTABLE, $rowTotal, $buttonLink, $ID, '$FILE'); … … 113 115 114 116 // list the results 115 while ( $qry->fetchInto($row)) {117 while (dbFetchInto($qry, $row)) { 116 118 // $link = "$FILE" . "?expID=" . $row[0] . "&" . $ID['link']; 117 119 -
trunk/ippMonitor/def/autocodeImage.php
r31102 r39498 46 46 menu_end(); 47 47 } 48 if (! $qry->fetchInto($row)) {48 if (!dbFetchInto($qry, $row)) { 49 49 echo "<b>error reading $TABLE table count</b><br>\n"; 50 50 echo "<br><small><b> count query : $sql </b></small><br>\n"; … … 111 111 112 112 // output the results to tmpfile 113 while ( $qry->fetchInto($row)) {113 while (dbFetchInto($qry, $row)) { 114 114 $line = ""; 115 115 foreach ($row as $i => $value) { -
trunk/ippMonitor/def/detInputExp.d
r18193 r39498 38 38 FIELD rawExp.bg_stdev, 5, %.2f, stdev 39 39 FIELD rawExp.bg_mean_stdev, 5, %.2f, <backgnd> 40 FIELD *, 5, %s, choose, value= resid, detResidImfile.php, ARG241 FIELD *, 5, %s, choose, value= proc, detProcessedImfile.php, ARG340 FIELD *, 5, %s, choose, value='resid', detResidImfile.php, ARG2 41 FIELD *, 5, %s, choose, value='proc', detProcessedImfile.php, ARG3 42 42 43 43 TD_CLASS det_off $detInputExp.include == 0 -
trunk/ippMonitor/def/detRun.d
r26072 r39498 23 23 FIELD det_type, 12, %s, type 24 24 FIELD state, 5, %s, state 25 FIELD *, 5, %s, IN, value= IN,detInputExp.php, ARG226 FIELD *, 5, %s, P, value= P, detProcessedExp.php, ARG327 FIELD *, 5, %s, D, value= D, detResidExp.php, ARG428 FIELD *, 5, %s, S, value= S, detStackedImfile.php, ARG529 FIELD *, 5, %s, N, value= N, detNormalizedImfile.php, ARG630 FIELD *, 5, %s, R, value= R, detRegisteredImfile.php, ARG725 FIELD *, 5, %s, IN, value='IN', detInputExp.php, ARG2 26 FIELD *, 5, %s, P, value='P', detProcessedExp.php, ARG3 27 FIELD *, 5, %s, D, value='D', detResidExp.php, ARG4 28 FIELD *, 5, %s, S, value='S', detStackedImfile.php, ARG5 29 FIELD *, 5, %s, N, value='N', detNormalizedImfile.php, ARG6 30 FIELD *, 5, %s, R, value='R', detRegisteredImfile.php, ARG7 31 31 FIELD mode, 5, %s, mode 32 32 FIELD filter, 5, %s, filter -
trunk/ippMonitor/def/detRunActive.d
r24868 r39498 26 26 FIELD det_type, 12, %s, type 27 27 FIELD state, 5, %s, state 28 FIELD *, 5, %s, IN, value= IN, detInputExp.php, ARG229 FIELD *, 5, %s, P, value= P, detProcessedExp.php, ARG330 FIELD *, 5, %s, D, value= D, detResidExp.php, ARG431 FIELD *, 5, %s, S, value= S, detStackedImfile.php, ARG532 FIELD *, 5, %s, N, value= N, detNormalizedImfile.php, ARG633 FIELD *, 5, %s, R, value= R, detRegisteredImfile.php, ARG728 FIELD *, 5, %s, IN, value='IN', detInputExp.php, ARG2 29 FIELD *, 5, %s, P, value='P', detProcessedExp.php, ARG3 30 FIELD *, 5, %s, D, value='D', detResidExp.php, ARG4 31 FIELD *, 5, %s, S, value='S', detStackedImfile.php, ARG5 32 FIELD *, 5, %s, N, value='N', detNormalizedImfile.php, ARG6 33 FIELD *, 5, %s, R, value='R', detRegisteredImfile.php, ARG7 34 34 FIELD mode, 5, %s, mode 35 35 FIELD filter, 5, %s, filter -
trunk/ippMonitor/def/detRunSummary.d
r19726 r39498 16 16 FIELD detRunSummary.iteration, 5, %s, iter 17 17 FIELD detRunSummary.accept, 4, %s, keep 18 FIELD *, 20, %s, choose, value= input, detInputExp.php, ARG119 FIELD *, 20, %s, choose, value= proc, detProcessedExp.php, ARG320 FIELD *, 20, %s, choose, value= resid, detResidExp.php, ARG218 FIELD *, 20, %s, choose, value='input', detInputExp.php, ARG1 19 FIELD *, 20, %s, choose, value='proc', detProcessedExp.php, ARG3 20 FIELD *, 20, %s, choose, value='resid', detResidExp.php, ARG2 21 21 FIELD detRunSummary.bg, 20, %s, bg 22 22 FIELD detRunSummary.bg_stdev, 20, %s, bg_stdev -
trunk/ippMonitor/def/keptDetrendFrames.d
r15954 r39498 28 28 FIELD detRun.det_type, 5, %s, type 29 29 FIELD detRun.state, 5, %s, state 30 FIELD *, 20, %s, choose, value= input, detInputExp.php, ARG231 FIELD *, 20, %s, choose, value= proc, detProcessedExp.php, ARG332 FIELD *, 20, %s, choose, value= resid, detResidExp.php, ARG430 FIELD *, 20, %s, choose, value='input', detInputExp.php, ARG2 31 FIELD *, 20, %s, choose, value='proc', detProcessedExp.php, ARG3 32 FIELD *, 20, %s, choose, value='resid', detResidExp.php, ARG4 33 33 FIELD detRunSummary.bg, 20, %s, bg 34 34 FIELD detRunSummary.bg_stdev, 20, %s, bg_stdev -
trunk/ippMonitor/def/masterDetrendFrames.d
r19726 r39498 30 30 # FIELD detRun.mode, 5, %s, mode 31 31 # FIELD detRunSummary.accept, 5, %s, accept 32 FIELD *, 5, %s, choose, value= input, detInputExp.php, ARG233 FIELD *, 5, %s, choose, value= proc, detProcessedExp.php, ARG334 FIELD *, 5, %s, choose, value= stack, detStackedImfile.php, ARG535 FIELD *, 5, %s, choose, value= resid, detResidExp.php, ARG432 FIELD *, 5, %s, choose, value='input', detInputExp.php, ARG2 33 FIELD *, 5, %s, choose, value='proc', detProcessedExp.php, ARG3 34 FIELD *, 5, %s, choose, value='stack', detStackedImfile.php, ARG5 35 FIELD *, 5, %s, choose, value='resid', detResidExp.php, ARG4 36 36 FIELD mode, 5, %s, mode 37 37 FIELD filter, 10, %s, filter -
trunk/ippMonitor/raw/columns_in_db.php
r28688 r39498 130 130 $line = ""; 131 131 $values = array(); 132 while ( $qry->fetchInto($row)) {132 while (dbFetchInto($qry, $row)) { 133 133 // print "[".$row[0]."]<br>\n"; 134 134 foreach ($row as $index => $value) { -
trunk/ippMonitor/raw/czartool_exposures.php
r38258 r39498 74 74 75 75 $qry = $db->query($sql); 76 $qry->fetchInto($count);76 dbFetchInto($qry, $count); 77 77 78 78 if ($surveyStr == "") $surveyText = "all surveys"; … … 154 154 155 155 // loop through results in order to make html table 156 while ( $qry->fetchInto($row)) {156 while (dbFetchInto($qry, $row)) { 157 157 158 158 $exp_id = $row[0]; … … 257 257 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 258 258 259 while ( $qry->fetchInto($row)) {259 while (dbFetchInto($qry, $row)) { 260 260 261 261 if ($row[2] > 0) $hash[$row[0]] = "Y"; … … 287 287 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 288 288 289 while ( $qry->fetchInto($row)) {289 while (dbFetchInto($qry, $row)) { 290 290 291 291 if ($row[2] > 0) $hash[$row[0]] = "Y"; … … 318 318 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 319 319 320 while ( $qry->fetchInto($row)) {320 while (dbFetchInto($qry, $row)) { 321 321 322 322 if ($row[2] > 0) $hash[$row[0]] = "Y"; … … 350 350 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 351 351 352 while ( $qry->fetchInto($row)) {352 while (dbFetchInto($qry, $row)) { 353 353 354 354 if ($row[2] > 0) $hash[$row[0]] = $row[2]; … … 380 380 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 381 381 382 while ( $qry->fetchInto($row)) {382 while (dbFetchInto($qry, $row)) { 383 383 384 384 if ($row[2] > 0) $hash[$row[0]] = $row[2]; … … 408 408 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 409 409 410 while ( $qry->fetchInto($row)) {410 while (dbFetchInto($qry, $row)) { 411 411 412 412 if ($row[2] > 0) { … … 444 444 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 445 445 446 while ( $qry->fetchInto($row)) {446 while (dbFetchInto($qry, $row)) { 447 447 448 448 if ($row[2] > 0) $hash[$row[0]] = $row[2]; … … 475 475 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 476 476 477 while ( $qry->fetchInto($row)) {477 while (dbFetchInto($qry, $row)) { 478 478 479 479 if ($row[2] > 0) $hash[$row[0]] = $row[2]; … … 505 505 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 506 506 507 while ( $qry->fetchInto($row)) {507 while (dbFetchInto($qry, $row)) { 508 508 509 509 $hash[$row[0]] = $row[1]; … … 536 536 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 537 537 538 while ( $qry->fetchInto($row)) {538 while (dbFetchInto($qry, $row)) { 539 539 540 540 if ($row[2] > 0) $hash[$row[0]] = $row[2]; … … 566 566 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 567 567 $hash = array(); 568 while ( $qry->fetchInto($row)) {568 while (dbFetchInto($qry, $row)) { 569 569 570 570 if ($row[2] == 2) $hash1[$row[0]] = $row[1]; -
trunk/ippMonitor/raw/czartool_ipptopsps.php
r33846 r39498 176 176 $qry = $db->query($sql); 177 177 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 178 while ( $qry->fetchInto($row)) {178 while (dbFetchInto($qry, $row)) { 179 179 180 180 $labels[] = $row[0]; … … 367 367 $qry = $db->query($sql); 368 368 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 369 $qry->fetchInto($row);369 dbFetchInto($qry, $row); 370 370 371 371 $pending = $row[0]; … … 400 400 $qry = $db->query($sql); 401 401 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 402 $qry->fetchInto($row);402 dbFetchInto($qry, $row); 403 403 404 404 return $row[0]; -
trunk/ippMonitor/raw/czartool_labels.php
r38719 r39498 313 313 314 314 // list the results 315 while ( $qry->fetchInto($row)) {315 while (dbFetchInto($qry, $row)) { 316 316 317 317 echo "<tr>"; … … 358 358 359 359 // list the results 360 while ( $qry->fetchInto($expType)) {360 while (dbFetchInto($qry, $expType)) { 361 361 362 362 $sql = "SELECT COUNT(*) FROM summitExp WHERE dateobs > '$date' AND exp_type = '$expType[0]'"; 363 363 $qry2 = $projectdb->query($sql); 364 $qry2->fetchInto($summit);364 dbFetchInto($qry2, $summit); 365 365 $sql = "SELECT COUNT(*) FROM summitExp JOIN rawExp ON summitExp.exp_name = rawExp.exp_name WHERE summitExp.dateobs > '$date' AND summitExp.exp_type = '$expType[0]'"; 366 366 $qry2 = $projectdb->query($sql); 367 $qry2->fetchInto($mhpcc);367 dbFetchInto($qry2, $mhpcc); 368 368 369 369 echo "<tr>"; … … 397 397 $qry = $db->query($sql); 398 398 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 399 while ( $qry->fetchInto($row)) {399 while (dbFetchInto($qry, $row)) { 400 400 401 401 $labels[] = $row[0]; … … 621 621 $qry = $db->query($sql); 622 622 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 623 $qry->fetchInto($row);623 dbFetchInto($qry, $row); 624 624 625 625 return $row[0]; … … 655 655 $qry = $db->query($sql); 656 656 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 657 $qry->fetchInto($row);657 dbFetchInto($qry, $row); 658 658 659 659 return $row[0]; … … 673 673 $qry = $db->query($sql); 674 674 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 675 $qry->fetchInto($row);675 dbFetchInto($qry, $row); 676 676 677 677 $pending = $row[0]; … … 730 730 $dates = ""; 731 731 $firstIn = true; 732 while ( $qry->fetchInto($row)) {732 while (dbFetchInto($qry, $row)) { 733 733 734 734 if ($firstIn) { … … 887 887 $qry = $db->query($sql); 888 888 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 889 $qry->fetchInto($row);889 dbFetchInto($qry, $row); 890 890 891 891 $alive = $row[0]; … … 906 906 $qry = $db->query($sql); 907 907 if (dberror($qry)) {echo "<b>error with $sql </b><br>\n";} 908 $qry->fetchInto($row);908 dbFetchInto($qry, $row); 909 909 910 910 return $row[0]; … … 947 947 } 948 948 $res = $dbRepl->query('SHOW SLAVE STATUS'); 949 while ( $res->fetchInto($row)) {949 while (dbFetchInto($res, $row)) { 950 950 # Have a look for Last_Errno in http://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html 951 951 $errorStatusInMySql = $row[18]; -
trunk/ippMonitor/raw/diskUsage.php
r29031 r39498 90 90 91 91 // list the results 92 while ( $qry->fetchInto($row)) {92 while (dbFetchInto($qry, $row)) { 93 93 echo "<tr><td class=\"$class\"><b>$TABLE</b></td>\n"; 94 94 // ** TABLE DATA ** -
trunk/ippMonitor/raw/getimage.php
r37983 r39498 17 17 // load an image file from the image directory 18 18 // validate request 19 if ($_SERVER[ REQUEST_METHOD] != 'GET') {19 if ($_SERVER['REQUEST_METHOD'] != 'GET') { 20 20 exit (); 21 21 } … … 37 37 38 38 // $basename may contain filename@filerule 39 $basename = $_GET[ name];39 $basename = $_GET['name']; 40 40 if ($basename == "noimage.noimage") { 41 41 $file = fopen ("noimage.png", "r");//$MISSING? … … 47 47 exit (); 48 48 } 49 $filerule = $_GET[ rule];50 $camera = $_GET[ camera];51 $class_id = $_GET[ class_id];49 $filerule = $_GET['rule']; 50 $camera = $_GET['camera']; 51 $class_id = $_GET['class_id']; 52 52 53 53 # $filerule = strtok("@"); -
trunk/ippMonitor/raw/histogram.php
r28433 r39498 101 101 menu_end(); 102 102 } 103 if (! $qry->fetchInto($row)) {103 if (!dbFetchInto($qry, $row)) { 104 104 echo "<b>error reading camRun, chipRun, rawExp, camProcessedExp table count</b><br>\n"; 105 105 echo "<br><small><b> count query : $sql </b></small><br>\n"; … … 376 376 } 377 377 // ** TAIL CODE ** 378 while ( $qry->fetchInto($row)) {378 while (dbFetchInto($qry, $row)) { 379 379 foreach ($keysToRowIndex as $i => $value) { 380 380 if (get_value_from_key($i, TRUE) == "on") { -
trunk/ippMonitor/raw/ipp.php
r38262 r39498 1 1 <?php 2 2 3 $debug = 0; 3 4 $dTABLE = 80; 4 5 include 'site.php'; … … 50 51 echo "<table class=select>\n"; 51 52 echo "<tr class=select><th class=select> projects </th></tr>\n"; 52 while ( $qry->fetchInto($row)) {53 while (dbFetchInto($qry, $row)) { 53 54 // add a link here to set the database 54 55 $tmp_proj = $row[0]; … … 56 57 echo "<tr class=select><td class=select><a class=\"menutop\" href=\"SelectProject.php?$tmp_link&proj=$tmp_proj&new=1\"> $row[0] </a></td></tr>\n"; 57 58 // echo "<tr class=select><td class=select> $row[0] </td></tr>\n"; 58 } 59 } 59 60 echo "</table>\n"; 60 61 61 62 menu_end (); 63 } 64 65 function dbFetchInto ($qry, &$result) { 66 global $DBI; 67 68 if ($DBI == "MDB2") { 69 $result = $qry->fetchRow(); 70 if ($result == NULL) { 71 $success = 0; 72 } else { 73 $success = 1; 74 } 75 } 76 if ($DBI == "DB") { 77 $success = $qry->fetchInto($result); 78 } 79 return $success; 62 80 } 63 81 … … 87 105 88 106 // connect to the database 107 if ($database == $CZARDBNAME) { 108 $dsn = "mysql://$DBUSER:$DBPASS@$CZARDBHOST/$database"; 109 $dsnerr = "mysql://$DBUSER:XXX@$CZARDBHOST/$database"; // only used to report the error 110 } else { 111 $dsn = "mysql://$DBUSER:$DBPASS@$DBHOST/$database"; 112 $dsnerr = "mysql://$DBUSER:XXX@$DBHOST/$database"; // only used to report the error 113 } 89 114 if ($DBI == "DB") { 90 if ($database == $CZARDBNAME) { 91 $db = DB::connect("mysql://$DBUSER:$DBPASS@$CZARDBHOST/$database"); 92 } else { 93 $db = DB::connect("mysql://$DBUSER:$DBPASS@$DBHOST/$database"); 94 } 115 $db = DB::connect($dsn); 95 116 } 96 117 if ($DBI == "MDB2") { 97 $db = MDB2::connect( "mysql://$DBUSER:$DBPASS@$DBHOST/$database");118 $db = MDB2::connect($dsn); 98 119 } 99 120 100 121 if (dberror($db)) { 101 122 echo "<b>error accessing database</b><br>\n"; 102 echo "<b>tried mysql://$DBUSER:XXX@$DBHOST/$database</b><br>\n";123 echo "<b>tried $dsnerr</b><br>\n"; 103 124 $result = $db->getMessage(); 104 125 echo "$result<br>"; … … 112 133 113 134 if ($DBI == "MDB2") { 114 $dberr = MDB2::isError($db);135 $dberr = PEAR::isError($db); 115 136 } 116 137 if ($DBI == "DB") { … … 129 150 function checkLogin () { 130 151 131 $username = $_POST[ username];132 $password = $_POST[ password];152 $username = $_POST['username']; 153 $password = $_POST['password']; 133 154 134 155 // if password is not specified, keep username and ask again … … 143 164 // get the users from the DB 144 165 $sql = "SELECT username FROM users WHERE username = '$username' AND password = '$password'"; 145 146 166 $qry = $db->query($sql); 167 147 168 if (dberror($db)) { 148 169 menu ('ipp.menu.dat', 'Login', 'ipp.css', '', ''); … … 152 173 menu_end(); 153 174 } 154 155 $success = $qry->fetchInto($row);175 176 $success = dbFetchInto($qry, $row); 156 177 if (!$success) { 157 178 menu ('ipp.menu.dat', 'Login', 'ipp.css', '', ''); … … 174 195 } 175 196 176 if ( $qry->fetchInto($row)) {197 if (dbFetchInto($qry, $row)) { 177 198 $ID['pass'] = $row[1]; 178 199 } else { … … 197 218 198 219 function checkID () { 199 200 201 220 $VERBOSE = 0; 202 221 if ($VERBOSE > 1) { … … 205 224 206 225 // check for valid server method 207 if (($_SERVER[ REQUEST_METHOD] != 'POST') && ($_SERVER[REQUEST_METHOD] != 'GET')) {226 if (($_SERVER['REQUEST_METHOD'] != 'POST') && ($_SERVER['REQUEST_METHOD'] != 'GET')) { 208 227 menu ('ipp.menu.dat', 'Login', 'ipp.css', '', ''); 209 228 echo "Invalid Client Request<br>\n"; … … 213 232 214 233 // look for pass & proj in appropriate location 215 if ($_SERVER[ REQUEST_METHOD] == 'GET') {216 $ID['pass'] = $_GET[pass];217 $ID['proj'] = $_GET[proj];218 $ID['menu'] = $_GET[menu];219 $ID['from'] = $_GET[from];234 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 235 $ID['pass'] = array_key_exists('pass', $_GET) ? $_GET['pass'] : ""; 236 $ID['proj'] = array_key_exists('proj', $_GET) ? $_GET['proj'] : ""; 237 $ID['menu'] = array_key_exists('menu', $_GET) ? $_GET['menu'] : ""; 238 $ID['from'] = array_key_exists('from', $_GET) ? $_GET['from'] : ""; 220 239 221 240 if ($VERBOSE) { … … 227 246 } 228 247 } 229 if ($_SERVER[ REQUEST_METHOD] == 'POST') {230 $ID['pass'] = $_POST[pass];231 $ID['proj'] = $_POST[proj];232 $ID['menu'] = $_POST[menu];233 $ID['from'] = $_POST[from];248 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 249 $ID['pass'] = array_key_exists('pass', $_POST) ? $_POST['pass'] : ""; 250 $ID['proj'] = array_key_exists('proj', $_POST) ? $_POST['proj'] : ""; 251 $ID['menu'] = array_key_exists('menu', $_POST) ? $_POST['menu'] : ""; 252 $ID['from'] = array_key_exists('from', $_POST) ? $_POST['from'] : ""; 234 253 235 254 if ($VERBOSE) { … … 264 283 } 265 284 266 $success = $qry->fetchInto($row);285 $success = dbFetchInto($qry,$row); 267 286 if (! $success) { 268 287 menu('ipp.menu.dat', 'Login', 'ipp.css', '', ''); … … 359 378 } 360 379 361 $thisname = $_SERVER[ SCRIPT_NAME];380 $thisname = $_SERVER['SCRIPT_NAME']; 362 381 $page = "$root/" . $base; 363 382 if ($page == $thisname) { … … 396 415 $sortKey = ""; 397 416 // try sort forward 398 if ($_SERVER[REQUEST_METHOD] == 'GET') { 399 $sortVal = $_GET['sort']; 400 } else { 401 $sortVal = $_POST['sort']; 402 } 417 $sortVal = get_htmlkey_value ('sort'); 403 418 if ($sortVal != "") { 404 419 $sortKey = "&sort=" . $sortVal; … … 406 421 // try sort reverse 407 422 if ($sortKey == "") { 408 if ($_SERVER[REQUEST_METHOD] == 'GET') { 409 $sortVal = $_GET['rsort']; 410 } else { 411 $sortVal = $_POST['rsort']; 412 } 423 $sortVal = get_htmlkey_value ('rsort'); 413 424 if ($sortVal != "") { 414 425 $sortKey = "&rsort=" . $sortVal; … … 473 484 } 474 485 475 if ($_SERVER[ REQUEST_METHOD] == 'GET') {476 $value = $_GET[$htmlkey];477 } else { 478 $value = $_POST[$htmlkey];486 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 487 $value = array_key_exists($htmlkey, $_GET) ? $_GET[$htmlkey] : ""; 488 } else { 489 $value = array_key_exists($htmlkey, $_POST) ? $_POST[$htmlkey] : ""; 479 490 } 480 491 if ($value == "") { return $where; } … … 517 528 } 518 529 519 if ($_SERVER[REQUEST_METHOD] == 'GET') { 520 $value = $_GET['sort']; 521 } else { 522 $value = $_POST['sort']; 523 } 530 $value = get_htmlkey_value ('sort'); 524 531 if ($value != "") { 525 532 $where = $where . " ORDER BY $value"; 526 533 return $where; 527 534 } 528 if ($_SERVER[REQUEST_METHOD] == 'GET') { 529 $value = $_GET['rsort']; 530 } else { 531 $value = $_POST['rsort']; 532 } 535 $value = get_htmlkey_value ('rsort'); 533 536 if ($value != "") { 534 537 $where = $where . " ORDER BY $value DESC"; … … 538 541 } 539 542 543 function get_htmlkey_value ($htmlkey) { 544 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 545 $value = array_key_exists($htmlkey, $_GET) ? $_GET[$htmlkey] : ""; 546 } else { 547 $value = array_key_exists($htmlkey, $_POST) ? $_POST[$htmlkey] : ""; 548 } 549 return $value; 550 } 551 540 552 // if we have a restriction for a string-valued field, supply it to outgoing links 541 553 function button_restrict_string ($key, $line) { 542 554 $htmlkey = preg_replace ('|\.|', '_', $key); 543 if ($_SERVER[REQUEST_METHOD] == 'GET') { 544 $value = $_GET[$htmlkey]; 545 } else { 546 $value = $_POST[$htmlkey]; 547 } 555 $value = get_htmlkey_value ($htmlkey); 556 548 557 # a search restriction may include an SQL wild-card. we have to mangle these so that the http 549 558 # does not get converted to a special character … … 563 572 $htmlkey = preg_replace ('|\.|', '_', $key); 564 573 $htmlkey = $htmlkey . '_min'; 565 if ($_SERVER[REQUEST_METHOD] == 'GET') { 566 $value = $_GET[$htmlkey]; 567 } else { 568 $value = $_POST[$htmlkey]; 569 } 574 $value = get_htmlkey_value ($htmlkey); 570 575 if ($value != "") { 571 576 if ($line) { … … 582 587 $htmlkey = preg_replace ('|\.|', '_', $key); 583 588 $htmlkey = $htmlkey . '_max'; 584 if ($_SERVER[REQUEST_METHOD] == 'GET') { 585 $value = $_GET[$htmlkey]; 586 } else { 587 $value = $_POST[$htmlkey]; 588 } 589 $value = get_htmlkey_value ($htmlkey); 589 590 if ($value != "") { 590 591 if ($line) { … … 600 601 function button_restrict_checkbox ($key, $line) { 601 602 $htmlkey = preg_replace ('|\.|', '_', $key); 602 if ($_SERVER[REQUEST_METHOD] == 'GET') { 603 $value = $_GET[$htmlkey]; 604 } else { 605 $value = $_POST[$htmlkey]; 606 } 603 $value = get_htmlkey_value ($htmlkey); 607 604 if ($value != "") { 608 605 if ($line) { … … 618 615 function button_restrict_radio ($key, $line) { 619 616 $htmlkey = preg_replace ('|\.|', '_', $key); 620 if ($_SERVER[REQUEST_METHOD] == 'GET') { 621 $value = $_GET[$htmlkey]; 622 } else { 623 $value = $_POST[$htmlkey]; 624 } 617 $value = get_htmlkey_value ($htmlkey); 625 618 if ($value != "") { 626 619 if ($line) { … … 648 641 } 649 642 650 if ($_SERVER[ REQUEST_METHOD] == 'GET') {651 $up = $_GET['rsort'];652 $down = $_GET['sort'];653 $from = $_GET['from'];654 } else { 655 $up = $_POST['rsort'];656 $down = $_POST['sort'];657 $from = $_POST['from'];643 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 644 $up = array_key_exists('rsort', $_GET) ? $_GET['rsort'] : ""; 645 $down = array_key_exists('sort', $_GET) ? $_GET['sort'] : ""; 646 $from = array_key_exists('from', $_GET) ? $_GET['from'] : ""; 647 } else { 648 $up = array_key_exists('rsort', $_POST) ? $_POST['rsort'] : ""; 649 $down = array_key_exists('sort', $_POST) ? $_POST['sort'] : ""; 650 $from = array_key_exists('from', $_POST) ? $_POST['from'] : ""; 658 651 } 659 652 … … 695 688 $htmlkey = $htmlkey . "_max"; 696 689 } 697 if ($_SERVER[REQUEST_METHOD] == 'GET') { 698 $value = $_GET[$htmlkey]; 699 } else { 700 $value = $_POST[$htmlkey]; 701 } 690 $value = get_htmlkey_value ($htmlkey); 702 691 703 692 // full table element includes optionally the <= or >= words … … 714 703 function write_query_checkbox ($key, $comment) { 715 704 $htmlkey = preg_replace ('|\.|', '_', $key); 716 717 if ($_SERVER[REQUEST_METHOD] == 'GET') { 718 $value = $_GET[$htmlkey]; 719 } else { 720 $value = $_POST[$htmlkey]; 721 } 705 $value = get_htmlkey_value ($htmlkey); 706 722 707 echo "<td> <input type=\"checkbox\" name=\"$htmlkey\""; 723 708 if ($value == "on") { … … 734 719 $htmlvalue = preg_replace ('|\.|', '_', $value); 735 720 736 if ($_SERVER[REQUEST_METHOD] == 'GET') { 737 $value = $_GET[$htmlkey]; 738 } else { 739 $value = $_POST[$htmlkey]; 740 } 721 $value = get_htmlkey_value ($htmlkey); 741 722 if ($htmlvalue == get_value_from_key($htmlkey, TRUE)) { 742 723 $checked = "checked"; … … 779 760 function insert_image ($rule, $size) { 780 761 781 if ($_SERVER[ REQUEST_METHOD] == 'GET') {782 $basename = $_GET['basename'];783 $class_id = $_GET['class'];784 $camera = $_GET['camera'];785 } else { 786 $basename = $_POST['basename'];787 $class_id = $_POST['class'];788 $camera = $_POST['camera'];762 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 763 $basename = array_key_exists('basename', $_GET) ? $_GET['basename'] : ""; 764 $class_id = array_key_exists('class', $_GET) ? $_GET['class'] : ""; 765 $camera = array_key_exists('camera', $_GET) ? $_GET['camera'] : ""; 766 } else { 767 $basename = array_key_exists('basename', $_POST) ? $_POST['basename'] : ""; 768 $class_id = array_key_exists('class', $_POST) ? $_POST['class'] : ""; 769 $camera = array_key_exists('camera', $_POST) ? $_POST['camera'] : ""; 789 770 } 790 771 … … 802 783 function insert_log ($filerule) { 803 784 804 if ($_SERVER[ REQUEST_METHOD] == 'GET') {805 $basename = $_GET['basename'];806 $class_id = $_GET['class'];807 $camera = $_GET['camera'];808 $state = $_GET['state'];809 } else { 810 $basename = $_POST['basename'];811 $class_id = $_POST['class'];812 $camera = $_POST['camera'];813 $state = $_POST['state'];785 if ($_SERVER['REQUEST_METHOD'] == 'GET') { 786 $basename = array_key_exists('basename', $_GET) ? $_GET['basename'] : ""; 787 $class_id = array_key_exists('class', $_GET) ? $_GET['class'] : ""; 788 $camera = array_key_exists('camera', $_GET) ? $_GET['camera'] : ""; 789 $state = array_key_exists('state', $_GET) ? $_GET['state'] : ""; 790 } else { 791 $basename = array_key_exists('basename', $_POST) ? $_POST['basename'] : ""; 792 $class_id = array_key_exists('class', $_POST) ? $_POST['class'] : ""; 793 $camera = array_key_exists('camera', $_POST) ? $_POST['camera'] : ""; 794 $state = array_key_exists('state', $_POST) ? $_POST['state'] : ""; 814 795 } 815 796 … … 830 811 //It's necessary for staticsky logs and it would require to join tables 831 812 //back to the warpRun table 832 if (! $camera) { $camera = strtoupper($_GET['proj']); } 813 if (! $camera) { 814 $camera = strtoupper($_GET['proj']); 815 } 833 816 834 817 if ($basename && $camera && $filerule) { … … 886 869 function insert_backref ($page, $key, $link) { 887 870 888 if ($_SERVER[REQUEST_METHOD] == 'GET') { 889 $name = $_GET[$key]; 890 } else { 891 $name = $_POST[$key]; 892 } 871 $name = get_htmlkey_value ($key); 893 872 894 873 if ($name) { … … 911 890 $htmlkey = $key; 912 891 } 913 if ($_SERVER[REQUEST_METHOD] == 'GET') { 914 return $_GET[$htmlkey]; 915 } else { 916 return $_POST[$htmlkey]; 917 } 892 $value = get_htmlkey_value ($key); 893 return $value; 918 894 } 919 895 -
trunk/ippMonitor/raw/masterDetrendImfiles.php
r21137 r39498 53 53 54 54 // list the results 55 while ( $qry->fetchInto($row)) {55 while (dbFetchInto($qry, $row)) { 56 56 // $link = "masterDetrendImfiles.php" . "?expID=" . $row[0] . "&" . $ID['link']; 57 57 -
trunk/ippMonitor/raw/nightSummary.php
r33846 r39498 25 25 26 26 // list the results 27 while ( $qry->fetchInto($row)) {27 while (dbFetchInto($qry, $row)) { 28 28 echo "<tr><td class=\"$class\"><b>$TABLE</b></td>\n"; 29 29 // ** TABLE DATA ** -
trunk/ippMonitor/raw/simplePlot.php
r31102 r39498 81 81 menu_end(); 82 82 } 83 if (! $qry->fetchInto($row)) {83 if (!dbFetchInto($qry, $row)) { 84 84 echo "<b>error reading chipRun, rawExp table count</b><br>\n"; 85 85 echo "<br><small><b> count query : $sql </b></small><br>\n"; … … 238 238 239 239 // list the results 240 while ( $qry->fetchInto($row)) {240 while (dbFetchInto($qry, $row)) { 241 241 switch ($row[2]) { 242 242 case 'g.00000': -
trunk/ippMonitor/raw/simplePlotcam.php
r34431 r39498 84 84 menu_end(); 85 85 } 86 if (! $qry->fetchInto($row)) {86 if (!dbFetchInto($qry, $row)) { 87 87 echo "<b>error reading camProcessedExp, camRun, chipRun, rawExp table count</b><br>\n"; 88 88 echo "<br><small><b> count query : $sql </b></small><br>\n"; … … 246 246 247 247 // list the results 248 while ( $qry->fetchInto($row)) {248 while (dbFetchInto($qry, $row)) { 249 249 switch ($row[2]) { 250 250 case 'g.00000': -
trunk/ippMonitor/raw/simplePlotraw.php
r31102 r39498 75 75 menu_end(); 76 76 } 77 if (! $qry->fetchInto($row)) {77 if (!dbFetchInto($qry, $row)) { 78 78 echo "<b>error reading rawExp table count</b><br>\n"; 79 79 echo "<br><small><b> count query : $sql </b></small><br>\n"; … … 218 218 219 219 // list the results 220 while ( $qry->fetchInto($row)) {220 while (dbFetchInto($qry, $row)) { 221 221 switch ($row[2]) { 222 222 case 'g.00000': -
trunk/ippMonitor/raw/warpProcessedExp.php
r32367 r39498 99 99 menu_end(); 100 100 } 101 if (! $qry->fetchInto($row)) {101 if (!dbFetchInto($qry, $row)) { 102 102 echo "<b>error reading warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary table count</b><br>\n"; 103 103 echo "<br><small><b> count query : $sql </b></small><br>\n"; … … 295 295 296 296 // list the results 297 while ( $qry->fetchInto($row)) {297 while (dbFetchInto($qry, $row)) { 298 298 // $link = "warpProcessedExp.php" . "?expID=" . $row[0] . "&" . $ID['link']; 299 299 -
trunk/ippMonitor/raw/warpProcessedExp_Images.php
r32366 r39498 91 91 menu_end(); 92 92 } 93 if (! $qry->fetchInto($row)) {93 if (!dbFetchInto($qry, $row)) { 94 94 echo "<b>error reading warpRun, fakeRun, camRun, chipRun, rawExp, warpSummary table count</b><br>\n"; 95 95 echo "<br><small><b> count query : $sql </b></small><br>\n"; … … 307 307 308 308 // list the results 309 while ( $qry->fetchInto($row)) {309 while (dbFetchInto($qry, $row)) { 310 310 // $link = "warpProcessedExp_Images.php" . "?expID=" . $row[0] . "&" . $ID['link']; 311 311
Note:
See TracChangeset
for help on using the changeset viewer.
