Changeset 9105


Ignore:
Timestamp:
08/06/08 16:13:23 (16 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/db
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/db/runinfo-aio.php

    r8850 r9105  
    4848            else
    4949            {
    50                 $query0 .= " RunData.fRunNumber as 'Run#' ";
     50//                $query0 .= " RunData.fRunNumber as 'Run#' ";
     51//                $query0 .= " Concat(RunData.fTelescopeNumber,':', RunData.fRunNumber,':', RunData.fFileNumber) as 'Run' ";
     52                $query0 .= " Concat(RunData.fTelescopeNumber,':', RunData.fRunNumber,':', RunData.fFileNumber) as 'Tel:Run:File' ";
    5153
    5254                if (empty($_GET["fSendTxt"]) && !empty($_GET["fLinks"]))
     
    6567        $query0 .= " FROM RunData ";
    6668
    67         $query0 .= " LEFT JOIN RunProcessStatus ON RunData.fRunNumber=RunProcessStatus.fRunNumber ";
     69        $query0 .= " LEFT JOIN RunProcessStatus USING(fRunNumber,fTelescopeNumber,fFileNumber) ";
    6870
    6971        foreach ($_GET as $key => $element)
     
    7476        {
    7577            if ($_GET["fSourceName"]!="On")
    76                 $query0 .= " LEFT JOIN Source ON Sequences.fSourceKEY=Source.fSourceKEY ";
     78                $query0 .= " LEFT JOIN Source USING(fSourceKEY) ";
    7779            $query0 .= " WHERE fTest='no'";
    7880        }
     
    262264        printf(" <P>\n");
    263265        PrintSourceMenu($host,$user,$pw,$db);
    264         PrintNumResPullDown();
    265266        printf("<p>");
    266267        printf("</div>");
     
    271272        ini_set("display_errors", "Off");
    272273
     274        PrintNumResPullDown();
    273275        PrintButtons("runinfo-aio.php");
    274276
  • trunk/MagicSoft/Mars/datacenter/db/runinfo.php

    r9052 r9105  
    5959        $query0 .= " FROM RunData ";
    6060
    61         $query0 .= " LEFT JOIN RunProcessStatus ON RunData.fRunNumber=RunProcessStatus.fRunNumber ";
     61        $query0 .= " LEFT JOIN RunProcessStatus USING(fRunNumber,fTelescopeNumber,fFileNumber) ";
    6262
    6363        foreach ($_GET as $key => $element)
     
    6868        {
    6969            if ($_GET["fSourceName"]!="On")
    70                 $query0 .= " LEFT JOIN Source ON Sequences.fSourceKEY=Source.fSourceKEY ";
     70                $query0 .= " LEFT JOIN Source USING(fSourceKEY) ";
    7171            $query0 .= " WHERE fTest='no'";
    7272        }
  • trunk/MagicSoft/Mars/datacenter/db/sequence.php

    r8468 r9105  
    3838        $query0 .= " FROM Sequences ";
    3939
    40         $query0 .= " LEFT JOIN Source ON Sequences.fSourceKEY=Source.fSourceKEY ";
    41         $query0 .= " LEFT JOIN Project ON Sequences.fProjectKEY=Project.fProjectKEY ";
    42         $query0 .= " LEFT JOIN HvSettings ON Sequences.fHvSettingsKEY=HvSettings.fHvSettingsKEY ";
    43         $query0 .= " LEFT JOIN DiscriminatorThresholdTable ON Sequences.fDiscriminatorThresholdTableKEY=DiscriminatorThresholdTable.fDiscriminatorThresholdTableKEY ";
    44         $query0 .= " LEFT JOIN L1TriggerTable ON Sequences.fL1TriggerTableKEY=L1TriggerTable.fL1TriggerTableKEY ";
    45         $query0 .= " LEFT JOIN L2TriggerTable ON Sequences.fL2TriggerTableKEY=L2TriggerTable.fL2TriggerTableKEY ";
    46         $query0 .= " LEFT JOIN TriggerDelayTable ON Sequences.fTriggerDelayTableKEY=TriggerDelayTable.fTriggerDelayTableKEY ";
    47         $query0 .= " LEFT JOIN TestFlag ON Sequences.fTestFlagKEY=TestFlag.fTestFlagKEY ";
    48         $query0 .= " LEFT JOIN LightConditions ON Sequences.fLightConditionsKEY=LightConditions.fLightConditionsKEY ";
    49         $query0 .= " LEFT JOIN ManuallyChanged ON Sequences.fManuallyChangedKEY=ManuallyChanged.fManuallyChangedKEY ";
    50         $query0 .= " LEFT JOIN SequenceProcessStatus ON Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst ";
    51         $query0 .= " LEFT JOIN Calibration ON Sequences.fSequenceFirst=Calibration.fSequenceFirst ";
    52         $query0 .= " LEFT JOIN Star ON Sequences.fSequenceFirst=Star.fSequenceFirst ";
     40        $query0 .= " LEFT JOIN Source USING(fSourceKEY) ";
     41        $query0 .= " LEFT JOIN Project USING(fProjectKEY) ";
     42        $query0 .= " LEFT JOIN HvSettings USING(fHvSettingsKEY) ";
     43        $query0 .= " LEFT JOIN DiscriminatorThresholdTable USING(fDiscriminatorThresholdTableKEY) ";
     44        $query0 .= " LEFT JOIN L1TriggerTable USING(fL1TriggerTableKEY) ";
     45        $query0 .= " LEFT JOIN L2TriggerTable USING(fL2TriggerTableKEY) ";
     46        $query0 .= " LEFT JOIN TriggerDelayTable USING(fTriggerDelayTableKEY) ";
     47        $query0 .= " LEFT JOIN TestFlag USING(fTestFlagKEY) ";
     48        $query0 .= " LEFT JOIN LightConditions USING(fLightConditionsKEY) ";
     49        $query0 .= " LEFT JOIN ManuallyChanged USING(fManuallyChangedKEY) ";
     50        $query0 .= " LEFT JOIN SequenceProcessStatus USING(fSequenceFirst,fTelescopeNumber) ";
     51        $query0 .= " LEFT JOIN Calibration USING(fSequenceFirst,fTelescopeNumber) ";
     52        $query0 .= " LEFT JOIN Star USING(fSequenceFirst,fTelescopeNumber) ";
    5353
    5454
     
    171171    {
    172172        $query1  = "SELECT fRunNumber, fCalibrationScriptName FROM RunData ";
    173         $query1 .= " LEFT JOIN RunType ON RunData.fRunTypeKEY=RunType.fRunTypeKEY ";
    174         $query1 .= " LEFT JOIN CalibrationScript ON RunData.fCalibrationScriptKEY=CalibrationScript.fCalibrationScriptKEY ";
     173        $query1 .= " LEFT JOIN RunType USING(fRunTypeKEY) ";
     174        $query1 .= " LEFT JOIN CalibrationScript USING(fCalibrationScriptKEY) ";
    175175        $query1 .= " WHERE fSequenceFirst=" . $sequ . " AND fRunTypeName='" . $type . "'";
    176176
     
    195195    {
    196196        $query2  = "SELECT RunData.fRunNumber FROM RunData ";
    197         $query2 .= " LEFT JOIN RunProcessStatus ON RunData.fRunNumber=RunProcessStatus.fRunNumber ";
     197        $query2 .= " LEFT JOIN RunProcessStatus USING(fRunNumber,fTelescopeNumber,fFileNumber) ";
    198198        $query2 .= " WHERE fSequenceFirst=" . $sequ . " AND IsNull(" . $column . ")";
    199199
  • trunk/MagicSoft/Mars/datacenter/db/sequinfo-aio.php

    r8797 r9105  
    5151                    //$query0 .= " CONCAT('<A&ws;HREF=\"runinfo-aio.php?',  'fRunStart=On', '&amp;fZenithDistance=On', '&amp;fRunMin=', Sequences.fSequenceFirst, '&amp;fMeanTriggerRate=On', '&amp;fTest=On', '&amp;fRunTypeName=On', '&amp;fRunMax=', fSequenceLast, '&amp;fNumEvents=On', '&amp;fSourceName=On&amp;', 'fExcludedFDAKEY=1', '&amp;fSequenceFirst=On', '&amp;fRawFileAvail=On', '&amp;fCCFileAvail=On', '&amp;fCaCoFileAvail=On', '&amp;fNumResults=500\">', Sequences.fSequenceFirst, '</A>') ";
    5252                    //new version using fSequenceNo
    53                     $query0 .= " CONCAT('<A&ws;HREF=\"runinfo-aio.php?',  'fRunStart=On', '&amp;fZenithDistance=On', '&amp;fSequenceNo=', Sequences.fSequenceFirst, '&amp;fMeanTriggerRate=On', '&amp;fTest=On', '&amp;fRunTypeName=On', '&amp;fNumEvents=On', '&amp;fSourceName=On&amp;', 'fExcludedFDAKEY=1', '&amp;fSequenceFirst=On', '&amp;fRawFileAvail=On', '&amp;fCCFileAvail=On', '&amp;fCaCoFileAvail=On', '&amp;fNumResults=500\">', Sequences.fSequenceFirst, '</A>') ";
    54                     $query0 .= " as " . $alias["fSequenceFirst"];
     53                    $query0 .= " CONCAT('<A&ws;HREF=\"runinfo-aio.php?',  'fRunStart=On', '&amp;fZenithDistance=On', '&amp;fSequenceNo=', Sequences.fSequenceFirst, '&amp;fMeanTriggerRate=On', '&amp;fTest=On', '&amp;fRunTypeName=On', '&amp;fNumEvents=On', '&amp;fSourceName=On&amp;', 'fExcludedFDAKEY=1', '&amp;fSequenceFirst=On', '&amp;fRawFileAvail=On', '&amp;fCCFileAvail=On', '&amp;fCaCoFileAvail=On', '&amp;fNumResults=500\">', Sequences.fTelescopeNumber, ':', Sequences.fSequenceFirst, '</A>') ";
     54//                    $query0 .= " as " . $alias["fSequenceFirst"];
     55                    $query0 .= " as 'Tel:Sequ'";
    5556                    if (!empty($_GET["fLinks"]))
    5657                    {
     
    7677        $query0 .= " FROM " . $fromtable;
    7778
    78         $query0 .= " LEFT JOIN SequenceProcessStatus ON Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst ";
    79         $query0 .= " LEFT JOIN Calibration ON Sequences.fSequenceFirst=Calibration.fSequenceFirst ";
    80         $query0 .= " LEFT JOIN Star ON Sequences.fSequenceFirst=Star.fSequenceFirst ";
     79        $query0 .= " LEFT JOIN SequenceProcessStatus USING(fSequenceFirst,fTelescopeNumber) ";
     80        $query0 .= " LEFT JOIN Calibration USING(fSequenceFirst,fTelescopeNumber) ";
     81        $query0 .= " LEFT JOIN Star USING(fSequenceFirst,fTelescopeNumber) ";
    8182
    8283        foreach ($_GET as $key => $element)
     
    8788        {
    8889            if ($_GET["fSourceName"]!="On")
    89                 $query0 .= " LEFT JOIN Source ON Sequences.fSourceKEY=Source.fSourceKEY ";
     90                $query0 .= " LEFT JOIN Source ON USING(fSourceKEY) ";
    9091            $query0 .= " WHERE fTest='no'";
    9192        }
     
    319320        printf(" <P>\n");
    320321
    321         PrintNumResPullDown();
    322322
    323323        ini_set("mysql.trace_mode", "Off");
    324324        ini_set("display_errors", "Off");
    325325
     326        PrintNumResPullDown();
    326327        PrintButtons("sequinfo-aio.php");
    327328
  • trunk/MagicSoft/Mars/datacenter/db/sequinfo.php

    r9052 r9105  
    7272        $query0 .= " FROM " . $fromtable;
    7373
    74         $query0 .= " LEFT JOIN SequenceProcessStatus ON Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst ";
    75         $query0 .= " LEFT JOIN Calibration ON Sequences.fSequenceFirst=Calibration.fSequenceFirst ";
    76         $query0 .= " LEFT JOIN Star ON Sequences.fSequenceFirst=Star.fSequenceFirst ";
     74        $query0 .= " LEFT JOIN SequenceProcessStatus USING(fSequenceFirst,fTelescopeNumber) ";
     75        $query0 .= " LEFT JOIN Calibration USING(fSequenceFirst,fTelescopeNumber) ";
     76        $query0 .= " LEFT JOIN Star USING(fSequenceFirst,fTelescopeNumber) ";
    7777
    7878//        foreach ($_GET as $key => $element)
     
    8787        {
    8888            if ($_GET["fSourceName"]!="On")
    89                 $query0 .= " LEFT JOIN Source ON Sequences.fSourceKEY=Source.fSourceKEY ";
     89                $query0 .= " LEFT JOIN Source ON USING(fSourceKEY) ";
    9090            $query0 .= " WHERE fTest='no'";
    9191        }
Note: See TracChangeset for help on using the changeset viewer.