Example #1
0
	<th style="width:5px;"></th>
</tr>


<?php 
if (sizeof($subnets) > 0) {
    /* each query result */
    foreach ($subnets as $subn) {
        foreach ($subn as $line) {
            # check permission
            $permission = checkSubnetPermission($line['id']);
            if ($permission != "0") {
                //get section details
                $section = getSectionDetailsById($line['sectionId']);
                //get vlan number
                $vlan = subnetGetVLANDetailsById($line['vlanId']);
                //format requests
                if ($line['allowRequests'] == 1) {
                    $line['allowRequests'] = "enabled";
                } else {
                    $line['allowRequests'] = "disabled";
                }
                //format master subnet
                if ($line['masterSubnetId'] == 0) {
                    $line['masterSubnetId'] = "/";
                } else {
                    $line['masterSubnetId'] = getSubnetDetailsById($line['masterSubnetId']);
                    # folder?
                    if ($line['isFolder'] == 1) {
                        $line['masterSubnetId'] = "<i class='fa fa-folder-o fa fa-gray'></i> {$line['description']}";
                    } else {
Example #2
0
<!-- IP addresses -->
<?php 
        /* if no result print nothing found */
        if (sizeof($result) > 0) {
            $m = 0;
            //for section change
            /* print content */
            foreach ($result as $line) {
                # check permission
                $permission = checkSubnetPermission($line['subnetId']);
                if ($permission != "0") {
                    //get the Subnet details
                    $subnet = getSubnetDetailsById($line['subnetId']);
                    //get vlan number
                    $vlan = subnetGetVLANDetailsById($subnet['vlanId']);
                    //get section
                    $section = getSectionDetailsById($subnet['sectionId']);
                    //detect section change and print headers
                    if ($result[$m]['subnetId'] != $result[$m - 1]['subnetId']) {
                        print '<tr>' . "\n";
                        print '	<th colspan="' . $colSpan . '">' . $section['name'] . ' :: <a href="' . create_link("subnets", $subnet['sectionId'], $subnet['id']) . '" style="font-weight:300">' . $subnet['description'] . ' (' . transform2long($subnet['subnet']) . '/' . $subnet['mask'] . ')</a></th>' . "\n";
                        print '</tr>';
                    }
                    $m++;
                    $stateClass = "";
                    if (in_array('state', $setFields)) {
                        if ($line['state'] == "0") {
                            $stateClass = "offline";
                        } else {
                            if ($line['state'] == "2") {