Changeset 7578 for trunk/MagicSoft/Mars/datacenter/db/ganymed.php
- Timestamp:
- 03/08/06 04:26:20 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/ganymed.php
r7571 r7578 20 20 $query0 .= " LEFT JOIN Ganymed ON DataSets.fDataSetNumber=Ganymed.fDataSetNumber "; 21 21 22 $query0 .= " WHERE DataSets.fDataSetNumber between " . $_GET["fRunMin"] . " and " . $_GET["fRunMax"] ; 22 if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"])) 23 $query0 .= " WHERE DataSets.fDataSetNumber between " . $_GET["fRunMin"] . " and " . $_GET["fRunMax"] ; 23 24 if (!empty($_GET["fDataSetNo"])) 24 $query0 .= " AND DataSets.fDataSetNumber='" . $_GET["fDataSetNo"] . "'"; 25 $query0 .= " AND fSourceName REGEXP \"^" . $_GET["fSourceN"] . "\" "; 25 { 26 if (strpos($query0, " WHERE ")==FALSE) 27 $query0 .= " WHERE "; 28 else 29 $query0 .= " AND "; 30 $query0 .= " DataSets.fDataSetNumber='" . $_GET["fDataSetNo"] . "'"; 31 } 32 if (!empty($_GET["fSourceN"])) 33 { 34 if (strpos($query0, " WHERE ")==FALSE) 35 $query0 .= " WHERE "; 36 else 37 $query0 .= " AND "; 38 $query0 .= " fSourceName REGEXP \"^" . $_GET["fSourceN"] . "\" "; 39 } 26 40 $query0 .= " ORDER BY DataSets.fDataSetNumber "; 27 41 … … 117 131 return "there is an error -> tell Dani"; 118 132 } 119 /* 120 function GetSequences($datasetfile) 121 // function QueryRuns($type, $sequ, $db_id, $db) 122 { 123 printf(" <td align='left'>"); 124 printf(" to be done"); 125 printf(" </td>\n"); 126 printf(" <td> to be done "); 127 printf(" </td>\n"); 128 } 129 130 function QueryMissingFiles($sequ, $db_id, $db) 131 { 132 $query2 = "SELECT fSequenceFirst FROM SequencesSequenceProcessStatus "; 133 $query2 .= " WHERE fSequenceFirst=" . $sequ . " AND IsNull(fStar)"; 134 135 mysql_select_db($db); 136 $files = mysql_query($query2, $db_id); 137 $numfiles = mysql_num_rows($files); 138 printf(" <td align='left'>"); 139 for ($i=0 ; $i<$numfiles ; $i++) 140 { 141 $file=mysql_result($files, $i, 0); 142 if ($i!=0) 143 printf(", "); 144 printf(" %s ", $file); 145 } 146 printf(" </td>\n"); 147 } 148 */ 149 150 function PrintDataSetInfo($result0) 133 134 function PrintDataSetInfo($result0, $ganymedtabs) 151 135 { 152 136 $numres = mysql_num_rows($result0); … … 234 218 $sequences=split(" ", trim($sequon)); 235 219 foreach($sequences as $key => $sequ) 236 { 237 $sequno=sprintf("%08d",$sequ); 238 $sequno2=substr($sequno,0,4); 239 printf("<a href=\"http://www.astro.uni-wuerzburg.de/datacenter/star/%s/%s/\">%s</a> ", 240 $sequno2, $sequno, $sequ); 241 } 220 printf("<a href=\"sequence.php?fSequenceNo=%s&fAll=On\">%s</a> ", $sequ, $sequ); 242 221 printf("</td></tr>"); 243 222 … … 247 226 $sequences=split(" ", trim($sequoff)); 248 227 foreach($sequences as $key => $sequ) 249 { 250 $sequno=sprintf("%08d",$sequ); 251 $sequno2=substr($sequno,0,4); 252 printf("<a href=\"http://www.astro.uni-wuerzburg.de/datacenter/star/%s/%s/\">%s</a> ", 253 $sequno2, $sequno, $sequ); 254 } 228 printf("<a href=\"sequence.php?fSequenceNo=%s&fAll=On\">%s</a> ", $sequ, $sequ); 229 printf("</td></tr>"); 255 230 } 256 231 } 257 232 } 233 printf("<tr><td colspan=\"6\">\n Plots: "); 234 foreach($ganymedtabs as $key => $element) 235 if (!$key==0) 236 printf("<a href=\"http://www.astro.uni-wuerzburg.de/datacenter/ganymed/%s/%s/ganymed%s-tab%s.png\">%s</a> ", $num2, $num, $num, $key, $element); 237 238 printf("</td></tr>"); 258 239 259 240 if ($_GET["fAll"]=="On" && !is_null($ganymed)) … … 276 257 } 277 258 278 function PrintPage($html, $host, $user, $pw, $db )259 function PrintPage($html, $host, $user, $pw, $db, $ganymedtabs) 279 260 { 280 261 $db_id = mysql_connect($host, $user, $pw); … … 293 274 { 294 275 if ($html=="1" || $html=="2") 295 PrintDataSetInfo($result0 );276 PrintDataSetInfo($result0, $ganymedtabs); 296 277 else 297 278 PrintText($result0); … … 307 288 include ("include.php"); 308 289 include ("db.php"); 290 include ("tabs.php"); 309 291 310 292 ini_set("display_errors", "On"); … … 316 298 header("Content-Disposition: attachment; filename=query-result.txt"); 317 299 318 PrintPage("0", $host, $user, $pw, $db );300 PrintPage("0", $host, $user, $pw, $db, $ganymedtabs); 319 301 } 320 302 else … … 333 315 { 334 316 if (empty($_GET["fPrintTable"])) 335 PrintPage("1", $host, $user, $pw, $db );336 else 337 PrintPage("2", $host, $user, $pw, $db );317 PrintPage("1", $host, $user, $pw, $db, $ganymedtabs); 318 else 319 PrintPage("2", $host, $user, $pw, $db, $ganymedtabs); 338 320 } 339 321
Note:
See TracChangeset
for help on using the changeset viewer.