Просмотр исходного кода

remove id element name from table row

rajven 3 лет назад
Родитель
Сommit
4977b699dc

+ 3 - 3
html/admin/customers/control-options.php

@@ -22,9 +22,9 @@ 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['id']) ? count($_POST['id']) : 0;
+        $len_all = is_array($_POST['r_id']) ? count($_POST['r_id']) : 0;
         for ($j = 0; $j < $len_all; $j ++) {
-            if (intval($_POST['id'][$j]) != $save_id) { continue; }
+            if (intval($_POST['r_id'][$j]) != $save_id) { continue; }
             $value = $_POST['f_config_value'][$j];
             if (isset($value) and $value!=='********') {
                 $new['value'] = $value;
@@ -84,7 +84,7 @@ $t_config = mysqli_query($db_link, "SELECT `config`.`id`,`option_id`,`option_nam
 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='id[]' value='{$row['id']}'>{$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\">";

+ 4 - 4
html/admin/devices/building.php

@@ -15,15 +15,15 @@ if (isset($_POST["remove"])) {
 }
 
 if (isset($_POST['save'])) {
-    $len = is_array($_POST['id']) ? count($_POST['id']) : 0;
+    $len = is_array($_POST['r_id']) ? count($_POST['r_id']) : 0;
     for ($i = 0; $i < $len; $i ++) {
         $save_id = intval($_POST['save'][$i]);
         if ($save_id == 0) {
             continue;
         }
-        $len_all = is_array($_POST['id']) ? count($_POST['id']) : 0;
+        $len_all = is_array($_POST['r_id']) ? count($_POST['r_id']) : 0;
         for ($j = 0; $j < $len_all; $j ++) {
-            if (intval($_POST['id'][$j]) != $save_id) {
+            if (intval($_POST['r_id'][$j]) != $save_id) {
                 continue;
             }
             $value = $_POST['f_building_name'][$j];
@@ -72,7 +72,7 @@ $t_building = get_records($db_link,'building','TRUE ORDER BY id');
 foreach ($t_building as $row) {
     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='id[]' value='{$row['id']}'>{$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_building_name[]' value='{$row['name']}'></td>\n";
     print "<td class=\"data\"><input type=\"text\" name='f_building_comment[]' value='{$row['comment']}'></td>\n";
     print "<td class=\"data\"><button name='save[]' value='{$row['id']}'>".WEB_btn_save."</button></td>\n";

+ 3 - 3
html/admin/devices/devmodels.php

@@ -28,9 +28,9 @@ if (isset($_POST['save'])) {
     for ($i = 0; $i < $len; $i ++) {
         $save_id = intval($saved[$i]);
         if ($save_id == 0) { continue;  }
-        $len_all = is_array($_POST['id']) ? count($_POST['id']) : 0;
+        $len_all = is_array($_POST['r_id']) ? count($_POST['r_id']) : 0;
         for ($j = 0; $j < $len_all; $j ++) {
-            if (intval($_POST['id'][$j]) != $save_id) { continue; }
+            if (intval($_POST['r_id'][$j]) != $save_id) { continue; }
             if ($save_id>=10000) {
                 $new['vendor_id'] = $_POST['f_vendor'][$j];
 	        $new['model_name'] = $_POST['f_name'][$j];
@@ -104,7 +104,7 @@ $t_ou = get_records_sql($db_link,'SELECT * FROM device_models '.$v_filter." ORDE
 foreach ($t_ou as $row) {
     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='id[]' value='{$row['id']}'>{$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\" width=150>"; print_vendor_set($db_link,'f_vendor[]',$row['vendor_id']); print "</td>\n";
     print "<td class=\"data\"><input type=\"text\" name='f_name[]' value='{$row['model_name']}'></td>\n";
     print "<td class=\"data\"><input type=\"text\" name='f_nagios[]' value='{$row['nagios_template']}'></td>\n";

+ 3 - 3
html/admin/devices/devvendors.php

@@ -30,9 +30,9 @@ if (isset($_POST['save'])) {
         $save_id = intval($saved[$i]);
         if ($save_id == 0) { continue;  }
         if ($save_id<10000) { continue; }
-        $len_all = is_array($_POST['id']) ? count($_POST['id']) : 0;
+        $len_all = is_array($_POST['r_id']) ? count($_POST['r_id']) : 0;
         for ($j = 0; $j < $len_all; $j ++) {
-            if (intval($_POST['id'][$j]) != $save_id) { continue; }
+            if (intval($_POST['r_id'][$j]) != $save_id) { continue; }
             $new['name'] = $_POST['f_name'][$j];
             update_record($db_link, "vendors", "id='{$save_id}'", $new);
             }
@@ -95,7 +95,7 @@ $t_ou = get_records_sql($db_link,"SELECT * FROM vendors ORDER BY name LIMIT $sta
 foreach ($t_ou as $row) {
     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\">{$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_name[]' value='{$row['name']}'></td>\n";
     print "<td class=\"data\"></td>\n";
     print "</tr>\n";

+ 1 - 1
html/admin/groups/index.php

@@ -46,7 +46,7 @@ $t_ou = get_records($db_link,'OU','TRUE ORDER BY ou_name');
 foreach ($t_ou as $row) {
     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='id[]' value='{$row['id']}'>{$row['id']}</td>\n";
+    print "<td class=\"data\"><input type=\"hidden\" name='r_id[]' value='{$row['id']}'>{$row['id']}</td>\n";
     $flag='';
     if ($row['default_users'] == 1) { $flag='D'; }
     if ($row['default_hotspot'] == 1) { $flag='H'; }

+ 3 - 3
html/admin/queues/index.php

@@ -3,9 +3,9 @@ require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
 
 if (isset($_POST['save'])) {
-    $len = is_array($_POST['id']) ? count($_POST['id']) : 0;
+    $len = is_array($_POST['r_id']) ? count($_POST['r_id']) : 0;
     for ($i = 0; $i < $len; $i ++) {
-        $id = intval($_POST['id'][$i]);
+        $id = intval($_POST['r_id'][$i]);
         $new['queue_name'] = trim($_POST['f_queue_name'][$i]);
         $new['Download'] = $_POST['f_down'][$i] * 1;
         $new['Upload'] = $_POST['f_up'][$i] * 1;
@@ -45,7 +45,7 @@ $t_queue=get_records($db_link, "Queue_list",'TRUE ORDER BY id');
 foreach ($t_queue as $row) {
     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='id[]' value='{$row['id']}'>{$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_queue_name[]' value='{$row['queue_name']}'></td>\n";
     print "<td class=\"data\"><input type=\"text\" name='f_down[]' value='{$row['Download']}'></td>\n";
     print "<td class=\"data\"><input type=\"text\" name='f_up[]' value='{$row['Upload']}'></td>\n";