Variable form select value mods

This commit is contained in:
Nate Jones
2014-04-27 08:55:39 +00:00
parent 89bea49f38
commit 53c7c9957e
2 changed files with 20 additions and 25 deletions

View File

@@ -194,10 +194,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
if ($action == "add") {
echo "<td width='30%' align='left'nowrap><b>".$text['header-var_add']."</b></td>\n";
echo "<td width='30%' align='left'nowrap><b>".$text['header-variable_add']."</b><br><br></td>\n";
}
if ($action == "update") {
echo "<td width='30%' align='left' nowrap><b>".$text['header-var_edit']."</b></td>\n";
echo "<td width='30%' align='left' nowrap><b>".$text['header-variable_edit']."</b><br><br></td>\n";
}
echo "<td width='70%' align='right'>";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='vars.php'\" value='".$text['button-back']."'>";
@@ -245,7 +245,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='var_enabled'>\n";
echo " <option value=''></option>\n";
if ($var_enabled == "true") {
echo " <option value='true' SELECTED >".$text['option-true']."</option>\n";
}
@@ -269,27 +268,23 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-order'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='var_order' class='formfld'>\n";
if (strlen(htmlspecialchars($var_order ))> 0) {
echo " <option selected='yes' value='".htmlspecialchars($var_order )."'>".htmlspecialchars($var_order )."</option>\n";
}
echo " <select name='var_order' class='formfld'>\n";
$i=0;
while($i<=999) {
if (strlen($i) == 1) {
echo " <option value='00$i'>00$i</option>\n";
}
if (strlen($i) == 2) {
echo " <option value='0$i'>0$i</option>\n";
}
if (strlen($i) == 3) {
echo " <option value='$i'>$i</option>\n";
}
$i++;
$selected = ($var_order == $i) ? "selected" : null;
if (strlen($i) == 1) {
echo " <option value='00$i' ".$selected.">00$i</option>\n";
}
if (strlen($i) == 2) {
echo " <option value='0$i' ".$selected.">0$i</option>\n";
}
if (strlen($i) == 3) {
echo " <option value='$i' ".$selected.">$i</option>\n";
}
$i++;
}
echo " </select>\n";
echo "<br />\n";
echo "\n";
echo " </select>\n";
echo " <br />\n";
echo "</td>\n";
echo "</tr>\n";