Changeset 9599 for trunk/MagicSoft
- Timestamp:
- 06/28/10 17:47:01 (14 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9598 r9599 19 19 -*-*- END OF LINE -*-*- 20 20 21 2010/06/28 Daniela Dorner 22 23 * datacenter/db/include.php: 24 - adapted status query for new db layout 25 26 * datacenter/db/menu.php: 27 - added and exchanged menu points and init elements for the new 28 layout of the FACT mc db 29 - bugfix that menu items can be switched off 30 31 * datacenter/db/mcinfo.php: 32 - adapted the queries for the new layout of the FACT mc db 33 (different table names, structures and content) 34 - adapted query for the status group by 35 36 * datacenter/db/mcdefs.php: 37 - adapted the arrays for the new layout of the FACT mc db 38 39 40 21 41 2010/06/28 Thomas Bretz 22 42 … … 88 108 89 109 110 >>>>>>> 1.4293 90 111 2010/06/24 Daniela Dorner 91 112 -
trunk/MagicSoft/Mars/datacenter/db/include.php
r9548 r9599 50 50 } 51 51 52 function StatusQuery($name, $ needs, $timelimits)52 function StatusQuery($name, $timelimits) 53 53 { 54 54 if (empty($timelimits[$name])) … … 60 60 switch ($_GET[$var]) 61 61 { 62 case 0: $txt .= ""; break; 63 case 1: $txt .= "NOT (IsNull(" . $name . ") OR " . $name . "='1970-01-01 00:00:00') AND "; break; 64 // case 2: $txt .= "IsNull(" . $name . ") AND IsNull(fStartTime) AND IsNull(fFailedTime) AND NOT IsNull(" . $needs[$name] . ") AND "; break; //not done but step before is done 65 case 2: $txt .= "IsNull(" . $name . ") AND "; break; //not done no matter what status of previous step is 66 case 3: $txt .= $name ."='1970-01-01 00:00:00' AND "; break; 67 case 4: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval " . $timelimit . " hour) < fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break; 68 case 5: $txt .= " (IsNull(" . $name . ") AND NOT IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND NOT IsNull(" . $needs[$name] . ")) AND "; break; 69 case 6: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval " . $timelimit . " hour) > fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break; 70 // case 6: $txt .= "crashed"; break; 71 case 7: $txt .= ""; break; 62 case 0://all 63 $txt .= " "; 64 break; 65 case 1://done 66 $txt .= " NOT ISNULL(" . $name . "Status.fStartTime) AND " 67 ." NOT ISNULL(" . $name . "Status.fStopTime) AND " 68 ." ISNULL(" . $name . "Status.fReturnCode) AND "; 69 break; 70 case 2://not done 71 $txt .= " ISNULL(" . $name . "Status.fStartTime) AND " 72 ." ISNULL(" . $name . "Status.fStopTime) AND " 73 ." ISNULL(" . $name . "Status.fReturnCode) AND "; 74 break; 75 case 3://not to be done 76 $txt .= $name ."Status.fStartTime='1970-01-01 00:00:00' AND " 77 . $name ."Status.fStopTime='1970-01-01 00:00:00' AND "; 78 break; 79 case 4://running 80 $txt .= " NOT ISNULL(" . $name . "Status.fStartTime) AND " 81 ." DATE_SUB(Now(),INTERVAL " . $timelimit . " HOUR) < " . $name . "Status.fStartTime AND " 82 ." ISNULL(" . $name . "Status.fStopTime) AND " 83 ." ISNULL(" . $name . "Status.fReturnCode) AND "; 84 break; 85 case 5://failed 86 $txt .= " NOT ISNULL(" . $name . "Status.fStartTime) AND " 87 ." NOT ISNULL(" . $name . "Status.fStopTime) AND " 88 ." NOT ISNULL(" . $name . "Status.fReturnCode) AND "; 89 break; 90 case 6://crashed 91 $txt .= " NOT ISNULL(" . $name . "Status.fStartTime) AND " 92 ." DATE_SUB(Now(),INTERVAL " . $timelimit . " HOUR) > " . $name . "Status.fStartTime AND " 93 ." ISNULL(" . $name . "Status.fStopTime) AND " 94 ." ISNULL(" . $name . "Status.fReturnCode) AND "; 95 break; 96 case 7://group by 97 $txt .= ""; 98 break; 72 99 } 73 100 return $txt; … … 108 135 } 109 136 110 /*111 $status = array("all", "done", "not done", "not to be done");112 $counter = 0;113 foreach ($status as $element)114 {115 if ($counter==$_GET[$var])116 printf("<option value=\"%d\" selected>%3s</option>\n", $counter++, $element);117 else118 printf("<option value=\"%d\">%3s</option>\n", $counter++, $element);119 }*/120 137 printf(" </select>\n"); 121 138 printf(" \n"); … … 329 346 { 330 347 foreach ($_GET as $key => $element) 331 if ($key==$column )348 if ($key==$column."Status") 332 349 if ($element==7) 333 350 return -1; -
trunk/MagicSoft/Mars/datacenter/db/mcdefs.php
r9498 r9599 1 1 <?php 2 3 $needs = array4 (5 "fCorsikaInputCreated" => "MCRunProcessStatus.fMCRunNumber",6 "fCorsikaFileAvail" => "MCRunProcessStatus.fCorsikaInputCreated",7 );8 9 2 10 3 $timelimits = array 11 4 ( 12 "fCorsikaInputCreated" => "1", 13 "fCorsikaFileAvail" => "60", 5 "Corsika" => "60", 6 "Ceres" => "1", 7 "SequenceFile" => "1", 8 "Callisto" => "1", 9 "Star" => "1", 14 10 ); 15 11 … … 18 14 ( 19 15 "fParticleTypeName" => CheckWhere("fParticleTypeKEY"), 16 "fRunTypeName" => CheckWhere("fRunTypeKEY"), 20 17 "fAtmosphericModelName" => CheckWhere("fAtmosphericModelKEY"), 21 18 ); … … 24 21 ( 25 22 "fParticleTypeName" => CheckGroup("fParticleTypeKEY"), 23 "fRunTypeName" => CheckGroup("fRunTypeKEY"), 26 24 "fAtmosphericModelName" => CheckGroup("fAtmosphericModelKEY"), 27 25 ); … … 30 28 $checkstatusgroup = array 31 29 ( 32 "fCorsikaInputCreated" => CheckStatusGroup("fCorsikaInputCreatedStatus"), 33 "fCorsikaFileAvail" => CheckStatusGroup("fCorsikaFileAvailStatus"), 30 "Corsika" => CheckStatusGroup("Corsika"), 31 "Ceres" => CheckStatusGroup("Ceres"), 32 "SequenceFile" => CheckStatusGroup("SequenceFile"), 33 "Callisto" => CheckStatusGroup("Callisto"), 34 "Star" => CheckStatusGroup("Star"), 34 35 ); 35 36 … … 38 39 $alias = array 39 40 ( 40 // "fRunNumber" => "Run#", 41 "Run#" => "Run#", 42 "fNumEvents" => "#Evts", 43 "SUM(fNumEvents)" => "Evts", 44 "fParticleTypeName" => "Particle", 45 "fAtmosphericModelName" => "Atm.Model", 46 "fCorsikaInputCreated" => "Input", 47 "fCorsikaFileAvail" => "Corsika", 48 "fStartTime" => "Process", 49 "fFailedTime" => "Failed", 50 "fReturnCode" => "Ret<br>Code", 51 "fProgramId" => "Prgr<br>Id", 52 "fZenithDistanceMin" => "Zd<br>Min", 53 "fZenithDistanceMax" => "Zd<br>Max", 54 "fAzimuthMin" => "Az<br>Min", 55 "fAzimuthMax" => "Az<br>Max", 56 "Min(fZenithDistanceMin)" => "ZDMin", 57 "Max(fZenithDistanceMax)" => "ZDMax", 58 "fEnergyMin" => "EMin<br>[GeV]", 59 "fEnergyMax" => "EMax<br>[GeV]", 60 "fImpactMax" => "Impact<br>[cm]", 61 "fViewConeMax" => "View<br>cone<br>[deg]", 62 "fEnergySlope" => "Slope", 63 "fNumReUseShower" => "#ShowerReUse", 64 "fStartingAltitude" => "Altitude<br>[g/sqcm]", 65 "fMirrorDiameter" => "Mirror<br>diam.<br>[cm]", 41 "Run.File" => "Run.File", 42 "fNumEvents" => "#Evts", 43 "SUM(fNumEvents)" => "Evts", 44 "fParticleTypeName" => "Particle", 45 "fRunTypeName" => "RunType", 46 "fAtmosphericModelName" => "Atm.Model", 47 "fCorsikaInputCreated" => "Input", 48 "Corsika" => "Corsika", 49 "Ceres" => "Ceres", 50 "SequenceFile" => "SequenceFile", 51 "Callisto" => "Callisto", 52 "Star" => "Star", 53 "fStartTime" => "Process", 54 "fFailedTime" => "Failed", 55 "fReturnCode" => "Ret<br>Code", 56 "fProgramId" => "Prgr<br>Id", 57 "fZenithDistanceMin" => "Zd<br>Min", 58 "fZenithDistanceMax" => "Zd<br>Max", 59 "fAzimuthMin" => "Az<br>Min", 60 "fAzimuthMax" => "Az<br>Max", 61 "Min(fZenithDistanceMin)" => "ZDMin", 62 "Max(fZenithDistanceMax)" => "ZDMax", 63 "fEnergyMin" => "EMin<br>[GeV]", 64 "fEnergyMax" => "EMax<br>[GeV]", 65 "fImpactMax" => "Impact<br>[cm]", 66 "fViewConeMax" => "View<br>cone<br>[deg]", 67 "fEnergySlope" => "Slope", 68 "fStartingAltitude" => "Altitude<br>[g/sqcm]", 69 "fMirrorDiameter" => "Mirror<br>diam.<br>[cm]", 66 70 ); 67 71 … … 80 84 $alias["fViewConeMax"] => "1", 81 85 $alias["fEnergySlope"] => "1", 82 $alias["fNumReUseShower"] => "1",83 86 $alias["fStartingAltitude"] => "1", 84 87 $alias["fMirrorDiameter"] => "1", … … 92 95 $checks = array 93 96 ( 94 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY", 95 "fAtmosphericModelName" => $fromtable . ".fAtmosphericModelKEY", 97 "fParticleTypeName" => "ParticleType.fParticleTypeKEY", 98 "fRunTypeName" => "RunType.fRunTypeKEY", 99 "fAtmosphericModelName" => "AtmosphericModel.fAtmosphericModelKEY", 96 100 ); 97 101 … … 117 121 "fProgramId" => "fProgramId", 118 122 "fParticleTypeName" => "ParticleType.fParticleTypeName", 123 "fRunTypeName" => "RunType.fRunTypeName", 119 124 "fAtmosphericModelName" => "AtmosphericModel.fAtmosphericModelName", 120 "fAzimuthMin" => $fromtable . ".fAzimuthMin", 121 "fAzimuthMax" => $fromtable . ".fAzimuthMax", 122 "fZenithDistanceMin" => $fromtable . ".fZenithDistanceMin", 123 "fZenithDistanceMax" => $fromtable . ".fZenithDistanceMax", 124 "fEnergyMin" => $fromtable . ".fEnergyMin", 125 "fEnergyMax" => $fromtable . ".fEnergyMax", 126 "fImpactMax" => $fromtable . ".fImpactMax", 127 "fViewConeMax" => $fromtable . ".fViewConeMax", 128 "fEnergySlope" => $fromtable . ".fEnergySlope", 129 "fNumReUseShower" => $fromtable . ".fNumReUseShower", 130 "fStartingAltitude" => $fromtable . ".fStartingAltitude", 131 "fMirrorDiameter" => $fromtable . ".fMirrorDiameter", 125 "fAzimuthMin" => "CorsikaInfo.fAzimuthMin", 126 "fAzimuthMax" => "CorsikaInfo.fAzimuthMax", 127 "fZenithDistanceMin" => "CorsikaInfo.fZenithDistanceMin", 128 "fZenithDistanceMax" => "CorsikaInfo.fZenithDistanceMax", 129 "fEnergyMin" => "CorsikaInfo.fEnergyMin", 130 "fEnergyMax" => "CorsikaInfo.fEnergyMax", 131 "fImpactMax" => "CorsikaInfo.fImpactMax", 132 "fViewConeMax" => "CorsikaInfo.fViewConeMax", 133 "fEnergySlope" => "CorsikaInfo.fEnergySlope", 134 "fStartingAltitude" => "CorsikaInfo.fStartingAltitude", 135 "fMirrorDiameter" => "CorsikaInfo.fMirrorDiameter", 132 136 "Min(fZenithDistanceMin)" => "'ZDMin'", 133 137 "Max(fZenithDistanceMax)" => "'ZDMax'", … … 137 141 if (!empty($tables[$val])) 138 142 $table=$tables[$val]; 139 if ($val==" Tel:Run/File")140 $table="' Tel:Run/File'";143 if ($val=="Run.File") 144 $table="'Run.File'"; 141 145 if ($val=="Tel:Sequ") 142 146 $table="CONCAT('M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, '0'))"; … … 147 151 if ($val=="NumDS") 148 152 $table="'# Datasets'"; 153 if ($val=="# Files") 154 $table="'# Files'"; 149 155 if ($val=="NumDays") 150 156 $table="'# days'"; … … 160 166 ( 161 167 "fParticleTypeName" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ", 168 "fRunTypeName" => " LEFT JOIN RunType USING(fRunTypeKEY) ", 162 169 "fAtmosphericModelName" => " LEFT JOIN AtmosphericModel USING(fAtmosphericModelKEY) ", 170 "Corsika" => " LEFT JOIN CorsikaStatus USING(fRunNumber, fFileNumber) ", 171 "Ceres" => " LEFT JOIN CeresStatus USING(fRunNumber, fFileNumber, fCeresSetupKEY) ", 172 "SequenceFile" => " LEFT JOIN SequenceFileStatus USING(fSequenceNumber) ", 173 "Callisto" => " LEFT JOIN CallistoStatus USING(fSequenceNumber, fCeresSetupKEY) ", 174 "Star" => " LEFT JOIN StarStatus USING(fSequenceNumber, fCeresSetupKEY) ", 163 175 ); 164 176 -
trunk/MagicSoft/Mars/datacenter/db/mcinfo.php
r9548 r9599 1 1 <?php 2 2 { 3 function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $ needs, $timelimits)4 { 5 $fromtable=" MCCorsikaRunData";3 function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $timelimits) 4 { 5 $fromtable="CeresInfo"; 6 6 7 7 $groups = 0; … … 42 42 foreach ($checkstatusgroup as $key => $element) 43 43 if ($element==-1) 44 $query0 .= " (if(IsNull(" . $key . "), if(isnull(fStartTime), 'not done', if(isnull(fFailedTime),if(isnull(" . $needs[$key] . "),'not done',if(date_sub(Now(),interval " . $timelimits[$key] . " 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] . "', "; 45 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 46 47 // $query0 .= " count(*) as '# Runs'"; 48 // $query0 .= ", SUM(fNumEvents) as '" . $alias["SUM(fNumEvents)"] . "' "; 49 44 $query0 .= " IF( ISNULL(" . $key . "Status.fStartTime) " 45 ." AND ISNULL(" . $key . "Status.fStopTime) " 46 ." AND ISNULL(" . $key . "Status.fReturnCode), 'not done', " 47 ." IF (NOT ISNULL(" . $key . "Status.fStartTime) " 48 ." AND DATE_SUB(Now(),INTERVAL " . $timelimits[$key] . " HOUR) > " . $key . "Status.fStartTime " 49 ." AND ISNULL(" . $key . "Status.fStopTime) " 50 ." AND ISNULL(" . $key . "Status.fReturnCode), 'crashed', " 51 ." IF (NOT ISNULL(" . $key . "Status.fStartTime) " 52 ." AND DATE_SUB(Now(),INTERVAL " . $timelimits[$key] . " HOUR) < " . $key . "Status.fStartTime " 53 ." AND ISNULL(" . $key . "Status.fStopTime) " 54 ." AND ISNULL(" . $key . "Status.fReturnCode), 'running', " 55 ." IF (NOT ISNULL(" . $key . "Status.fStartTime) " 56 ." AND NOT ISNULL(" . $key . "Status.fStopTime) " 57 ." AND ISNULL(" . $key . "Status.fReturnCode), 'done', 'bla' " 58 ." )))) AS '". $key . "', "; 50 59 } 51 $query0 .= " COUNT(*) as '# Runs' ";60 $query0 .= " COUNT(*) as '# Files' "; 52 61 $query0 .= ", SUM(fNumEvents) as '" . $alias["SUM(fNumEvents)"] . "' "; 53 62 } 54 63 else 55 64 { 56 $query0 .= " MCCorsikaRunData.fCorsikaRunNumber as 'Run' "; 57 // $query0 .= " Concat(RunData.fTelescopeNumber,':', RunData.fRunNumber,':', RunData.fFileNumber) as 'Run' "; 58 // $query0 .= " Concat('M', RunData.fTelescopeNumber,':', LPAD(RunData.fRunNumber,8, ' '),'/', LPAD(RunData.fFileNumber, 3, ' ')) as 'Tel:Run/File' "; 65 $query0 .= " CONCAT(LPAD(" . $fromtable . ".fRunNumber,8, ' '),'.', "; 66 $query0 .= " RIGHT(LPAD(" . $fromtable . ".fFileNumber, 6, 0), 3)) as 'Run.File' "; 59 67 60 68 if (empty($_GET["fSendTxt"]) && !empty($_GET["fLinks"])) … … 65 73 66 74 foreach ($_GET as $key => $element) 67 if ($key!="fLinks" && $_GET[$key]=="On" && $key!="fTest") 68 if (empty($checkwhere[$key]) || $checkwhere[$key]==0) 69 $query0 .= ", " . $key . " as '" . $alias[$key] . "' "; 70 } 71 72 $query0 .= " FROM MCCorsikaRunData "; 73 74 $query0 .= " LEFT JOIN MCRunProcessStatus ON MCCorsikaRunData.fCorsikaRunNumber=MCRunProcessStatus.fMCRunNumber "; 75 if ($_GET[$key]=="On" && $key!="fTest" && $key!="fLinks") 76 if (!ereg("^f", $key)) 77 { 78 79 $query0 .= ", IF (ISNULL(" . $key . "Status.fStartTime) AND "; 80 $query0 .= " ISNULL(" . $key . "Status.fStopTime) AND "; 81 $query0 .= " ISNULL(" . $key . "Status.fReturnCode), 'not done', "; 82 $query0 .= " IF (NOT ISNULL(" . $key . "Status.fReturnCode), "; 83 $query0 .= " CONCAT('failed (', " . $key . "Status.fReturnCode, ')'), "; 84 $query0 .= " CONCAT('done (', " . $key . "Status.fStopTime, ')'))) "; 85 86 //$query0 .= ", CONCAT( 'halo', " . $key . "Status.fStartTime)"; 87 $query0 .= " AS '" . $alias[$key] . "' "; 88 //echo "ereg: " . $key . "<br>"; 89 } 90 else 91 if (empty($checkwhere[$key]) || $checkwhere[$key]==0) 92 $query0 .= ", " . $key . " as '" . $alias[$key] . "' "; 93 } 94 95 $query0 .= " FROM " . $fromtable; 96 97 $query0 .= " LEFT JOIN CorsikaInfo USING(fRunNumber,fFileNumber) "; 75 98 76 99 foreach ($_GET as $key => $element) 77 100 if (($_GET[$key]=="On" || $groups>0))// && !empty($joins[$key])) 78 101 $query0 .= GetJoin($fromtable,$key); 79 80 /*81 if ($_GET["fTest"]!="On")82 {83 if ($_GET["fSourceName"]!="On")84 $query0 .= " LEFT JOIN Source USING(fSourceKEY) ";85 $query0 .= " WHERE fTest='no'";86 }87 */88 102 89 103 foreach ($checkwhere as $key => $element) … … 108 122 $query0 .= " AND "; 109 123 110 $query0 .= StatusQuery("fCorsikaInputCreated", $needs, $timelimits); 111 $query0 .= StatusQuery("fCorsikaFileAvail", $needs, $timelimits); 124 $query0 .= StatusQuery("Corsika", $timelimits); 125 $query0 .= StatusQuery("Ceres", $timelimits); 126 $query0 .= StatusQuery("SequenceFile", $timelimits); 127 $query0 .= StatusQuery("Callisto", $timelimits); 128 $query0 .= StatusQuery("Star", $timelimits); 112 129 113 130 if ((!empty($_GET["fRunMin"]) || $_GET["fRunMin"]=="0") && !empty($_GET["fRunMax"])) 114 $query0 .= "MCCorsikaRunData.fCorsikaRunNumber BETWEEN " . $_GET["fRunMin"] . " AND " . $_GET["fRunMax"] . " "; 115 116 // if ((!empty($_GET["fZDMin"]) || $_GET["fZDMin"]==0) && !empty($_GET["fZDMax"])) 117 // $query0 .= "AND fZenithDistance BETWEEN " . $_GET["fZDMin"] . " AND " . $_GET["fZDMax"] . " "; 118 119 /* 120 if (!empty($_GET["fDate"])) 121 $query0 .= " AND fRunStart REGEXP \"^" . $_GET["fDate"] . "\" "; 122 */ 123 124 /* 125 if (!empty($_GET["fSourceN"])) 126 $query0 .= " AND fSourceName REGEXP \"^" . $_GET["fSourceN"] . "\" "; 127 128 if (!empty($_GET["fStartDate"])) 129 { 130 if (strpos(strrev($query0), " DNA ")!=0) 131 $query0 .= " AND "; 132 133 $startdate=substr($_GET["fStartDate"], 0, 10); 134 if ($startdate=="0000-00-00") 135 $query0 .=" fRunStart >= '" . $startdate . " 00:00:00' "; 136 else 137 $query0 .= " fRunStart >= ADDDATE('" . $startdate . " 13:00:00', INTERVAL -1 DAY) "; 138 } 139 140 if (!empty($_GET["fStopDate"])) 141 { 142 if (strpos(strrev($query0), " DNA ")!=0) 143 $query0 .= " AND "; 144 145 $stopdate=substr($_GET["fStopDate"], 0, 10); 146 $query0 .= " fRunStart < '" . $stopdate . " 13:00:00' "; 147 } 148 149 if (!empty($_GET["fSequenceNo"]) || $_GET["fSequenceNo"]=="0") 150 { 151 if (strpos(strrev($query0), " DNA ")!=0) 152 $query0 .= " AND "; 153 154 $query0 .= " fSequenceFirst = '" . $_GET["fSequenceNo"] . "' "; 155 } 156 */ 131 $query0 .= " " . $fromtable . ".fRunNumber BETWEEN " . $_GET["fRunMin"] . " AND " . $_GET["fRunMax"] . " "; 132 157 133 158 134 //remove WHERE or AND in the end of the query … … 175 151 if ($statusgroups>0) 176 152 { 177 // $query0 .= " GROUP BY ";178 153 if (strpos($query0, " GROUP BY ")==FALSE) 179 154 $query0 .= " GROUP BY "; … … 198 173 } 199 174 else 200 $query0 .=" ORDER BY MCCorsikaRunData.fCorsikaRunNumber ASC";175 $query0 .=" ORDER BY " . $fromtable . ".fRunNumber ASC"; 201 176 202 177 if (empty($_GET["fNumStart"])) … … 265 240 } 266 241 267 function PrintPage($html, $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $ needs, $timelimits)242 function PrintPage($html, $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $timelimits) 268 243 { 269 244 $db_id = mysql_connect($host, $user, $pw); … … 276 251 mysql_query("SET BIG_TABLES=1"); // necessary for mySQL <= 4 277 252 278 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $ needs, $timelimits);253 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $timelimits); 279 254 280 255 $result0 = mysql_query($query0, $db_id); … … 310 285 header("Content-Disposition: attachment; filename=query-result.txt"); 311 286 312 PrintPage("0", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $ needs, $timelimits);287 PrintPage("0", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $timelimits); 313 288 } 314 289 else 315 290 { 316 291 if (empty($_GET["fPrintTable"])) 317 echo (file_get_contents("index-header .html"));292 echo (file_get_contents("index-header-fact.html")); 318 293 319 294 $environment = sizeof($_GET); … … 328 303 { 329 304 if (empty($_GET["fPrintTable"])) 330 PrintPage("1", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $ needs, $timelimits);305 PrintPage("1", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $timelimits); 331 306 else 332 PrintPage("2", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $ needs, $timelimits);307 PrintPage("2", $host, $user, $pw, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $timelimits); 333 308 } 334 309 -
trunk/MagicSoft/Mars/datacenter/db/menu.php
r9546 r9599 17 17 CheckBox("fImpactMax", "Impact"); 18 18 CheckBox("fViewConeMax", "Viewcone"); 19 CheckBox("fNumReUseShower", "#Shower reuse");20 19 CheckBox("fStartingAltitude", "Starting alt."); 21 22 printf(" </tr><tr>\n");23 24 20 CheckBox("fMirrorDiameter", "Mirror diam."); 25 21 … … 35 31 PrintPullDown($host, $user, $pw, $db, "ParticleType", "fParticleTypeName", "fParticleTypeKEY", "Particle type"); 36 32 printf(" </td><td>\n"); 33 PrintPullDown($host, $user, $pw, $db, "RunType", "fRunTypeName", "fRunTypeKEY", "Run type"); 34 printf(" </td><td>\n"); 37 35 PrintPullDown($host, $user, $pw, $db, "AtmosphericModel", "fAtmosphericModelName", "fAtmosphericModelKEY", "Atm. model"); 38 36 printf(" </td>\n"); … … 49 47 printf(" <tr><td>\n"); 50 48 51 PrintStatusMenu("fCorsikaInputCreated", "Input"); 52 printf(" </td><td>\n"); 53 PrintStatusMenu("fCorsikaFileAvail", "Corsika"); 49 PrintStatusMenu("Corsika", "Corsika"); 50 printf(" </td><td>\n"); 51 PrintStatusMenu("Ceres", "Ceres"); 52 printf(" </td><td>\n"); 53 PrintStatusMenu("SequenceFile", "SequenceFile"); 54 55 printf(" </td></tr><tr><td>\n"); 56 57 PrintStatusMenu("Callisto", "Callisto"); 58 printf(" </td><td>\n"); 59 PrintStatusMenu("Star", "Star"); 54 60 55 61 printf(" </td></tr></table>\n"); … … 627 633 { 628 634 if (empty($_GET["fRunMin"])) 629 $min = GetMin("f CorsikaRunNumber", "MCCorsikaRunData", $host, $user, $pw, $db);635 $min = GetMin("fRunNumber", "CorsikaInfo", $host, $user, $pw, $db); 630 636 else 631 637 $min = $_GET["fRunMin"]; 632 638 633 639 if (empty($_GET["fRunMax"])) 634 $max = GetMax("f CorsikaRunNumber", "MCCorsikaRunData", $host, $user, $pw, $db);640 $max = GetMax("fRunNumber", "CorsikaInfo", $host, $user, $pw, $db); 635 641 else 636 642 $max = $_GET["fRunMax"]; … … 1625 1631 function InitMCRunStatus($_GET, $first) 1626 1632 { 1627 if (empty($_GET["fCorsikaFileAvail"])) 1628 $_GET["fCorsikaFileAvail"]="On"; 1629 1630 if (empty($_GET["fCorsikaFileAvailStatus"])) 1631 $_GET["fCorsikaFileAvailStatus"]="0"; 1632 1633 if (empty($_GET["fCorsikaInputCreated"])) 1634 $_GET["fCorsikaInputCreated"]="Off"; 1635 1636 if (empty($_GET["fCorsikaInputCreatedStatus"])) 1637 $_GET["fCorsikaInputCreatedStatus"]="0"; 1633 1634 if (empty($_GET["Corsika"])) 1635 $_GET["Corsika"]=$first?"On":""; 1636 1637 if (empty($_GET["CorsikaStatus"])) 1638 $_GET["CorsikaStatus"]="0"; 1639 1640 if (empty($_GET["Ceres"])) 1641 $_GET["Ceres"]=$first?"On":""; 1642 1643 if (empty($_GET["CeresStatus"])) 1644 $_GET["CeresStatus"]="0"; 1645 1646 if (empty($_GET["SequenceFile"])) 1647 $_GET["SequenceFile"]=$first?"Off":""; 1648 1649 if (empty($_GET["SequenceFileStatus"])) 1650 $_GET["SequenceFileStatus"]="0"; 1651 1652 if (empty($_GET["Callisto"])) 1653 $_GET["Callisto"]=$first?"Off":""; 1654 1655 if (empty($_GET["CallistoStatus"])) 1656 $_GET["CallistoStatus"]="0"; 1657 1658 if (empty($_GET["Star"])) 1659 $_GET["Star"]=$first?"On":""; 1660 1661 if (empty($_GET["StarStatus"])) 1662 $_GET["StarStatus"]="0"; 1638 1663 1639 1664 } … … 1649 1674 1650 1675 if (empty($_GET["fParticleTypeName"])) 1651 $_GET["fParticleTypeName"]="On"; 1676 $_GET["fParticleTypeName"]=$first?"On":""; 1677 1678 if (empty($_GET["fRunTypeName"])) 1679 $_GET["fRunTypeName"]=$first?"On":""; 1652 1680 1653 1681 if (empty($_GET["fAtmosphericModelName"])) … … 1658 1686 1659 1687 if (empty($_GET["fZenithDistanceMin"])) 1660 $_GET["fZenithDistanceMin"]= "On";1688 $_GET["fZenithDistanceMin"]=$first?"On":""; 1661 1689 1662 1690 if (empty($_GET["fZenithDistanceMax"])) 1663 $_GET["fZenithDistanceMax"]= "On";1691 $_GET["fZenithDistanceMax"]=$first?"On":""; 1664 1692 1665 1693 if (empty($_GET["fAzimuthMin"])) 1666 $_GET["fAzimuthMin"]= "On";1694 $_GET["fAzimuthMin"]=$first?"On":""; 1667 1695 1668 1696 if (empty($_GET["fAzimuthMax"])) 1669 $_GET["fAzimuthMax"]= "On";1697 $_GET["fAzimuthMax"]=$first?"On":""; 1670 1698 1671 1699 if (empty($_GET["fEnergyMin"])) 1672 $_GET["fEnergyMin"]= "On";1700 $_GET["fEnergyMin"]=$first?"On":""; 1673 1701 1674 1702 if (empty($_GET["fEnergyMax"])) 1675 $_GET["fEnergyMax"]= "On";1703 $_GET["fEnergyMax"]=$first?"On":""; 1676 1704 1677 1705 if (empty($_GET["fImpactMax"])) 1678 $_GET["fImpactMax"]= "On";1706 $_GET["fImpactMax"]=$first?"On":""; 1679 1707 1680 1708 if (empty($_GET["fViewConeMax"])) 1681 $_GET["fViewConeMax"]= "On";1709 $_GET["fViewConeMax"]=$first?"On":""; 1682 1710 1683 1711 if (empty($_GET["fEnergySlope"])) 1684 $_GET["fEnergySlope"]="On"; 1685 1686 if (empty($_GET["fNumReUseShower"])) 1687 $_GET["fNumReUseShower"]="Off"; 1712 $_GET["fEnergySlope"]=$first?"On":""; 1688 1713 1689 1714 if (empty($_GET["fStartingAltitude"])) 1690 $_GET["fStartingAltitude"]= "On";1715 $_GET["fStartingAltitude"]=$first?"On":""; 1691 1716 1692 1717 if (empty($_GET["fMirrorDiameter"])) 1693 $_GET["fMirrorDiameter"]= "On";1718 $_GET["fMirrorDiameter"]=$first?"On":""; 1694 1719 1695 1720 }
Note:
See TracChangeset
for help on using the changeset viewer.