Changeset 9150 for trunk/MagicSoft/Mars/datacenter/db/tabs.php
- Timestamp:
- 11/11/08 11:11:19 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/tabs.php
r8785 r9150 1 <?php 2 3 $ganymedtabs = array ("0", "SourcePos", "EffOnVsZD", "PreCut", 4 "FSOff", "PostCut", "VsSize", "CutT", 5 "HillasExt", "HilSrc", "ImgPar", "NewPar", 6 "HistOff", "FS", "Hist", "SizeBins"); 7 $ganymedtabsw = array ("0", "EffOnVsZD", "PreCut", "FSOff", "PostCut", 8 "VsSize", "CutT", "HillasExt", "HilSrc", 9 "ImgPar", "NewPar", "HistOff", "SourcePos", 10 "FS", "Hist", "MHPhi", "SizeBins"); 11 12 $startabs = array ("0", "Rate", "EffOnTime", "Cleaned", 13 "CleanedWithoutSparks", "CleanedOnlySparks", "UsedPix", 14 "MHHillas", "MHHillasExt", "MHHillasSrc", 15 "MHImagePar", "MHNewImagePar", "MHMuonPar", 16 "MHWeather", "MHPointing", "MeanPedRms", "Currents", 17 "MeanIPR", "DT"); 18 19 $calibtabs = array ("0", "Ped", "PedExtr", "ExtrdSignal", "ArrTime", 20 "Time", "Charge", "FitCharge", "Conversion", 21 "AbsTime", "Defect", "RelTimes"); 22 23 $signaltabs = array ("0", "PedFLG", "PedRmsFLG", "Extrac'd", 24 "Conv", "Unsuitable", "PedRms", "Interpol'd", 25 "PulsePos", "NumUnsuitablePix", "NumDeadPix", 26 "HiLoCal", "HiLoOffset"); 27 28 ?> 1 <? // To be shifted to magicdefs.pho 2 $htpath = "/www/htdocs/datacenter"; 3 $htlink = "http://datacenter.astro.uni-wuerzburg.de"; 4 5 $htlinks = dirname($_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]); 6 7 $paths = array 8 ( 9 "star" => "/star/", 10 "calib" => "/callisto/", 11 "signal" => "/callisto/", 12 "ganymed" => "/ganymed/", 13 "db" => "/plotdb/", 14 "status" => "/status/", 15 "condor" => "/condor/", 16 "optical" => "/optical/", 17 ); 18 19 $csvname = array 20 ( 21 "star" => "star", 22 "calib" => "calib", 23 "signal" => "signal", 24 "ganymed" => "ganymed", 25 "db" => "plotdb", 26 "status" => "plotstat", 27 "condor" => "plotusage", 28 "optical" => "plotoptical", 29 ); 30 31 $prefix = array 32 ( 33 "star" => "star", 34 "calib" => "calib", 35 "signal" => "signal", 36 "ganymed" => "ganymed", 37 "db" => "plotdb", 38 "status" => "status", 39 "condor" => "condor", 40 "optical" => "optical", 41 ); 42 43 ?> 44 <? // Prepare 45 46 $number = empty($_GET["n"]) ? -1 : $_GET["n"]; 47 $type = empty($_GET["t"]) ? "db" : $_GET["t"]; 48 49 $path = $htpath.$paths[$type]; 50 if ($number>0) 51 $path = sprintf($path."%04d/%08d/", $number/10000, $number); 52 ?> 53 <? 54 // read the file into an array 55 $lines = file($path.$csvname[$type].".csv"); 56 57 // some replacement for the printf 58 $search = array ("%", "\n", "\\" ); 59 $replace = array ("%%", "", "\\\\" ); 60 61 for ($i=0; $i<sizeof($lines); $i++) 62 { 63 //$arr = get_csv($lines[$i], "\t\n"); 64 $tok = strtok($lines[$i], "\t\n"); 65 $j=0; 66 while ($tok!==false) 67 { 68 $arr[$i][$j++] = str_replace($search, $replace, $tok); 69 $tok = strtok("\t"); 70 } 71 } 72 73 fclose($file); 74 ?> 75 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 76 77 <html> 78 <head> 79 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 80 <meta name="Author" content="Thomas Bretz"> 81 <link rel="stylesheet" type="text/css" href="tabs.css"> 82 <script type="text/javascript" src="tabs.js">You need JavaScript switched on for this page to work!</script> 83 <title>Tabs: <? printf($arr[0][2]); ?></title> 84 </head> 85 86 <body onload="Resize();Switch(0);" onresize="Execute();"> 87 <div class="tabs-blue" id="tabs"> 88 <ul id="tabsul"> 89 <li id='prevnext'><A HREF="#" accesskey='alt-shift-P' style="width:6;" class='tooltip' onclick="Add(+1);">+<span class='info'>Switch to previous tab.</span></A></li> 90 <li id='prevnext' style='margin-left:5px'><A HREF="#" accesskey='alt-shift-N' style="width:6;" class='tooltip' onclick="Add(-1);">-<span class='info'>Switch to next tab.</span></A></li> 91 <li id='prevnext'><A HREF="#" accesskey='alt-shift-P' style="width:6;" class='tooltip' onclick="Hide();">><span class='info'>Step in shown tabs to right.</span></A></li> 92 <li id='prevnext' style='margin-left:5px'><A HREF="#" accesskey='alt-shift-N' style="width:6;" class='tooltip' onclick="Show();"><<span class='info'>Step in shown tabs to leaft.</span></A></li> 93 <li id='magnify'><A HREF="#" style="width:8;" class='tooltip' id="magtxt" onclick="ToggleSize();">O<span class='info'>Toggle between original image size and resized to the document's width.</span></A></li> 94 <? 95 $n=0; 96 97 printf(" <li style='margin-right:3px' id='current' class='tabno%d'><A HREF=\"#\" class='tooltip load_def' onclick=\"Switch(%d);\">MARS<span class='info' style='text-align:center;'><P><font style='text-decoration:underline;'>Tab Overview</font><P>%s</span></A></li>\n", 98 $n, $n, $arr[0][2]); 99 100 $n++; 101 102 for ($i=1; $i<sizeof($lines); $i++, $n++) 103 { 104 // Use blur() to remove the focus after the click 105 106 foreach (glob($path.$prefix[$type].$i.".png") as $file) 107 { 108 $link = ereg_replace("^".$htpath, $htlink, $file); 109 $name = basename($file); 110 111 printf(" <li class='tabno".$n."'>"); 112 printf("<A class='tooltip load_png' name='".$link."' "); 113 printf("onclick=\"Switch(".$n.");\" "); 114 printf("onmouseover=\"LoadImgTT('".$link."');\" HREF='#'>"); 115 printf($arr[$i][1]."<span class='info'>".$arr[$i][2]."</span>"); 116 printf("<span class='preview' id='preview'><div>".$arr[$i][2]."</div>"); 117 printf("<span id='image'></span></span></A></li>\n"); 118 } 119 } 120 121 foreach (glob($path."/*") as $file) 122 { 123 $info = pathinfo($file); // dirname, extension, basename, filename 124 125 $link = ereg_replace("^".$htpath, $htlink, $file); 126 $name = $info['basename']; 127 $exten = $info['extension']; 128 129 130 // Define list of valid extension 131 if ($exten!="html" && $exten!="rc") 132 continue; 133 134 printf(" <li class='tabno".$n."'>"); 135 printf("<A class='tooltip load_".$exten."' name='".$link."' "); 136 printf("onclick=\"Switch(".$n.");\" HREF='#'>"); 137 138 if ($exten=="html") 139 printf(ereg_replace("[0-9]{8}\.html", "", $name).".log"); 140 if ($exten=="rc") 141 printf($name); 142 143 printf("<span class='info'>".$name."</span></A></li>\n"); 144 145 $n++; 146 } 147 ?> 148 </ul> 149 </div> 150 <table style="clear:both;" background="box_mtl_ctr.gif" border="0" cellpadding="0" cellspacing="0" width="100%"> 151 <tbody> 152 <tr height="12"> 153 <td width="12"><img src="box_mtl_topl.gif"></td> 154 <td background="box_mtl_top.gif"><img src="spacer.gif"></td> 155 <td width="12"><img src="box_mtl_topr.gif"></td> 156 </tr> 157 <tr> 158 <td background="box_mtl_l.gif" width="12"><img src="spacer.gif"></td> 159 <td align="center" background="bg_spacer.gif" valign="top"> 160 <div class="tabcontent" id="tabcontent"></div> 161 </td> 162 <td background="box_mtl_r.gif" width="12"><img src="spacer.gif"></td> 163 </tr> 164 <tr height="14"> 165 <td width="12"><img src="box_mtl_botl.gif"></td> 166 <td background="box_mtl_bot.gif"><img src="spacer.gif"></td> 167 <td width="12"><img src="box_mtl_botr.gif"></td> 168 </tr> 169 </tbody> 170 </table> 171 <!-- 172 <div class="tabcontent" id="tabcontent"></div> 173 --> 174 <div style="display:none" id="default"> 175 <? 176 printf("<p>\n"); 177 printf("<center>\n"); 178 printf(" <table class='marstable'>\n"); 179 printf(" <tr><td id='title' colspan='3'>%s</td></tr>\n", $arr[0][2]); 180 181 for ($i=1; $i<sizeof($lines); $i++) 182 { 183 foreach (glob($path.$prefix[$type].$i.".png") as $file) 184 { 185 $link = ereg_replace("^".$htpath, $htlink, $file); 186 $name = basename($file); 187 188 printf(" <tr>"); 189 printf("<td id='left'>%d</td>", $i); 190 printf("<td id='middle'><A HREF=\"#\" "); 191 printf("onclick=\"Switch(".$i.");\">"); 192 printf(htmlspecialchars($arr[$i][1])."</A></td>"); 193 printf("<td id='right'>".htmlspecialchars($arr[$i][2])."</td>"); 194 printf("</tr>\n"); 195 } 196 } 197 198 foreach (glob($path."*") as $file) 199 if (ereg("\.(root|log|html|pdf|ps|rc)$", $file)) 200 { 201 $link = ereg_replace("^".$htpath, $htlink, $file); 202 $name = basename($file); 203 204 printf(" <tr>"); 205 printf("<td id='left'></td>"); 206 printf("<td id='middle'>Download</td>"); 207 printf("<td id='middle' colspan='1'><A HREF=\"".$link."\">".$name."</A></td>"); 208 printf("</tr>\n"); 209 } 210 211 printf(" </table>\n"); 212 printf("</center>\n"); 213 printf("</p>\n"); 214 ?> 215 </div> 216 <p id="myContent"> 217 <?/*printf( 218 "SERVER: ".$_SERVER["SERVER_NAME"]."<br>". 219 "HTTP_HOST: ".$_SERVER["HTTP_HOST"]."<br>". 220 "REQ_URI: ".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]."<br>". 221 "DIR: ".dirname($_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"])."<br>". 222 "REQ_URI: ".basename($_SERVER["REQUEST_URI"])."<br>". 223 "PATH_TRANS: ".$_SERVER["PATH_TRANSLATED"]."<br>". 224 "PATH_INFO: ".$_SERVER["PATH_INFO"]."<br>". 225 "SCRIPT_NAME: ".$_SERVER["SCRIP_NAME"]."<br>". 226 "_FILE_: ".__FILE__."<br>". 227 "_DIR_: ".__DIR__."<br>". 228 $paths[$type]."\n".$path."\n".$_GET["number"]."\n".$_GET["type"]."\n".$number."\n".$type); 229 */?> 230 </p> 231 </body> 232 </html>
Note:
See TracChangeset
for help on using the changeset viewer.