Browse Source

fix mass change in some pages

rajven 2 years ago
parent
commit
822dd074ec

+ 88 - 84
html/admin/customers/control-options.php

@@ -1,39 +1,33 @@
 <?php
 
-require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
-require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
+require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/auth.php");
+require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/languages/" . HTML_LANG . ".php");
 
 if (isset($_POST["remove"])) {
-    $fid = $_POST["f_id"];
-    if (!empty($fid)) {
-        foreach ($fid as $key => $val) {
-            if (isset($val) and $val != 1) {
-                $opt_def = get_record($db_link, "config_options","id=$val");
-                LOG_INFO($db_link, WEB_config_remove_option." id: ".$val." name: ".$opt_def["option_name"]);
-                delete_record($db_link, "config", "id=" . $val);
-                }
-            }
+    if (!empty($_POST["f_id"])) {
+        $fid = $_POST["f_id"];
+        foreach ($fid as $option_id => $config_id) {
+            $opt_def = get_record($db_link, "config_options", "id=" . $option_id);
+            LOG_INFO($db_link, WEB_config_remove_option . " id: " . $config_id . " name: " . $opt_def["option_name"]);
+            delete_record($db_link, "config", "id=" . $config_id);
         }
+    }
     header("Location: " . $_SERVER["REQUEST_URI"]);
     exit;
 }
 
 if (isset($_POST['save'])) {
-    $len = is_array($_POST['save']) ? count($_POST['save']) : 0;
-    for ($i = 0; $i < $len; $i ++) {
-        $save_id = intval($_POST['save'][$i]);
-        $len_all = is_array($_POST['r_id']) ? count($_POST['r_id']) : 0;
-        for ($j = 0; $j < $len_all; $j ++) {
-            if (intval($_POST['r_id'][$j]) != $save_id) { continue; }
-            $value = $_POST['f_config_value'][$j];
-            if (isset($value) and $value!=='********') {
+    if (!empty($_POST["f_id"])) {
+        $fid = $_POST["f_id"];
+        foreach ($fid as $option_id => $config_id) {
+            $value = $_POST['f_config_value'][$config_id];
+            $option = get_record_sql($db_link, "SELECT * FROM config_options WHERE id=" . $option_id);
+            if (isset($value) and $value !== '********') {
                 $new['value'] = $value;
-                $opt_cur = get_record($db_link, "config","id=$save_id");
-                if (isset($opt_cur) and !empty($opt_cur["option_id"])) {
-                    $opt_def = get_record($db_link, "config_options","id=".$opt_cur["option_id"]);
-                    LOG_INFO($db_link, WEB_config_set_option." id: ".$save_id." name: ".$opt_def["option_name"]." = ".$value);
-                    update_record($db_link, "config", "id='$save_id'", $new);
-                    }
+            }
+            LOG_INFO($db_link, WEB_config_set_option . " id: " . $config_id . " name: " . $opttion["option_name"] . " = " . $value);
+            if (!empty($new)) {
+                update_record($db_link, "config", "id=" . $config_id, $new);
             }
         }
     }
@@ -45,11 +39,11 @@ if (isset($_POST["create"])) {
     $new_option = $_POST["f_new_option"];
     if (isset($new_option)) {
         $new['option_id'] = $new_option;
-        $new['value'] = get_option($db_link,$new_option);
-        $opt_def = get_record($db_link, "config_options","id=$new_option");
-        LOG_INFO($db_link, WEB_config_add_option." id: ".$new_option." name: ".$opt_def["option_name"]." = ".$new['value']);
+        $new['value'] = get_option($db_link, $new_option);
+        $opt_def = get_record($db_link, "config_options", "id=$new_option");
+        LOG_INFO($db_link, WEB_config_add_option . " id: " . $new_option . " name: " . $opt_def["option_name"] . " = " . $new['value']);
         insert_record($db_link, "config", $new);
-        }
+    }
     header("Location: " . $_SERVER["REQUEST_URI"]);
     exit;
 }
@@ -58,65 +52,75 @@ unset($_POST);
 
 fix_auth_rules($db_link);
 
-require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
+require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/header.php");
 
 print_control_submenu($page_url);
 
 ?>
 <div id="cont">
-<br>
-<form name="def" action="control-options.php" method="post">
-<br><b><?php print WEB_config_parameters; ?></b><br>
-<table class="data" width=800>
-<tr align="center">
-<td width=20><input type="checkbox" onClick="checkAll(this.checked);"></td>
-<td width=30><b>Id</b></td>
-<td width=150><b><?php print WEB_config_option; ?></b></td>
-<td width=150><b><?php print WEB_config_value; ?></b></td>
-<td width=350><b><?php print WEB_msg_comment; ?></b></td>
-<td width=100><input type="submit" onclick="return confirm('<?php print WEB_btn_delete; ?>?')" name="remove" value="<?php print WEB_btn_remove; ?>"></td>
-</tr>
+    <br>
+    <form name="def" action="control-options.php" method="post">
+        <br><b><?php print WEB_config_parameters; ?></b><br>
+        <table class="data" width=800>
+            <tr align="center">
+                <td width=20><input type="checkbox" onClick="checkAll(this.checked);"></td>
+                <td width=150><b><?php print WEB_config_option; ?></b></td>
+                <td width=150><b><?php print WEB_config_value; ?></b></td>
+                <td width=350><b><?php print WEB_msg_comment; ?></b></td>
+                <td class="warn">
+                    <input type="submit" onclick="return confirm('<?php print WEB_btn_delete; ?>?')" name="remove" value="<?php print WEB_btn_remove; ?>">
+                </td>
+                <td class="up">
+                    <button name='save'><?php print WEB_btn_save; ?></button>
+                </td>
+            </tr>
 
-<?php
-$descr_field = "description.".HTML_LANG;
-$t_config = mysqli_query($db_link, "SELECT `config`.`id`,`option_id`,`option_name`,`value`,`type`,`".$descr_field."`,`min_value`,`max_value` FROM `config`,`config_options` WHERE
+            <?php
+            $descr_field = "description." . HTML_LANG;
+            $t_config = mysqli_query($db_link, "SELECT `config`.`id`,`option_id`,`option_name`,`value`,`type`,`" . $descr_field . "`,`min_value`,`max_value` FROM `config`,`config_options` WHERE
  `config`.`option_id`=`config_options`.`id` ORDER BY `option_name`");
-while ($row = mysqli_fetch_array($t_config)) {
-    print "<tr align=center>\n";
-    print "<td class=\"data\" style='padding:0'><input type=checkbox name=f_id[] value='{$row['id']}'></td>\n";
-    print "<td class=\"data\"><input type=\"hidden\" name='r_id[]' value='{$row['id']}'>{$row['id']}</td>\n";
-    print "<td class=\"data\"><input type=\"text\" name='f_config_option[]' value='{$row['option_name']}' disabled=true readonly=true></td>\n";
-    $type = $row['type'];
-    print "<td class=\"data\">";
-    $option_value = $row['value'];
-    if ($row['option_id']==29) { $option_value='********'; }
-    if (!isset($option_value)) {
-        $option_value = get_option($db_link, $row['option_id']);
-        set_option($db_link, $row['option_id'], $option_value);
-    }
-    if ($type == 'int') {
-        $min = '';
-        $max = '';
-        if (!empty($row['min_value']) or $row['min_value']==0) { $min="min=".$row['min_value']; }
-        if (!empty($row['max_value'])) { $max="max=".$row['max_value']; }
-        print "<input type=\"number\" name='f_config_value[]' value='$option_value' $min $max>";
-    }
-    if ($type == 'text') {
-        print "<input type=\"text\" name='f_config_value[]' value='$option_value' size=30>";
-    }
-    if ($type == 'bool') {
-        print_qa_select("f_config_value[]", $option_value);
-    }
-    print "</td>\n";
-    print "<td class=\"data\">".$row[$descr_field]."</td>\n";
-    print "<td class=\"data\"><button name='save[]' value='{$row['id']}'>".WEB_btn_save."</button></td>\n";
-    print "</tr>\n";
-}
-?>
-<tr>
-<td colspan=5 class="data"><?php print WEB_btn_add." ".mb_strtolower(WEB_config_option).":&nbsp"; print_option_select($db_link, "f_new_option"); ?></td>
-<td><input type="submit" name="create" value="<?php echo WEB_btn_add; ?>"></td>
-</tr>
-</table>
-</form>
-<?php require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php"); ?>
+            while ($row = mysqli_fetch_array($t_config)) {
+                print "<tr align=center>\n";
+                print "<td class=\"data\" style='padding:0'><input type=checkbox name=f_id[" . $row["option_id"] . "] value='" . $row['id'] . "'></td>\n";
+                print "<td class=\"data\"><input type=\"text\" value='" . $row['option_name'] . "' disabled=true readonly=true></td>\n";
+                $type = $row['type'];
+                print "<td class=\"data\">";
+                $option_value = $row['value'];
+                if ($row['option_id'] == 29) {
+                    $option_value = '********';
+                }
+                if (!isset($option_value)) {
+                    $option_value = get_option($db_link, $row['option_id']);
+                    set_option($db_link, $row['option_id'], $option_value);
+                }
+                if ($type == 'int') {
+                    $min = '';
+                    $max = '';
+                    if (!empty($row['min_value']) or $row['min_value'] == 0) {
+                        $min = "min=" . $row['min_value'];
+                    }
+                    if (!empty($row['max_value'])) {
+                        $max = "max=" . $row['max_value'];
+                    }
+                    print "<input type=\"number\" name='f_config_value[" . $row['id'] . "]' value='$option_value' $min $max>";
+                }
+                if ($type == 'text') {
+                    print "<input type=\"text\" name='f_config_value[" . $row['id'] . "]' value='$option_value' size=30>";
+                }
+                if ($type == 'bool') {
+                    print_qa_select("f_config_value[" . $row['id'] . "]", $option_value);
+                }
+                print "</td>\n";
+                print "<td colspan=3 class=\"data\">" . $row[$descr_field] . "</td>\n";
+                print "</tr>\n";
+            }
+            ?>
+            <tr>
+                <td colspan=4 class="data"><?php print WEB_btn_add . " " . mb_strtolower(WEB_config_option) . ":&nbsp";
+                                            print_option_select($db_link, "f_new_option"); ?></td>
+                <td class="up" align="center"><input type="submit" name="create" value="<?php echo WEB_btn_add; ?>"></td>
+                <td colspan=2 class="data"></td>
+            </tr>
+        </table>
+    </form>
+    <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/footer.php"); ?>

+ 109 - 114
html/admin/customers/control-subnets.php

@@ -4,12 +4,12 @@ require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/auth.php");
 require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/languages/" . HTML_LANG . ".php");
 
 if (isset($_POST["s_remove"])) {
-    $s_id = $_POST["s_id"];
-    if (!empty($s_id)) {
-        foreach ($s_id as $key => $val) {
-            if (isset($val)) {
-                LOG_INFO($db_link, "Remove subnet id: $val");
-                delete_record($db_link, "subnets", "id=" . $val);
+    if (!empty($_POST["s_id"])) {
+        $s_id = $_POST["s_id"];
+        foreach ($s_id as $key => $net_id) {
+            if (isset($net_id)) {
+                LOG_INFO($db_link, "Remove subnet id: $net_id");
+                delete_record($db_link, "subnets", "id=" . $net_id);
             }
         }
     }
@@ -18,91 +18,88 @@ if (isset($_POST["s_remove"])) {
 }
 
 if (isset($_POST['s_save'])) {
-    $len = is_array($_POST['s_save']) ? count($_POST['s_save']) : 0;
-    for ($i = 0; $i < $len; $i++) {
-        $save_id = intval($_POST['s_save'][$i]);
-        $len_all = is_array($_POST['n_id']) ? count($_POST['n_id']) : 0;
-        for ($j = 0; $j < $len_all; $j++) {
-            if (intval($_POST['n_id'][$j]) != $save_id) {
-                continue;
-            }
-            $new['subnet'] = trim($_POST['s_subnet'][$j]);
-            $new['office'] = $_POST['s_office'][$j] * 1;
-            $new['hotspot'] = $_POST['s_hotspot'][$j] * 1;
-            $new['vpn'] = $_POST['s_vpn'][$j] * 1;
-            $new['free'] = $_POST['s_free'][$j] * 1;
-            $new['dhcp'] = $_POST['s_dhcp'][$j] * 1;
-            $new['dhcp_lease_time'] = $_POST['s_lease_time'][$j] * 1;
-            $new['static'] = $_POST['s_static'][$j] * 1;
-            $new['discovery'] = $_POST['s_discovery'][$j] * 1;
-            $new['dhcp_update_hostname'] = $_POST['s_dhcp_update'][$j] * 1;
-            $new['comment'] = trim($_POST['s_comment'][$j]);
-            $range = cidrToRange($new['subnet']);
-            $first_user_ip = $range[0];
-            $last_user_ip = $range[1];
-            $cidr = $range[2][1];
-            if (isset($cidr) and $cidr <= 32) {
-                $new['subnet'] = $first_user_ip . '/' . $cidr;
-            } else {
-                $new['subnet'] = '';
-            }
-            $new['ip_int_start'] = ip2long($first_user_ip);
-            $new['ip_int_stop'] = ip2long($last_user_ip);
-            $new['dhcp_start'] = ip2long(trim($_POST['s_dhcp_start'][$j]));
-            $new['dhcp_stop'] = ip2long(trim($_POST['s_dhcp_stop'][$j]));
-            $dhcp_fail = 0;
-            if (!isset($new['dhcp_start']) or $new['dhcp_start'] == 0) {
-                $dhcp_fail = 1;
-            }
-            if (!isset($new['dhcp_stop']) or $new['dhcp_stop'] == 0) {
-                $dhcp_fail = 1;
-            }
-            if (!$dhcp_fail and ($new['dhcp_start'] - $new['ip_int_stop'] >= 0)) {
-                $dhcp_fail = 1;
-            }
-            if (!$dhcp_fail and ($new['dhcp_start'] - $new['ip_int_start'] <= 0)) {
-                $dhcp_fail = 1;
-            }
-            if (!$dhcp_fail and ($new['dhcp_stop'] - $new['ip_int_stop'] >= 0)) {
-                $dhcp_fail = 1;
-            }
-            if (!$dhcp_fail and ($new['dhcp_stop'] - $new['ip_int_start'] <= 0)) {
-                $dhcp_fail = 1;
-            }
-            if (!$dhcp_fail and ($new['dhcp_start'] - $new['dhcp_stop'] >= 0)) {
-                $dhcp_fail = 1;
-            }
-            if ($dhcp_fail) {
-                $new['dhcp_start'] = ip2long($range[3]);
-                $new['dhcp_stop'] = ip2long($range[4]);
-            }
-            $gateway = ip2long(trim($_POST['s_gateway'][$j]));
-            if (!isset($gateway)) {
-                $gateway = $range[5];
-            }
-            $new['gateway'] = $gateway;
-            if ($new['hotspot']) {
-                $new['dhcp_update_hostname'] = 0;
-                $new['discovery'] = 0;
-                $new['vpn'] = 0;
-            }
-            if ($new['vpn']) {
-                $new['discovery'] = 0;
-                $new['dhcp'] = 0;
-            }
-            if ($new['office']) {
-                $new['free'] = 0;
-            }
-            if (!$new['office']) {
-                $new['discovery'] = 0;
-                $new['dhcp'] = 0;
-                $new['static'] = 0;
-                $new['dhcp_update_hostname'] = 0;
-                $new['gateway'] = 0;
-                $new['dhcp_start'] = 0;
-                $new['dhcp_stop'] = 0;
+    if (!empty($_POST["s_id"])) {
+        $s_id = $_POST["s_id"];
+        foreach ($s_id as $key => $net_id) {
+            if (isset($net_id)) {
+                $new['subnet'] = trim($_POST['s_subnet'][$net_id]);
+                $new['office'] = $_POST['s_office'][$net_id] * 1;
+                $new['hotspot'] = $_POST['s_hotspot'][$net_id] * 1;
+                $new['vpn'] = $_POST['s_vpn'][$net_id] * 1;
+                $new['free'] = $_POST['s_free'][$net_id] * 1;
+                $new['dhcp'] = $_POST['s_dhcp'][$net_id] * 1;
+                $new['dhcp_lease_time'] = $_POST['s_lease_time'][$net_id] * 1;
+                $new['static'] = $_POST['s_static'][$net_id] * 1;
+                $new['discovery'] = $_POST['s_discovery'][$net_id] * 1;
+                $new['dhcp_update_hostname'] = $_POST['s_dhcp_update'][$net_id] * 1;
+                $new['comment'] = trim($_POST['s_comment'][$net_id]);
+                $range = cidrToRange($new['subnet']);
+                $first_user_ip = $range[0];
+                $last_user_ip = $range[1];
+                $cidr = $range[2][1];
+                if (isset($cidr) and $cidr <= 32) {
+                    $new['subnet'] = $first_user_ip . '/' . $cidr;
+                } else {
+                    $new['subnet'] = '';
+                }
+                $new['ip_int_start'] = ip2long($first_user_ip);
+                $new['ip_int_stop'] = ip2long($last_user_ip);
+                $new['dhcp_start'] = ip2long(trim($_POST['s_dhcp_start'][$net_id]));
+                $new['dhcp_stop'] = ip2long(trim($_POST['s_dhcp_stop'][$net_id]));
+                $dhcp_fail = 0;
+                if (!isset($new['dhcp_start']) or $new['dhcp_start'] == 0) {
+                    $dhcp_fail = 1;
+                }
+                if (!isset($new['dhcp_stop']) or $new['dhcp_stop'] == 0) {
+                    $dhcp_fail = 1;
+                }
+                if (!$dhcp_fail and ($new['dhcp_start'] - $new['ip_int_stop'] >= 0)) {
+                    $dhcp_fail = 1;
+                }
+                if (!$dhcp_fail and ($new['dhcp_start'] - $new['ip_int_start'] <= 0)) {
+                    $dhcp_fail = 1;
+                }
+                if (!$dhcp_fail and ($new['dhcp_stop'] - $new['ip_int_stop'] >= 0)) {
+                    $dhcp_fail = 1;
+                }
+                if (!$dhcp_fail and ($new['dhcp_stop'] - $new['ip_int_start'] <= 0)) {
+                    $dhcp_fail = 1;
+                }
+                if (!$dhcp_fail and ($new['dhcp_start'] - $new['dhcp_stop'] >= 0)) {
+                    $dhcp_fail = 1;
+                }
+                if ($dhcp_fail) {
+                    $new['dhcp_start'] = ip2long($range[3]);
+                    $new['dhcp_stop'] = ip2long($range[4]);
+                }
+                $gateway = ip2long(trim($_POST['s_gateway'][$net_id]));
+                if (!isset($gateway)) {
+                    $gateway = $range[5];
+                }
+                $new['gateway'] = $gateway;
+                if ($new['hotspot']) {
+                    $new['dhcp_update_hostname'] = 0;
+                    $new['discovery'] = 0;
+                    $new['vpn'] = 0;
+                }
+                if ($new['vpn']) {
+                    $new['discovery'] = 0;
+                    $new['dhcp'] = 0;
+                }
+                if ($new['office']) {
+                    $new['free'] = 0;
+                }
+                if (!$new['office']) {
+                    $new['discovery'] = 0;
+                    $new['dhcp'] = 0;
+                    $new['static'] = 0;
+                    $new['dhcp_update_hostname'] = 0;
+                    $new['gateway'] = 0;
+                    $new['dhcp_start'] = 0;
+                    $new['dhcp_stop'] = 0;
+                }
+                update_record($db_link, "subnets", "id='$net_id'", $new);
             }
-            update_record($db_link, "subnets", "id='{$save_id}'", $new);
         }
     }
     header("Location: " . $_SERVER["REQUEST_URI"]);
@@ -146,11 +143,16 @@ print_control_submenu($page_url);
 <div id="cont">
     <br>
     <form name="def" action="control-subnets.php" method="post">
+    <div>
+        <?php print WEB_network_create . "&nbsp:<input type=\"text\" name='s_create_subnet' value=''>"; ?>
+        <input type="submit" name="s_create" value="<?php echo WEB_btn_add; ?>">
+        <button class="button_right" name='s_save' value='save'><?php print WEB_btn_save; ?></button>
+        <input type="submit" onclick="return confirm('<?php print WEB_btn_delete; ?>?')" name="s_remove" value="<?php print WEB_btn_remove; ?>">
+    </div>
         <b><?php echo WEB_network_org_title; ?></b> <br>
         <table class="data">
             <tr align="center">
                 <td></td>
-                <td width=30><b>id</b></td>
                 <td><b><?php echo WEB_network_subnet; ?></b></td>
                 <td><b><?php echo WEB_network_gateway; ?></b></td>
                 <td><b><?php echo WEB_network_use_dhcp; ?></b></td>
@@ -165,16 +167,14 @@ print_control_submenu($page_url);
                 <td><b><?php echo WEB_network_dyndns; ?></b></td>
                 <td><b><?php echo WEB_network_discovery; ?></b></td>
                 <td><b><?php echo WEB_cell_comment; ?></b></td>
-                <td><input type="submit" onclick="return confirm('<?php print WEB_btn_delete; ?>?')" name="s_remove" value="<?php print WEB_btn_remove; ?>"></td>
             </tr>
             <?php
             $t_subnets = get_records($db_link, 'subnets', 'True ORDER BY ip_int_start');
             foreach ($t_subnets as $row) {
                 print "<tr align=center>\n";
                 $cl = "data";
-                print "<td class=\"$cl\" style='padding:0'><input type=checkbox name=s_id[] value='{$row['id']}'></td>\n";
-                print "<td class=\"$cl\"><input type=\"hidden\" name='n_id[]' value='{$row['id']}'>{$row['id']}</td>\n";
-                print "<td class=\"$cl\"><input type=\"text\" name='s_subnet[]' value='{$row['subnet']}' size='18'></td>\n";
+                print "<td class=\"$cl\" style='padding:0'><input type=checkbox name=s_id[] value='" . $row['id'] . "'></td>\n";
+                print "<td class=\"$cl\"><input type=\"text\" name='s_subnet[" . $row['id'] . "]' value='".$row['subnet']."' size='18'></td>\n";
                 $cell_disabled = '';
                 if ($row['office'] and !$row['vpn']) {
                     $default_range = cidrToRange($row['subnet']);
@@ -188,14 +188,14 @@ print_control_submenu($page_url);
                     $cell_disabled = 'readonly=true';
                     $cl = 'down';
                 }
-                print "<td class=\"$cl\"><input type=\"text\" name='s_gateway[]' value='" . long2ip($row['gateway']) . "'  size='15' $cell_disabled></td>\n";
+                print "<td class=\"$cl\"><input type=\"text\" name='s_gateway[" . $row['id'] . "]' value='" . long2ip($row['gateway']) . "'  size='15' $cell_disabled></td>\n";
                 if ($row['dhcp']) {
                     $cl = 'up';
                 } else {
                     $cl = 'data';
                 }
                 print "<td class=\"$cl\">";
-                print_qa_select("s_dhcp[]", $row['dhcp']);
+                print_qa_select("s_dhcp[" . $row['id'] . "]", $row['dhcp']);
                 print "</td>\n";
                 if ($row['static']) {
                     $cl = 'up';
@@ -203,12 +203,12 @@ print_control_submenu($page_url);
                     $cl = 'data';
                 }
                 print "<td class=\"$cl\">";
-                print_qa_select("s_static[]", $row['static']);
+                print_qa_select("s_static[" . $row['id'] . "]", $row['static']);
                 print "</td>\n";
                 $cl = 'data';
-                print "<td class=\"$cl\"><input type=\"text\" name='s_dhcp_start[]' value='" . long2ip($row['dhcp_start']) . "' size='15' $cell_disabled></td>\n";
-                print "<td class=\"$cl\"><input type=\"text\" name='s_dhcp_stop[]' value='" . long2ip($row['dhcp_stop']) . "' size='15' $cell_disabled></td>\n";
-                print "<td class=\"$cl\"><input type=\"text\" name='s_lease_time[]' value='" . $row['dhcp_lease_time'] . "'size='3' $cell_disabled></td>\n";
+                print "<td class=\"$cl\"><input type=\"text\" name='s_dhcp_start[" . $row['id'] . "]' value='" . long2ip($row['dhcp_start']) . "' size='15' $cell_disabled></td>\n";
+                print "<td class=\"$cl\"><input type=\"text\" name='s_dhcp_stop[" . $row['id'] . "]' value='" . long2ip($row['dhcp_stop']) . "' size='15' $cell_disabled></td>\n";
+                print "<td class=\"$cl\"><input type=\"text\" name='s_lease_time[" . $row['id'] . "]' value='" . $row['dhcp_lease_time'] . "'size='3' $cell_disabled></td>\n";
                 $row_cl = 'data';
                 if (!$row['office']) {
                     $row_cl = 'down';
@@ -219,7 +219,7 @@ print_control_submenu($page_url);
                     $cl = 'data';
                 }
                 print "<td class=\"$cl\">";
-                print_qa_select("s_office[]", $row['office']);
+                print_qa_select("s_office[" . $row['id'] . "]", $row['office']);
                 print "</td>\n";
                 if ($row_cl === 'data' and $row['hotspot']) {
                     $cl = 'up';
@@ -227,7 +227,7 @@ print_control_submenu($page_url);
                     $cl = $row_cl;
                 }
                 print "<td class=\"$cl\">";
-                print_qa_select_ext("s_hotspot[]", $row['hotspot'], !$row['office']);
+                print_qa_select_ext("s_hotspot[" . $row['id'] . "]", $row['hotspot'], !$row['office']);
                 print "</td>\n";
                 if ($row_cl === 'data' and $row['vpn']) {
                     $cl = 'up';
@@ -235,7 +235,7 @@ print_control_submenu($page_url);
                     $cl = $row_cl;
                 }
                 print "<td class=\"$cl\">";
-                print_qa_select_ext("s_vpn[]", $row['vpn'], !$row['office']);
+                print_qa_select_ext("s_vpn[" . $row['id'] . "]", $row['vpn'], !$row['office']);
                 print "</td>\n";
                 if ($row['free']) {
                     $cl = 'up';
@@ -243,7 +243,7 @@ print_control_submenu($page_url);
                     $cl = $row_cl;
                 }
                 print "<td class=\"$cl\">";
-                print_qa_select("s_free[]", $row['free']);
+                print_qa_select("s_free[" . $row['id'] . "]", $row['free']);
                 print "</td>\n";
                 if ($row_cl === 'data' and $row['dhcp_update_hostname']) {
                     $cl = 'up';
@@ -251,7 +251,7 @@ print_control_submenu($page_url);
                     $cl = $row_cl;
                 }
                 print "<td class=\"$cl\">";
-                print_qa_select_ext("s_dhcp_update[]", $row['dhcp_update_hostname'], !$row['office']);
+                print_qa_select_ext("s_dhcp_update[" . $row['id'] . "]", $row['dhcp_update_hostname'], !$row['office']);
                 print "</td>\n";
                 if ($row_cl === 'data' and $row['discovery']) {
                     $cl = 'up';
@@ -259,17 +259,12 @@ print_control_submenu($page_url);
                     $cl = $row_cl;
                 }
                 print "<td class=\"$cl\">";
-                print_qa_select_ext("s_discovery[]", $row['discovery'], !$row['office']);
+                print_qa_select_ext("s_discovery[" . $row['id'] . "]", $row['discovery'], !$row['office']);
                 print "</td>\n";
-                print "<td class=\"data\"><input type=\"text\" name='s_comment[]' value='{$row['comment']}'></td>\n";
-                print "<td class=\"data\"><button name='s_save[]' value='{$row['id']}'>" . WEB_btn_save . "</button></td>\n";
+                print "<td class=\"data\"><input type=\"text\" name='s_comment[" . $row['id'] . "]' value='".$row['comment']."'></td>\n";
                 print "</tr>\n";
-            }
+                }
             ?>
-            <tr>
-                <td colspan=6><?php print WEB_network_create . "&nbsp:<input type=\"text\" name='s_create_subnet' value=''>"; ?></td>
-                <td><input type="submit" name="s_create" value="<?php echo WEB_btn_add; ?>"></td>
-            </tr>
         </table>
     </form>
     <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/footer.php"); ?>

+ 4 - 8
html/admin/customers/ipcam.php

@@ -44,16 +44,12 @@ print "<tr><td colspan=3><br></td></tr>\n";
 $t_config = get_records_sql($db_link, "select id,name from building order by name");
 foreach ($t_config as $row) {
     print "<tr align=center>\n";
-    print "<td class=\"data\"><input type=\"text\" name='f_name[]' value='{$row['name']}' disabled=true readonly=true></td>\n";
-    print "<td class=\"data\"><button name='port_on[]' value='{$row['id']}'>".WEB_control_port_poe_on."</button></td>\n";
-    print "<td class=\"data\"><button name='port_off[]' value='{$row['id']}'>".WEB_control_port_poe_off."</button></td>\n";
+    print "<td class=\"$cl\" style='padding:0'><input type=checkbox name=fid[] value=".$row['id']."></td>\n";
+    print "<td class=\"data\"><input type=\"text\" name='f_name[".$row['id']."]' value='".$row['name']."' disabled=true readonly=true></td>\n";
+    print "<td class=\"data\"><button name='port_on[".$row['id']."]' value='".$row['id']."'>".WEB_control_port_poe_on."</button></td>\n";
+    print "<td class=\"data\"><button name='port_off[".$row['id']."]' value='".$row['id']."'>".WEB_control_port_poe_off."</button></td>\n";
     print "</tr>\n";
 }
-print "<tr align=center>\n";
-print "<td class=\"data\"><input type=\"text\" name='f_name[]' value='ALL' disabled=true readonly=true></td>\n";
-print "<td class=\"data\"><button name='port_on[]' value='{0}'>".WEB_control_port_poe_on."</button></td>\n";
-print "<td class=\"data\"><button name='port_off[]' value='{0}'>".WEB_control_port_poe_off."</button></td>\n";
-print "</tr>\n";
 ?>
 </table>
 </form>

+ 0 - 1
html/admin/filters/editgroup.php

@@ -40,7 +40,6 @@ if (isset($_POST["removefilter"])) {
 }
 
 if (isset($_POST["updateFilters"])) {
-    var_dump($_POST);
     if (!empty($_POST["f_group_filter"])) {
         $f_group_filter = $_POST["f_group_filter"];
         LOG_DEBUG($db_link, "Update filters for group id: " . $id);

+ 2 - 0
html/css/white.css

@@ -55,3 +55,5 @@ a:hover                         { color: #ed8b0d; text-decoration: none; }
 html                            { margin:0; padding:0; font-size:62.5%; }
 h1                              { font-size:1.8em; }
 .tree                           { overflow:auto; border:0px; }
+
+.button_right                   { position:absolute; right:0; }