Przeglądaj źródła

the work with mass modification of records has been simplified.

root 1 rok temu
rodzic
commit
69787cbcae

+ 9 - 9
html/admin/iplist/index.php

@@ -125,15 +125,15 @@ print_ip_submenu($page_url);
         <h2 id="modal1Title"><?php print WEB_selection_title; ?></h2>
         <input type="hidden" name="ApplyForAll" value="MassChange">
         <table class="data" align=center>
-        <tr><td><input type=checkbox class="putField" name="e_enabled" value='1'></td><td><?php print WEB_cell_enabled."&nbsp"; print_qa_select('a_enabled', 1);?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_group_id" value='1'></td><td><?php print WEB_cell_filter."&nbsp";print_group_select($db_link, 'a_group_id', 0);?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_queue_id" value='1'></td><td><?php print WEB_cell_shaper."&nbsp";print_queue_select($db_link, 'a_queue_id', 0);?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_dhcp" value='1'></td><td><?php print "Dhcp&nbsp"; print_qa_select('a_dhcp', 1);?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_dhcp_acl" value='1'></td><td><?php print "Dhcp-acl&nbsp"; ?><input type="text" name="a_dhcp_acl" value="" size=10/></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_dhcp_option_set" value='1'></td><td><?php print "Dhcp-option-set&nbsp"; ?> <input type="text" name="a_dhcp_option_set" value="" size=10/> </td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_traf" value='1'></td><td><?php print "Save traffic&nbsp"; print_qa_select('a_traf',1);?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_bind_mac" value='1'></td><td><?php print WEB_user_bind_mac."&nbsp";print_qa_select('a_bind_mac', 1);?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_bind_ip" value='1'></td><td><?php print WEB_user_bind_ip."&nbsp";print_qa_select('a_bind_ip', 1);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_enabled" value='1'></td><td align=left><?php print WEB_cell_enabled."</td><td align=right>"; print_qa_select('a_enabled', 1);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_group_id" value='1'></td><td align=left><?php print WEB_cell_filter."</td><td align=right>";print_group_select($db_link, 'a_group_id', 0);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_queue_id" value='1'></td><td align=left><?php print WEB_cell_shaper."</td><td align=right>";print_queue_select($db_link, 'a_queue_id', 0);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_dhcp" value='1'></td><td align=left><?php print "Dhcp"."</td><td align=right>"; print_qa_select('a_dhcp', 1);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_dhcp_acl" value='1'></td><td align=left><?php print "Dhcp-acl"."</td><td align=right>"; print_dhcp_acl($db_link,"a_dhcp_acl"); ?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_dhcp_option_set" value='1'></td><td align=left><?php print "Dhcp-option-set"."</td><td align=right>"; print_dhcp_option_set($db_link,"a_dhcp_option_set"); ?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_traf" value='1'></td><td align=left><?php print "Save traffic"."</td><td align=right>"; print_qa_select('a_traf',1);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_bind_mac" value='1'></td><td align=left><?php print WEB_user_bind_mac."</td><td align=right>";print_qa_select('a_bind_mac', 1);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_bind_ip" value='1'></td><td align=left><?php print WEB_user_bind_ip."</td><td align=right>";print_qa_select('a_bind_ip', 1);?></td></tr>
         </table>
         <input type="submit" name="submit" class="btn" value="<?php echo WEB_btn_apply; ?>">
     </form>

+ 1 - 1
html/admin/iplist/nagios.php

@@ -59,7 +59,7 @@ print_ip_submenu($page_url);
         <table class="data" align=center>
         <tr><td><input type=checkbox class="putField" name="e_nag_enabled" value='1'></td><td>Nagios&nbsp<?php print_qa_select('n_enabled', 1); ?></td></tr>
         <tr><td><input type=checkbox class="putField" name="e_nag_link" value='1'></td><td>Link&nbsp<?php print_qa_select('n_link', 0); ?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_nag_handler" value='1'></td><td>Event-handler&nbsp<?php print_nagios_handler_select('n_handler', ''); ?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_nag_handler" value='1'></td><td>Event-handler&nbsp<?php print_nagios_handler_select($db_link,'n_handler', ''); ?></td></tr>
         </table>
         <input type="submit" name="submit" class="btn" value="<?php echo WEB_btn_apply; ?>">
     </form>

+ 10 - 10
html/admin/users/index.php

