- Timestamp:
- 02/23/12 16:40:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/datacenter/db/run_comment.php
r12779 r12931 11 11 } 12 12 13 if (empty($_GET["f FileNumber"]))14 $_GET["f FileNumber"]="001";15 16 if (empty($_GET["f RunNumber"]))17 $_GET["f RunNumber"]=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)); 18 18 19 19 if (strcmp($_GET["fMode"], "tooltip")!=0) … … 62 62 if (strcmp($_GET["fMode"], "insert")==0) 63 63 { 64 $query0.=", f RunNumber=".$_GET["fRunNumber"];65 $query0.= ", f FileNumber=".$_GET["fFileNumber"];64 $query0.=", fNight=".$_GET["fNight"]; 65 $query0.= ", fRunID=".$_GET["fRunID"]; 66 66 } 67 67 //for update … … 69 69 { 70 70 $query2="SELECT fCommentKEY FROM RunComments "; 71 $query2.=" WHERE f RunNumber=".$_GET["fRunNumber"];72 $query2.=" AND f FileNumber=".$_GET["fFileNumber"];71 $query2.=" WHERE fNight=".$_GET["fNight"]; 72 $query2.=" AND fRunID=".$_GET["fRunID"]; 73 73 $query2.=" AND fComment='".str_replace("'", "\'", $_GET["fOldComment"])."'"; 74 74 $result2=mysql_query($query2, $db_id); … … 111 111 //insert field for run number 112 112 printf("<form action=\"run_comment.php\" METHOD=\"GET\">\n"); 113 printf("Run# (YYYYMMDD_FFF) <input name=\"f RunNumber\" type=\"text\" size=\"8\" maxlength=\"8\" value=\"%s\">\n", $_GET["fRunNumber"]);114 printf("_ <input name=\"f FileNumber\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"%s\">\n", $_GET["fFileNumber"]);113 printf("Run# (YYYYMMDD_FFF) <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"]); 115 115 printf("<input type='hidden' name='fMode' value='%s'>", $_GET["fMode"]); 116 116 printf("<input type='submit' value='Get Comments'><br><br>\n"); … … 126 126 mysql_select_db($db); 127 127 128 $query1 = "SELECT CONCAT(f RunNumber,'_', LPAD(fFileNumber, 3, 0)), fComment FROM RunComments ";129 $query1 .= "WHERE f RunNumber=".$_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"]; 130 130 $result1=mysql_query($query1, $db_id); 131 131 printf("Found %d comment(s).\n\n", mysql_num_rows($result1)); … … 156 156 printf("<input type='hidden' name='fOldComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES)); 157 157 printf("<input type='hidden' name='fMode' value='%s'>\n", $_GET["fMode"]); 158 printf("<input type='hidden' name='f RunNumber' value='%s'>\n", $_GET["fRunNumber"]);159 printf("<input type='hidden' name='f FileNumber' 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"]); 160 160 printf("<input type='submit' value='Update Comment'>\n"); 161 161 printf("</td>\n"); … … 167 167 } 168 168 else 169 printf("%s_%s: %s\n", $_GET["f RunNumber"], $_GET["fFileNumber"], $row1[1]);169 printf("%s_%s: %s\n", $_GET["fNight"], $_GET["fRunID"], $row1[1]); 170 170 } 171 171 //insert mode … … 173 173 { 174 174 printf("<tr BGCOLOR='#C0C0C0'>"); 175 printf("<td>%s_%s</td>\n", $_GET["f RunNumber"], $_GET["fFileNumber"]);175 printf("<td>%s_%s</td>\n", $_GET["fNight"], $_GET["fRunID"]); 176 176 printf("<td>\n"); 177 177 printf("<form style='display:inline' action=\"run_comment.php\" METHOD=\"GET\">\n"); 178 178 printf("<input type='text' size='50' maxlength='255' name='fComment'>\n"); 179 179 printf("<input type='hidden' name='fMode' value='%s'>\n", $_GET["fMode"]); 180 printf("<input type='hidden' name='f RunNumber' value='%s'>\n", $_GET["fRunNumber"]);181 printf("<input type='hidden' name='f FileNumber' 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"]); 182 182 printf("<input type='submit' value='Insert Comment'>\n"); 183 183 printf("</form>\n");
Note:
See TracChangeset
for help on using the changeset viewer.