Changeset 13566
- Timestamp:
- May 30, 2007, 6:13:58 PM (19 years ago)
- Location:
- trunk/ippMonitor
- Files:
-
- 7 edited
-
def/autocode.php (modified) (5 diffs)
-
def/detInputExp.d (modified) (1 diff)
-
def/detResidExp.d (modified) (1 diff)
-
def/masterDetrendFrames.d (modified) (2 diffs)
-
generate (modified) (13 diffs)
-
raw/ipp.css (modified) (1 diff)
-
raw/ipp.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippMonitor/def/autocode.php
r10963 r13566 27 27 28 28 // get the result table count 29 if ($WHERE) { 30 $sql = "SELECT count(*) FROM $TABLE WHERE $WHERE"; 31 } else { 32 $sql = "SELECT count(*) FROM $TABLE"; 33 } 29 $sql = "SELECT count(*) FROM $TABLE $WHERE"; 30 34 31 $qry = $db->query($sql); 35 32 if (DB::iserror($db)) { … … 53 50 54 51 // query the database 55 if ($WHERE) { 56 $sql = "SELECT $FIELDS FROM $TABLE WHERE $WHERE LIMIT $dTABLE OFFSET $rowStart"; 57 } else { 58 $sql = "SELECT $FIELDS FROM $TABLE LIMIT $dTABLE OFFSET $rowStart"; 59 } 52 $sql = "SELECT $FIELDS FROM $TABLE $WHERE LIMIT $dTABLE OFFSET $rowStart"; 60 53 61 54 $qry = $db->query($sql); … … 67 60 // ** HEAD CODE ** 68 61 69 if ($rowStart > 0) { 70 $value = 0; 71 $link = "$FILE" . "?" . $ID['link'] . "&from=$value"; 72 echo "<a width=10 class=\"button\" href=\"$link\"><<</a>\n"; 73 } else { 74 echo "<<\n"; 75 } 76 if ($rowStart >= $dTABLE) { 77 $value = $rowStart - $dTABLE; 78 $link = "$FILE" . "?" . $ID['link'] . "&from=$value"; 79 echo "<a class=\"button\" href=\"$link\"><</a>\n"; 80 } else { 81 echo "<\n"; 82 } 83 84 if ($rowLast < $rowTotal) { 85 $value = $rowStart + $dTABLE; 86 $link = "$FILE" . "?" . $ID['link'] . "&from=$value"; 87 echo "<a class=\"button\" href=\"$link\">></a>\n"; 88 } else { 89 echo ">\n"; 90 } 91 92 if ($rowLast < $rowTotal) { 93 $value = $rowTotal - $dTABLE; 94 $link = "$FILE" . "?" . $ID['link'] . "&from=$value"; 95 echo "<a class=\"button\" href=\"$link\">>></a>\n"; 96 } else { 97 echo ">>\n"; 98 } 62 // ** BUTTON RESTRICTIONS ** 63 navigate_buttons ($rowStart, $rowLast, $dTABLE, $rowTotal, $buttonLink, $ID, '$FILE'); 99 64 100 65 echo " : or enter start row: <input type=\"text\" name=\"from\" size=\"5\" value=\"$rowStart\">\n"; … … 104 69 echo "<tr>\n"; 105 70 // ** TABLE HEADER ** 106 // echo "<th class=list> FIELD </th>\n";107 71 echo "</tr>\n"; 108 72 … … 117 81 // $link = "$FILE" . "?expID=" . $row[0] . "&" . $ID['link']; 118 82 83 $class = "list"; 84 // ** TD CLASS ** 85 119 86 echo "<tr>\n"; 120 87 // ** TABLE DATA ** 121 // echo "<td class=list><a href=\"$link\"> $row[0] </a></td>\n";122 // echo "<td class=list> $row[1] </td>\n";123 88 echo "</tr>\n"; 124 89 } -
trunk/ippMonitor/def/detInputExp.d
r13264 r13566 4 4 MENU ipp.detrend.dat 5 5 6 ARGS ARG1 exp_tag=$exp_tag6 ARGS ARG1 rawImfile.exp_tag=$detInputExp.exp_tag 7 7 8 ARGS ARG2 exp_tag=$exp_tag9 ARGS ARG2 det _id=$det_id10 ARGS ARG2 iteration=$iteration8 ARGS ARG2 detResidImfile.exp_tag=$detInputExp.exp_tag 9 ARGS ARG2 detResidImfile.det_id=$detInputExp.det_id 10 ARGS ARG2 detResidImfile.iteration=$detInputExp.iteration 11 11 12 # field width name show link to extras 13 FIELD det_id, 7, det_id 14 FIELD exp_tag, 20, exposure, value, rawImfile.php, ARG1 15 FIELD iteration, 5, iteration 16 FIELD include, 7, include 17 FIELD *, 5, resid, value=goto, detResidImfile.php, ARG2 18 FIELD *, 5, proc, value=goto, detProcessedImfile.php, ARG2 12 ARGS ARG2 detProcessedImfile.exp_tag=$detInputExp.exp_tag 13 ARGS ARG2 detProcessedImfile.det_id=$detInputExp.det_id 14 ARGS ARG2 detProcessedImfile.iteration=$detInputExp.iteration 19 15 16 # field width name show link to extras 17 FIELD detInputExp.det_id, 7, det_id 18 FIELD detInputExp.exp_tag, 20, exposure, value, rawImfile.php, ARG1 19 FIELD detInputExp.iteration, 5, iteration 20 FIELD detInputExp.include, 7, include 21 FIELD *, 5, choose, value=resid, detResidImfile.php, ARG2 22 FIELD *, 5, choose, value=proc, detProcessedImfile.php, ARG3 23 -
trunk/ippMonitor/def/detResidExp.d
r13264 r13566 31 31 FIELD detResidExp.path_base, 20, path_base, none 32 32 FIELD rawExp.camera, 20, camera, none 33 34 TD_CLASS list_off $detResidExp.accept == 0 -
trunk/ippMonitor/def/masterDetrendFrames.d
r13264 r13566 12 12 WHERE detRun.iteration = detRunSummary.iteration 13 13 14 ARGS ARG1 det _id=$detRunSummary.det_id14 ARGS ARG1 detRunSummary.det_id=$detRunSummary.det_id 15 15 16 ARGS ARG2 det_id=$detRunSummary.det_id 17 ARGS ARG2 iteration=$detRunSummary.iteration 16 ARGS ARG2 detInputExp.det_id=$detRunSummary.det_id 17 ARGS ARG2 detInputExp.iteration=$detRunSummary.iteration 18 19 ARGS ARG3 detProcessedExp.det_id=$detRunSummary.det_id 20 21 ARGS ARG4 detResidExp.det_id=$detRunSummary.det_id 22 ARGS ARG4 detResidExp.iteration=$detRunSummary.iteration 18 23 19 24 # field width name show link to extras … … 21 26 FIELD detRunSummary.iteration, 5, iter 22 27 FIELD detRun.det_type, 5, type 23 FIELD *, 20, choose, value=files, detNormalizedImfiles.php, ARG224 28 FIELD *, 20, choose, value=input, detInputExp.php, ARG2 25 FIELD *, 20, choose, value=resid, detResidExp.php, ARG2 29 FIELD *, 20, choose, value=proc, detProcessedExp.php, ARG3 30 FIELD *, 20, choose, value=resid, detResidExp.php, ARG4 26 31 FIELD detRunSummary.bg, 20, bg 27 32 FIELD detRunSummary.bg_stdev, 20, bg_stdev -
trunk/ippMonitor/generate
r13264 r13566 59 59 } 60 60 61 if ($key eq "FILE") { 62 $myFile = $value; 63 } 64 61 65 # list of the table fields 62 66 if ($key eq "HEAD") { … … 69 73 } 70 74 71 # the IMAGE commands sets up a reference name75 # the ARGS commands defines arguments to FIELDS commands 72 76 if ($key eq "ARGS") { 73 77 push @linkargs, $value; 78 } 79 80 # the TD_CLASS command sets up an alternate TD class 81 if ($key eq "TD_CLASS") { 82 $tdClass = $value; 83 # print STDERR "found TD_CLASS\n"; 74 84 } 75 85 … … 151 161 } 152 162 163 # fill in TD_CLASS test 164 if ($line =~ m|// \*\* TD CLASS \*\*|) { 165 &write_td_class; 166 } 167 153 168 # fill in table data 154 169 if ($line =~ m|// \*\* TABLE DATA \*\*|) { … … 164 179 if ($line =~ m|// \*\* TABLE RESTRICTIONS \*\*|) { 165 180 &write_table_restrict; 181 } 182 183 # fill in table restricts 184 if ($line =~ m|// \*\* BUTTON RESTRICTIONS \*\*|) { 185 &write_button_restrict; 166 186 } 167 187 … … 200 220 for ($i = 0; $i < @field; $i++) { 201 221 if ($show[$i] eq "none") { next; } 202 printf FILE "echo \"<th class=\\\"list\\\"> $name[$i] </th>\\n\";\n"; 203 } 222 # printf FILE "echo \"<th class=\\\"list\\\"> $name[$i] </th>\\n\";\n"; 223 printf FILE "write_table_header (\"list\", \"$name[$i]\", \"$field[$i]\", \$buttonLink, \$ID, '$myFile');\n"; 224 } 225 } 226 227 sub write_td_class { 228 my ($field, $testline); 229 230 if ($tdClass eq "") { return; } 231 # print STDERR "write TD CLASS: $tdClass...\n"; 232 233 # TD_CLASS class field expression 234 ($class, $field, $testline) = split (" ", $tdClass, 3); 235 236 $field = &parse_fieldname ($field); 237 238 printf FILE " if ($field $testline) {\n"; 239 printf FILE " \$class = \"$class\";\n"; 240 printf FILE " }\n"; 204 241 } 205 242 … … 208 245 209 246 if ($WHERE) { 210 printf FILE "\$WHERE = \" $WHERE\";\n";247 printf FILE "\$WHERE = \"WHERE $WHERE\";\n"; 211 248 } 212 249 for ($i = 0; $i < @field; $i++) { … … 215 252 printf FILE "\$WHERE = check_restrict ('$value', \$WHERE);\n"; 216 253 } 254 printf FILE "\$WHERE = check_ordering (\$WHERE);\n"; 255 } 256 257 # generate a button link entry for each field (field != *) 258 sub write_button_restrict { 259 260 for ($i = 0; $i < @field; $i++) { 261 $value = $field[$i]; 262 if ($value eq "*") { next; } 263 printf FILE "\$buttonLink = button_restrict ('$value', \$buttonLink);\n"; 264 } 217 265 } 218 266 … … 228 276 if ($label eq "none") { next; } 229 277 230 if (($label eq "value") && !$link[$i]) { 231 # print value without link or image 232 if (! $value && ($field[$i] ne "*")) { $value = "\$row[$Nrow]"; } 233 print FILE " echo \"<td class=\\\"list\\\"> $value </td>\\n\";\n"; 234 next; 235 } 236 237 if (($label eq "value") && $link[$i]) { 278 if ($label eq "value") { 238 279 # create the basic link variable 239 printf FILE " \$link = \"$link[$i]\" . \"?menu=$MENU&\" . \$ID['link'];\n"; 240 # add extra GET data to target 241 if ($extras[$i]) { &parse_extras ($linkarg{$extras[$i]}); } 280 if ($link[$i]) { 281 printf FILE " \$link = \"$link[$i]\" . \"?menu=$MENU&\" . \$ID['link'];\n"; 282 # add extra GET data to target 283 if ($extras[$i]) { &parse_extras ($linkarg{$extras[$i]}); } 284 $myLink = "\$link"; 285 } else { 286 $myLink = "\"\""; 287 } 242 288 # print the actual table cell line with the link... 243 289 if (! $value && ($field[$i] ne "*")) { $value = "\$row[$Nrow]"; } 244 printf FILE " echo \"<td class=\\\"list\\\"><a href=\\\"\$link\\\"> $value </a></td>\\n\";\n";290 printf FILE " write_table_cell (\$class, $myLink, $value);\n"; 245 291 next; 246 292 } … … 248 294 if (($label eq "image") && !$link[$i]) { 249 295 # print the actual table cell line with the image... 250 printf FILE " echo \"<td class=\\\" list\\\"><img src=\\\"$image{$value}\\\"></td>\\n\";\n";296 printf FILE " echo \"<td class=\\\"\$class\\\"><img src=\\\"$image{$value}\\\"></td>\\n\";\n"; 251 297 next; 252 298 } … … 258 304 if ($extras[$i]) { &parse_extras ($linkarg{$extras[$i]}); } 259 305 # print the actual table cell line with the link... 260 printf FILE " echo \"<td class=\\\" list\\\"><a href=\\\"\$link\\\"> <img src=\\\"$image{$value}\\\"> </a></td>\\n\";\n";306 printf FILE " echo \"<td class=\\\"\$class\\\"><a href=\\\"\$link\\\"> <img src=\\\"$image{$value}\\\"> </a></td>\\n\";\n"; 261 307 next; 262 308 } … … 401 447 my ($i); 402 448 449 # print STDERR "variable: $variable\n"; 450 403 451 unless ($variable =~ m|^\$|) { 404 452 return $variable; … … 407 455 $fieldname = substr ($variable, 1); 408 456 409 print STDERR "fieldname: $fieldname\n";410 411 for ($i = 0; $i < @field; $i++) { 412 print STDERR "$i: $field[$i] : $fieldname\n";457 # print STDERR "fieldname: $fieldname\n"; 458 459 for ($i = 0; $i < @field; $i++) { 460 # print STDERR "$i: $field[$i] : $fieldname\n"; 413 461 414 462 if ($field[$i] eq "*") { next; } … … 420 468 $value = "\$row[$Nrow]"; 421 469 422 print STDERR "found : $i : $count[$i] : $Nrow : $value\n";470 # print STDERR "found : $i : $count[$i] : $Nrow : $value\n"; 423 471 return $value; 424 472 } -
trunk/ippMonitor/raw/ipp.css
r12835 r13566 101 101 } 102 102 103 td.list_off { 104 text-align: left; 105 font-size: normal; 106 font-weight: normal; 107 vertical-align: top; 108 background: #a0a0a0; 109 background-color: #a0a0a0; 110 border: 2px solid #000000; 111 padding: 2px; 112 } 113 103 114 th.list { 104 115 text-align: left; -
trunk/ippMonitor/raw/ipp.php
r13264 r13566 1 1 <?php 2 2 3 $dTABLE = 10;3 $dTABLE = 80; 4 4 5 5 function logintext () { … … 282 282 } 283 283 284 function navigate_buttons ($rowStart, $rowLast, $dTABLE, $rowTotal, $buttonLink, $ID, $file) { 285 286 if ($rowStart > 0) { 287 $value = 0; 288 $link = "$file" . "?" . $ID['link'] . "&from=$value"; 289 if ($buttonLink != "") { 290 $link = $link . "&$buttonLink"; 291 } 292 echo "<a width=10 class=\"button\" href=\"$link\"><<</a>\n"; 293 } else { 294 echo "<<\n"; 295 } 296 if ($rowStart >= $dTABLE) { 297 $value = $rowStart - $dTABLE; 298 $link = "$file" . "?" . $ID['link'] . "&from=$value"; 299 if ($buttonLink != "") { 300 $link = $link . "&$buttonLink"; 301 } 302 echo "<a class=\"button\" href=\"$link\"><</a>\n"; 303 } else { 304 echo "<\n"; 305 } 306 307 if ($rowLast < $rowTotal) { 308 $value = $rowStart + $dTABLE; 309 $link = "$file" . "?" . $ID['link'] . "&from=$value"; 310 if ($buttonLink != "") { 311 $link = $link . "&$buttonLink"; 312 } 313 echo "<a class=\"button\" href=\"$link\">></a>\n"; 314 } else { 315 echo ">\n"; 316 } 317 318 if ($rowLast < $rowTotal) { 319 $value = $rowTotal - $dTABLE; 320 $link = "$file" . "?" . $ID['link'] . "&from=$value"; 321 if ($buttonLink != "") { 322 $link = $link . "&$buttonLink"; 323 } 324 echo "<a class=\"button\" href=\"$link\">>></a>\n"; 325 } else { 326 echo ">>\n"; 327 } 328 } 329 284 330 function check_restrict ($key, $where) { 285 331 $htmlkey = preg_replace ('|\.|', '_', $key); 286 332 if ($_SERVER[REQUEST_METHOD] == 'GET') { 287 333 $value = $_GET[$htmlkey]; 288 // echo "using GET: $value<br>\n";289 334 } else { 290 335 $value = $_POST[$htmlkey]; 291 // echo "using POST: $value<br>\n"; 292 } 293 // echo "value: $value<br>\n"; 336 } 294 337 if ($value != "") { 295 338 if ($where) { 296 339 $where = $where . " AND $key = '$value'"; 297 // echo "where 1: $where<br>\n";298 340 } else { 299 $where = "$key = '$value'"; 300 // echo "where 2: $where<br>\n"; 341 $where = "WHERE $key = '$value'"; 301 342 } 302 343 } 303 344 return $where; 345 } 346 347 function check_ordering ($where) { 348 349 if ($_SERVER[REQUEST_METHOD] == 'GET') { 350 $value = $_GET['sort']; 351 } else { 352 $value = $_POST['sort']; 353 } 354 if ($value != "") { 355 $where = $where . " ORDER BY $value"; 356 } 357 return $where; 358 } 359 360 function button_restrict ($key, $line) { 361 $htmlkey = preg_replace ('|\.|', '_', $key); 362 if ($_SERVER[REQUEST_METHOD] == 'GET') { 363 $value = $_GET[$htmlkey]; 364 } else { 365 $value = $_POST[$htmlkey]; 366 } 367 if ($value != "") { 368 if ($line) { 369 $line = $line . "&$key=$value"; 370 } else { 371 $line = "$key=$value"; 372 } 373 } 374 return $line; 375 } 376 377 function write_table_header ($class, $name, $value, $buttonLink, $ID, $file) { 378 379 $link = "$file" . "?" . $ID['link'] . "&sort=$value"; 380 if ($buttonLink != "") { 381 $link = $link . "&$buttonLink"; 382 } 383 echo "<th class=\"$class\"><a href=\"$link\"> $name </a></th>\n"; 304 384 } 305 385 306 386 function write_query_row ($key, $width) { 307 387 $htmlkey = preg_replace ('|\.|', '_', $key); 308 $value = $_POST[$htmlkey]; 309 if (($_SERVER[REQUEST_METHOD] == 'POST') && $value) { 388 if ($_SERVER[REQUEST_METHOD] == 'GET') { 389 $value = $_GET[$htmlkey]; 390 } else { 391 $value = $_POST[$htmlkey]; 392 } 393 if ($value != "") { 310 394 echo "<td class=\"list\"> <input type=\"text\" name=\"$key\" size=\"$width\" value=\"$value\"> </td>\n"; 311 395 } else { 312 396 echo "<td class=\"list\"> <input type=\"text\" name=\"$key\" size=\"$width\"> </td>\n"; 397 } 398 } 399 400 function write_table_cell ($class, $link, $value) { 401 $myValue = $value; 402 if ($myValue == "") { $myValue = " "; } 403 404 if ($link) { 405 echo "<td class=\"$class\"><a href=\"$link\"> $myValue </a></td>\n"; 406 } else { 407 echo "<td class=\"$class\"> $myValue </td>\n"; 313 408 } 314 409 }
Note:
See TracChangeset
for help on using the changeset viewer.
