Ignore:
Timestamp:
02/23/12 16:40:01 (13 years ago)
Author:
Daniela Dorner
Message:
changed names of 2 DB columns
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/datacenter/db/run_comment.php

    r12779 r12931  
    1111    }
    1212
    13     if (empty($_GET["fFileNumber"]))
    14         $_GET["fFileNumber"]="001";
    15 
    16     if (empty($_GET["fRunNumber"]))
    17         $_GET["fRunNumber"]=date("Ymd", time()-(12*60*60));
     13    if (empty($_GET["fRunID"]))
     14        $_GET["fRunID"]="001";
     15
     16    if (empty($_GET["fNight"]))
     17        $_GET["fNight"]=date("Ymd", time()-(12*60*60));
    1818
    1919    if (strcmp($_GET["fMode"], "tooltip")!=0)
     
    6262            if (strcmp($_GET["fMode"], "insert")==0)
    6363            {
    64                 $query0.=", fRunNumber=".$_GET["fRunNumber"];
    65                 $query0.= ", fFileNumber=".$_GET["fFileNumber"];
     64                $query0.=", fNight=".$_GET["fNight"];
     65                $query0.= ", fRunID=".$_GET["fRunID"];
    6666            }
    6767            //for update
     
    6969            {
    7070                $query2="SELECT fCommentKEY FROM RunComments ";
    71                 $query2.=" WHERE fRunNumber=".$_GET["fRunNumber"];
    72                 $query2.=" AND fFileNumber=".$_GET["fFileNumber"];
     71                $query2.=" WHERE fNight=".$_GET["fNight"];
     72                $query2.=" AND fRunID=".$_GET["fRunID"];
    7373                $query2.=" AND fComment='".str_replace("'", "\'", $_GET["fOldComment"])."'";
    7474                $result2=mysql_query($query2, $db_id);
     
    111111        //insert field for run number
    112112        printf("<form action=\"run_comment.php\" METHOD=\"GET\">\n");
    113         printf("Run#&nbsp;(YYYYMMDD_FFF)&nbsp;<input name=\"fRunNumber\" type=\"text\" size=\"8\" maxlength=\"8\" value=\"%s\">\n", $_GET["fRunNumber"]);
    114         printf("_ <input name=\"fFileNumber\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"%s\">\n", $_GET["fFileNumber"]);
     113        printf("Run#&nbsp;(YYYYMMDD_FFF)&nbsp;<input name=\"fNight\" type=\"text\" size=\"8\" maxlength=\"8\" value=\"%s\">\n", $_GET["fNight"]);
     114        printf("_ <input name=\"fRunID\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"%s\">\n", $_GET["fRunID"]);
    115115        printf("<input type='hidden' name='fMode' value='%s'>", $_GET["fMode"]);
    116116        printf("<input type='submit' value='Get Comments'><br><br>\n");
     
    126126    mysql_select_db($db);
    127127
    128     $query1 = "SELECT CONCAT(fRunNumber,'_', LPAD(fFileNumber, 3, 0)), fComment FROM RunComments ";
    129     $query1 .= "WHERE fRunNumber=".$_GET["fRunNumber"]." AND fFileNumber=".$_GET["fFileNumber"];
     128    $query1 = "SELECT CONCAT(fNight,'_', LPAD(fRunID, 3, 0)), fComment FROM RunComments ";
     129    $query1 .= "WHERE fNight=".$_GET["fNight"]." AND fRunID=".$_GET["fRunID"];
    130130    $result1=mysql_query($query1, $db_id);
    131131    printf("Found %d comment(s).\n\n", mysql_num_rows($result1));
     
    156156                printf("<input type='hidden' name='fOldComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES));
    157157                printf("<input type='hidden' name='fMode' value='%s'>\n", $_GET["fMode"]);
    158                 printf("<input type='hidden' name='fRunNumber' value='%s'>\n", $_GET["fRunNumber"]);
    159                 printf("<input type='hidden' name='fFileNumber' value='%s'>\n", $_GET["fFileNumber"]);
     158                printf("<input type='hidden' name='fNight' value='%s'>\n", $_GET["fNight"]);
     159                printf("<input type='hidden' name='fRunID' value='%s'>\n", $_GET["fRunID"]);
    160160                printf("<input type='submit' value='Update Comment'>\n");
    161161                printf("</td>\n");
     
    167167        }
    168168        else
    169             printf("%s_%s: %s\n", $_GET["fRunNumber"], $_GET["fFileNumber"], $row1[1]);
     169            printf("%s_%s: %s\n", $_GET["fNight"], $_GET["fRunID"], $row1[1]);
    170170    }
    171171    //insert mode
     
    173173    {
    174174        printf("<tr BGCOLOR='#C0C0C0'>");
    175         printf("<td>%s_%s</td>\n", $_GET["fRunNumber"], $_GET["fFileNumber"]);
     175        printf("<td>%s_%s</td>\n", $_GET["fNight"], $_GET["fRunID"]);
    176176        printf("<td>\n");
    177177        printf("<form style='display:inline' action=\"run_comment.php\" METHOD=\"GET\">\n");
    178178        printf("<input type='text' size='50' maxlength='255' name='fComment'>\n");
    179179        printf("<input type='hidden' name='fMode' value='%s'>\n", $_GET["fMode"]);
    180         printf("<input type='hidden' name='fRunNumber' value='%s'>\n", $_GET["fRunNumber"]);
    181         printf("<input type='hidden' name='fFileNumber' value='%s'>\n", $_GET["fFileNumber"]);
     180        printf("<input type='hidden' name='fNight' value='%s'>\n", $_GET["fNight"]);
     181        printf("<input type='hidden' name='fRunID' value='%s'>\n", $_GET["fRunID"]);
    182182        printf("<input type='submit' value='Insert Comment'>\n");
    183183        printf("</form>\n");
Note: See TracChangeset for help on using the changeset viewer.