- Timestamp:
- Feb 11, 2011, 2:49:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/ippMonitor/raw/czartool_exposures.php
r30446 r30579 17 17 else {$myMenu = "ipp.imfiles.dat";} 18 18 19 menu($myMenu, 'Czartool on '.$lastUpdateTime, 'ipp.css', $ID['link'], $ID['proj']);20 21 19 $pass = $ID['pass']; 22 20 $proj = $ID['proj']; 23 21 $menu = $ID['menu']; 24 22 25 $today = date("Y-m-d"); 26 23 $date = $_POST['date']; 24 $survey = $_POST['survey']; 25 26 // if no date chosen, use today 27 if ($date == "") $date = date("Y-m-d"); 28 if ($survey == "") $survey = ""; 29 30 menu($myMenu, 'Exposure summary for '.$date , 'ipp.css', $ID['link'], $ID['proj']); 31 32 // set up the form 33 echo "<form action=\"czartool_exposures.php\" method=\"POST\">\n"; 34 35 echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n"; 36 echo "<input type=\"hidden\" name=\"proj\" value=\"$proj\">\n"; 37 echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n"; 38 39 40 echo "<form method=post action=czartool_exposures.php?pass=$pass&proj=$proj&date=$date&survey=$survey>"; 41 echo "<p align=\"center\"> Current status of all exposures taken on (UTC) <input type=text name=date value='$date'>"; 42 echo " for survey <input type=text name=survey value='$survey'> (leave blank for all surveys)"; 43 echo "<input type=submit value=Submit>"; 27 44 echo "</p>"; 28 echo "<p align=\"center\"> Current status of all exposures taken $today UTC </p>"; 29 30 createTableForThisSurvey($gpc1db, $today, ""); 45 46 echo "</form>\n"; 47 48 createTableForThisSurvey($gpc1db, $date, $survey); 31 49 32 50 menu_end(); … … 58 76 $qry->fetchInto($count); 59 77 60 if ($surveyStr == "") $surveyText = "all surveys"; 78 if ($surveyStr == "") $surveyText = "all surveys"; 61 79 else $surveyText = "$surveyStr survey"; 62 80 … … 83 101 $ssDiffProduced = array(); getSSDiffProduced($db, $date, $surveyStr, &$ssDiffProduced); 84 102 85 $class = "list"; 86 echo "<table class=$class >\n"; 103 // create table 104 echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 105 106 // table headers 87 107 echo "<tr><td></td>\n"; 88 write_header_cell($class, "");89 write_header_cell($class, "");90 write_header_cell($class, "");91 write_header_cell($class, "");92 write_header_cell($class, "Raw");93 write_header_cell($class, "Chip");94 write_header_cell($class, "Camera");95 write_header_cell($class, "Warp");96 write_header_cell($class, "Stack");97 write_header_cell($class, "Warp-Stack Diff");98 write_header_cell($class, "Warp-Warp1 Diff");99 write_header_cell($class, "Warp-Warp2 Diff");100 write_header_cell($class, "Stack-Stack Diff");108 echo "<th></th>"; 109 echo "<th></th>"; 110 echo "<th></th>"; 111 echo "<th></th>"; 112 echo "<th>Raw</th>"; 113 echo "<th>Chip</th>"; 114 echo "<th>Camera</th>"; 115 echo "<th>Warp</th>"; 116 echo "<th>Stack</th>"; 117 echo "<th>Warp-Stack Diff</th>"; 118 echo "<th>Warp-Warp1 Diff</th>"; 119 echo "<th>Warp-Warp2 Diff</th>"; 120 echo "<th>Stack-Stack Diff</th>"; 101 121 echo "<tr><td></td>\n"; 102 write_header_cell($class, "Exp ID");103 write_header_cell($class, "Exp Name");104 write_header_cell($class, "Filter");105 write_header_cell($class, "Comment");106 write_header_cell($class, "state");107 write_header_cell($class, "state/dist?");108 write_header_cell($class, "state/dist?");109 write_header_cell($class, "state/dist?");110 write_header_cell($class, "total/dist");111 write_header_cell($class, "total/dist");112 write_header_cell($class, "total/dist");113 write_header_cell($class, "total/dist");114 write_header_cell($class, "total/dist");122 echo "<th>Exp ID</th>"; 123 echo "<th>Exp Name</th>"; 124 echo "<th>Filter</th>"; 125 echo "<th>Comment</th>"; 126 echo "<th>state</th>"; 127 echo "<th>state/dist?</th>"; 128 echo "<th>state/dist?</th>"; 129 echo "<th>state/dist?</th>"; 130 echo "<th>total/dist</th>"; 131 echo "<th>total/dist</th>"; 132 echo "<th>total/dist</th>"; 133 echo "<th>total/dist</th>"; 134 echo "<th>total/dist</th>"; 115 135 116 136 $sql = … … 147 167 echo "<tr><td></td>\n"; 148 168 169 echo "<TD>$exp_id</td>"; 170 echo "<TD>$exp_name</td>"; 171 echo "<TD>$filter</td>"; 172 echo "<TD>$comment</td>"; 173 echo "<TD>$rawExp</td>"; 174 149 175 // chip 150 176 if (!$chipDist[$exp_id]) $chipDistStr = "N"; 151 177 else $chipDistStr = $chipDist[$exp_id]; 178 echo "<TD>$chipState/$chipDistStr</td>"; 152 179 153 180 // cam 154 181 if (!$camDist[$exp_id]) $camDistStr = "N"; 155 182 else $camDistStr = $camDist[$exp_id]; 183 echo "<TD>$camState/$camDistStr</td>"; 156 184 157 185 // warp 158 186 if (!$warpDist[$exp_id]) $warpDistStr = "N"; 159 187 else $warpDistStr = $warpDist[$exp_id]; 188 echo "<TD>$warpState/$warpDistStr</td>"; 160 189 161 190 // stack 162 if (!$stack_hash[$exp_id] && !$stackDist[$exp_id]) $stackDistStr = " ";191 if (!$stack_hash[$exp_id] && !$stackDist[$exp_id]) $stackDistStr = " "; 163 192 else $stackDistStr = $stack_hash[$exp_id] . "/" . $stackDist[$exp_id]; 193 $color = getColour($stack_hash[$exp_id], $stackDist[$exp_id]); 194 echo "<TD bgcolor=\"$color\" >$stackDistStr</td>"; 164 195 165 196 // WS diff 166 if (!$wsDiffProduced[$exp_id] && !$wsDiffDist[$exp_id]) $wsDistStr = " ";197 if (!$wsDiffProduced[$exp_id] && !$wsDiffDist[$exp_id]) $wsDistStr = " "; 167 198 else $wsDistStr = $wsDiffProduced[$exp_id] . "/" . $wsDiffDist[$exp_id]; 199 $color = getColour($wsDiffProduced[$exp_id], $wsDiffDist[$exp_id]); 200 echo "<TD bgcolor=\"$color\" >$wsDistStr</td>"; 168 201 169 202 // WW1 diff 170 if (!$ww1DiffProduced[$exp_id] && !$ww1DiffDist[$exp_id]) $ww1DistStr = " ";203 if (!$ww1DiffProduced[$exp_id] && !$ww1DiffDist[$exp_id]) $ww1DistStr = " "; 171 204 else $ww1DistStr = $ww1DiffProduced[$exp_id] . "/" . $ww1DiffDist[$exp_id]; 205 $color = getColour($ww1DiffProduced[$exp_id], $ww1DiffDist[$exp_id]); 206 echo "<TD bgcolor=\"$color\" >$ww1DistStr</td>"; 172 207 173 208 // WW2 dist 174 if (!$ww2DiffProduced[$exp_id] && !$ww2DiffDist[$exp_id]) $ww2DistStr = " ";209 if (!$ww2DiffProduced[$exp_id] && !$ww2DiffDist[$exp_id]) $ww2DistStr = " "; 175 210 else $ww2DistStr = $ww2DiffProduced[$exp_id] . "/" . $ww2DiffDist[$exp_id]; 211 $color = getColour($ww2DiffProduced[$exp_id], $ww2DiffDist[$exp_id]); 212 echo "<TD bgcolor=\"$color\" >$ww2DistStr</td>"; 176 213 177 214 // SS dist 178 if (!$ssDiffProduced[$exp_id] && !$ssDiffDist[$exp_id]) $ssDistStr = " ";215 if (!$ssDiffProduced[$exp_id] && !$ssDiffDist[$exp_id]) $ssDistStr = " "; 179 216 else $ssDistStr = $ssDiffProduced[$exp_id] . "/" . $ssDiffDist[$exp_id]; 180 181 write_table_cell($class, '%s', "", $exp_id); 182 write_table_cell($class, '%s', "", $exp_name); 183 write_table_cell($class, '%s', "", $filter); 184 write_table_cell($class, '%s', "", $comment); 185 write_table_cell($class, '%s', "", $rawExp); 186 write_table_cell($class, '%s', "", "$chipState/$chipDistStr"); 187 write_table_cell($class, '%s', "", "$camState/$camDistStr"); 188 write_table_cell($class, '%s', "", "$warpState/$warpDistStr"); 189 write_table_cell($class, '%s', "", $stackDistStr); 190 write_table_cell($class, '%s', "", $wsDistStr); 191 write_table_cell($class, '%s', "", $ww1DistStr); 192 write_table_cell($class, '%s', "", $ww2DistStr); 193 write_table_cell($class, '%s', "", $ssDistStr); 217 $color = getColour($ssDiffProduced[$exp_id], $ssDiffDist[$exp_id]); 218 echo "<TD bgcolor=\"$color\" >$ssDistStr</td>"; 194 219 195 220 echo "</tr>\n"; … … 199 224 } 200 225 226 ########################################################################### 227 # 228 # Gets the right cell colour provided number created and distributed 229 # 230 ########################################################################### 231 function getColour($created, $distributed) { 232 233 if ($distributed > 0 && $created > 0 && $distributed % $created != 0) return "red"; 234 return ""; 235 } 201 236 202 237 ###########################################################################
Note:
See TracChangeset
for help on using the changeset viewer.
