Changeset 11599 for trunk/www/db_po
- Timestamp:
- 07/26/11 10:51:38 (13 years ago)
- Location:
- trunk/www/db_po
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/db_po/get_date.php
r11502 r11599 21 21 if (empty($_GET["fDateValuePrev"])) 22 22 $_GET["fDateValuePrev"]=""; 23 if (empty($_GET["fStatusDate"])) 24 $_GET["fStatusDate"]=""; 23 25 24 26 include("db.php"); … … 43 45 if (strcmp("month",$_GET["fDateName"])==0) 44 46 { 45 $identifier1=" Y";47 $identifier1="%Y"; 46 48 $identifier2="m"; 47 49 $newdatename="day"; … … 49 51 if (strcmp("day",$_GET["fDateName"])==0) 50 52 { 51 $identifier1=" m";53 $identifier1="%Y-%m"; 52 54 $identifier2="d"; 53 55 $newdatename="hour"; … … 55 57 if (strcmp("hour",$_GET["fDateName"])==0) 56 58 { 57 $identifier1=" d";59 $identifier1="%Y-%m-%d"; 58 60 $identifier2="H"; 59 61 $newdatename="min"; … … 61 63 if (strcmp("min",$_GET["fDateName"])==0) 62 64 { 63 $identifier1=" H";65 $identifier1="%Y-%m-%d %H"; 64 66 $identifier2="i"; 65 67 $newdatename="sec"; … … 67 69 if (strcmp("sec",$_GET["fDateName"])==0) 68 70 { 69 $identifier1=" i";71 $identifier1="%Y-%m-%d %H:%i"; 70 72 $identifier2="s"; 71 73 $newdatename=""; … … 80 82 $query0.=" WHERE NOT fValidFrom='0000-00-00 00:00:00' "; 81 83 else 82 $query0.=" WHERE Date_Format(fValidFrom, '%". $identifier1."')=".$_GET["fDateValuePrev"]; 84 $query0.=" WHERE Date_Format(fValidFrom, '". $identifier1."')='".$_GET["fStatusDate"]."'"; 85 //$query0.=" WHERE Date_Format(fValidFrom, '%". $identifier1."')=".$_GET["fDateValuePrev"]; 83 86 $query0.=" GROUP BY valid"; 84 87 $result0=mysql_query($query0, $db_id); 85 88 } 86 //echo $ _GET["fDateValuePrev"];89 //echo $query0; 87 90 88 //echo $query0;89 91 if (empty($newdatename)) 90 92 printf("<select id='%s%d'>\n", $_GET["fDateName"], $_GET["fIdx"]); 91 93 else 92 { 93 //if (empty($identifier1)) 94 //{ 95 printf("<select id='%s%d' onchange=\"get_dates('%s', this.value, this.value, %d, 'yes')\">\n", 96 $_GET["fDateName"], $_GET["fIdx"], $newdatename, $_GET["fIdx"]); 97 //} 98 //else 99 //{ 100 // printf("<select id='%s%d' onchange=\"get_dates('%s', this.value, '%s', %d, 'yes')\">\n", 101 // $_GET["fDateName"], $_GET["fIdx"], $newdatename, $_GET["fDateValuePrev"], $_GET["fIdx"]); 102 //} 103 } 94 printf("<select id='%s%d' onchange=\"get_dates('%s', this.value, this.value, %d, 'yes')\">\n", 95 $_GET["fDateName"], $_GET["fIdx"], $newdatename, $_GET["fIdx"]); 104 96 if (strcmp($_GET["fDateValue"],"empty")!=0) 105 97 printf("<option value='empty'>%s</option>\n", $_GET["fDateName"]); -
trunk/www/db_po/get_keys.php
r11505 r11599 41 41 if (strcmp($_GET["fMode"], "edit")==0) 42 42 printf("select key: <br>\n"); 43 // else 44 // printf("select key: \n"); 45 46 if (strcmp($_GET["fMode"], "view")==0)//reload tables in case of mode 'view' 47 printf("<select style='width:200px' id='key' size='%s' onchange='get_values(1,\"%s\",this.value,\"%s\");get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");CompareValues();' class='Width'>\n", 48 $_GET["fSelectSize"], $_GET["fProgram"], $_GET["fMode"]); 43 49 else 44 printf(" select key: \n");45 printf("<select style='width:200px' id='key' size='%s' onchange=\"get_values(1,'%s',this.value,'%s')\"class='Width'>\n",46 $_GET["fSelectSize"], $_GET["fProgram"], $_GET["fMode"]); 50 printf("<select style='width:200px' id='key' size='%s' onchange=\"get_values(1,'%s',this.value,'%s')\" class='Width'>\n", 51 $_GET["fSelectSize"], $_GET["fProgram"], $_GET["fMode"]); 52 47 53 if (!empty($_GET["fKey"]) && strcmp("all", $_GET["fKey"])==0) 48 54 printf("<option value='all' selected> --- all keys --- </option>\n"); … … 54 60 else 55 61 printf("<option value='%s'>%s </option>\n", $row0[0], $row0[0]); 56 printf("</select>\n <br>\n");62 printf("</select>\n"); 57 63 if (strcmp($_GET["fMode"], "edit")==0) 58 printf("<b utton onClick='addRow(2,\"%s\",\"\",\"\",\"\",\"\");' id='addrowkey' style='display:inline'>Add Key</button>\n", $_GET["fProgram"]);64 printf("<br>\n<button onClick='addRow(2,\"%s\",\"\",\"\",\"\",\"\",\"\",\"\");' id='addrowkey' style='display:inline'>Add Key</button>\n", $_GET["fProgram"]); 59 65 mysql_free_result($result0); 60 66 -
trunk/www/db_po/get_progs.php
r11501 r11599 33 33 if (strcmp($_GET["fMode"], "edit")==0) 34 34 printf("select program: <br>\n"); 35 // else 36 // printf("select program: \n"); 37 38 if (strcmp($_GET["fMode"], "view")==0)//reload tables in case of mode 'view' 39 printf("<select style='width: 120px' id='prog' size='%s' onchange='get_keys(this.value,\"\",\"%s\",\"%s\");get_values(2,\"all\",\"all\");get_values(3,\"all\",\"all\");CompareValues();' class='Width'>\n", 40 $_GET["fSelectSize"], $_GET["fSelectSize"], $_GET["fMode"]); 35 41 else 36 printf(" select program: \n");37 printf("<select style='width: 120px' id='prog' size='%s' onchange=\"get_keys(this.value,'','%s','%s')\" class='Width'>\n",38 $_GET["fSelectSize"], $_GET["fSelectSize"], $_GET["fMode"]); 42 printf("<select style='width: 120px' id='prog' size='%s' onchange=\"get_keys(this.value,'','%s','%s')\" class='Width'>\n", 43 $_GET["fSelectSize"], $_GET["fSelectSize"], $_GET["fMode"]); 44 39 45 if (!empty($_GET["fProgram"]) && strcmp("all", $_GET["fProgram"])==0) 40 46 printf("<option value='all' selected> --- all programs --- </option>\n"); … … 46 52 else 47 53 printf("<option value='%s'>%s </option>\n", $row0[0], $row0[0]); 48 printf("</select>\n <br>\n");54 printf("</select>\n"); 49 55 if (strcmp($_GET["fMode"], "edit")==0) 50 printf("<b utton onClick='addRow(1,\"\",\"\",\"\",\"\",\"\");' id='addrowprog' style='display:inline'>Add Prg/Key</button>\n");56 printf("<br>\n<button onClick='addRow(1,\"\",\"\",\"\",\"\",\"\",\"\",\"\");' id='addrowprog' style='display:inline'>Add Prg/Key</button>\n"); 51 57 mysql_free_result($result0); 52 58 -
trunk/www/db_po/get_values.php
r11505 r11599 45 45 46 46 //get key1 and key2 separately from DB (for function AddRow()) 47 $query2 = "SELECT fKey1, SUBSTRING(fKey2,2), fType FROM ProgramOption WHERE Concat(fKey1,fKey2)='".$_GET["fKey"]."'";47 $query2 = "SELECT fKey1, SUBSTRING(fKey2,2), fType, fMin, fMax FROM ProgramOption WHERE Concat(fKey1,fKey2)='".$_GET["fKey"]."'"; 48 48 $result2=mysql_query($query2, $db_id); 49 49 $row2 = mysql_fetch_row($result2); … … 51 51 $key2=$row2[1]; 52 52 $type=$row2[2]; 53 $min=$row2[3]; 54 $max=$row2[4]; 53 55 mysql_free_result($result2); 54 56 55 $query0 ="SELECT fIndex, fValidFrom, fProgram, Concat(fKey1,fKey2), fValue, fDescription, fCounter, fType, fMin, fMax, fKey1, SUBSTRING(fKey2,2), if(fOriginalIndex=0, fIndex, fOriginalIndex) FROM ProgramOption "; 57 $query0 ="SELECT fIndex, fValidFrom, fProgram, Concat(fKey1,fKey2), fValue, "; 58 $query0.="fDescription, fCounter, fType, fMin, fMax, fKey1, SUBSTRING(fKey2,2), "; 59 $query0.="if(fOriginalIndex=0, fIndex, fOriginalIndex), fUser FROM ProgramOption "; 56 60 $query0.="WHERE 1=1 "; 57 61 if (strcmp($_GET["fKey"],"all")!=0) … … 74 78 printf("<button onClick='ShowCurrent();' id='showcurrent' style='display:none'>Show Current</button>\n"); 75 79 printf("<button onClick='ShowAll();' id='showall' style='display:inline'>Show History</button>\n"); 76 printf("<button onClick='addRow(3, \"%s\",\"%s\",\"%s\",\"%s\",\"%s\" );' id='addrowvals' style='display:inline'>Add Value</button>\n",77 $_GET["fProgram"], $_GET["fKey"], $key1, $key2, $type );80 printf("<button onClick='addRow(3, \"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\");' id='addrowvals' style='display:inline'>Add Value</button>\n", 81 $_GET["fProgram"], $_GET["fKey"], $key1, $key2, $type, $min, $max); 78 82 } 79 printf("<table font-size='-1' border='1' width='100px' height='100px'><tbody id='valtable%s'>\n", $_GET["fGetValCase"]); 83 84 if ($_GET["fGetValCase"]==1)//show only in edit mode 85 $generalshowhide=''; 86 else 87 $generalshowhide='none'; 88 89 printf("<table font-size='-1' border='0' cellspacing='5px' width='100%%'><tbody id='valtable%s'>\n", $_GET["fGetValCase"]); 80 90 printf("<tr>"); 81 printf("<th >Index / Orig / Counter</th>\n");82 printf("<th >Valid since</th>\n");91 printf("<th class='indices%d' style='display:%s'>Idx/Orig/Ctr</th>\n",$_GET["fGetValCase"], $generalshowhide); 92 printf("<th class='validsince%d' style='display:%s'>Valid since</th>\n", $_GET["fGetValCase"], $generalshowhide); 83 93 printf("<th>Program</th>\n"); 84 94 //printf("<th>Key</th>\n"); … … 87 97 printf("<th>Value</th>\n"); 88 98 printf("<th>Type</th>\n"); 89 if ($_GET["fGetValCase"]==1)//show only in edit mode 90 printf("<th class='description%d'>Description</th>\n", $_GET["fGetValCase"]); 91 else 92 printf("<th class='description%d' style='display:none'>Description</th>\n", $_GET["fGetValCase"]); 99 printf("<th class='minimum%d' style='display:%s'>Min</th>\n", $_GET["fGetValCase"], $generalshowhide); 100 printf("<th class='maximum%d' style='display:%s'>Max</th>\n", $_GET["fGetValCase"], $generalshowhide); 101 printf("<th class='description%d' style='display:%s'>Description</th>\n", $_GET["fGetValCase"], $generalshowhide); 93 102 if ($_GET["fGetValCase"]==1)//show only in edit mode 94 103 printf("<th>Action</th>\n"); 95 printf("<th>Min</th>\n"); 96 printf("<th>Max</th>\n"); 104 printf("<th class='user%d' style='display:%s'>User</th>\n", $_GET["fGetValCase"], $generalshowhide); 97 105 printf("</tr>\n"); 98 106 $maxindex=0; … … 103 111 { 104 112 if ($row0[6]==$counter) 105 printf("<tr id='new%s' style='display:' >\n", $row0[0]);113 printf("<tr id='new%s' style='display:' bgcolor='#E2E2E2'>\n", $row0[0]); 106 114 else 107 printf("<tr id='old%s' style='display:none' >\n", $row0[0]);115 printf("<tr id='old%s' style='display:none' bgcolor='#EBEBEB'>\n", $row0[0]); 108 116 } 109 117 else 110 printf("<tr id='%scompare%s' style='display:' >\n", $_GET["fGetValCase"], $row0[12]);118 printf("<tr id='%scompare%s' style='display:' bgcolor='white'>\n", $_GET["fGetValCase"], $row0[12]); 111 119 112 printf("<td> %s / %s / %s <div id='%dorigindex%s' style='display:none'>%s</div> </td>\n", 113 $row0[0], $row0[12], $row0[6], $_GET["fGetValCase"], $row0[0], $row0[12]); 120 printf("<td class='indices%d' style='display:%s'> %s / %s / %s <div id='%dorigindex%s' style='display:none'>%s</div> </td>\n", 121 $_GET["fGetValCase"], $generalshowhide, $row0[0], $row0[12], $row0[6], $_GET["fGetValCase"], $row0[0], $row0[12]); 122 //valid from 114 123 if (strcmp('0000-00-00 00:00:00', $row0[1])==0) 115 printf("<td id='notyetvalid%s'> %s </td>\n", $row0[0], $row0[1]);124 printf("<td class='validsince%d' style='display:%s' id='notyetvalid%s'> %s </td>\n", $_GET["fGetValCase"], $generalshowhide, $row0[0], $row0[1]); 116 125 else 117 printf("<td> %s </td>\n", $row0[1]); 126 printf("<td class='validsince%d' style='display:%s'> %s </td>\n", $_GET["fGetValCase"], $generalshowhide, $row0[1]); 127 //program 118 128 printf("<td id='prog%s'>%s</td>\n", $row0[0], $row0[2]); 129 //keys 119 130 //printf("<td id='key%s'>%s</td>\n", $row0[0], $row0[3]); 120 131 printf("<td id='1key%s'>%s</td>\n", $row0[0], $row0[10]); 121 132 printf("<td id='2key%s'>%s</td>\n", $row0[0], $row0[11]); 133 //value 122 134 printf("<td align='right' id='val%s'>%s</td>\n", $row0[0], $row0[4]); 135 //type 123 136 printf("<td id='type%s'>%s</td>\n", $row0[0], $row0[7]); 124 if ($_GET["fGetValCase"]==1)//show only in edit mode 125 printf("<td class='description%d' id='descr%s'>%s</td>\n", $_GET["fGetValCase"], $row0[0], $row0[5]); 126 else 127 printf("<td class='description%d' style='display:none' id='descr%s'>%s</td>\n", $_GET["fGetValCase"], $row0[0], $row0[5]); 137 //min 138 printf("<td class='minimum%d' style='display:%s' id='min%s'>%s</td>\n", $_GET["fGetValCase"], $generalshowhide, $row0[0], $row0[8]); 139 //max 140 printf("<td class='maximum%d' style='display:%s' id='max%s'>%s</td>\n", $_GET["fGetValCase"], $generalshowhide, $row0[0], $row0[9]); 141 //descripton 142 printf("<td class='description%d' style='display:%s' id='descr%s'>%s</td>\n", $_GET["fGetValCase"], $generalshowhide, $row0[0], $row0[5]); 143 //action 128 144 if ($_GET["fGetValCase"]==1)//show only in edit mode 129 145 { … … 133 149 printf("<td id='action%s'></td>\n", $row0[0]); 134 150 } 135 printf("<td id='min%s'>%s</td>\n", $row0[0], $row0[8]);136 printf("<td id='max%s'>%s</td>\n", $row0[0], $row0[9]);151 //user 152 printf("<td class='user%d' style='display:%s' id='user%s'>%s</td>\n", $_GET["fGetValCase"], $generalshowhide, $row0[0], $row0[13]); 137 153 printf("</tr>\n"); 138 154 if ($row0[0]>$maxindex) … … 144 160 printf("<button onClick='ShowCurrent();' id='showcurrent2' style='display:none'>Show Current</button>\n"); 145 161 printf("<button onClick='ShowAll();' id='showall2' style='display:inline'>Show History</button>\n"); 146 printf("<button onClick='addRow(3,\"%s\",\"%s\",\"%s\",\"%s\",\"%s\" );' id='addrowvals2' style='display:inline'>Add Value</button>\n",147 $_GET["fProgram"], $_GET["fKey"], $key1, $key2, $type );162 printf("<button onClick='addRow(3,\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\");' id='addrowvals2' style='display:inline'>Add Value</button>\n", 163 $_GET["fProgram"], $_GET["fKey"], $key1, $key2, $type, $min, $max); 148 164 } 165 /* 149 166 else 150 167 { 151 printf("<button onClick='HideDescription(%d);' id='hidedescr%d' style='display:none'>Hide Description</button>\n", $_GET["fGetValCase"], $_GET["fGetValCase"]); 152 printf("<button onClick='ShowDescription(%d);' id='showdescr%d' style='display:'>Show Description</button>\n", $_GET["fGetValCase"], $_GET["fGetValCase"]); 168 printf("Show:\n"); 169 printf("<input type='checkbox' id='sh_indices%d' onclick='ShowHide(\"indices\", \"sh_indices\", %d);'>indices\n", $_GET["fGetValCase"], $_GET["fGetValCase"]); 170 printf("<input type='checkbox' id='sh_validsince%d' onclick='ShowHide(\"validsince\", \"sh_validsince\", %d);'>validsince\n", $_GET["fGetValCase"], $_GET["fGetValCase"]); 171 printf("<input type='checkbox' id='sh_descr%d' onclick='ShowHide(\"description\", \"sh_descr\", %d);'>description\n", $_GET["fGetValCase"], $_GET["fGetValCase"]); 172 printf("<input type='checkbox' id='sh_min%d' onclick='ShowHide(\"minimum\", \"sh_min\", %d);'>min\n", $_GET["fGetValCase"], $_GET["fGetValCase"]); 173 printf("<input type='checkbox' id='sh_max%d' onclick='ShowHide(\"maximum\", \"sh_max\", %d);'>max\n", $_GET["fGetValCase"], $_GET["fGetValCase"]); 153 174 } 175 */ 154 176 155 177 if ($_GET["fGetValCase"]==3) -
trunk/www/db_po/insert_po.php
r11505 r11599 46 46 if (empty($_GET["fOriginalIndex"])) 47 47 $_GET["fOriginalIndex"]=""; 48 48 if (empty($_GET["fMin"])) 49 $_GET["fMin"]=""; 50 if (empty($_GET["fMax"])) 51 $_GET["fMax"]=""; 52 53 if (empty($_SERVER['PHP_AUTH_USER'])) 54 { 55 // be careful, this output is evaluated by UpdateRow() in po.js 56 echo "user empty"; 57 return; 58 } 49 59 include("db.php"); 50 60 $db_id = mysqli_connect($host, $user, $pw, $db); … … 142 152 if (!empty($_GET["fOriginalIndex"])) 143 153 $query0.=", fOriginalIndex='".$_GET["fOriginalIndex"]."'"; 154 if (!empty($_GET["fMin"])) 155 $query0.=", fMin='".$_GET["fMin"]."'"; 156 if (!empty($_GET["fMax"])) 157 $query0.=", fMax='".$_GET["fMax"]."'"; 158 $query0.=", fUser='".$_SERVER['PHP_AUTH_USER']."'"; 144 159 $query0.=", fKey1='".$_GET["fKey1"]."'"; 145 160 $query0.=", fKey2='.".$_GET["fKey2"]."'"; -
trunk/www/db_po/po.js
r11505 r11599 60 60 min=document.getElementById('min'+getvalcase).value; 61 61 sec=document.getElementById('sec'+getvalcase).value; 62 if (year=="empty") 63 statusdate=""; 64 else 65 { 66 statusdate=year; 67 if (month!="empty") 68 { 69 statusdate=statusdate+"-"+month; 70 if (day!="empty") 71 { 72 statusdate=statusdate+"-"+day; 73 if (hour!="empty") 74 { 75 statusdate=statusdate+" "+hour; 76 if (min!="empty") 77 { 78 statusdate=statusdate+":"+min; 79 if (sec!="empty") 80 statusdate=statusdate+":"+sec; 81 } 82 } 83 } 84 } 85 } 62 63 statusdate=(year =='empty'? '':year); 64 statusdate=statusdate+(month=='empty'? '':'-'+month); 65 statusdate=statusdate+(day =='empty'? '':'-'+day); 66 statusdate=statusdate+(hour =='empty'? '':' '+hour); 67 statusdate=statusdate+(min =='empty'? '':':'+min); 68 statusdate=statusdate+(sec =='empty'? '':':'+sec); 86 69 } 87 70 if (val=="textinput") … … 93 76 function get_values(getvalcase, prog, key, mode) 94 77 { 78 //in this case the given 'prog' and 'key' are ignored 95 79 if (parseInt(getvalcase)>1) 96 80 { … … 113 97 key="all"; 114 98 } 115 if (mode=="view" && getvalcase==1) 116 return; 117 //if (getvalcase==3) 118 // document.getElementById('comparevals').style.display = ""; 99 //if (mode=="view" && getvalcase==1) 100 // return; 101 119 102 if ((getvalcase==2 || getvalcase==3) && document.getElementById('statusdate'+getvalcase)) 120 103 { 121 104 statusdate=get_statusdate(getvalcase); 122 //alert(statusdate);123 105 phpcall="get_values.php?fStatusDate="+statusdate+"&fGetValCase="+getvalcase+"&fKey="+key+"&fProgram="+prog; 124 106 } … … 137 119 } 138 120 139 function addRow(addcase, prog, key, key1, key2, type )121 function addRow(addcase, prog, key, key1, key2, type, min, max) 140 122 { 141 123 if (!prog) … … 161 143 { 162 144 case 1: 163 get_keys(prog, key,"10", "edit");145 get_keys(prog, key, "10", "edit"); 164 146 case 2: 165 get_values(1, prog, key );147 get_values(1, prog, key, "edit"); 166 148 } 167 149 … … 180 162 row=document.createElement("TR"); 181 163 row.id='val0'; 164 row.bgColor='#C8C8C8'; 182 165 cell0 = document.createElement("TD"); 183 166 cell1 = document.createElement("TD"); … … 196 179 // 1: add new prog+key, val=NULL 197 180 // 2: add new key, val=NULL, prog=selected 198 // 3: add new val, prog=selected, key=selected, type fixed181 // 3: add new val, prog=selected, key=selected, type/min/max fixed 199 182 switch(addcase) 200 183 { 201 184 case 1: 185 updcase=5; 202 186 //field for prog 203 187 input1 = document.createElement("INPUT"); 188 input1.style.width = 80; 204 189 input1.id = 'prog0'; 205 190 cell1.appendChild(input1); 206 191 //fields for keys 207 192 input2 = document.createElement("INPUT"); 193 input2.style.width = 100; 208 194 input2.id = '1key0'; 209 195 cell2.appendChild(input2); 210 196 input10 = document.createElement("INPUT"); 211 197 input10.id = '2key0'; 198 input10.style.width = 100; 212 199 cell10.appendChild(input10); 213 200 //field for val … … 215 202 textnode3=document.createTextNode("NULL"); 216 203 cell3.appendChild(textnode3); 217 updcase=5;218 204 //field type 219 205 select7 = document.createElement("select"); … … 245 231 select7.appendChild(option7e); 246 232 cell7.appendChild(select7); 233 //field for min 234 input8 = document.createElement("INPUT"); 235 input8.id = 'newmin0'; 236 input8.style.width = 50; 237 cell8.appendChild(input8); 238 //field for max 239 input9 = document.createElement("INPUT"); 240 input9.id = 'newmax0'; 241 input9.style.width = 50; 242 cell9.appendChild(input9); 247 243 break; 248 244 case 2: 245 updcase=1; 249 246 //field for prog 250 247 cell1.id = 'prog0'; … … 254 251 input2 = document.createElement("INPUT"); 255 252 input2.id = '1key0'; 253 input2.style.width = 100; 256 254 cell2.appendChild(input2); 257 255 input10 = document.createElement("INPUT"); 258 256 input10.id = '2key0'; 257 input10.style.width = 100; 259 258 cell10.appendChild(input10); 260 259 //field for val … … 262 261 textnode3=document.createTextNode("NULL"); 263 262 cell3.appendChild(textnode3); 264 updcase=1;265 263 //field type 266 264 select7 = document.createElement("select"); … … 292 290 select7.appendChild(option7e); 293 291 cell7.appendChild(select7); 292 //field for min 293 input8 = document.createElement("INPUT"); 294 input8.id = 'newmin0'; 295 input8.style.width = 50; 296 cell8.appendChild(input8); 297 //field for max 298 input9 = document.createElement("INPUT"); 299 input9.id = 'newmax0'; 300 input9.style.width = 50; 301 cell9.appendChild(input9); 294 302 break; 295 303 case 3: 304 updcase=2; 296 305 //field for prog 297 306 cell1.id = 'prog0'; … … 307 316 //field for val 308 317 input3 = document.createElement("INPUT"); 318 input3.style.width = 100; 309 319 input3.id = 'newval0'; 310 320 cell3.appendChild(input3); 311 updcase=2;312 321 //field type 313 322 cell7.id = 'type0'; 314 323 textnode7 = document.createTextNode(type); 315 324 cell7.appendChild(textnode7); 325 //field min 326 cell8.id = 'min0'; 327 textnode8 = document.createTextNode(min); 328 cell8.appendChild(textnode8); 329 //field max 330 cell9.id = 'max0'; 331 textnode9 = document.createTextNode(max); 332 cell9.appendChild(textnode9); 316 333 break; 317 334 default: … … 321 338 //field descr 322 339 input4 = document.createElement("INPUT"); 340 input4.style.width = 200; 323 341 input4.id = 'newdescr0'; 324 342 cell4.appendChild(input4); … … 342 360 row.appendChild(cell3);//value 343 361 row.appendChild(cell7);//type 362 row.appendChild(cell8);//min 363 row.appendChild(cell9);//max 344 364 row.appendChild(cell4);//descr 345 365 row.appendChild(cell5);//action 346 row.appendChild(cell8);//min347 row.appendChild(cell9);//max348 366 tabBody.appendChild(row); 349 367 350 // to be removed later when solution for adding multiple new rows is found 368 //disabeling all other edit/add buttons 369 // (to be removed later when solution for adding multiple new rows is found) 351 370 document.getElementById('addrowvals').style.display = "none"; 352 371 document.getElementById('addrowvals2').style.display = "none"; … … 369 388 } 370 389 //reload the original content in case of cancel 371 get_values(1, prog, key); 372 373 // to be removed later when solution for adding multiple new rows is found 390 get_values(1, prog, key, "edit"); 391 392 //disabeling all other edit/add buttons 393 // (to be removed later when solution for adding multiple new rows is found) 374 394 document.getElementById('addrowvals').style.display = ""; 375 395 document.getElementById('addrowvals2').style.display = ""; … … 381 401 { 382 402 //get select program and key 403 document.getElementById('addrowprog').style.display = ""; 383 404 progselect=document.getElementById("prog"); 384 405 prog=progselect.options[progselect.selectedIndex].value; … … 386 407 key=keyselect.options[keyselect.selectedIndex].value; 387 408 //reload the original table in case of cancel 388 get_values(1, prog, key );409 get_values(1, prog, key, "edit"); 389 410 } 390 411 391 412 function EditRow(index) 392 413 { 414 //disabeling all other edit/add buttons 415 // (to be removed later when solution for adding multiple new rows is found) 393 416 for (var i = 1 ; i <= document.getElementById('maxindex').innerHTML ; i++) 394 417 if(document.getElementById('action'+i) && i!=index) 395 //document.getElementById('action'+i).innerHTML = "";396 418 document.getElementById('action'+i).style.display = "none"; 419 document.getElementById('addrowvals').style.display = "none"; 420 document.getElementById('addrowvals2').style.display = "none"; 421 document.getElementById('addrowkey').style.display = "none"; 422 document.getElementById('addrowprog').style.display = "none"; 397 423 398 424 //get current values … … 458 484 // 5: add new prog + key addcase 1 459 485 // 1: add new key addcase 2 460 // 2: add new val (for same key) addcase 3 -> same type 461 // 3: edit val -> same type 462 // 4: delete val (ie set to NULL) -> same type 486 // 2: add new val (for same key) addcase 3 -> same type,min,max 487 // 3: edit val -> same type,min,max 488 // 4: delete val (ie set to NULL) -> same type,min,max 463 489 // 6: delete new key (ie val still NULL) -> real delete 464 490 descr=document.getElementById('newdescr'+index).value; … … 472 498 val=document.getElementById('newval'+index).innerHTML; 473 499 type=document.getElementById('newtype'+index).value; 500 min=document.getElementById('newmin'+index).value; 501 max=document.getElementById('newmax'+index).value; 474 502 break; 475 503 case 1: … … 480 508 val=document.getElementById('newval'+index).innerHTML; 481 509 type=document.getElementById('newtype'+index).value; 510 min=document.getElementById('newmin'+index).value; 511 max=document.getElementById('newmax'+index).value; 482 512 break; 483 513 case 2: … … 488 518 val=document.getElementById('newval'+index).value; 489 519 type=document.getElementById('type'+index).innerHTML; 520 min=document.getElementById('min'+index).innerHTML; 521 max=document.getElementById('max'+index).innerHTML; 490 522 break; 491 523 case 3: … … 494 526 key2=document.getElementById('2key'+index).innerHTML; 495 527 type=document.getElementById('type'+index).innerHTML; 528 min=document.getElementById('min'+index).innerHTML; 529 max=document.getElementById('max'+index).innerHTML; 496 530 val="hallo"; 497 531 if (type=="bool") … … 518 552 val="NULL"; 519 553 type=document.getElementById('type'+index).innerHTML; 554 min=document.getElementById('min'+index).innerHTML; 555 max=document.getElementById('max'+index).innerHTML; 520 556 origindex=document.getElementById('1origindex'+index).innerHTML; 521 557 break; … … 533 569 if (index==0) 534 570 index=-1; 535 536 //check if value has correct type 571 if (!type && (updcase==2 || updcase==3 || updcase==4)) 572 { 573 alert("Please select type!"); 574 return; 575 } 576 577 //check if value has correct type and is within ranges 537 578 // for string no check needed 538 579 if (updcase==3) … … 553 594 return; 554 595 } 555 } 556 if (!type && (updcase==2 || updcase==3 || updcase==4)) 557 { 558 alert("Please select type!"); 559 return; 560 } 561 562 phpcall="insert_po.php?fUpdCase="+updcase+"&fIndex="+index+"&fOriginalIndex="+origindex+"&fProgram="+prog 563 +"&fKey1="+key1+"&fKey2="+key2+"&fValue="+val+"&fDescription="+descr+"&fType="+type; 596 // check ranges for int 597 if (type=='int' && parseInt(val)>parseInt(max)) 598 { 599 alert("You cannot enter a value larger than "+max+"."); 600 return; 601 } 602 if (type=='int' && parseInt(val)<parseInt(min)) 603 { 604 alert("You cannot enter a value smaller than "+min+"."); 605 return; 606 } 607 // check ranges for float 608 if (type=='float' && parseFloat(val)>parseFloat(max)) 609 { 610 alert("You cannot enter a value larger than "+max+"."); 611 return; 612 } 613 if (type=='float' && parseFloat(val)<parseFloat(min)) 614 { 615 alert("You cannot enter a value smaller than "+min+"."); 616 return; 617 } 618 } 619 620 if (!min && (type=='int' || type=='float')) 621 { 622 alert("Please insert minimum!"); 623 return; 624 } 625 if (!max && (type=='int' || type=='float')) 626 { 627 alert("Please insert maximum!"); 628 return; 629 } 630 //check if min/max have correct type 631 // for string no check needed 632 if (updcase==1 || updcase==5) 633 { 634 if (type=='int' && parseInt(min)!=min) 635 { 636 alert("Minimum is not a int."); 637 return; 638 } 639 if (type=='int' && parseInt(max)!=max) 640 { 641 alert("Maximum is not a int."); 642 return; 643 } 644 if (type=='float' && parseFloat(min)!=min) 645 { 646 alert("Minimum is not a float."); 647 return; 648 } 649 if (type=='float' && parseFloat(max)!=max) 650 { 651 alert("Maximum is not a float."); 652 return; 653 } 654 } 655 656 phpcall="insert_po.php?fUpdCase="+updcase+"&fIndex="+index+"&fOriginalIndex="+origindex 657 +"&fProgram="+prog+"&fKey1="+key1+"&fKey2="+key2+"&fValue="+val+"&fDescription="+descr 658 +"&fType="+type+"&fMin="+min+"&fMax="+max; 564 659 //alert(phpcall); 565 660 … … 584 679 { 585 680 alert("This program already exists. You cannot insert it a second time."); 681 return; 682 } 683 if (xmlhttp.responseText=="user empty") 684 { 685 alert("User name is missing. Please give a user name when logging in."); 586 686 return; 587 687 } … … 648 748 { 649 749 var x=document.getElementById('valtable'+table).insertRow(row); 650 for (var i = 0 ; i < 9 ; i++) 651 { 652 y=x.insertCell(i); 653 y.innerHTML=" "; 654 } 750 y=x.insertCell(0); 751 y.colSpan='5'; 752 y.innerHTML=" "; 655 753 } 656 754 … … 660 758 maxindex2=document.getElementById('maxindex').innerHTML; 661 759 maxindex3=document.getElementById('maxindex3').innerHTML; 662 //alert(maxindex2);663 //alert(maxindex3);664 760 if (parseInt(maxindex2)>parseInt(maxindex3)) 665 761 maxindex=maxindex2; … … 697 793 } 698 794 //document.getElementById('comparevals').style.display = "none"; 699 } 700 701 function HideDescription(getvalcase) 702 { 795 796 //reload all setting for show-menu 797 ShowHide('indices', 'sh_indices', 2) 798 ShowHide('indices', 'sh_indices', 3) 799 ShowHide('description', 'sh_descr', 2) 800 ShowHide('description', 'sh_descr', 3) 801 ShowHide('validsince', 'sh_validsince', 2) 802 ShowHide('validsince', 'sh_validsince', 3) 803 ShowHide('minimum', 'sh_min', 2) 804 ShowHide('minimum', 'sh_min', 3) 805 ShowHide('maximum', 'sh_max', 2) 806 ShowHide('maximum', 'sh_max', 3) 807 } 808 809 function ShowHide(column, idname, getvalcase) 810 { 811 box=document.getElementById(idname+getvalcase); 812 text=box.checked? '':'none'; 813 703 814 for(var i=0;i<document.getElementsByTagName('*').length;i++) 704 if(document.getElementsByTagName('*')[i].className == 'description'+getvalcase) 705 document.getElementsByTagName('*')[i].style.display = 'none'; 706 document.getElementById('hidedescr'+getvalcase).style.display = "none"; 707 document.getElementById('showdescr'+getvalcase).style.display = ""; 708 } 709 710 function ShowDescription(getvalcase) 711 { 712 for(var i=0;i<document.getElementsByTagName('*').length;i++) 713 if(document.getElementsByTagName('*')[i].className == 'description'+getvalcase) 714 document.getElementsByTagName('*')[i].style.display = ''; 715 document.getElementById('showdescr'+getvalcase).style.display = "none"; 716 document.getElementById('hidedescr'+getvalcase).style.display = ""; 815 if(document.getElementsByTagName('*')[i].className == column+getvalcase) 816 document.getElementsByTagName('*')[i].style.display = text; 717 817 } 718 818 … … 773 873 document.getElementById('statusdate'+idx).value=""; 774 874 } 875 775 876 function get_dates(datename, dateval, datevalprev, idx, reset) 776 877 { 777 878 //alert(datename+"_"+dateval+"_"+datevalprev+"_"+idx); 778 phpcall="get_date.php?fDateValue="+dateval+"&fDateValuePrev="+datevalprev+"&fDateName="+datename+"&fIdx="+idx; 879 statusdate=get_statusdate(idx); 880 //if (datename=="year") 881 // statusdate=""; 882 //alert(datename+" === "+statusdate+" --- "+datevalprev); 883 phpcall="get_date.php?fDateValue="+dateval+"&fDateValuePrev="+datevalprev+"&fDateName="+datename+"&fIdx="+idx+"&fStatusDate="+statusdate; 884 //phpcall="get_date.php?fDateValue="+dateval+"&fDateValuePrev="+statusdate+"&fDateName="+datename+"&fIdx="+idx; 779 885 //alert(phpcall); 780 886 xmlhttp.open("GET",phpcall,false); … … 792 898 function set_statusdate(getvalcase, statusdate) 793 899 { 794 //alert(statusdate); 795 900 //get info whether to get statusdate from pulldown or input 796 901 radio=document.getElementsByName('dateformat'+getvalcase); 797 902 for (i=0; i< radio.length; i++) 798 903 if (radio[i].checked) 799 904 val=radio[i].value; 800 if (val=="pulldown") 801 { 802 //check whole string 803 if (statusdate=="") 804 { 805 //set all values to 'empty' 806 get_dates("year", "empty", "empty", getvalcase, "yes"); 807 return; 808 } 809 dates=statusdate.split("-",3); 810 //check year 811 if (!dates[0]) 812 { 813 get_dates("year", "empty", "empty", getvalcase, "yes"); 814 return; 815 } 816 else 817 get_dates("year", dates[0], dates[0], getvalcase); 818 //check month 819 if (!dates[1]) 820 { 821 get_dates("month", "empty", "empty", getvalcase, "yes"); 822 return; 823 } 824 else 825 get_dates("month", dates[1], dates[0], getvalcase); 826 //check rest of string 827 if (!dates[2]) 828 { 829 get_dates("day", "empty", "empty", getvalcase, "yes"); 830 return; 831 } 832 rests=dates[2].split(" ",2); 833 //check day 834 if (!rests[0]) 835 { 836 get_dates("day", "empty", "empty", getvalcase, "yes"); 837 return; 838 } 839 else 840 get_dates("day", rests[0], dates[1], getvalcase); 841 //check rest of string 842 if (!rests[1]) 843 { 844 get_dates("hour", "empty", "empty", getvalcase, "yes"); 845 return; 846 } 847 times=rests[1].split(":",3); 848 //check hour 849 if (!times[0]) 850 { 851 get_dates("hour", "empty", "empty", getvalcase, "yes"); 852 return; 853 } 854 else 855 get_dates("hour", times[0], rests[0], getvalcase); 856 //check minutes 857 if (!times[1]) 858 { 859 get_dates("min", "empty", "empty", getvalcase, "yes"); 860 return; 861 } 862 else 863 get_dates("min", times[1], times[0], getvalcase); 864 //check seconds 865 if (!times[2]) 866 { 867 get_dates("sec", "empty", "empty", getvalcase, "yes"); 868 return; 869 } 870 else 871 get_dates("sec", times[2], times[1], getvalcase); 872 873 } 905 874 906 if (val=="textinput") 907 { 875 908 document.getElementById('statusdate'+getvalcase).value=statusdate; 876 909 return 910 } 911 912 //val=="pulldown" 913 //reset date pulldowns 914 get_dates("year", "empty", "empty", getvalcase, "yes"); 915 916 //whole string (YYYY-MM-DD hh:mm:ss) 917 if (statusdate=="") 918 return; 919 920 dates=statusdate.split("-",3); 921 //years 922 if (!dates[0]) 923 return; 924 get_dates("year", dates[0], dates[0], getvalcase); 925 926 //months 927 if (!dates[1]) 928 return; 929 get_dates("month", dates[1], dates[0], getvalcase); 930 931 //rest of string (DD hh:mm:ss) 932 if (!dates[2]) 933 return; 934 935 rests=dates[2].split(" ",2); 936 //days 937 if (!rests[0]) 938 return; 939 get_dates("day", rests[0], dates[1], getvalcase); 940 941 //rest of string (hh:mm:ss) 942 if (!rests[1]) 943 return; 944 945 times=rests[1].split(":",3); 946 //hours 947 if (!times[0]) 948 return; 949 get_dates("hour", times[0], rests[0], getvalcase); 950 951 //minutes 952 if (!times[1]) 953 return; 954 get_dates("min", times[1], times[0], getvalcase); 955 956 //seconds 957 if (!times[2]) 958 return; 959 get_dates("sec", times[2], times[1], getvalcase); 877 960 } 878 961 … … 882 965 statusdate=get_statusdate(getvalcase); 883 966 967 // get next or previous timestamp 884 968 xmlhttp.open("GET","get_timestamp.php?fStatusDate="+statusdate+"&fDirection="+direction,false); 885 969 xmlhttp.send(); … … 891 975 set_statusdate(getvalcase, newstatusdate); 892 976 } 977 978 function show_viewinfo() 979 { 980 if (document.getElementById('showinfo').innerHTML=='Hide Info') 981 { 982 document.getElementById('viewinfo').style.display='none'; 983 document.getElementById('showinfo').innerHTML='Show Info'; 984 } 985 else 986 { 987 document.getElementById('viewinfo').style.display=''; 988 document.getElementById('showinfo').innerHTML='Hide Info'; 989 } 990 991 } 992 -
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.