IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31892


Ignore:
Timestamp:
Jul 18, 2011, 12:23:39 PM (15 years ago)
Author:
rhenders
Message:

cosmetic changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/czartool_labels.php

    r31834 r31892  
    4646$menu = $ID['menu'];
    4747
     48$selectedMode = $_GET[mode];
    4849$selectedStage = $_GET[stage];
    4950$selectedLabel = $_GET[label];
     
    5556$allServerCmd = $_GET[allservercmd];
    5657
    57 if ($selectedLabel == "") { $selectedLabel = "all_stdscience_labels"; }
     58$headerColor = "#0080c0";
     59$columnHeaderColor = "lavender";
     60
     61if ($selectedMode == "") { $selectedMode = "stdscience"; }
     62if ($selectedLabel == "") { $selectedLabel = "all"; }
    5863if ($selectedStage == "") { $selectedStage = "all_stages"; }
    5964if ($plotType == "") { $plotType = "linear"; }
     
    7378
    7479$debug = 0;
    75 
    76 $stdsLabels = getLabels($czardb, "stdscience");
     80$table = "<table bgcolor=\"#FFFFFF\" width=\"700\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     81
     82$labels = getLabels($czardb, $selectedMode);
    7783$distLabels = getLabels($czardb, "distribution");
    7884$pubLabels = getLabels($czardb, "publishing");
    79 $updateLabels = getLabels($czardb, "update");
    8085
    8186if ($debug) {
     
    8691}
    8792
     93$isUpdate = ($selectedMode == "update");
     94$modeText = $isUpdate ? "Showing update processing" : "Showing standard processing";
     95$modeLinkText = $isUpdate ? "standard" : "update";
     96$modeLink = $isUpdate ? "stdscience" : "update";
     97$link = "czartool_labels.php?pass=".$pass."&proj=".$proj."&mode=".$modeLink."&label=all&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotType";
    8898
    8999// set up the form
     
    98108
    99109echo "<tr>";
    100 echo "<td colspan=\"2\" style=\"background-color:#0080c0;\">";
     110echo "<td colspan=\"3\" style=\"background-color:#0080c0;\">";
    101111echo "<h1 align=\"middle\">Czartool</h1>";
     112echo "<h4 align=\"middle\">$modeText (change to <a href=\"$link\"><font color=\"blue\">$modeLinkText</font></a>)</h4>";
    102113echo "</td>";
    103114echo "</tr>";
    104115
    105116echo "<tr valign=\"top\">";
    106 echo "<td style=\"background-color:#EEEEEE;width:100px;text-align:top;\">";
     117echo "<td style=width:100px;text-align:top;\">";
    107118 # time series plot
    108  echo "<img src=\"czartool_getplot.php?type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>";
     119echo "<br>";
     120 echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>";
    109121 # rate time series plot
    110  echo "<img src=\"czartool_getplot.php?type=rt&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
     122echo "<br>";
     123 echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rt&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
    111124 # rate stacked histo plot
    112  echo "<img src=\"czartool_getplot.php?type=rh&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
     125 #echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=rh&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
    113126 # histogram plot
    114  echo "<img src=\"czartool_getplot.php?type=h&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
     127 #echo "<img src=\"czartool_getplot.php?mode=$selectedMode&type=h&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
     128 # storage plot
     129echo "<br>";
     130 echo "<img src=\"czartool_getplot.php?type=s\"><br>";
    115131 # storage timeseries
    116  echo "<img src=\"czartool_getplot.php?type=st\"><br>";
    117  # storage plot
    118  echo "<img src=\"czartool_getplot.php?type=s\"><br>";
     132 #echo "<img src=\"czartool_getplot.php?type=st\"><br>";
    119133 # pantasks server status, if requested
     134echo "<br>";
    120135 if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
    121136echo "</td>";
    122 echo "<td style=\"background-color:#EEEEEE;height:200px;width:400px;text-align:top;\">";
    123 
    124 echo "<br><br>";
     137echo "<td style=height:200px;width:10px;text-align:top;\">";
     138echo "<td style=height:200px;width:400px;text-align:top;\">";
     139
     140#echo "<br>";
    125141
    126142// status table at top
     
    128144$plotTypeLink = ($plotType == "linear") ? "log" : "linear";
    129145$link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink";
    130 echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     146echo "<br>";
     147echo $table;
     148#"<table width=\"$width\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     149createTableTitle("Status and links", 3);
    131150echo "<tr>\n";
    132151echo "<tr><td>Time of last update</td><td>$lastUpdateTime</td></tr>";
     
    140159echo "<tr><td>Czar log pages</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PS1_IPP_CzarLogs\"><font color=\"blue\">here</font></a></td></tr>";
    141160echo "<tr><td>Exposure summary</td><td><a href=\"czartool_exposures.php?pass=$pass&proj=$proj\"><font color=\"blue\">here</font></a></td></tr>";
     161
     162$plotTypeLink = ($plotType == "linear") ? "log" : "linear";
     163$link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&mode=" . $selectedMode . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink";
     164echo "<tr><td>Plot type</td><td><a href=\"$link\"><font color=\"blue\">Change to $plotTypeLink</font></a></td></tr>";
     165
     166
    142167echo "</table>\n";
    143168
    144 echo "<br><br>";
     169echo "<br>";
    145170
    146171       createLabelsTable($pass,
    147172         $proj,
    148173         $czardb,
    149          "stdscience",
    150          $stdsLabels,
     174         $selectedMode,
     175         $labels,
    151176         $distLabels,
    152177         $pubLabels,
     
    158183         $plotType);
    159184
    160 echo "<br><br>";
    161       createLabelsTable($pass,
    162          $proj,
    163          $czardb,
    164          "update",
    165          $updateLabels,
    166          $distLabels,
    167          $pubLabels,
    168          $stages,
    169          $states,
    170          "new",
    171          $selectedLabel,
    172          $selectedStage,
    173          $plotType);
    174 echo "<br><br>";
    175       createServersTable($pass, $proj,$czardb, $servers, $selectedLabel, $selectedStage, $plotType);
    176 echo "<br><br>";
     185if ($selectedMode == "update") {echo "<br>"; createPStampDataTable();}
     186echo "<br>";
     187      createServersTable($pass, $proj,$selectedMode,$czardb, $servers, $selectedLabel, $selectedStage, $plotType);
     188echo "<br>";
    177189      createSummitDataTable($gpc1db);
    178 echo "<br><br>";
     190echo "<br>";
    179191      createDatesTable($czardb);
    180 echo "<br><br>";
    181       createPStampDataTable();
    182 echo "<br><br>";
     192echo "<br>";
    183193      # This is awful
    184       echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     194      echo $table;
    185195      echo "<tr>";
    186       echo "<th colspan=\"2\">Database replication status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)</th>";
     196      createTableTitle("Database replication status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)", 2);
     197#      echo "<th colspan=\"2\"><h2>Database replication status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)</h2></th>";
    187198      echo "<tr>";
    188       echo "<th>Database</th>";
    189       echo "<th>Status</th>";
     199      createTableColumnHeader("Database");
     200      createTableColumnHeader("Status");
    190201      showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
    191202      showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
     
    217228
    218229    // set up the table
    219     echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     230    global $table;
     231    echo $table;
     232
     233    #echo "<table width=\"$width\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
    220234    echo "<tr>";
    221     echo "<th colspan=\"3\">Postage stamp requests</th>";
     235    createTableTitle("Postage stamp requests", 3);
    222236    echo "<tr>";
    223     echo "<th>Label</th>";
    224     echo "<th>Unfinished jobs</th>";
    225     echo "<th>Priority</th>";
     237    createTableColumnHeader("Label");
     238    createTableColumnHeader("Unfinished jobs");
     239    createTableColumnHeader("Priority");
    226240
    227241    // list the results
     
    259273
    260274    // set up the table
    261     echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     275    global $table;
     276    echo $table;
    262277    echo "<tr>";
    263     echo "<th colspan=\"3\">Status of last night's data</th>";
     278    createTableTitle("Status of last night's data", 3);
    264279    echo "<tr>";
    265     echo "<th>Exposure type</th>";
    266     echo "<th>At summit</th>";
    267     echo "<th>Registered at MHPCC</th>";
     280    createTableColumnHeader("Exposure type");
     281    createTableColumnHeader("At summit");
     282    createTableColumnHeader("Registered at MHPCC");
    268283
    269284    $msg = "No science images taken since $date";
     
    281296        echo "<tr>";
    282297
    283         if ($summit[0] == $mhpcc[0]) {
    284 
    285             if ($expType[0] == "OBJECT") $msg = "All science exposures taken since $date<br>have been registered at MHPCC";
    286             $error = 0;
    287         }
    288         else {
    289             if ($expType[0] == "OBJECT") $msg = "<font color=\"red\">Warning: Not all science exposures taken since $date<br>have been registered at MHPCC</a>";
    290             $error = 1;
    291         }
     298        if ($summit[0] == $mhpcc[0]) $error = 0;
     299        else $error = 1;
    292300
    293301        echo "<td>$expType[0]</td>";
    294302        echo "<td>$summit[0]</td>";
    295303       
    296 
    297 
    298         #echo "<td bgcolor=\"$color\">$mhpcc[0]</td>";
    299         createFormattedTableCell("", "", $mhpcc[0], $error);
     304        createFormattedTableCell("", "", $mhpcc[0], $error, 0);
    300305
    301306        echo "</tr>";
    302307    }
    303308
    304     echo "<td colspan=\"3\">$msg</td>";
    305309    echo "</table>\n";
    306310
     
    337341        $proj,
    338342        $db,
    339         $server,
     343        $selectedMode,
    340344        $labels,
    341345        $distLabels,
     
    346350        $selectedLabel, $selectedStage, $plotType) {
    347351
     352    $isUpdate = ($selectedMode == "update");
     353    global $headerColor;
     354    global $columnHeaderColor;
     355
    348356    // setup table
    349     echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     357    global $table;
     358    echo $table;
     359    createTableTitle("Label status", 13);
     360
    350361    echo "<tr>\n";
    351     echo "<th colspan=\"13\">";
    352    
    353362    $link = "czartool_labels.php?pass=".$pass
    354363        ."&proj=".$proj
     364        ."&mode=".$selectedMode
    355365        ."&label=".$selectedLabel
    356366        ."&stage=all_stages"
    357367        ."&plottype=".$plotType;
    358     if ($selectedStage != "all_stages") echo "<a href=\"$link\"><font color=\"blue\">";
    359     else echo "<a><font color=\"black\">";
    360     echo "Plot all stages</font></a> | ";
    361     $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=all_".$server."_labels&stage=".$selectedStage."&plottype=".$plotType;
    362     echo "<a ";
    363     if ($selectedLabel != "all_".$server."_labels") echo "<a href=\"$link\"><font color=\"blue\">";
    364     else echo "<a><font color=\"black\">";
    365     echo "Plot all ".$server."_labels</a> | ";
    366     $plotTypeLink = ($plotType == "linear") ? "log" : "linear";
    367     $plotTypeText = ($plotType == "linear") ? "Use log plots" : "Use linear plots";
    368     $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $selectedLabel . "&stage=" . $selectedStage . "&revertstage=" . $stage . "&plottype=$plotTypeLink";
    369     echo "<a href=\"$link\"><font color=\"blue\">$plotTypeText</font></a>";
    370 
    371 
    372     echo "</th>";
    373     echo "</tr>\n";
    374 
    375     echo "<tr>\n";
    376     //echo "<th></th>";
    377     echo "<th colspan=\"2\">$server server</th>";
    378     echo "<th>Reverts:</th>";
    379 
    380     foreach ($stages as &$stage) {
    381 
    382         if ($stage == "burntool") continue;
    383         $reverting = getRevertStatus($db, $stage);
    384         $link =
    385             "czartool_labels.php?pass=".$pass
    386             ."&proj=".$proj
    387             ."&label=".$selectedLabel
    388             ."&stage=".$selectedStage
    389             ."&plottype=".$plotType
    390             ."&revertstage=".$stage
    391             ."&revertmode=";
    392 
    393         if(!$reverting) {$label =  "Start";$link = $link . "on";}
    394         if($reverting) {$label = "Stop";$link = $link . "off";}
    395         unset($reverting);
    396         echo "<td><a href=\"$link\"><font color=\"blue\">$label</font></td>";
    397 
    398     }
    399 
    400     echo "</tr>\n";
    401     echo "<tr>\n";
    402     //echo "<th> </th>";
    403     echo "<th colspan=\"2\">Label (in order of priority)</th>";
     368    createFormattedTableCell(($selectedStage != "all_stages"), $link, "All stages", 0, "$columnHeaderColor");
     369
     370    #echo "<th>Label (in order of priority)</th>";
    404371    foreach ($stages as &$stage) {
    405372
     
    409376            "czartool_labels.php?pass=".$pass
    410377            ."&proj=".$proj
     378            ."&mode=" .$selectedMode
    411379            ."&label=".$selectedLabel
    412380            ."&stage=".$stage
    413381            ."&plottype=".$plotType;
    414382
    415         createFormattedTableCell($showLink, $link, $stage, 0);
    416     }
    417 
     383        createFormattedTableCell($showLink, $link, $stage, 0, "$columnHeaderColor");
     384#        createTableColumnHeader("Dates");
     385    }
    418386
    419387    // setup default link
     
    421389        "czartool_labels.php?pass=".$pass
    422390        ."&proj=".$proj
     391        ."&mode=" .$selectedMode
    423392        ."&label=".$selectedLabel
    424393        ."&stage=".$selectedStage
     
    426395
    427396    $searchState = "new";
    428     if ($server == "update") $searchState = "update";
     397    if ($selectedMode == "update") $searchState = "update";
    429398
    430399    // write rows
     
    444413        // show distribution/publishing status
    445414        echo "<tr>\n";
    446         $distPub = "&nbsp;";
    447         if ($distributing) $distPub = "D";
    448         if ($publishing) $distPub = $distPub . "P";
    449         echo "<td>$distPub</td>";
    450415
    451416        // create link to label summary page for each label
     
    455420            "czartool_labels.php?pass=".$pass
    456421            ."&proj=".$proj
     422            ."&mode=" .$selectedMode
    457423            ."&label=".$thisLabel
    458424            ."&stage=".$selectedStage
    459425            ."&plottype=".$plotType;
    460         createFormattedTableCell($showLink, $link, $thisLabel, 0);
     426        createFormattedTableCell($showLink, $link, $thisLabel, 0, null);
    461427
    462428        $str = "";
     
    465431        $link = $defaultlink;
    466432        getStateAndFaults($db, $thisLabel, $selectedState, "burntool", $str, $anyFaults);
    467         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     433        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    468434
    469435        $link = "failedChipProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $thisLabel . "&chipRun.state=".$searchState;
    470436        getStateAndFaults($db, $thisLabel, $selectedState, "chip", $str, $anyFaults);
    471         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     437        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    472438
    473439        $link = "failedCamProcessedExp.php?pass=" . $pass . "&proj=" . $proj . "&camRun.label=" . $thisLabel . "&camRun.state=".$searchState;
    474440        getStateAndFaults($db, $thisLabel, $selectedState, "cam", $str, $anyFaults);
    475         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     441        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    476442
    477443        $link =  "failedFakeProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&fakeRun.label=" . $thisLabel . "&fakeRun.state=".$searchState;
    478444        getStateAndFaults($db, $thisLabel, $selectedState, "fake", $str, $anyFaults);
    479         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     445        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    480446
    481447        $link = "failedWarpSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.label=" . $thisLabel . "&warpRun.state=".$searchState;
    482448        getStateAndFaults($db, $thisLabel, $selectedState, "warp", $str, $anyFaults);
    483         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     449        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    484450
    485451        $link = "failedStackSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.label=" . $thisLabel . "&stackRun.state=".$searchState;
    486452        getStateAndFaults($db, $thisLabel, $selectedState, "stack", $str, $anyFaults);
    487         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     453        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    488454
    489455        $link = "failedDiffSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $thisLabel . "&diffRun.state=".$searchState;
    490456        getStateAndFaults($db, $thisLabel, $selectedState, "diff", $str, $anyFaults);
    491         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     457        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, 0);
    492458
    493459        $link = $defaultlink;
    494460        getStateAndFaults($db, $thisLabel, $selectedState, "magic", $str, $anyFaults);
    495         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     461        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
    496462
    497463        $link = $defaultlink;
    498464        getStateAndFaults($db, $thisLabel, $selectedState, "magicDS", $str, $anyFaults);
    499         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     465        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
    500466
    501467        $link = $defaultlink;
    502468        getStateAndFaults($db, $thisLabel, $selectedState, "dist", $str, $anyFaults);
    503         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     469        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$distributing) ? "gray" : null);
    504470
    505471        $link = "publishDone.php?pass=" . $pass . "&proj=" . $proj . "&publishRun.label=" . $thisLabel . "&publishRun.state=".$searchState;
    506472        getStateAndFaults($db, $thisLabel, $selectedState, "pub", $str, $anyFaults);
    507         createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
     473        createFormattedTableCell($anyFaults, $link, $str, $anyFaults, (!$isUpdate && !$publishing) ? "gray" : null);
    508474
    509475        echo "</tr>\n";
    510476    }
    511477
    512     if ($selectedLabel == "all_".$server."_labels") $showLink = 0;
     478    echo "<tr>\n";
     479    $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&mode=" . $selectedMode . "&label=all&stage=".$selectedStage."&plottype=".$plotType;
     480    createFormattedTableCell(($selectedLabel != "all"), $link, "All labels", 0, null);
     481
     482    createFormattedTableCell(0, null, "Reverts:", 0, "$columnHeaderColor");
     483
     484    foreach ($stages as &$stage) {
     485
     486        if ($stage == "burntool") continue;
     487        $reverting = getRevertStatus($db, $stage);
     488        $link =
     489            "czartool_labels.php?pass=".$pass
     490            ."&proj=".$proj
     491            ."&mode=" .$selectedMode
     492            ."&label=".$selectedLabel
     493            ."&stage=".$selectedStage
     494            ."&plottype=".$plotType
     495            ."&revertstage=".$stage
     496            ."&revertmode=";
     497
     498        if(!$reverting) {$label =  "Start";$link = $link . "on";}
     499        if($reverting) {$label = "Stop";$link = $link . "off";}
     500        unset($reverting);
     501        createFormattedTableCell(1, $link, $label, 0, "$columnHeaderColor");
     502        #echo "<td><a href=\"$link\"><font color=\"blue\">$label</font></td>";
     503
     504    }
     505
     506    echo "</tr>\n";
     507    if ($selectedLabel == "all") $showLink = 0;
    513508    else  $showLink = 1;
    514     $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=all_".$server."_labels&stage=".$selectedStage."&plottype=".$plotType;
     509    $link = "czartool_labels.php?pass=".$pass."&proj=".$proj."&mode=".$selectedMode."&label=all&stage=".$selectedStage."&plottype=".$plotType;
    515510
    516511    echo "</tr>\n";
     
    521516###########################################################################
    522517#
     518# Creates a table title
     519#
     520###########################################################################
     521function createTableTitle($str, $colSpan) {
     522
     523    global $headerColor;
     524    echo "<th colspan=\"$colSpan\"bgcolor=\"$headerColor\"><h2>$str</h2></th>";
     525}
     526
     527###########################################################################
     528#
     529# Creates a table header cell
     530#
     531###########################################################################
     532function createTableColumnHeader($str) {
     533
     534    global $columnHeaderColor;
     535    echo "<th bgcolor=\"$columnHeaderColor\"><h3>$str</h3></th>";
     536}
     537
     538###########################################################################
     539#
    523540# Creates table cell with a red background if an error
    524541#
    525542###########################################################################
    526 function createFormattedTableCell($showLink, $link, $str, $error) {
     543function createFormattedTableCell($showLink, $link, $str, $error, $color) {
    527544
    528545    $fontColor = $error ? "black" : "blue";
    529546
    530547    if ($error) echo "<td bgcolor=\"red\">";
     548    else if ($color) echo "<td bgcolor=\"$color\">";
    531549    else  echo "<td>";
    532550    if ($showLink) echo "<a href=\"$link\"><font color=\"$fontColor\">$str</font></td>";
     
    640658function createDatesTable($db) {
    641659
    642     echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     660    global $table;
     661    echo $table;
    643662    echo "<tr>\n";
    644     echo "<th colspan=\"3\">Current dates for selected pantasks servers</th>";
     663    createTableTitle("Current dates for selected pantasks servers", 3);
    645664    echo "<tr>\n";
    646     echo "<th>Server</th>";
    647     echo "<th>Dates</th>";
     665    createTableColumnHeader("Server");
     666    createTableColumnHeader("Dates");
    648667    echo "</tr>\n";
    649668
     
    691710#
    692711###########################################################################
    693 function createServersTable($pass, $proj, $db, $servers, $selectedLabel, $selectedStage, $plotType) {
     712function createServersTable($pass, $proj, $selectedMode, $db, $servers, $selectedLabel, $selectedStage, $plotType) {
    694713
    695714    // set up table columns
    696     echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     715    global $table;
     716    echo $table;
    697717    echo "<tr>";
    698     echo "<th colspan=\"3\">Pantasks server status</th>";
     718    createTableTitle("Pantasks server status", 3);
    699719    echo "<tr>";
    700     echo "<th>Server</th>";
    701     echo "<th>Alive?</th>";
    702     echo "<th>Running?</th>";
     720    createTableColumnHeader("Server");
     721    createTableColumnHeader("Alive?");
     722    createTableColumnHeader("Running?");
    703723
    704724    //write_header_cell($class, "Server");
     
    731751        $link = "czartool_labels.php?pass=".$pass
    732752            ."&proj=".$proj
     753            ."&mode=".$selectedMode
    733754            ."&server=".$server
    734755            ."&label=".$selectedLabel
     
    740761        //write_table_cell($class, '%s', "", $alive ? "yes" : "NO");
    741762        //echo "<td>$server</td>";
    742         createFormattedTableCell(1, $link, $server, 0);
    743         createFormattedTableCell(0, "", $alive ? "yes" : "NO", !$alive);
    744         createFormattedTableCell(0, "", $running ? "yes" : "NO", !$running);
     763        createFormattedTableCell(1, $link, $server, 0, 0);
     764        createFormattedTableCell(0, "", $alive ? "yes" : "NO", !$alive, 0);
     765        createFormattedTableCell(0, "", $running ? "yes" : "NO", !$running, 0);
    745766
    746767        //if ($alive) {
Note: See TracChangeset for help on using the changeset viewer.