- Timestamp:
- 09/06/11 22:32:35 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/db_po/get_values.php
r11977 r11989 45 45 46 46 //get key1 and key2 separately from DB (for function AddRow()) 47 $query2 = "SELECT fKey1, SUBSTRING(fKey2,2), fType, fMin, fMax FROM ProgramOption WHERE Concat(fKey1,fKey2)='".$_GET["fKey"]."'"; 47 $query2 = "SELECT fKey1, SUBSTRING(fKey2,2), fType, fMin, fMax, fDescription "; 48 $query2 .= "FROM ProgramOption WHERE Concat(fKey1,fKey2)='".$_GET["fKey"]."' ORDER BY fValidFrom DESC LIMIT 0,1"; 48 49 $result2=mysql_query($query2, $db_id); 49 50 $row2 = mysql_fetch_row($result2); 50 $key1=$row2[0]; 51 $key2=$row2[1]; 52 $type=$row2[2]; 53 $min=$row2[3]; 54 $max=$row2[4]; 51 //get values from result 52 $key1 =$row2[0]; 53 $key2 = $row2[1]; 54 $type = $row2[2]; 55 $min = $row2[3]; 56 $max = $row2[4]; 57 $descr = $row2[5]; 55 58 mysql_free_result($result2); 56 59 … … 78 81 printf("<button onClick='ShowCurrent();' id='showcurrent' style='display:none'>Show Current</button>\n"); 79 82 printf("<button onClick='ShowAll();' id='showall' style='display:inline'>Show History</button>\n"); 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 );83 printf("<button onClick='addRow(3, \"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\");' id='addrowvals' style='display:inline'>Add Value</button>\n", 84 $_GET["fProgram"], $_GET["fKey"], $key1, $key2, $type, $min, $max, $descr); 82 85 } 83 86 … … 145 148 { 146 149 if ($row0[6]==$counter) 147 printf("<td id='action%s'><input type='button' value='Edit' onclick='EditRow(\"%s\")'></td>\n", $row0[0], $row0[0]); 150 { 151 printf("<td id='action%s'>\n", $row0[0]); 152 printf("<input type='button' value='Edit' onclick='EditRow(\"%s\")'>\n", $row0[0]); 153 printf("<input type='button' value='Copy Key' onclick='addRow(2,\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\");' id='copyval' style='display:inline'>\n", 154 $_GET["fProgram"], $_GET["fKey"], $key1, $key2, $type, $min, $max, $descr); 155 //missing here descr(, key1, key2, val?) 156 // in po.js: add descr, key1, key2, min, max in AddRow 157 printf("</td>\n"); 158 } 148 159 else 149 160 printf("<td id='action%s'></td>\n", $row0[0]); … … 160 171 printf("<button onClick='ShowCurrent();' id='showcurrent2' style='display:none'>Show Current</button>\n"); 161 172 printf("<button onClick='ShowAll();' id='showall2' style='display:inline'>Show History</button>\n"); 162 printf("<button onClick='addRow(3,\"%s\",\"%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 );173 printf("<button onClick='addRow(3,\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\");' id='addrowvals2' style='display:inline'>Add Value</button>\n", 174 $_GET["fProgram"], $_GET["fKey"], $key1, $key2, $type, $min, $max, $descr); 164 175 } 165 176 /*
Note:
See TracChangeset
for help on using the changeset viewer.