- Timestamp:
- 07/28/10 14:38:30 (14 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/db
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/mcdefs.php
r9610 r9617 4 4 ( 5 5 "Corsika" => "60", 6 "Ceres" => " 1",6 "Ceres" => "2", 7 7 "SequenceFile" => "1", 8 8 "Callisto" => "1", … … 40 40 ( 41 41 "Run.File" => "Run.File", 42 "fSequenceNumber" => "Sequ", 42 43 "fNumEvents" => "#Evts", 43 44 "SUM(fNumEvents)" => "Evts", … … 69 70 $rightalign = array 70 71 ( 71 // $alias["fRunNumber"]=> "1",72 $alias["fSequenceNumber"] => "1", 72 73 $alias["fNumEvents"] => "1", 73 74 $alias["fZenithDistanceMin"] => "1", … … 157 158 $joins = array 158 159 ( 159 "fParticleTypeName" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ", 160 "fRunTypeName" => " LEFT JOIN RunType USING(fRunTypeKEY) ", 161 "fAtmosphericModelName" => " LEFT JOIN AtmosphericModel USING(fAtmosphericModelKEY) ", 162 "Corsika" => " LEFT JOIN CorsikaStatus USING(fRunNumber, fFileNumber) ", 163 "Ceres" => " LEFT JOIN CeresStatus USING(fRunNumber, fFileNumber, fCeresSetupKEY) ", 164 "SequenceFile" => " LEFT JOIN SequenceFileStatus USING(fSequenceNumber) ", 165 "Callisto" => " LEFT JOIN CallistoStatus USING(fSequenceNumber, fCeresSetupKEY) ", 166 "Star" => " LEFT JOIN StarStatus USING(fSequenceNumber, fCeresSetupKEY) ", 160 "fParticleTypeKEY" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ", 161 "fRunTypeKEY" => " LEFT JOIN RunType USING(fRunTypeKEY) ", 162 "fAtmosphericModelKEY" => " LEFT JOIN AtmosphericModel USING(fAtmosphericModelKEY) ", 163 "fParticleTypeName" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ", 164 "fRunTypeName" => " LEFT JOIN RunType USING(fRunTypeKEY) ", 165 "fAtmosphericModelName" => " LEFT JOIN AtmosphericModel USING(fAtmosphericModelKEY) ", 166 "CorsikaStatus" => " LEFT JOIN CorsikaStatus USING(fRunNumber, fFileNumber) ", 167 "CeresStatus" => " LEFT JOIN CeresStatus USING(fRunNumber, fFileNumber, fCeresSetupKEY) ", 168 "SequenceFileStatus" => " LEFT JOIN SequenceFileStatus USING(fSequenceNumber) ", 169 "CallistoStatus" => " LEFT JOIN CallistoStatus USING(fSequenceNumber, fCeresSetupKEY) ", 170 "StarStatus" => " LEFT JOIN StarStatus USING(fSequenceNumber, fCeresSetupKEY) ", 171 "Corsika" => " LEFT JOIN CorsikaStatus USING(fRunNumber, fFileNumber) ", 172 "Ceres" => " LEFT JOIN CeresStatus USING(fRunNumber, fFileNumber, fCeresSetupKEY) ", 173 "SequenceFile" => " LEFT JOIN SequenceFileStatus USING(fSequenceNumber) ", 174 "Callisto" => " LEFT JOIN CallistoStatus USING(fSequenceNumber, fCeresSetupKEY) ", 175 "Star" => " LEFT JOIN StarStatus USING(fSequenceNumber, fCeresSetupKEY) ", 167 176 ); 168 177 -
trunk/MagicSoft/Mars/datacenter/db/mcinfo.php
r9610 r9617 85 85 $query0 .= " CONCAT('running (since ', " . $key . "Status.fStartTime, ')'), "; 86 86 $query0 .= " IF (NOT ISNULL(" . $key . "Status.fReturnCode), "; 87 $query0 .= " CONCAT('failed (', " . $key . "Status.fReturnCode, ' )'), ";87 $query0 .= " CONCAT('failed (', " . $key . "Status.fReturnCode, ', ', " . $key . "Status.fStopTime, ')'), "; 88 88 $query0 .= " CONCAT('done (', " . $key . "Status.fStopTime, "; 89 89 $query0 .= " ', ', TIMEDIFF(" . $key . "Status.fStopTime, " . $key . "Status.fStartTime), ')')))) "; … … 103 103 104 104 foreach ($_GET as $key => $element) 105 if (($_GET[$key]=="On" || $groups>0 || $statusgroups>0))// && !empty($joins[$key])) 106 $query0 .= GetJoin($fromtable,$key); 105 if ($_GET[$key]=="On" || $_GET[$key]!=0) 106 if (strpos($query0, GetJoin($fromtable,$key))==FALSE) 107 $query0 .= GetJoin($fromtable,$key); 107 108 108 109 foreach ($checkwhere as $key => $element) … … 123 124 124 125 if (strpos($query0, " WHERE ")==FALSE) 125 $query0 .= " WHERE 126 $query0 .= " WHERE"; 126 127 else 127 128 $query0 .= " AND "; … … 138 139 139 140 //remove WHERE or AND in the end of the query 140 $query0= ereg_replace(" WHERE \$", " ", $query0);141 $query0= ereg_replace(" AND \$", " ", $query0);141 $query0=preg_replace("/ WHERE\s+$/", " ", $query0); 142 $query0=preg_replace("/ AND\s+$/", " ", $query0); 142 143 143 144 if ($groups>0) -
trunk/MagicSoft/Mars/datacenter/db/menu.php
r9599 r9617 9 9 10 10 CheckBox("fNumEvents", "Num of events"); 11 CheckBox("fEnergyMin", "Emin"); 12 CheckBox("fEnergyMax", "Emax"); 13 CheckBox("fEnergySlope", "Slope"); 11 CheckBox("fSequenceNumber", "Sequ#"); 14 12 15 13 printf(" </tr><tr>\n"); … … 22 20 printf(" </tr><tr>\n"); 23 21 24 CheckBox("fZenithDistanceMin", "Zenith dist ancemin");25 CheckBox("fZenithDistanceMax", "Zenith dist ancemax");22 CheckBox("fZenithDistanceMin", "Zenith dist. min"); 23 CheckBox("fZenithDistanceMax", "Zenith dist. max"); 26 24 CheckBox("fAzimuthMin", "Azimuth min"); 27 25 CheckBox("fAzimuthMax", "Azimuth max"); 26 27 printf(" </tr><tr>\n"); 28 29 CheckBox("fEnergyMin", "Emin"); 30 CheckBox("fEnergyMax", "Emax"); 31 CheckBox("fEnergySlope", "Slope"); 28 32 29 33 printf(" </tr><tr>\n"); … … 633 637 { 634 638 if (empty($_GET["fRunMin"])) 635 $min = GetMin("fRunNumber", "C orsikaInfo", $host, $user, $pw, $db);639 $min = GetMin("fRunNumber", "CeresInfo", $host, $user, $pw, $db); 636 640 else 637 641 $min = $_GET["fRunMin"]; 638 642 639 643 if (empty($_GET["fRunMax"])) 640 $max = GetMax("fRunNumber", "C orsikaInfo", $host, $user, $pw, $db);644 $max = GetMax("fRunNumber", "CeresInfo", $host, $user, $pw, $db); 641 645 else 642 646 $max = $_GET["fRunMax"]; … … 790 794 } 791 795 792 function InitFailInfo($first)793 {794 if (empty($_GET["fStartTime"]))795 $_GET["fStartTime"]="Off";796 797 if (empty($_GET["fFailedTime"]))798 $_GET["fFailedTime"]="Off";799 800 if (empty($_GET["fReturnCode"]))801 $_GET["fReturnCode"]="Off";802 803 if (empty($_GET["fProgramId"]))804 $_GET["fProgramId"]="Off";805 }806 807 796 function InitInfo($first) 808 797 { … … 810 799 $_GET["fNumResults"]="20"; 811 800 812 if (empty($_GET["fNumEvents"]))813 $_GET["fNumEvents"]="Off";814 815 801 if (empty($_GET["fRunStart"])) 816 802 $_GET["fRunStart"]="Off"; … … 908 894 InitRunStatus($first); 909 895 InitInfo($first); 910 InitFailInfo($first); 896 897 if (empty($_GET["fNumEvents"])) 898 $_GET["fNumEvents"]=$first?"Off":""; 911 899 912 900 if (empty($_GET["fLinks"])) … … 1185 1173 InitInfo($first); 1186 1174 InitSequStatus($first); 1187 InitFailInfo($first);1188 1175 InitCalInfo($first); 1189 1176 InitStarInfo($first); 1190 1177 1178 if (empty($_GET["fNumEvents"])) 1179 $_GET["fNumEvents"]=$first?"Off":""; 1180 1191 1181 if (empty($_GET["fRunTime/60"])) 1192 1182 $_GET["fRunTime/60"]="Off"; … … 1256 1246 { 1257 1247 InitDataSetStatus($first); 1258 InitFailInfo($first);1259 1248 1260 1249 if (empty($_GET["fNumResults"])) … … 1612 1601 InitCTAMCRunStatus($first); 1613 1602 InitInfo($first); 1614 InitFailInfo($first); 1603 1604 if (empty($_GET["fNumEvents"])) 1605 $_GET["fNumEvents"]=$first?"Off":""; 1615 1606 1616 1607 if (empty($_GET["fObsLevel"])) … … 1671 1662 InitMCRunStatus($_GET, $first); 1672 1663 InitInfo($_GET, $first); 1673 InitFailInfo($_GET, $first);1674 1664 1675 1665 if (empty($_GET["fParticleTypeName"])) … … 1685 1675 $_GET["fNumEvents"]=$first?"On":""; 1686 1676 1677 if (empty($_GET["fSequenceNumber"])) 1678 $_GET["fSequenceNumber"]=$first?"On":""; 1679 1687 1680 if (empty($_GET["fZenithDistanceMin"])) 1688 $_GET["fZenithDistanceMin"]=$first?"O n":"";1681 $_GET["fZenithDistanceMin"]=$first?"Off":""; 1689 1682 1690 1683 if (empty($_GET["fZenithDistanceMax"])) 1691 $_GET["fZenithDistanceMax"]=$first?"O n":"";1684 $_GET["fZenithDistanceMax"]=$first?"Off":""; 1692 1685 1693 1686 if (empty($_GET["fAzimuthMin"])) 1694 $_GET["fAzimuthMin"]=$first?"O n":"";1687 $_GET["fAzimuthMin"]=$first?"Off":""; 1695 1688 1696 1689 if (empty($_GET["fAzimuthMax"])) 1697 $_GET["fAzimuthMax"]=$first?"O n":"";1690 $_GET["fAzimuthMax"]=$first?"Off":""; 1698 1691 1699 1692 if (empty($_GET["fEnergyMin"]))
Note:
See TracChangeset
for help on using the changeset viewer.