<?php /** * Script to display available VLANs */ /* verify that user is authenticated! */ isUserAuthenticated(); /* check if admin */ if (checkAdmin(false)) { $admin = true; } /* get all VLANs and subnet descriptions */ $vlans = getAllVlans(true); /* get custom fields */ $custom = getCustomFields('vlans'); # title print "<h4>" . _('Available VLANs:') . "</h4>"; print "<hr>"; if ($admin) { print "<a class='btn btn-sm btn-default' href='administration/manageVLANs/' data-action='add' data-switchid='' style='margin-bottom:10px;'><i class='fa fa-pencil'></i> " . _('Manage') . "</a>"; } # table print "<table id='vlans' class='table table-striped table-condensed table-top'>"; /* headers */ print '<tr">' . "\n"; print ' <th>' . _('Number') . '</th>' . "\n"; print ' <th>' . _('Name') . '</th>' . "\n"; print ' <th>' . _('Description') . '</th>' . "\n"; print ' <th>' . _('Belonging subnets') . '</th>' . "\n"; print ' <th>' . _('Section') . '</th>' . "\n"; print ' <th class="hidden-xs hidden-sm">' . _('Used') . '</th>' . "\n";
<?php /** * Print all available VLANs and configurations ************************************************/ /* verify that user is admin */ checkAdmin(); /* get all available VLANSs */ $vlans = getAllVlans(); /* get custom fields */ $custom = getCustomFields('vlans'); /* check customfields */ $ffields = json_decode($settings['hiddenCustomFields'], true); if (is_array($ffields['vlans'])) { $ffields = $ffields['vlans']; } else { $ffields = array(); } //size of custom fields $csize = sizeof($custom) - sizeof($ffields); ?> <h4><?php print _('Manage VLANs'); ?> </h4> <hr><br> <!-- add new --> <button class="btn btn-sm btn-default editVLAN" data-action="add" data-vlanid="" style="margin-bottom:10px;"><i class="fa fa-plus"></i> <?php print _('Add VLAN');