@@ -71,16 +71,16 @@ if ($msg_error) {
         <h2 id="modal1Title"><?php print WEB_selection_title; ?></h2>
         <input type="hidden" name="ApplyForAll" value="MassChange">
         <table class="data" align=center>
-        <tr><td><input type=checkbox class="putField" name="e_enabled" value='1'></td><td><?php print WEB_cell_enabled."&nbsp";print_qa_select('a_enabled', 0); ?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_group_id" value='1'></td><td><?php print WEB_cell_filter."&nbsp";print_group_select($db_link, 'a_group_id', 0); ?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_queue_id" value='1'></td><td><?php print WEB_cell_shaper."&nbsp";print_queue_select($db_link, 'a_queue_id', 0); ?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_day_q" value='1'></td><td><?php print WEB_cell_perday."&nbsp"; ?><input type="text" name="a_day_q" value="0" size=5></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_month_q" value='1'></td><td><?php print WEB_cell_permonth."&nbsp"; ?><input type="text" name="a_month_q" value="0" size=5></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_new_ou" value='1'></td><td><?php print WEB_cell_ou."&nbsp";print_ou_select($db_link, 'a_new_ou', $rou); ?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_bind_mac" value='1'></td><td><?php print WEB_user_bind_mac."&nbsp";print_qa_select('a_bind_mac', 1);?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_bind_ip" value='1'></td><td><?php print WEB_user_bind_ip."&nbsp";print_qa_select('a_bind_ip', 1);?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_create_netdev" value='1'></td><td><?php print WEB_user_create_netdev."&nbsp";print_qa_select('a_create_netdev', 1);?></td></tr>
-        <tr><td><input type=checkbox class="putField" name="e_permanent" value='1'></td><td><?php print WEB_user_permanent."&nbsp";print_qa_select('a_permanent', 0);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_enabled" value='1'></td><td align=left><?php print WEB_cell_enabled."</td><td align=right>";print_qa_select('a_enabled', 0); ?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_group_id" value='1'></td><td align=left><?php print WEB_cell_filter."</td><td align=right>";print_group_select($db_link, 'a_group_id', 0); ?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_queue_id" value='1'></td><td align=left><?php print WEB_cell_shaper."</td><td align=right>";print_queue_select($db_link, 'a_queue_id', 0); ?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_day_q" value='1'></td><td align=left><?php print WEB_cell_perday."</td><td align=right>"; ?><input type="text" name="a_day_q" value="0" size=5></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_month_q" value='1'></td><td align=left><?php print WEB_cell_permonth."</td><td align=right>"; ?><input type="text" name="a_month_q" value="0" size=5></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_new_ou" value='1'></td><td align=left><?php print WEB_cell_ou."</td><td align=right>";print_ou_select($db_link, 'a_new_ou', $rou); ?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_bind_mac" value='1'></td><td align=left><?php print WEB_user_bind_mac."</td><td align=right>";print_qa_select('a_bind_mac', 1);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_bind_ip" value='1'></td><td align=left><?php print WEB_user_bind_ip."</td><td align=right>";print_qa_select('a_bind_ip', 1);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_create_netdev" value='1'></td><td align=left><?php print WEB_user_create_netdev."</td><td align=right>";print_qa_select('a_create_netdev', 1);?></td></tr>
+        <tr><td><input type=checkbox class="putField" name="e_permanent" value='1'></td><td align=left><?php print WEB_user_permanent."</td><td align=right>";print_qa_select('a_permanent', 0);?></td></tr>
         </table>
         <input type="submit" name="submit" class="btn" value="<?php echo WEB_btn_apply; ?>">
     </form>

+ 1 - 1
html/css/remodal-custom.css

@@ -103,6 +103,6 @@
 
 @media only screen and (min-width: 140px) {
   .remodal {
-    max-width: 380px;
+    max-width: 480px;
   }
 }

+ 33 - 4
html/inc/common.php

@@ -1188,20 +1188,49 @@ function print_dhcp_select($qa_name, $qa_value = 0)
     print "</select>\n";
 }
 
-function print_nagios_handler_select($qa_name)
+function print_nagios_handler_select($db,$qa_name)
 {
+$nagios_handler = get_records_sql($db,"SELECT DISTINCT `nagios_handler` FROM User_auth WHERE `nagios_handler` IS NOT NULL AND `nagios_handler` != '' AND  `deleted`=0");
+if (!empty($nagios_handler) and count($nagios_handler)>0) {
     print "<select name=\"$qa_name\">\n";
     print_select_simple(WEB_select_item_no, '');
-    print_select_simple('restart-port', 'restart-port');
+    foreach ($nagios_handler as $handler) {
+        print_select_simple($handler['nagios_handler'],$handler['nagios_handler']);
+        }
     print "</select>\n";
+    } else {
+    print "<input type=\"text\" name=\"$qa_name\" value=\"\" size=10/>";
+    }
 }
 
-function print_dhcp_acl_select($qa_name)
+function print_dhcp_acl($db,$qa_name)
 {
+$dhcp_acl = get_records_sql($db,"SELECT DISTINCT `dhcp_acl` FROM User_auth WHERE `dhcp_acl` IS NOT NULL AND `dhcp_acl` != '' AND  `deleted`=0");
+if (!empty($dhcp_acl) and count($dhcp_acl)>0) {
     print "<select name=\"$qa_name\">\n";
     print_select_simple(WEB_select_item_no, '');
-    print_select_simple('hotspot-free', 'hotspot-free');
+    foreach ($dhcp_acl as $acl) {
+        print_select_simple($acl['dhcp_acl'],$acl['dhcp_acl']);
+        }
     print "</select>\n";
+    } else {
+    print "<input type=\"text\" name=\"$qa_name\" value=\"\" size=10/>";
+    }
+}
+
+function print_dhcp_option_set($db,$qa_name)
+{
+$dhcp_option_sets = get_records_sql($db,"SELECT DISTINCT `dhcp_option_set` FROM User_auth WHERE `dhcp_option_set` IS NOT NULL AND `dhcp_option_set` != '' AND `deleted`=0");
+if (!empty($dhcp_option_sets) and count($dhcp_option_sets)>0) {
+    print "<select name=\"$qa_name\">\n";
+    print_select_simple(WEB_select_item_no, '');
+    foreach ($dhcp_option_sets as $dhcp_option_set) {
+        print_select_simple($dhcp_option_set['dhcp_option_set'],$dhcp_option_set['dhcp_option_set']);
+        }
+    print "</select>\n";
+    } else {
+    print "<input type=\"text\" name=\"$qa_name\" value=\"\" size=10/>";
+    }
 }
 
 function print_enabled_select($qa_name, $qa_value)