| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | function EnumQuery($name)
|
|---|
| 4 | {
|
|---|
| 5 | $var = $name . "Enum";
|
|---|
| 6 | $txt = "";
|
|---|
| 7 | switch ($_GET[$var])
|
|---|
| 8 | {
|
|---|
| 9 | case 0: $txt .= ""; break;
|
|---|
| 10 | case 1: $txt .= $name . "='yes' AND "; break;
|
|---|
| 11 | case 2: $txt .= $name . "='no' AND "; break;
|
|---|
| 12 | case 3: $txt .= ""; break;
|
|---|
| 13 | }
|
|---|
| 14 | return $txt;
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | function PrintEnumMenu($name, $text)
|
|---|
| 18 | {
|
|---|
| 19 | $var = $name . "Enum";
|
|---|
| 20 |
|
|---|
| 21 | if ($_GET[$name]=="On")
|
|---|
| 22 | $checked = "checked";
|
|---|
| 23 | else
|
|---|
| 24 | $checked = "";
|
|---|
| 25 |
|
|---|
| 26 | printf(" <input type='checkbox' name='%s' value='On' %s>%s\n", $name, $checked, $text);
|
|---|
| 27 | printf("<BR>");
|
|---|
| 28 |
|
|---|
| 29 | printf(" <select name='%s'>\n", $var);
|
|---|
| 30 |
|
|---|
| 31 | $status = array
|
|---|
| 32 | ( 0 => "all",
|
|---|
| 33 | 1 => "yes",
|
|---|
| 34 | 2 => "no",
|
|---|
| 35 | 3 => "group by"
|
|---|
| 36 | );
|
|---|
| 37 |
|
|---|
| 38 | $stat=$_GET[$var];
|
|---|
| 39 | for ($i=0; $i<4; $i++)
|
|---|
| 40 | {
|
|---|
| 41 | if ($stat==$i)
|
|---|
| 42 | printf("<option value='%d' selected>%s</option>\n", $i, $status[$i]);
|
|---|
| 43 | else
|
|---|
| 44 | printf("<option value='%d'>%s</option>\n", $i, $status[$i]);
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | printf(" </select>\n");
|
|---|
| 48 | printf(" \n");
|
|---|
| 49 |
|
|---|
| 50 | }
|
|---|
| 51 |
|
|---|
| 52 | function StatusQuery($name, $needs)
|
|---|
| 53 | {
|
|---|
| 54 | $var = $name . "Status";
|
|---|
| 55 | $txt = "";
|
|---|
| 56 | switch ($_GET[$var])
|
|---|
| 57 | {
|
|---|
| 58 | case 0: $txt .= ""; break;
|
|---|
| 59 | case 1: $txt .= "NOT (IsNull(" . $name . ") OR " . $name . "='1970-01-01 00:00:00') AND "; break;
|
|---|
| 60 | case 2: $txt .= "IsNull(" . $name . ") AND IsNull(fStartTime) AND IsNull(fFailedTime) AND NOT IsNull(" . $needs[$name] . ") AND "; break;
|
|---|
| 61 | case 3: $txt .= $name ."='1970-01-01 00:00:00' AND "; break;
|
|---|
| 62 | case 4: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval 12 hour) < fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break;
|
|---|
| 63 | case 5: $txt .= " (IsNull(" . $name . ") AND NOT IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND NOT IsNull(" . $needs[$name] . ")) AND "; break;
|
|---|
| 64 | case 6: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval 12 hour) > fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break;
|
|---|
| 65 | // case 6: $txt .= "crashed"; break;
|
|---|
| 66 | case 7: $txt .= ""; break;
|
|---|
| 67 | }
|
|---|
| 68 | return $txt;
|
|---|
| 69 | }
|
|---|
| 70 |
|
|---|
| 71 | function PrintStatusMenu($name, $text)
|
|---|
| 72 | {
|
|---|
| 73 | $var = $name . "Status";
|
|---|
| 74 |
|
|---|
| 75 | if ($_GET[$name]=="On")
|
|---|
| 76 | $checked = "checked";
|
|---|
| 77 | else
|
|---|
| 78 | $checked = "";
|
|---|
| 79 |
|
|---|
| 80 | printf(" <input type='checkbox' name='%s' value='On' %s>%s\n", $name, $checked, $text);
|
|---|
| 81 | printf("<BR>");
|
|---|
| 82 |
|
|---|
| 83 | printf(" <select name='%s'>\n", $var);
|
|---|
| 84 |
|
|---|
| 85 | $status = array
|
|---|
| 86 | ( 0 => "all",
|
|---|
| 87 | 1 => "done",
|
|---|
| 88 | 2 => "not done",
|
|---|
| 89 | 3 => "not to be done",
|
|---|
| 90 | 4 => "running",
|
|---|
| 91 | 5 => "failed",
|
|---|
| 92 | 6 => "crashed",
|
|---|
| 93 | 7 => "group by",
|
|---|
| 94 | );
|
|---|
| 95 |
|
|---|
| 96 | $stat=$_GET[$var];
|
|---|
| 97 | for ($i=0; $i<8; $i++)
|
|---|
| 98 | {
|
|---|
| 99 | if ($stat==$i)
|
|---|
| 100 | printf("<option value='%d' selected>%s</option>\n", $i, $status[$i]);
|
|---|
| 101 | else
|
|---|
| 102 | printf("<option value='%d'>%s</option>\n", $i, $status[$i]);
|
|---|
| 103 | }
|
|---|
| 104 |
|
|---|
| 105 | /*
|
|---|
| 106 | $status = array("all", "done", "not done", "not to be done");
|
|---|
| 107 | $counter = 0;
|
|---|
| 108 | foreach ($status as $element)
|
|---|
| 109 | {
|
|---|
| 110 | if ($counter==$_GET[$var])
|
|---|
| 111 | printf("<option value=\"%d\" selected>%3s</option>\n", $counter++, $element);
|
|---|
| 112 | else
|
|---|
| 113 | printf("<option value=\"%d\">%3s</option>\n", $counter++, $element);
|
|---|
| 114 | }*/
|
|---|
| 115 | printf(" </select>\n");
|
|---|
| 116 | printf(" \n");
|
|---|
| 117 |
|
|---|
| 118 | }
|
|---|
| 119 |
|
|---|
| 120 | function PrintPullDown($host, $user, $pw, $db, $table, $name, $index, $descr)
|
|---|
| 121 | {
|
|---|
| 122 | $db_id = mysql_connect($host, $user, $pw);
|
|---|
| 123 | if ($db_id==FALSE)
|
|---|
| 124 | {
|
|---|
| 125 | printf("mysql_connect returned the following error:<br>");
|
|---|
| 126 | printf("%s<br>", mysql_error());
|
|---|
| 127 | die("");
|
|---|
| 128 | }
|
|---|
| 129 |
|
|---|
| 130 | $query = "SELECT " . $index . ", " . $name . " FROM " . $db . "." . $table . " ORDER BY " . $name;
|
|---|
| 131 | $result = mysql_query($query);
|
|---|
| 132 |
|
|---|
| 133 | if (!$result)
|
|---|
| 134 | {
|
|---|
| 135 | printf("-N/A-");
|
|---|
| 136 | return;
|
|---|
| 137 | }
|
|---|
| 138 |
|
|---|
| 139 | $numrows = mysql_num_rows($result);
|
|---|
| 140 |
|
|---|
| 141 | if ($_GET[$name]=="On")
|
|---|
| 142 | $checked = "checked";
|
|---|
| 143 | else
|
|---|
| 144 | $checked = "";
|
|---|
| 145 |
|
|---|
| 146 | printf(" <input type='checkbox' name='%s' value='On' %s><A HREF='printtable.php?fTable=%s'>%s</A>\n", $name, $checked, $table, $descr);
|
|---|
| 147 |
|
|---|
| 148 | printf(" <BR>\n");
|
|---|
| 149 |
|
|---|
| 150 | printf(" <select name='%s' size='1' class='Width'>\n", $index);
|
|---|
| 151 |
|
|---|
| 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");
|
|---|
| 156 |
|
|---|
| 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");
|
|---|
| 161 |
|
|---|
| 162 | while ($row = mysql_fetch_row($result))
|
|---|
| 163 | {
|
|---|
| 164 | if (!empty($_GET[$index]) && $_GET[$index]==$row[0])
|
|---|
| 165 | printf(" <option value='%s' selected>%s</option>\n", $row[0], $row[1]);
|
|---|
| 166 | else
|
|---|
| 167 | printf(" <option value='%s'>%s</option>\n", $row[0], $row[1]);
|
|---|
| 168 | }
|
|---|
| 169 | printf(" </select>\n");
|
|---|
| 170 | printf(" \n", $index);
|
|---|
| 171 |
|
|---|
| 172 | mysql_free_result($result);
|
|---|
| 173 |
|
|---|
| 174 | mysql_close($db_id);
|
|---|
| 175 | }
|
|---|
| 176 |
|
|---|
| 177 | function GetMin($field, $table, $host, $user, $pw, $db)
|
|---|
| 178 | {
|
|---|
| 179 | $db_id = mysql_connect($host, $user, $pw);
|
|---|
| 180 | if ($db_id==FALSE)
|
|---|
| 181 | {
|
|---|
| 182 | printf("mysql_connect returned the following error:<br>");
|
|---|
| 183 | printf("%s<br>", mysql_error());
|
|---|
| 184 | die("");
|
|---|
| 185 | }
|
|---|
| 186 |
|
|---|
| 187 | $query = "SELECT MIN(" . $field . ") FROM " . $db . "." . $table;
|
|---|
| 188 | $result = mysql_query($query);
|
|---|
| 189 | if (!$result)
|
|---|
| 190 | return "0";
|
|---|
| 191 |
|
|---|
| 192 | $row = mysql_fetch_row($result);
|
|---|
| 193 |
|
|---|
| 194 | $min = $row[0];
|
|---|
| 195 |
|
|---|
| 196 | mysql_free_result($result);
|
|---|
| 197 | mysql_close($db_id);
|
|---|
| 198 |
|
|---|
| 199 | return $min;
|
|---|
| 200 | }
|
|---|
| 201 |
|
|---|
| 202 | function GetMax($field, $table, $host, $user, $pw, $db)
|
|---|
| 203 | {
|
|---|
| 204 | $db_id = mysql_connect($host, $user, $pw);
|
|---|
| 205 | if ($db_id==FALSE)
|
|---|
| 206 | {
|
|---|
| 207 | printf("mysql_connect returned the following error:<br>");
|
|---|
| 208 | printf("%s<br>", mysql_error());
|
|---|
| 209 | die("");
|
|---|
| 210 | }
|
|---|
| 211 |
|
|---|
| 212 | $query = "SELECT MAX(" . $field . ") FROM " . $db . "." . $table;
|
|---|
| 213 | $result = mysql_query($query);
|
|---|
| 214 | if (!$result)
|
|---|
| 215 | return "0";
|
|---|
| 216 |
|
|---|
| 217 | $row = mysql_fetch_row($result);
|
|---|
| 218 |
|
|---|
| 219 | $max = $row[0];
|
|---|
| 220 |
|
|---|
| 221 | mysql_free_result($result);
|
|---|
| 222 | mysql_close($db_id);
|
|---|
| 223 |
|
|---|
| 224 | return $max;
|
|---|
| 225 | }
|
|---|
| 226 |
|
|---|
| 227 | function PrintText($result0)
|
|---|
| 228 | {
|
|---|
| 229 | header("Content-type: application/octet");
|
|---|
| 230 | header("Content-Disposition: attachment; filename=query-result.txt");
|
|---|
| 231 |
|
|---|
| 232 | while ($row0 = mysql_fetch_assoc($result0))
|
|---|
| 233 | {
|
|---|
| 234 | foreach ($row0 as $key => $element)
|
|---|
| 235 | printf("%s\t", $element);
|
|---|
| 236 | printf("\n");
|
|---|
| 237 | }
|
|---|
| 238 | }
|
|---|
| 239 |
|
|---|
| 240 | function PrintSubmittedQuery($query0, $html, $db, $old)
|
|---|
| 241 | {
|
|---|
| 242 | //diplay query on old websites
|
|---|
| 243 | if (empty($old))
|
|---|
| 244 | printf("<tr class='Block' id='showquery' style='display:none'><td>");
|
|---|
| 245 | else
|
|---|
| 246 | printf("<tr class='Block' id='showquery' style='display:block'><td>");
|
|---|
| 247 | printf("<b>DB:</b> %s <br>", $db);
|
|---|
| 248 | if ($html=="1")
|
|---|
| 249 | printf("<U><B>submitted query:</B></U><BR>%s<BR>", htmlspecialchars($query0));
|
|---|
| 250 | printf("</td></tr>");
|
|---|
| 251 | }
|
|---|
| 252 |
|
|---|
| 253 | function Checkbox($value, $text)
|
|---|
| 254 | {
|
|---|
| 255 | if ($_GET[$value]=="On")
|
|---|
| 256 | $checked = "checked";
|
|---|
| 257 | else
|
|---|
| 258 | $checked = "";
|
|---|
| 259 |
|
|---|
| 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);
|
|---|
| 284 | }
|
|---|
| 285 |
|
|---|
| 286 | function CheckWhere($column, $_GET)
|
|---|
| 287 | {
|
|---|
| 288 | foreach ($_GET as $key => $element)
|
|---|
| 289 | {
|
|---|
| 290 | if ($key==$column)
|
|---|
| 291 | {
|
|---|
| 292 | if ($element>0)
|
|---|
| 293 | printf ("FIXED: %s<BR>", $column);
|
|---|
| 294 | return $element;
|
|---|
| 295 | }
|
|---|
| 296 | }
|
|---|
| 297 | return 0;
|
|---|
| 298 | }
|
|---|
| 299 |
|
|---|
| 300 | function CheckGroup($column, $_GET)
|
|---|
| 301 | {
|
|---|
| 302 | foreach ($_GET as $key => $element)
|
|---|
| 303 | {
|
|---|
| 304 | if ($key==$column)
|
|---|
| 305 | {
|
|---|
| 306 | //if ($element==-1)
|
|---|
| 307 | // printf ("GROUP: %s<BR>", $column);
|
|---|
| 308 | return $element;
|
|---|
| 309 | }
|
|---|
| 310 | }
|
|---|
| 311 | return 0;
|
|---|
| 312 | }
|
|---|
| 313 |
|
|---|
| 314 | function CheckStatusGroup($column, $_GET)
|
|---|
| 315 | {
|
|---|
| 316 | foreach ($_GET as $key => $element)
|
|---|
| 317 | if ($key==$column)
|
|---|
| 318 | if ($element==7)
|
|---|
| 319 | return -1;
|
|---|
| 320 | return 0;
|
|---|
| 321 | }
|
|---|
| 322 |
|
|---|
| 323 | function CheckEnumGroup($column, $_GET)
|
|---|
| 324 | {
|
|---|
| 325 | foreach ($_GET as $key => $element)
|
|---|
| 326 | if ($key==$column)
|
|---|
| 327 | if ($element==3)
|
|---|
| 328 | return -1;
|
|---|
| 329 | return 0;
|
|---|
| 330 | }
|
|---|
| 331 |
|
|---|
| 332 | function CreateMenu($rows)
|
|---|
| 333 | {
|
|---|
| 334 | $menu = "";
|
|---|
| 335 |
|
|---|
| 336 | if (empty($_GET["fNumResults"]))
|
|---|
| 337 | return;
|
|---|
| 338 |
|
|---|
| 339 | if ($_GET["fNumStart"]!=0)
|
|---|
| 340 | {
|
|---|
| 341 | $uri = htmlspecialchars($_SERVER["REQUEST_URI"]);
|
|---|
| 342 | $pos = strpos($uri, "fNumStart");
|
|---|
| 343 | $amp3=FALSE;
|
|---|
| 344 | if ($pos!=FALSE)
|
|---|
| 345 | {
|
|---|
| 346 | $amp1 = substr($uri, 0, $pos-1);
|
|---|
| 347 | $amp2 = substr($uri, $pos);
|
|---|
| 348 | $amp3 = strchr($amp2, "&");
|
|---|
| 349 |
|
|---|
| 350 | $uri = $amp1;
|
|---|
| 351 | }
|
|---|
| 352 | $pos = $_GET["fNumStart"]-$rows;
|
|---|
| 353 | if ($pos<0)
|
|---|
| 354 | $pos=0;
|
|---|
| 355 | $uri .= "&fNumStart=" . $pos;
|
|---|
| 356 | if ($amp3!=FALSE)
|
|---|
| 357 | $uri .= $amp3;
|
|---|
| 358 |
|
|---|
| 359 | $menu .= "<A HREF='" . $uri . "'><<< Prev</A>\n";
|
|---|
| 360 | }
|
|---|
| 361 |
|
|---|
| 362 | $menu .= " --- <B>";
|
|---|
| 363 | $menu .= $_GET["fNumStart"];
|
|---|
| 364 | $menu .= "</B> --- \n";
|
|---|
| 365 |
|
|---|
| 366 | if ($rows==$_GET["fNumResults"])
|
|---|
| 367 | {
|
|---|
| 368 | $uri = $_SERVER["REQUEST_URI"];
|
|---|
| 369 | $pos = strpos($uri, "fNumStart");
|
|---|
| 370 | $amp3=FALSE;
|
|---|
| 371 | if ($pos!=FALSE)
|
|---|
| 372 | {
|
|---|
| 373 | $amp1 = substr($uri, 0, $pos-1);
|
|---|
| 374 | $amp2 = substr($uri, $pos);
|
|---|
| 375 | $amp3 = strchr($amp2, "&");
|
|---|
| 376 |
|
|---|
| 377 | $uri = $amp1;
|
|---|
| 378 | }
|
|---|
| 379 | $uri .= "&fNumStart=" . ($_GET["fNumStart"]+$rows);
|
|---|
| 380 | if ($amp3!=FALSE)
|
|---|
| 381 | $uri .= $amp3;
|
|---|
| 382 |
|
|---|
| 383 | $menu .= "<A HREF='" . htmlspecialchars($uri) . "'>Next >>></A>\n";
|
|---|
| 384 | }
|
|---|
| 385 | return $menu;
|
|---|
| 386 | }
|
|---|
| 387 |
|
|---|
| 388 | function RemoveSortBy()
|
|---|
| 389 | {
|
|---|
| 390 | $menu = "";
|
|---|
| 391 |
|
|---|
| 392 | $uri = $_SERVER["REQUEST_URI"];
|
|---|
| 393 | $pos = strpos($uri, "fSortBy");
|
|---|
| 394 | $amp3=FALSE;
|
|---|
| 395 | if ($pos!=FALSE)
|
|---|
| 396 | {
|
|---|
| 397 | $amp1 = substr($uri, 0, $pos-1);
|
|---|
| 398 | $amp2 = substr($uri, $pos);
|
|---|
| 399 | $amp3 = strchr($amp2, "&");
|
|---|
| 400 |
|
|---|
| 401 | $uri = $amp1;
|
|---|
| 402 | }
|
|---|
| 403 |
|
|---|
| 404 | return $uri;
|
|---|
| 405 | }
|
|---|
| 406 |
|
|---|
| 407 | function FindAlias($alias, $search)
|
|---|
| 408 | {
|
|---|
| 409 | foreach ($alias as $key => $element)
|
|---|
| 410 | if ($element==$search)
|
|---|
| 411 | return $key;
|
|---|
| 412 |
|
|---|
| 413 | if ($search=="# Runs")
|
|---|
| 414 | return "NumRuns";
|
|---|
| 415 | if ($search=="# Sequ")
|
|---|
| 416 | return "NumSequ";
|
|---|
| 417 | if ($search=="# Datasets")
|
|---|
| 418 | return "NumDS";
|
|---|
| 419 | if ($search=="# days")
|
|---|
| 420 | return "NumDays";
|
|---|
| 421 | return $search;
|
|---|
| 422 | return "";
|
|---|
| 423 | }
|
|---|
| 424 |
|
|---|
| 425 | function PrintMagicTable($result0, $alias, $rightalign, $limitsmean, $limitsmin, $limitsmax, $form, $_GET)
|
|---|
| 426 | {
|
|---|
| 427 | $col = FALSE;
|
|---|
| 428 | $first = TRUE;
|
|---|
| 429 |
|
|---|
| 430 | $sigma = array
|
|---|
| 431 | (
|
|---|
| 432 | 5 => "#FF9900",
|
|---|
| 433 | 3 => "#FFFF66",
|
|---|
| 434 | 2 => "#33CC00",
|
|---|
| 435 | 1 => "#006600",
|
|---|
| 436 | );
|
|---|
| 437 | $offlimitcolour="#FF0000";
|
|---|
| 438 |
|
|---|
| 439 |
|
|---|
| 440 | $menu = CreateMenu(mysql_num_rows($result0));
|
|---|
| 441 |
|
|---|
| 442 | printf("\n<center>\n");
|
|---|
| 443 | if ($form)
|
|---|
| 444 | printf("<form method='POST'>");
|
|---|
| 445 | if (empty($_GET["fPrintTable"]))
|
|---|
| 446 | printf("<p>%s<P>\n", $menu);
|
|---|
| 447 | printf("<table BORDER='0'>\n");
|
|---|
| 448 | while ($row0 = mysql_fetch_assoc($result0))
|
|---|
| 449 | {
|
|---|
| 450 | if ($first)
|
|---|
| 451 | {
|
|---|
| 452 | printf(" <tr BGCOLOR='#C0C0C0'>\n");
|
|---|
| 453 | $first = FALSE;
|
|---|
| 454 | if ($form)
|
|---|
| 455 | printf("<td>ON</td><td>Off</td>");
|
|---|
| 456 | foreach ($row0 as $key => $element)
|
|---|
| 457 | {
|
|---|
| 458 | $col = FindAlias($alias, $key);
|
|---|
| 459 |
|
|---|
| 460 | $ord="-";
|
|---|
| 461 | $issort = "";
|
|---|
| 462 | if (!empty($_GET["fSortBy"]) && substr($_GET["fSortBy"], 0, -1)==$col)
|
|---|
| 463 | {
|
|---|
| 464 | if (substr($_GET["fSortBy"], -1)=="-")
|
|---|
| 465 | {
|
|---|
| 466 | $ord="+";
|
|---|
| 467 | $issort=" <IMG SRC='down.gif'>";
|
|---|
| 468 | }
|
|---|
| 469 | else
|
|---|
| 470 | $issort=" <IMG SRC='up.gif'>";
|
|---|
| 471 | }
|
|---|
| 472 | printf(" <th> <A HREF='%s&fSortBy=%s%s'>%s</A>%s </th>\n",
|
|---|
| 473 | htmlspecialchars(RemoveSortBy()), $col, $ord, $key, $issort);
|
|---|
| 474 | }
|
|---|
| 475 | printf(" </tr>\n\n");
|
|---|
| 476 | }
|
|---|
| 477 |
|
|---|
| 478 | if (!$col)
|
|---|
| 479 | printf(" <tr BGCOLOR='#E0E0E0'>\n");
|
|---|
| 480 | else
|
|---|
| 481 | printf(" <tr BGCOLOR='#D0D0D0'>\n");
|
|---|
| 482 | $col = !$col;
|
|---|
| 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 | }
|
|---|
| 491 | foreach ($row0 as $key => $element)
|
|---|
| 492 | {
|
|---|
| 493 | if (empty($rightalign[$key]))
|
|---|
| 494 | printf(" <td align='left'>");
|
|---|
| 495 | else
|
|---|
| 496 | printf(" <td align='right'>");
|
|---|
| 497 |
|
|---|
| 498 | //determine color of text in cell
|
|---|
| 499 | if (!empty($limitsmean))
|
|---|
| 500 | {
|
|---|
| 501 | foreach($limitsmean as $key2 => $element2)
|
|---|
| 502 | {
|
|---|
| 503 | $mean=$key2 . "Mean";
|
|---|
| 504 | $rms2=$key2 . "Rms";
|
|---|
| 505 | if ($key==$alias[$element2] && !empty($_GET[$mean]))
|
|---|
| 506 | {
|
|---|
| 507 | if (!empty($_GET[$rms2]))
|
|---|
| 508 | {
|
|---|
| 509 | $colour=$offlimitcolour;
|
|---|
| 510 | foreach ($sigma as $margin => $newcolour)
|
|---|
| 511 | {
|
|---|
| 512 | $min=$_GET[$mean] - ($margin * $_GET[$rms2]);
|
|---|
| 513 | $max=$_GET[$mean] + ($margin * $_GET[$rms2]);
|
|---|
| 514 | if ($min < $element && $element < $max)
|
|---|
| 515 | $colour=$newcolour;
|
|---|
| 516 | }
|
|---|
| 517 | printf("<font color='%s' style='font-weight:bold'>", $colour);
|
|---|
| 518 | }
|
|---|
| 519 | }
|
|---|
| 520 | }
|
|---|
| 521 | }
|
|---|
| 522 | if (!empty($limitsmin))
|
|---|
| 523 | {
|
|---|
| 524 | foreach($limitsmin as $key2 => $element2)
|
|---|
| 525 | {
|
|---|
| 526 | $limit1=$key2 . "1";
|
|---|
| 527 | $limit2=$key2 . "2";
|
|---|
| 528 | if ($key==$alias[$element2] && !empty($_GET[$limit1]))
|
|---|
| 529 | {
|
|---|
| 530 | $colour=$offlimitcolour;
|
|---|
| 531 | if ($_GET[$limit1] <= $element)
|
|---|
| 532 | $colour=$sigma[1];
|
|---|
| 533 | else
|
|---|
| 534 | {
|
|---|
| 535 | if (!empty($_GET[$limit2]))
|
|---|
| 536 | {
|
|---|
| 537 | if ($_GET[$limit2] <= $element)
|
|---|
| 538 | $colour=$sigma[5];
|
|---|
| 539 | }
|
|---|
| 540 | }
|
|---|
| 541 | printf("<font color='%s' style='font-weight:bold'>", $colour);
|
|---|
| 542 | }
|
|---|
| 543 | }
|
|---|
| 544 | }
|
|---|
| 545 |
|
|---|
| 546 | if (!empty($limitsmax))
|
|---|
| 547 | {
|
|---|
| 548 | foreach($limitsmax as $key2 => $element2)
|
|---|
| 549 | {
|
|---|
| 550 | $limit1=$key2 . "1";
|
|---|
| 551 | $limit2=$key2 . "2";
|
|---|
| 552 | if ($key==$alias[$element2] && !empty($_GET[$limit1]))
|
|---|
| 553 | {
|
|---|
| 554 | $colour=$offlimitcolour;
|
|---|
| 555 | if ($_GET[$limit1] >= $element)
|
|---|
| 556 | $colour=$sigma[1];
|
|---|
| 557 | else
|
|---|
| 558 | {
|
|---|
| 559 | if (!empty($_GET[$limit2]))
|
|---|
| 560 | {
|
|---|
| 561 | if ($_GET[$limit2] >= $element)
|
|---|
| 562 | $colour=$sigma[5];
|
|---|
| 563 | }
|
|---|
| 564 | }
|
|---|
| 565 | printf("<font color='%s' style='font-weight:bold'>", $colour);
|
|---|
| 566 | }
|
|---|
| 567 | }
|
|---|
| 568 | }
|
|---|
| 569 |
|
|---|
| 570 | //fill text in cell
|
|---|
| 571 | printf(" %s </td>\n", str_replace("&ws;", " ", str_replace(" ", " ", $element)));
|
|---|
| 572 | }
|
|---|
| 573 | printf(" </tr>\n");
|
|---|
| 574 | }
|
|---|
| 575 | printf("</table>\n");
|
|---|
| 576 |
|
|---|
| 577 | /*
|
|---|
| 578 | $info = mysql_info();
|
|---|
| 579 | if (!empty($info))
|
|---|
| 580 | printf("%s<BR>\n", $info);
|
|---|
| 581 | */
|
|---|
| 582 |
|
|---|
| 583 | printf("<P><B>Number of displayed results: %d</B><P><P>\n", mysql_num_rows($result0));
|
|---|
| 584 | if (empty($_GET["fPrintTable"]))
|
|---|
| 585 | printf("%s\n", $menu);
|
|---|
| 586 | printf("<P>\n");
|
|---|
| 587 |
|
|---|
| 588 | if (!$form)
|
|---|
| 589 | {
|
|---|
| 590 | printf("</center>\n");
|
|---|
| 591 | printf("</td>\n");
|
|---|
| 592 | printf("</tr>\n");
|
|---|
| 593 | }
|
|---|
| 594 | }
|
|---|
| 595 |
|
|---|
| 596 | ?>
|
|---|