Changeset 7527 for trunk/MagicSoft/Mars/datacenter/db/statusrps.php
- Timestamp:
- 02/24/06 19:12:49 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/statusrps.php
r7484 r7527 1 1 <?php 2 2 { 3 function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere )3 function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs) 4 4 { 5 5 $query0 = "SELECT "; … … 14 14 foreach ($checkstatusgroup as $key => $element) 15 15 if ($element==-1) 16 $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $key . "', "; 16 $query0 .= " (if(IsNull(" . $key . "), if(isnull(fStartTime), 'not done', if(isnull(fFailedTime),if(isnull(" . $needs[$key] . "),'not done',if(date_sub(Now(),interval 12 hour) < fStartTime,'running','crashed')),if(isnull(" . $needs[$key] . "),'not done','failed'))) ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 17 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $key . "', "; 17 18 18 19 $query0 .= " count(*) as 'Run#'"; … … 36 37 $query0 .= " AND "; 37 38 38 $query0 .= StatusQuery("fCCFileAvail" );39 $query0 .= StatusQuery("fCaCoFileAvail" );40 $query0 .= StatusQuery("fCaCoFileFound" );41 $query0 .= StatusQuery("fRawFileAvail" );42 $query0 .= StatusQuery("fDataCheckDone" );43 $query0 .= StatusQuery("fTimingCorrection" );39 $query0 .= StatusQuery("fCCFileAvail", $needs); 40 $query0 .= StatusQuery("fCaCoFileAvail", $needs); 41 $query0 .= StatusQuery("fCaCoFileFound", $needs); 42 $query0 .= StatusQuery("fRawFileAvail", $needs); 43 $query0 .= StatusQuery("fDataCheckDone", $needs); 44 $query0 .= StatusQuery("fTimingCorrection", $needs); 44 45 45 46 $query0 .= "fRunNumber BETWEEN " . $_GET["fRunMin"] . " AND " . $_GET["fRunMax"] . " "; … … 52 53 if ($element==-1) 53 54 { 54 $query0 .= $ key;55 $query0 .= $alias[$key]; 55 56 if ($num-->1) 56 57 $query0 .= ", "; … … 189 190 } 190 191 191 function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere )192 function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs) 192 193 { 193 194 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 199 200 mysql_select_db($db); 200 201 201 $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere );202 $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs); 202 203 203 204 $result0 = mysql_query($query0, $db_id); … … 230 231 header("Content-Disposition: attachment; filename=query-result.txt"); 231 232 232 PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere );233 PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs); 233 234 } 234 235 else … … 244 245 printf("No query submitted yet.<BR>"); 245 246 else 246 PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere );247 PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs); 247 248 248 249 echo (file_get_contents("index-footer.html"));
Note:
See TracChangeset
for help on using the changeset viewer.