| 1 | <?php
|
|---|
| 2 | {
|
|---|
| 3 | function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs)
|
|---|
| 4 | {
|
|---|
| 5 | $fromtable="Sequences";
|
|---|
| 6 |
|
|---|
| 7 | $groups = 0;
|
|---|
| 8 | foreach ($checkgroup as $element)
|
|---|
| 9 | if ($element==-1)
|
|---|
| 10 | $groups++;
|
|---|
| 11 |
|
|---|
| 12 | $statusgroups = 0;
|
|---|
| 13 | foreach ($checkstatusgroup as $element)
|
|---|
| 14 | if ($element==-1)
|
|---|
| 15 | $statusgroups++;
|
|---|
| 16 |
|
|---|
| 17 | $query0 = "SELECT ";
|
|---|
| 18 |
|
|---|
| 19 | if ($groups>0)
|
|---|
| 20 | {
|
|---|
| 21 | foreach ($checkgroup as $key => $element)
|
|---|
| 22 | if ($element==-1)
|
|---|
| 23 | $query0 .= $key . " as '" . $alias[$key] . "' " . ", ";
|
|---|
| 24 | //--------------------------------------------------
|
|---|
| 25 | $query0 .= "SUM(fRunTime)/3600 as '" . $alias["SUM(fRunTime)/3600"] . "', ";
|
|---|
| 26 | //--------------------------------------------------
|
|---|
| 27 | $query0 .= " SUM(fNumEvents) as '" . $alias["SUM(fNumEvents)"] . "', ";
|
|---|
| 28 | $query0 .= " Min(fZenithDistanceMin) as '" . $alias["Min(fZenithDistanceMin)"] . "', ";
|
|---|
| 29 | $query0 .= " Max(fZenithDistanceMax) as '" . $alias["Max(fZenithDistanceMax)"] . "', ";
|
|---|
| 30 | $query0 .= " COUNT(*) as '# Sequ' ";
|
|---|
| 31 | }
|
|---|
| 32 | else
|
|---|
| 33 | {
|
|---|
| 34 | if ($statusgroups>0)
|
|---|
| 35 | {
|
|---|
| 36 | foreach ($checkstatusgroup as $key => $element)
|
|---|
| 37 | if ($element==-1)
|
|---|
| 38 | $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] . "', ";
|
|---|
| 39 | // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', ";
|
|---|
| 40 |
|
|---|
| 41 | $query0 .= " COUNT(*) as '# Sequ'";
|
|---|
| 42 |
|
|---|
| 43 | }
|
|---|
| 44 | else
|
|---|
| 45 | {
|
|---|
| 46 | if (!empty($_GET["fSendTxt"]))
|
|---|
| 47 | $query0 .= " " . $fromtable . ".fSequenceFirst as '" . $alias["fSequenceFirst"] . "' ";
|
|---|
| 48 | else
|
|---|
| 49 | {
|
|---|
| 50 | //old version using fRunMin, fRunMax
|
|---|
| 51 | //$query0 .= " CONCAT('<A&ws;HREF=\"runinfo-aio.php?', 'fRunStart=On', '&fZenithDistance=On', '&fRunMin=', Sequences.fSequenceFirst, '&fMeanTriggerRate=On', '&fTest=On', '&fRunTypeName=On', '&fRunMax=', fSequenceLast, '&fNumEvents=On', '&fSourceName=On&', 'fExcludedFDAKEY=1', '&fSequenceFirst=On', '&fRawFileAvail=On', '&fCCFileAvail=On', '&fCaCoFileAvail=On', '&fNumResults=500\">', Sequences.fSequenceFirst, '</A>') ";
|
|---|
| 52 | //new version using fSequenceNo
|
|---|
| 53 | $query0 .= " CONCAT('<A&ws;HREF=\"runinfo-aio.php?', 'fRunStart=On', '&fZenithDistance=On', '&fSequenceNo=', Sequences.fSequenceFirst, '&fMeanTriggerRate=On', '&fTest=On', '&fRunTypeName=On', '&fNumEvents=On', '&fSourceName=On&', 'fExcludedFDAKEY=1', '&fSequenceFirst=On', '&fRawFileAvail=On', '&fCCFileAvail=On', '&fCaCoFileAvail=On', '&fNumResults=500\">', 'M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, ' '), '</A>') ";
|
|---|
| 54 | // $query0 .= " as " . $alias["fSequenceFirst"];
|
|---|
| 55 | $query0 .= " as 'Tel:Sequ'";
|
|---|
| 56 | if (!empty($_GET["fLinks"]))
|
|---|
| 57 | {
|
|---|
| 58 | $query0 .= ", CONCAT('<A&ws;HREF=\"tabs.php?t=calib&n=', fSequenceFirst, '\">cal</A>'";
|
|---|
| 59 | $query0 .= ", ' <A&ws;HREF=\"tabs.php?t=signal&n=', fSequenceFirst, '\">sig</A>'";
|
|---|
| 60 | $query0 .= ", ' <A&ws;HREF=\"tabs.php?t=star&n=', fSequenceFirst, '\">star</A>'";
|
|---|
| 61 | $query0 .= ", ' <A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/sequences/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/sequence', LPAD(CONCAT(Sequences.fSequenceFirst , '.txt'), 12,'0') , '\">', 'f </A>' ";
|
|---|
| 62 | // $query0 .= ", ' <A&ws;HREF=\"sequence.php?fSequenceNo=', Sequences.fSequenceFirst , '&fAll=On\">i</A>'";
|
|---|
| 63 | $query0 .= ", ' <A&ws;HREF=\"queryrbk.php?fNight=', date_format(adddate(fRunStart, interval +13 HOUR), '%Y-%m-%d') , '&fDate=2\">rbk</A>') ";
|
|---|
| 64 | // $query0 .= ", CONCAT('<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/callisto/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), 'callisto', LPAD(CONCAT(Sequences.fSequenceFirst , '.html'), 13,'0') , '\">cl</A>'";
|
|---|
| 65 | // $query0 .= ", ' <A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/callisto/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), '\">c</A>'";
|
|---|
| 66 | // $query0 .= ", ' <A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/star/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), 'star', LPAD(CONCAT(Sequences.fSequenceFirst , '.html'), 13,'0') , '\">sl</A>'";
|
|---|
| 67 | // $query0 .= ", ' <A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/star/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), '\">s</A>'";
|
|---|
| 68 | // $query0 .= ", ' <A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/sequences/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/sequence', LPAD(CONCAT(Sequences.fSequenceFirst , '.txt'), 12,'0') , '\">', 'f </A>' ";
|
|---|
| 69 | // $query0 .= ", ' <A&ws;HREF=\"sequence.php?fSequenceNo=', Sequences.fSequenceFirst , '&fAll=On\">i</A>'";
|
|---|
| 70 | // $query0 .= ", ' <A&ws;HREF=\"queryrbk.php?fNight=', date_format(adddate(fRunStart, interval +13 HOUR), '%Y-%m-%d') , '&fDate=2\">rbk</A>') ";
|
|---|
| 71 | $query0 .= " as 'Links'";
|
|---|
| 72 | }
|
|---|
| 73 | }
|
|---|
| 74 |
|
|---|
| 75 | foreach ($_GET as $key => $element)
|
|---|
| 76 | if ($_GET[$key]=="On")
|
|---|
| 77 | if ($key!="fLinks" && $key!="fOff" && $key!="fOnlyOff" && $key!="fOnlySum")
|
|---|
| 78 | if (empty($checkwhere[$key]) || $checkwhere[$key]==0)
|
|---|
| 79 | $query0 .= ", " . $key . " as '" . $alias[$key] . "' ";
|
|---|
| 80 | }
|
|---|
| 81 | }
|
|---|
| 82 |
|
|---|
| 83 | $query0 .= " FROM " . $fromtable;
|
|---|
| 84 |
|
|---|
| 85 | $query0 .= " LEFT JOIN SequenceProcessStatus USING(fSequenceFirst,fTelescopeNumber) ";
|
|---|
| 86 | $query0 .= " LEFT JOIN Calibration USING(fSequenceFirst,fTelescopeNumber) ";
|
|---|
| 87 | $query0 .= " LEFT JOIN Star USING(fSequenceFirst,fTelescopeNumber) ";
|
|---|
| 88 |
|
|---|
| 89 | foreach ($_GET as $key => $element)
|
|---|
| 90 | if (($_GET[$key]=="On" || $groups>0))// && !empty(GetJoin($fromtable,$key)))
|
|---|
| 91 | $query0 .= GetJoin($fromtable,$key);
|
|---|
| 92 |
|
|---|
| 93 | if ($_GET["fTest"]!="On")
|
|---|
| 94 | {
|
|---|
| 95 | if ($_GET["fSourceName"]!="On")
|
|---|
| 96 | $query0 .= " LEFT JOIN Source USING(fSourceKEY) ";
|
|---|
| 97 | $query0 .= " WHERE fTest='no'";
|
|---|
| 98 | }
|
|---|
| 99 |
|
|---|
| 100 | if ($_GET["fOff"]=="Off")
|
|---|
| 101 | {
|
|---|
| 102 | if (strpos($query0, " WHERE ")==FALSE)
|
|---|
| 103 | $query0 .= " WHERE ";
|
|---|
| 104 | else
|
|---|
| 105 | $query0 .= " AND ";
|
|---|
| 106 |
|
|---|
| 107 | $query0 .= " NOT (fSourceName like '%Off%')";
|
|---|
| 108 | }
|
|---|
| 109 |
|
|---|
| 110 | if ($_GET["fOnlyOff"]=="On")
|
|---|
| 111 | {
|
|---|
| 112 | if (strpos($query0, " WHERE ")==FALSE)
|
|---|
| 113 | $query0 .= " WHERE ";
|
|---|
| 114 | else
|
|---|
| 115 | $query0 .= " AND ";
|
|---|
| 116 |
|
|---|
| 117 | $query0 .= " fSourceName like '%Off%'";
|
|---|
| 118 | }
|
|---|
| 119 |
|
|---|
| 120 | if ($_GET["fOnlySum"]=="On")
|
|---|
| 121 | {
|
|---|
| 122 | if (strpos($query0, " WHERE ")==FALSE)
|
|---|
| 123 | $query0 .= " WHERE ";
|
|---|
| 124 | else
|
|---|
| 125 | $query0 .= " AND ";
|
|---|
| 126 |
|
|---|
| 127 | $query0 .= " NOT ISNULL(fRateSumEvts) ";
|
|---|
| 128 | }
|
|---|
| 129 |
|
|---|
| 130 | foreach ($checkwhere as $key => $element)
|
|---|
| 131 | {
|
|---|
| 132 | if (empty($element) || $element<=0)
|
|---|
| 133 | continue;
|
|---|
| 134 |
|
|---|
| 135 | if (strpos($query0, " WHERE ")==FALSE)
|
|---|
| 136 | $query0 .= " WHERE ";
|
|---|
| 137 | else
|
|---|
| 138 | if ($element!=-1)
|
|---|
| 139 | if (strrpos($query0, " AND ")!=strlen($query0)-5)
|
|---|
| 140 | $query0 .= " AND ";
|
|---|
| 141 |
|
|---|
| 142 | if ($element!=-1)
|
|---|
| 143 | $query0 .= GetCheck($fromtable, $key) . "=" . $element;
|
|---|
| 144 | }
|
|---|
| 145 |
|
|---|
| 146 | if (strpos($query0, " WHERE ")==FALSE)
|
|---|
| 147 | $query0 .= " WHERE ";
|
|---|
| 148 | else
|
|---|
| 149 | $query0 .= " AND ";
|
|---|
| 150 |
|
|---|
| 151 | $query0 .= StatusQuery("fSequenceFileWritten", $needs);
|
|---|
| 152 | $query0 .= StatusQuery("fAllFilesAvail", $needs);
|
|---|
| 153 | $query0 .= StatusQuery("fCallisto", $needs);
|
|---|
| 154 | $query0 .= StatusQuery("fFillCallisto", $needs);
|
|---|
| 155 | $query0 .= StatusQuery("fStar", $needs);
|
|---|
| 156 | $query0 .= StatusQuery("fFillStar", $needs);
|
|---|
| 157 |
|
|---|
| 158 | if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"]))
|
|---|
| 159 | $query0 .= "Sequences.fSequenceFirst BETWEEN " . $_GET["fRunMin"] . " AND " . $_GET["fRunMax"] . " ";
|
|---|
| 160 | else
|
|---|
| 161 | $query0 = substr($query0, 0, -4);
|
|---|
| 162 |
|
|---|
| 163 | if ((!empty($_GET["fZDMin"]) || $_GET["fZDMin"]==0) && !empty($_GET["fZDMax"]))
|
|---|
| 164 | $query0 .= "AND (fZenithDistanceMin >= " . $_GET["fZDMin"] . " AND fZenithDistanceMax <= " . $_GET["fZDMax"] . ") ";
|
|---|
| 165 |
|
|---|
| 166 | if (!empty($_GET["fSourceN"]))
|
|---|
| 167 | $query0 .= " AND fSourceName REGEXP \"^" . $_GET["fSourceN"] . "\" ";
|
|---|
| 168 |
|
|---|
| 169 | if (!empty($_GET["fStartDate"]))
|
|---|
| 170 | {
|
|---|
| 171 | if (strpos(strrev($query0), " DNA ")!=0 || !strpos(strrev($query0), " DNA "))
|
|---|
| 172 | $query0 .= " AND ";
|
|---|
| 173 |
|
|---|
| 174 | $startdate=substr($_GET["fStartDate"], 0, 10);
|
|---|
| 175 | if ($startdate=="0000-00-00")
|
|---|
| 176 | $query0 .=" fRunStart >= '" . $startdate . " 00:00:00' ";
|
|---|
| 177 | else
|
|---|
| 178 | $query0 .= " fRunStart >= ADDDATE('" . $startdate . " 13:00:00', INTERVAL -1 DAY) ";
|
|---|
| 179 | }
|
|---|
| 180 |
|
|---|
| 181 | if (!empty($_GET["fStopDate"]))
|
|---|
| 182 | {
|
|---|
| 183 | if (strpos(strrev($query0), " DNA ")!=0 || !strpos(strrev($query0), " DNA "))
|
|---|
| 184 | $query0 .= " AND ";
|
|---|
| 185 |
|
|---|
| 186 | $stopdate=substr($_GET["fStopDate"], 0, 10);
|
|---|
| 187 | $query0 .= " fRunStart < '" . $stopdate . " 13:00:00' ";
|
|---|
| 188 | }
|
|---|
| 189 |
|
|---|
| 190 | if (!empty($_GET["fStarStart"]))
|
|---|
| 191 | {
|
|---|
| 192 | if (strpos(strrev($query0), " DNA ")!=0 || !strpos(strrev($query0), " DNA "))
|
|---|
| 193 | $query0 .= " AND ";
|
|---|
| 194 |
|
|---|
| 195 | $starstart=substr($_GET["fStarStart"], 0, 10);
|
|---|
| 196 | $query0 .=" fStar >= '" . $starstart . " 00:00:00' ";
|
|---|
| 197 | }
|
|---|
| 198 |
|
|---|
| 199 | if (!empty($_GET["fStarStop"]))
|
|---|
| 200 | {
|
|---|
| 201 | if (strpos(strrev($query0), " DNA ")!=0 || !strpos(strrev($query0), " DNA "))
|
|---|
| 202 | $query0 .= " AND ";
|
|---|
| 203 |
|
|---|
| 204 | $starstop=substr($_GET["fStarStop"], 0, 10);
|
|---|
| 205 | $query0 .= " fStar < '" . $starstop . " 23:59:59' ";
|
|---|
| 206 | }
|
|---|
| 207 |
|
|---|
| 208 | if ($groups>0)
|
|---|
| 209 | {
|
|---|
| 210 | $query0 .= " GROUP BY ";
|
|---|
| 211 | $num = $groups;
|
|---|
| 212 | foreach ($checkgroup as $key => $element)
|
|---|
| 213 | if ($element==-1)
|
|---|
| 214 | {
|
|---|
| 215 | $query0 .= GetCheck($fromtable,$key);
|
|---|
| 216 | if ($num-->1)
|
|---|
| 217 | $query0 .= ", ";
|
|---|
| 218 | }
|
|---|
| 219 | }
|
|---|
| 220 |
|
|---|
| 221 | if ($statusgroups>0)
|
|---|
| 222 | {
|
|---|
| 223 | $query0 .= " GROUP BY ";
|
|---|
| 224 | $num = $statusgroups;
|
|---|
| 225 | foreach ($checkstatusgroup as $key => $element)
|
|---|
| 226 | if ($element==-1)
|
|---|
| 227 | {
|
|---|
| 228 | $query0 .= $alias[$key];
|
|---|
| 229 | if ($num-->1)
|
|---|
| 230 | $query0 .= ", ";
|
|---|
| 231 | }
|
|---|
| 232 | }
|
|---|
| 233 |
|
|---|
| 234 | if (!empty($_GET["fSortBy"]))
|
|---|
| 235 | {
|
|---|
| 236 | $val=substr($_GET["fSortBy"], 0, -1);
|
|---|
| 237 | $query0 .= " ORDER BY " . GetTable($fromtable,$val) . " ";
|
|---|
| 238 | if (substr($_GET["fSortBy"], -1)=="-")
|
|---|
| 239 | $query0 .= "DESC";
|
|---|
| 240 | }
|
|---|
| 241 |
|
|---|
| 242 | if (empty($_GET["fSortBy"]) && $groups==0 && $statusgroups==0)
|
|---|
| 243 | $query0 .= "ORDER BY Sequences.fSequenceFirst ASC ";
|
|---|
| 244 |
|
|---|
| 245 | if (empty($_GET["fNumStart"]))
|
|---|
| 246 | $_GET["fNumStart"]=0;
|
|---|
| 247 |
|
|---|
| 248 | if (empty($_GET["fSendTxt"]))
|
|---|
| 249 | $query0 .= " LIMIT " . $_GET["fNumStart"] . ", " . $_GET["fNumResults"];
|
|---|
| 250 |
|
|---|
| 251 | return $query0;
|
|---|
| 252 | }
|
|---|
| 253 |
|
|---|
| 254 | function InitGet($_GET)
|
|---|
| 255 | {
|
|---|
| 256 | // Find out whether it is the first call to the php script
|
|---|
| 257 | $first = empty($_GET["fRunMin"]) && empty($_GET["fRunMax"]);
|
|---|
| 258 |
|
|---|
| 259 | if (empty($_GET["fNumResults"]))
|
|---|
| 260 | $_GET["fNumResults"]="50";
|
|---|
| 261 |
|
|---|
| 262 | if (empty($_GET["fRunStart"]))
|
|---|
| 263 | $_GET["fRunStart"]=$first?"On":"";
|
|---|
| 264 |
|
|---|
| 265 | if (empty($_GET["fRunTime/60"]))
|
|---|
| 266 | $_GET["fRunTime/60"]=$first?"On":"";
|
|---|
| 267 |
|
|---|
| 268 | if (empty($_GET["fZenithDistanceMin"]))
|
|---|
| 269 | $_GET["fZenithDistanceMin"]=$first?"On":"";
|
|---|
| 270 |
|
|---|
| 271 | if (empty($_GET["fSourceName"]))
|
|---|
| 272 | $_GET["fSourceName"]=$first?"On":"";
|
|---|
| 273 |
|
|---|
| 274 | if (empty($_GET["fStar"]))
|
|---|
| 275 | $_GET["fStar"]=$first?"On":"";
|
|---|
| 276 |
|
|---|
| 277 | if (empty($_GET["fInhomogeneity"]))
|
|---|
| 278 | $_GET["fInhomogeneity"]=$first?"On":"";
|
|---|
| 279 |
|
|---|
| 280 | if (empty($_GET["fPSF"]))
|
|---|
| 281 | $_GET["fPSF"]=$first?"On":"";
|
|---|
| 282 |
|
|---|
| 283 | if (empty($_GET["fMeanPedRmsInner"]))
|
|---|
| 284 | $_GET["fMeanPedRmsInner"]=$first?"On":"";
|
|---|
| 285 |
|
|---|
| 286 | if (empty($_GET["fOff"]))
|
|---|
| 287 | $_GET["fOff"]=$first?"On":"";
|
|---|
| 288 |
|
|---|
| 289 | if (empty($_GET["fLinks"]))
|
|---|
| 290 | $_GET["fLinks"]=$first?"On":"";
|
|---|
| 291 |
|
|---|
| 292 | if (empty($_GET["fOnlyOff"]))
|
|---|
| 293 | $_GET["fOnlyOff"]=$first?"Off":"";
|
|---|
| 294 |
|
|---|
| 295 | if (empty($_GET["fOnlySum"]))
|
|---|
| 296 | $_GET["fOnlySum"]=$first?"Off":"";
|
|---|
| 297 |
|
|---|
| 298 | InitFindOffData($_GET, $first);
|
|---|
| 299 | }
|
|---|
| 300 |
|
|---|
| 301 | function PrintForm($_GET, $host, $user, $pw, $db, $limitsmean, $limitsmin, $limitsmax, $alias)
|
|---|
| 302 | {
|
|---|
| 303 | printf("<center>\n");
|
|---|
| 304 | printf("<form action='sequinfo-aio.php' METHOD='GET'>\n");
|
|---|
| 305 | printf("<input id='sh' type='hidden' name='fShowHide' value='");
|
|---|
| 306 | if (!empty($_GET["fShowHide"]))
|
|---|
| 307 | printf("%s", $_GET["fShowHide"]);
|
|---|
| 308 | else
|
|---|
| 309 | printf("1000000010");
|
|---|
| 310 | printf("'>\n");
|
|---|
| 311 | printf("<img id='allbutton' src='minus.png' alt='-' onclick='showhide(\"all\")'> <b>Menu</b> \n");
|
|---|
| 312 | printf(" <img id='infobutton' src='plus.png' alt='+' onClick='showhide(\"info\");showhide(\"info2\")'> SequInfo \n");
|
|---|
| 313 | printf(" <img id='statbutton' src='plus.png' alt='+' onClick='showhide(\"stat\");showhide(\"fail\")'> StatusInfo \n");
|
|---|
| 314 | printf(" <img id='calbutton' src='plus.png' alt='+' onClick='showhide(\"cal\")'> CalInfo \n");
|
|---|
| 315 | printf(" <img id='starbutton' src='plus.png' alt='+' onClick='showhide(\"star\")'> StarInfo \n");
|
|---|
| 316 | printf(" <img id='limitsbutton' src='plus.png' alt='+' onClick='showhide(\"limits\")'> Limits \n");
|
|---|
| 317 | printf(" <img id='rangesbutton' src='minus.png' alt='-' onClick='showhide(\"ranges\")'> Ranges \n");
|
|---|
| 318 |
|
|---|
| 319 | printf(" <div id='all' style='display:block'>");
|
|---|
| 320 |
|
|---|
| 321 | PrintSequInfoMenu();
|
|---|
| 322 | PrintSequInfo2Menu($host,$user,$pw,$db);
|
|---|
| 323 | PrintSequStatMenu();
|
|---|
| 324 | PrintFailMenu();
|
|---|
| 325 | PrintCalMenu();
|
|---|
| 326 | PrintStarMenu();
|
|---|
| 327 | PrintLimitsMenu($limitsmean, $limitsmin, $limitsmax, $alias, "");
|
|---|
| 328 |
|
|---|
| 329 | printf(" <div id='ranges' style='display:block'>");
|
|---|
| 330 | PrintZdRangeMenu($host,$user,$pw,$db);
|
|---|
| 331 | PrintSequRangeMenu($host,$user,$pw,$db);
|
|---|
| 332 | printf("<p>");
|
|---|
| 333 | PrintSourceMenu($host,$user,$pw,$db);
|
|---|
| 334 | PrintNightRangeMenu($host,$user,$pw,$db, "Sequences");
|
|---|
| 335 | printf("<p>");
|
|---|
| 336 | printf("</div>");
|
|---|
| 337 |
|
|---|
| 338 | printf("</div>");
|
|---|
| 339 | printf(" <P>\n");
|
|---|
| 340 |
|
|---|
| 341 |
|
|---|
| 342 | ini_set("mysql.trace_mode", "Off");
|
|---|
| 343 | ini_set("display_errors", "Off");
|
|---|
| 344 |
|
|---|
| 345 | PrintNumResPullDown();
|
|---|
| 346 | PrintButtons("sequinfo-aio.php");
|
|---|
| 347 |
|
|---|
| 348 | printf("</form>\n");
|
|---|
| 349 | printf("</center>\n");
|
|---|
| 350 | printf("</td>\n");
|
|---|
| 351 | printf("</tr>\n");
|
|---|
| 352 | printf("<tr class='Block'>\n");
|
|---|
| 353 | printf("<td>\n");
|
|---|
| 354 | }
|
|---|
| 355 |
|
|---|
| 356 | function PrintPage($html, $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limitsmean, $limitsmin, $limitsmax, $needs)
|
|---|
| 357 | {
|
|---|
| 358 | $db_id = mysql_pconnect($host, $user, $pw);
|
|---|
| 359 | if ($db_id==FALSE)
|
|---|
| 360 | {
|
|---|
| 361 | printf("mysql_connect returned the following error: %s\n", mysql_error());
|
|---|
| 362 | die("");
|
|---|
| 363 | }
|
|---|
| 364 | mysql_select_db($db);
|
|---|
| 365 |
|
|---|
| 366 | $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
|
|---|
| 367 |
|
|---|
| 368 | $result0 = mysql_query($query0, $db_id);
|
|---|
| 369 |
|
|---|
| 370 | if ($result0)
|
|---|
| 371 | {
|
|---|
| 372 | if ($html=="1" || $html=="2")
|
|---|
| 373 | PrintMagicTable($result0, $alias, $rightalign, $limitsmean, $limitsmin, $limitsmax, "", $_GET);
|
|---|
| 374 | else
|
|---|
| 375 | PrintText($result0);
|
|---|
| 376 |
|
|---|
| 377 | mysql_free_result($result0);
|
|---|
| 378 | }
|
|---|
| 379 | mysql_close($db_id);
|
|---|
| 380 |
|
|---|
| 381 | PrintSubmittedQuery($query0, $html, $db, "");
|
|---|
| 382 | }
|
|---|
| 383 |
|
|---|
| 384 | include ("include.php");
|
|---|
| 385 | include ("menu.php");
|
|---|
| 386 | include ("db.php");
|
|---|
| 387 | include ("magicdefs.php");
|
|---|
| 388 |
|
|---|
| 389 | ini_set("display_errors", "On");
|
|---|
| 390 | ini_set("mysql.trace_mode", "On");
|
|---|
| 391 |
|
|---|
| 392 | if (!empty($_GET["fSendTxt"]))
|
|---|
| 393 | {
|
|---|
| 394 | header("Content-type: application/octet");
|
|---|
| 395 | header("Content-Disposition: attachment; filename=query-result.txt");
|
|---|
| 396 |
|
|---|
| 397 | PrintPage("0", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limitsmean, $limitsmin, $limitsmax, $needs);
|
|---|
| 398 | }
|
|---|
| 399 | else
|
|---|
| 400 | {
|
|---|
| 401 | if (empty($_GET["fPrintTable"]))
|
|---|
| 402 | echo (file_get_contents("index-header.html"));
|
|---|
| 403 |
|
|---|
| 404 | $environment = sizeof($_GET);
|
|---|
| 405 |
|
|---|
| 406 | InitGet($_GET);
|
|---|
| 407 | if (empty($_GET["fPrintTable"]))
|
|---|
| 408 | PrintForm($_GET, $host, $user, $pw, $db, $limitsmean, $limitsmin, $limitsmax, $alias);
|
|---|
| 409 |
|
|---|
| 410 | if ($environment==0)
|
|---|
| 411 | printf("No query submitted yet.<BR>");
|
|---|
| 412 | else
|
|---|
| 413 | {
|
|---|
| 414 | if (empty($_GET["fPrintTable"]))
|
|---|
| 415 | PrintPage("1", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limitsmean, $limitsmin, $limitsmax, $needs);
|
|---|
| 416 | else
|
|---|
| 417 | PrintPage("2", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limitsmean, $limitsmin, $limitsmax, $needs);
|
|---|
| 418 | }
|
|---|
| 419 |
|
|---|
| 420 | if (empty($_GET["fPrintTable"]))
|
|---|
| 421 | echo (file_get_contents("index-footer.html"));
|
|---|
| 422 | }
|
|---|
| 423 |
|
|---|
| 424 | ini_set("display_errors", "Off");
|
|---|
| 425 | ini_set("mysql.trace_mode", "Off");
|
|---|
| 426 | }
|
|---|
| 427 | ?>
|
|---|