Changeset 11599 for trunk/www/db_po/get_values.php
- Timestamp:
- 07/26/11 10:51:38 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note:
See TracChangeset
for help on using the changeset viewer.