Changeset 12695 for trunk/Mars
- Timestamp:
- 12/03/11 01:48:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/datacenter/db/run_comment.php
r12667 r12695 3 3 ini_set("display_errors", "On"); 4 4 ini_set("mysql.trace_mode", "On"); 5 6 echo (file_get_contents("index-header.html"));7 5 8 6 if (empty($_GET["fMode"])) … … 14 12 if (empty($_GET["fRunNumber"])) 15 13 $_GET["fRunNumber"]=date("Ymd", time()-(12*60*60)); 14 15 if (strcmp($_GET["fMode"], "tooltip")!=0) 16 echo (file_get_contents("index-header.html")); 16 17 17 18 … … 84 85 // 85 86 include("db.php"); 86 printf("With this page, you can \n"); 87 //view mode 88 if (strcmp($_GET["fMode"], "view")==0) 89 printf("view,\n"); 90 else 91 printf("<a href='%s'>view</a>,\n", str_replace($_GET["fMode"], 'view', $_SERVER['REQUEST_URI'])); 92 //update mode 93 if (strcmp($_GET["fMode"], "update")==0) 94 printf("update and\n"); 95 else 96 printf("<a href='%s'>update</a> and \n", str_replace($_GET["fMode"], 'update', $_SERVER['REQUEST_URI'])); 97 //insert mode 98 if (strcmp($_GET["fMode"], "insert")==0) 99 printf("insert\n"); 100 else 101 printf("<a href='%s'>insert</a> \n", str_replace($_GET["fMode"], 'insert', $_SERVER['REQUEST_URI'])); 102 printf("entries in the table <b>RunComment</b> from the DB <b>%s</b>.<br><br>\n", $db); 87 if (strcmp($_GET["fMode"], "tooltip")!=0) 88 { 89 printf("With this page, you can \n"); 90 //view mode 91 if (strcmp($_GET["fMode"], "view")==0) 92 printf("view,\n"); 93 else 94 printf("<a href='%s'>view</a>,\n", str_replace($_GET["fMode"], 'view', $_SERVER['REQUEST_URI'])); 95 //update mode 96 if (strcmp($_GET["fMode"], "update")==0) 97 printf("update and\n"); 98 else 99 printf("<a href='%s'>update</a> and \n", str_replace($_GET["fMode"], 'update', $_SERVER['REQUEST_URI'])); 100 //insert mode 101 if (strcmp($_GET["fMode"], "insert")==0) 102 printf("insert\n"); 103 else 104 printf("<a href='%s'>insert</a> \n", str_replace($_GET["fMode"], 'insert', $_SERVER['REQUEST_URI'])); 105 printf("entries in the table <b>RunComment</b> from the DB <b>%s</b>.<br><br>\n", $db); 103 106 104 //insert field for run number 105 printf("<form action=\"run_comment.php\" METHOD=\"GET\">\n"); 106 printf("Run# (YYYYMMDD_FFF) <input name=\"fRunNumber\" type=\"text\" size=\"8\" maxlength=\"8\" value=\"%s\">\n", $_GET["fRunNumber"]); 107 printf("_ <input name=\"fFileNumber\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"%s\">\n", $_GET["fFileNumber"]); 108 printf("<input type='hidden' name='fMode' value='%s'>", $_GET["fMode"]); 109 printf("<input type='submit' value='Get Comments'><br><br>\n"); 110 printf("</form>\n"); 107 //insert field for run number 108 printf("<form action=\"run_comment.php\" METHOD=\"GET\">\n"); 109 printf("Run# (YYYYMMDD_FFF) <input name=\"fRunNumber\" type=\"text\" size=\"8\" maxlength=\"8\" value=\"%s\">\n", $_GET["fRunNumber"]); 110 printf("_ <input name=\"fFileNumber\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"%s\">\n", $_GET["fFileNumber"]); 111 printf("<input type='hidden' name='fMode' value='%s'>", $_GET["fMode"]); 112 printf("<input type='submit' value='Get Comments'><br><br>\n"); 113 printf("</form>\n"); 114 } 111 115 112 116 $db_id = mysql_pconnect($host, $user, $pw); … … 121 125 $query1 .= "WHERE fRunNumber=".$_GET["fRunNumber"]." AND fFileNumber=".$_GET["fFileNumber"]; 122 126 $result1=mysql_query($query1, $db_id); 123 printf("Found %d comment(s).<br>", mysql_num_rows($result1)); 124 printf("<table BORDER='0' style='margin-top:1ex'>"); 125 $col = FALSE; 126 printf("<tr BGCOLOR='#C0C0C0'><td>Run#</td><td>Comment</td></tr>"); 127 printf("Found %d comment(s).\n\n", mysql_num_rows($result1)); 128 if (strcmp($_GET["fMode"], "tooltip")!=0) 129 { 130 printf("<br>\n"); 131 printf("<table BORDER='0' style='margin-top:1ex'>"); 132 $col = FALSE; 133 printf("<tr BGCOLOR='#C0C0C0'><td>Run#</td><td>Comment</td></tr>"); 134 } 127 135 while ($row1 = mysql_fetch_row($result1)) 128 136 { 129 if (!$col) 130 printf("<tr BGCOLOR='#E0E0E0'>\n"); 131 else 132 printf("<tr BGCOLOR='#D0D0D0'>\n"); 133 $col = !$col; 137 if (strcmp($_GET["fMode"], "tooltip")!=0) 138 { 139 if (!$col) 140 printf("<tr BGCOLOR='#E0E0E0'>\n"); 141 else 142 printf("<tr BGCOLOR='#D0D0D0'>\n"); 143 $col = !$col; 134 144 135 if (strcmp($_GET["fMode"], "update")==0) 136 printf("<form style='display:inline' action=\"run_comment.php\" METHOD=\"GET\">\n"); 137 printf("<td>\n%s\n</td>\n", $row1[0]); 138 if (strcmp($_GET["fMode"], "update")==0) 139 { 140 printf("<td>\n"); 141 printf("<input type='text' size='50' maxlength='255' name='fComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES)); 142 printf("<input type='hidden' name='fOldComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES)); 143 printf("<input type='hidden' name='fMode' value='%s'>\n", $_GET["fMode"]); 144 printf("<input type='hidden' name='fRunNumber' value='%s'>\n", $_GET["fRunNumber"]); 145 printf("<input type='hidden' name='fFileNumber' value='%s'>\n", $_GET["fFileNumber"]); 146 printf("<input type='submit' value='Update Comment'>\n"); 147 printf("</td>\n"); 148 printf("</form>\n"); 145 if (strcmp($_GET["fMode"], "update")==0) 146 printf("<form style='display:inline' action=\"run_comment.php\" METHOD=\"GET\">\n"); 147 printf("<td>\n%s\n</td>\n", $row1[0]); 148 if (strcmp($_GET["fMode"], "update")==0) 149 { 150 printf("<td>\n"); 151 printf("<input type='text' size='50' maxlength='255' name='fComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES)); 152 printf("<input type='hidden' name='fOldComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES)); 153 printf("<input type='hidden' name='fMode' value='%s'>\n", $_GET["fMode"]); 154 printf("<input type='hidden' name='fRunNumber' value='%s'>\n", $_GET["fRunNumber"]); 155 printf("<input type='hidden' name='fFileNumber' value='%s'>\n", $_GET["fFileNumber"]); 156 printf("<input type='submit' value='Update Comment'>\n"); 157 printf("</td>\n"); 158 printf("</form>\n"); 159 } 160 else 161 printf("<td>\n%s\n</td>\n", $row1[1]); 162 printf("</tr>\n"); 149 163 } 150 164 else 151 printf("<td>\n%s\n</td>\n", $row1[1]); 152 printf("</tr>\n"); 165 printf("%s_%s: %s\n", $_GET["fRunNumber"], $_GET["fFileNumber"], $row1[1]); 153 166 } 154 167 //insert mode … … 168 181 printf("</tr>\n"); 169 182 } 170 printf("</table>"); 183 if (strcmp($_GET["fMode"], "tooltip")!=0) 184 printf("</table>"); 171 185 172 186 if (strcmp($_GET["fMode"], "update")==0) … … 176 190 mysql_close($db_id); 177 191 178 echo (file_get_contents("index-footer.html")); 192 if (strcmp($_GET["fMode"], "tooltip")!=0) 193 echo (file_get_contents("index-footer.html")); 179 194 180 195 ini_set("display_errors", "Off");
Note:
See TracChangeset
for help on using the changeset viewer.