Changeset 11599 for trunk/www/db_po/view_po.php
- Timestamp:
- 07/26/11 10:51:38 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/db_po/view_po.php
r11504 r11599 12 12 13 13 include("db.php"); 14 printf("This page is to <u>view</u> the DB <b>%s</b>.\n", $db); 14 printf("This page is to <u>view and compare</u> entries from the DB <b>%s</b>.\n", $db); 15 printf("<button onClick='show_viewinfo()' id='showinfo' style='display:inline'>More Info</button>\n"); 15 16 printf("For edit, please go <a href='edit_po.php'>here</a>.<br><br>\n"); 17 printf("<div id='viewinfo' style='display:none'>\n"); 18 echo (file_get_contents("view-info.html")); 19 printf("</div>\n"); 16 20 17 21 $db_id = mysql_pconnect($host, $user, $pw); … … 23 27 mysql_select_db($db); 24 28 25 printf("<table><tbody>\n");26 27 printf("<tr>\n");28 printf("<td valign='top' id='progfield'></td>\n");29 printf("<td valign='top' id='keyfield'></td>\n");30 printf("</tr>\n");31 32 printf("<tr><td colspan='2'>\n");33 //printf("<button onClick='get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");alert(\"wait\");CompareValues();' id='showpo' style='display:inline'>Show Status</button></div>\n");34 printf("<button onClick='get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");CompareValues();' id='showpo' style='display:inline'>Show Status</button></div>\n");35 printf("<button onClick='reset_dates(\"year\", \"empty\", \"empty\", 2);reset_dates(\"year\", \"empty\", \"empty\", 3)' id='resetdates' style='display:inline'>Reset Dates</button></div>\n");36 printf("</td></tr>\n");37 38 printf("<tr>\n");39 for ($i=2; $i<4; $i++)40 {41 printf("<td>\n");42 printf("<input name='dateformat%d' type='radio' onclick='ShowDatePulldown(%d)' value='pulldown' checked>pulldown \n", $i, $i);43 printf("<input name='dateformat%d' type='radio' onclick='ShowDateInput(%d)' value='textinput'>text input \n", $i, $i);44 printf("</td>\n");45 }46 printf("</tr>\n");47 48 29 $query0="SELECT DATE_FORMAT(fValidFrom, '%Y') AS valid FROM History WHERE NOT fValidFrom='0000-00-00 00:00:00' group by valid"; 49 30 $result0=mysql_query($query0, $db_id); 50 31 32 33 printf("<table border='0' cellspacing='2px'><tbody>\n"); 34 35 printf("<tr>\n"); 36 printf("<th bgcolor='#DCFFDC'>Configuration 1</th>\n"); 37 printf("<td colspan='2' align='center'>\n"); 38 printf("<button onClick='get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");CompareValues();' id='showpo' style='display:inline'>Show /<br>Compare</button>\n"); 39 printf("</td>\n"); 40 printf("<th bgcolor='#DCDCFF'>Configuration 2</th>\n"); 41 printf("</tr>\n"); 51 42 52 43 //date fields … … 55 46 for ($i=2; $i<4; $i++) 56 47 { 57 printf("<td>\n"); 48 if ($i==2) 49 printf("<td bgcolor='#DCFFDC'>Date: \n"); 50 else 51 printf("<td bgcolor='#DCDCFF'>Date: \n"); 52 //buttons to show next/prev timestamp 53 printf("<button onClick='get_timestamp(%s, \"next\");get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");CompareValues();' id='nexttimestamp%s' style='display:inline'>Next Time Stamp</button>\n", $i, $i); 54 printf("<button onClick='get_timestamp(%s, \"prev\");get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");CompareValues();' id='prevtimestamp%s' style='display:inline'>Prev Time Stamp</button>\n", $i, $i); 58 55 //input field 59 printf("<div id='dateinput%d' style='display:none'>Date (YYYY-MM-DD hh:mm:ss) \n", $i); 60 printf("<input id=\"statusdate%d\" type=\"text\" size=\"19\" maxlength=\"19\">\n", $i); 61 printf("<button onClick='get_timestamp(%s, \"next\");' id='nextimestamp%s' style='display:inline'>Next Time Stamp</button>\n", $i, $i); 62 printf("<button onClick='get_timestamp(%s, \"prev\");' id='nextimestamp%s' style='display:inline'>Prev Time Stamp</button>\n", $i, $i); 56 printf("<br>\n", $i); 57 printf("<div id='dateinput%d' style='display:none'>(YYYY-MM-DD hh:mm:ss) \n", $i); 58 printf("<input id=\"statusdate%d\" type=\"text\" size=\"19\" maxlength=\"19\"><br>\n", $i); 63 59 printf("</div>\n"); 60 64 61 //pull down menus 65 printf("<div id='datepulldown%d' style='display:inline'> Date:\n", $i);62 printf("<div id='datepulldown%d' style='display:inline'>\n", $i); 66 63 //select for years 67 64 printf("<div id='yearselect%d' style='display:inline'>\n", $i); … … 77 74 printf("<div id='monthselect%d' style='display:inline'>\n", $i); 78 75 printf("<select id='month%d' onchange=\"get_dates('day', this.value, 'empty', %d, 'yes')\">\n", $i, $i); 79 printf("<option value='empty'>-</option>\n"); 80 printf("</select></div>\n"); 76 printf("<option value='empty'>month</option>\n"); 77 printf("</select>\n"); 78 printf("</div>\n"); 81 79 //select for days 82 80 printf("<div id='dayselect%d' style='display:inline'>\n", $i); 83 81 printf("<select id='day%d' onchange=\"get_dates('hour', this.value, 'empty', %d, 'yes')\">\n", $i, $i); 84 printf("<option value='empty'>-</option>\n"); 85 printf("</select></div>\n"); 82 printf("<option value='empty'>day</option>\n"); 83 printf("</select>\n"); 84 printf("</div>\n"); 86 85 //select for hours 87 86 printf("<div id='hourselect%d' style='display:inline'>\n", $i); 88 87 printf("<select id='hour%d' onchange=\"get_dates('min', this.value, 'empty', %d, 'yes')\">\n", $i, $i); 89 printf("<option value='empty'>-</option>\n"); 90 printf("</select></div>\n"); 88 printf("<option value='empty'>hour</option>\n"); 89 printf("</select>\n"); 90 printf("</div>\n"); 91 91 //select for minutes 92 92 printf("<div id='minselect%d' style='display:inline'>\n", $i); 93 93 printf("<select id='min%d' onchange=\"get_dates('sec', this.value, 'empty', %d, 'yes')\">\n", $i, $i); 94 printf("<option value='empty'>-</option>\n"); 95 printf("</select></div>\n"); 94 printf("<option value='empty'>min</option>\n"); 95 printf("</select>\n"); 96 printf("</div>\n"); 96 97 //select for seconds 97 printf("<div id='secselect%d' style='display:inline'><select id='sec%d'>\n", $i, $i); 98 printf("<option value='empty'>-</option>\n"); 99 printf("</select></div>\n"); 98 printf("<div id='secselect%d' style='display:inline'>\n", $i); 99 printf("<select id='sec%d'>\n", $i, $i); 100 printf("<option value='empty'>sec</option>\n"); 101 printf("</select>\n"); 102 printf("</div>\n"); 100 103 //buttton to show next timestamp 101 //printf("<button onClick='get_next_timestamp(%s);' id='nextimestamp%s' style='display:inline'>Next Time Stamp</button>\n", $i, $i); 102 printf("<button onClick='get_timestamp(%s, \"next\");' id='nextimestamp%s' style='display:inline'>Next Time Stamp</button>\n", $i, $i); 103 printf("<button onClick='get_timestamp(%s, \"prev\");' id='nextimestamp%s' style='display:inline'>Prev Time Stamp</button>\n", $i, $i); 104 //printf("<button onClick='get_timestamp(%s, \"next\");get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");CompareValues();' id='nexttimestamp%s' style='display:inline'>Next Time Stamp</button>\n", $i, $i); 105 //printf("<button onClick='get_timestamp(%s, \"prev\");get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");CompareValues();' id='prevtimestamp%s' style='display:inline'>Prev Time Stamp</button>\n", $i, $i); 106 printf("</div>\n"); 107 printf("<br>\n"); 108 109 //radio button to select input-format for date 110 printf("<input name='dateformat%d' type='radio' onclick='ShowDatePulldown(%d)' value='pulldown' checked>pulldown \n", $i, $i); 111 printf("<input name='dateformat%d' type='radio' onclick='ShowDateInput(%d)' value='textinput'>text input \n", $i, $i); 104 112 printf("</td>\n"); 113 114 //reset mysql result to loop again over it 105 115 if ($i==2 && $rowcount > 0) 106 116 mysql_data_seek($result0, 0); 117 118 if ($i==2) 119 printf("<td colspan='2' align='center'><button onClick='reset_dates(\"year\", \"empty\", \"empty\", 2);reset_dates(\"year\", \"empty\", \"empty\", 3);get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");CompareValues();' id='resetdates' style='display:inline'>Reset Dates</button></td>\n"); 107 120 } 108 121 printf("</tr>\n"); 109 122 mysql_free_result($result0); 110 123 124 //print pulldown for programs/key and buttons 125 printf("<tr><td colspan='4'>\n"); 126 printf("<br>Select a subset of program options:\n"); 127 printf("<div id='progfield' style='display:inline'></div>\n"); 128 printf("<div id='keyfield' style='display:inline'></div>\n"); 129 //printf("<button onClick='get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");alert(\"wait\");CompareValues();' id='showpo' style='display:inline'>Show Status</button></div>\n"); 130 printf("</td></tr>\n"); 131 132 //checkboxes to show/hide part of the table 133 printf("<tr>\n"); 134 for ($i=2; $i<4; $i++) 135 { 136 if ($i==2) 137 printf("<td bgcolor='#DCFFDC' colspan='2'>\n"); 138 else 139 printf("<td bgcolor='#DCDCFF' colspan='2'>\n"); 140 printf("Show:\n"); 141 printf("<input type='checkbox' id='sh_indices%d' onclick='ShowHide(\"indices\", \"sh_indices\", %d);'>indices\n", $i, $i); 142 printf("<input type='checkbox' id='sh_validsince%d' onclick='ShowHide(\"validsince\", \"sh_validsince\", %d);'>validsince\n", $i, $i); 143 printf("<input type='checkbox' id='sh_descr%d' onclick='ShowHide(\"description\", \"sh_descr\", %d);'>description\n", $i, $i); 144 printf("<input type='checkbox' id='sh_min%d' onclick='ShowHide(\"minimum\", \"sh_min\", %d);'>min\n", $i, $i); 145 printf("<input type='checkbox' id='sh_max%d' onclick='ShowHide(\"maximum\", \"sh_max\", %d);'>max\n", $i, $i); 146 printf("</td>\n"); 147 } 148 printf("</tr>\n"); 149 111 150 //list of POs 112 151 printf("<tr>\n"); 113 printf("<td ><div id='valuefield2'></div></td>\n");114 printf("<td ><div id='valuefield3'></div></td>\n");152 printf("<td bgcolor='#BEFFBE' colspan='2'><div id='valuefield2'></div></td>\n"); 153 printf("<td bgcolor='#BEBEFF' colspan='2'><div id='valuefield3'></div></td>\n"); 115 154 printf("</tr>\n"); 116 155
Note:
See TracChangeset
for help on using the changeset viewer.