|
|
@ -19,45 +19,42 @@ $smarty->assign("scripts",'changetext.js'); |
|
|
|
include("header.php"); |
|
|
|
include("header.php"); |
|
|
|
|
|
|
|
|
|
|
|
// subnet |
|
|
|
// subnet |
|
|
|
$query = "SELECT |
|
|
|
$sql = "SELECT |
|
|
|
s.subnet_address, |
|
|
|
s.subnet_id AS id, |
|
|
|
s.subnet_mask, |
|
|
|
s.subnet_address AS address, |
|
|
|
s.subnet_dhcp_start, |
|
|
|
s.subnet_mask AS mask, |
|
|
|
s.subnet_dhcp_end, |
|
|
|
s.subnet_dhcp_start AS dhcp_start, |
|
|
|
s.subnet_info, |
|
|
|
s.subnet_dhcp_end AS dhcp_end, |
|
|
|
s.protocol_version, |
|
|
|
s.subnet_info AS info, |
|
|
|
|
|
|
|
s.protocol_version AS proto_vers, |
|
|
|
s.ntp_server, |
|
|
|
s.ntp_server, |
|
|
|
COUNT(node.subnet_id) AS node_counter |
|
|
|
COUNT(node.subnet_id) AS node_counter |
|
|
|
FROM |
|
|
|
FROM |
|
|
|
subnet AS s LEFT JOIN node USING (subnet_id) |
|
|
|
subnet AS s LEFT JOIN node USING (subnet_id) |
|
|
|
WHERE |
|
|
|
WHERE |
|
|
|
s.subnet_id=" . $subnet_id . " |
|
|
|
s.subnet_id=? |
|
|
|
GROUP BY |
|
|
|
GROUP BY |
|
|
|
s.subnet_id"; |
|
|
|
s.subnet_id"; |
|
|
|
|
|
|
|
$sth = $dbh->prepare($sql); |
|
|
|
|
|
|
|
$sth->execute([$subnet_id]); |
|
|
|
|
|
|
|
|
|
|
|
$subnet = $db->db_select($query); |
|
|
|
$subnet = $sth->fetch(PDO::FETCH_OBJ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$smarty->assign("subnet", $subnet); |
|
|
|
|
|
|
|
|
|
|
|
// set needed variables |
|
|
|
// set needed variables |
|
|
|
$subnet_address = $subnet[0]['subnet_address']; |
|
|
|
$subnet_address = $subnet->address; |
|
|
|
$subnet_mask = $subnet[0]['subnet_mask']; |
|
|
|
$subnet_mask = $subnet->mask; |
|
|
|
$subnet_dhcpstart = $subnet[0]['subnet_dhcp_start']; |
|
|
|
$subnet_dhcpstart = $subnet->dhcp_start; |
|
|
|
$subnet_dhcpend = $subnet[0]['subnet_dhcp_end']; |
|
|
|
$subnet_dhcpend = $subnet->dhcp_end; |
|
|
|
$subnet_proto_vers = $subnet[0]['protocol_version']; |
|
|
|
$subnet_proto_vers = $subnet->protocol_version; |
|
|
|
$subnet_ntp_server = $subnet[0]['ntp_server']; |
|
|
|
$subnet_ntp_server = $subnet->ntp_server; |
|
|
|
|
|
|
|
|
|
|
|
// set counters |
|
|
|
// set counters |
|
|
|
$host_counter = pow(2,(32-$subnet_mask)); |
|
|
|
$host_counter = pow(2,(32-$subnet_mask)); |
|
|
|
$node_counter = $subnet[0]['node_counter']; |
|
|
|
$node_counter = $subnet->node_counter; |
|
|
|
$subnet_usedpercentage = round((($node_counter/($host_counter-2))*100), 1); |
|
|
|
$subnet_usedpercentage = round((($node_counter/($host_counter-2))*100), 1); |
|
|
|
|
|
|
|
|
|
|
|
$smarty->assign("subnet_id", $subnet_id); |
|
|
|
|
|
|
|
$smarty->assign("subnet_address", $subnet_address); |
|
|
|
|
|
|
|
$smarty->assign("subnet_mask", $subnet_mask); |
|
|
|
|
|
|
|
$smarty->assign("subnet_dhcpstart", $subnet_dhcpstart); |
|
|
|
|
|
|
|
$smarty->assign("subnet_dhcpend", $subnet_dhcpend); |
|
|
|
|
|
|
|
$smarty->assign("subnet_info", nl2br($subnet[0]['subnet_info'])); |
|
|
|
|
|
|
|
$smarty->assign("subnet_proto_vers", $subnet_proto_vers); |
|
|
|
|
|
|
|
$smarty->assign("subnet_ntp_server", $subnet_ntp_server); |
|
|
|
|
|
|
|
$smarty->assign("node_counter", $node_counter); |
|
|
|
$smarty->assign("node_counter", $node_counter); |
|
|
|
$smarty->assign("subnet_usedpercentage", $subnet_usedpercentage); |
|
|
|
$smarty->assign("subnet_usedpercentage", $subnet_usedpercentage); |
|
|
|
$smarty->assign("config_color_unused", $config_color_unused); |
|
|
|
$smarty->assign("config_color_unused", $config_color_unused); |
|
|
@ -67,25 +64,25 @@ $smarty->assign("free_counter", (($host_counter-2)-$node_counter)); |
|
|
|
// subnet |
|
|
|
// subnet |
|
|
|
|
|
|
|
|
|
|
|
// split up the range |
|
|
|
// split up the range |
|
|
|
$iprange = explode('.', $subnet_address); |
|
|
|
$iprange = explode('.', $subnet->address); |
|
|
|
$iprange1 = $iprange[0]; |
|
|
|
$iprange1 = $iprange[0]; |
|
|
|
$iprange2 = $iprange[1]; |
|
|
|
$iprange2 = $iprange[1]; |
|
|
|
$iprange3 = $iprange[2]; |
|
|
|
$iprange3 = $iprange[2]; |
|
|
|
$iprange4 = $iprange[3]; |
|
|
|
$iprange4 = $iprange[3]; |
|
|
|
|
|
|
|
|
|
|
|
// create empty subnet-array |
|
|
|
// create empty subnet-array |
|
|
|
$subnet = array(); |
|
|
|
$subnetdata = array(); |
|
|
|
|
|
|
|
|
|
|
|
// determine range (Class A/B/C) |
|
|
|
// determine range (Class A/B/C) |
|
|
|
if ($subnet_mask>=24) { |
|
|
|
if ($subnet_mask >= 24) { |
|
|
|
// Class C |
|
|
|
// Class C |
|
|
|
// fill subnet-array with addresses we want to see |
|
|
|
// fill subnet-array with addresses we want to see |
|
|
|
for($i=0;$i<$host_counter;$i++) { |
|
|
|
for($i=0; $i<$host_counter; $i++) { |
|
|
|
// build ip |
|
|
|
// build ip |
|
|
|
$ip = $iprange1 . '.' . $iprange2 . '.' . $iprange3 . '.' . ($iprange4+$i); |
|
|
|
$ip = $iprange1 . '.' . $iprange2 . '.' . $iprange3 . '.' . ($iprange4+$i); |
|
|
|
|
|
|
|
|
|
|
|
// fill subnet-array |
|
|
|
// fill subnet-array |
|
|
|
$subnet[$ip] = array(); |
|
|
|
$subnetdata[$ip] = array(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// calculate broadcast address |
|
|
|
// calculate broadcast address |
|
|
@ -121,7 +118,7 @@ if ($subnet_mask>=24) { |
|
|
|
$ip = $iprange1 . '.' . $iprange2 . '.' . $page2 . '.' . $i; |
|
|
|
$ip = $iprange1 . '.' . $iprange2 . '.' . $page2 . '.' . $i; |
|
|
|
|
|
|
|
|
|
|
|
// fill subnet-array |
|
|
|
// fill subnet-array |
|
|
|
$subnet[$ip] = array(); |
|
|
|
$subnetdata[$ip] = array(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// calculate broadcast address |
|
|
|
// calculate broadcast address |
|
|
@ -162,18 +159,18 @@ if ($subnet_mask>=24) { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Class A |
|
|
|
// Class A |
|
|
|
// which part do we want to see? |
|
|
|
// which part do we want to see? |
|
|
|
if((empty($page)) ? $page=$subnet_address : $page=$page); |
|
|
|
if ((empty($page)) ? $page = $subnet_address : $page = $page); |
|
|
|
$page = explode('.', $page); |
|
|
|
$page = explode('.', $page); |
|
|
|
$page2 = $page[1]; |
|
|
|
$page2 = $page[1]; |
|
|
|
$page3 = $page[2]; |
|
|
|
$page3 = $page[2]; |
|
|
|
|
|
|
|
|
|
|
|
// fill subnet-array with addresses we want to see |
|
|
|
// fill subnet-array with addresses we want to see |
|
|
|
for($i=0;$i<256;$i++) { |
|
|
|
for($i=0; $i<256; $i++) { |
|
|
|
// build ip |
|
|
|
// build ip |
|
|
|
$ip = $iprange1 . '.' . $page2 . '.' . $page3 . '.' . $i; |
|
|
|
$ip = $iprange1 . '.' . $page2 . '.' . $page3 . '.' . $i; |
|
|
|
|
|
|
|
|
|
|
|
// fill subnet-array |
|
|
|
// fill subnet-array |
|
|
|
$subnet[$ip] = array(); |
|
|
|
$subnetdata[$ip] = array(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// calculate broadcast address |
|
|
|
// calculate broadcast address |
|
|
@ -192,7 +189,7 @@ if ($subnet_mask>=24) { |
|
|
|
$smarty->assign("iprange4", $iprange4); |
|
|
|
$smarty->assign("iprange4", $iprange4); |
|
|
|
|
|
|
|
|
|
|
|
// set select box |
|
|
|
// set select box |
|
|
|
if($i==$page2) { |
|
|
|
if($i == $page2) { |
|
|
|
$smarty->assign("row1_selected", "selected"); |
|
|
|
$smarty->assign("row1_selected", "selected"); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -204,7 +201,7 @@ if ($subnet_mask>=24) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// loop addresses in range 3 |
|
|
|
// loop addresses in range 3 |
|
|
|
for($i=0;$i<256;$i++) { |
|
|
|
for($i=0; $i<256; $i++) { |
|
|
|
// send to tpl |
|
|
|
// send to tpl |
|
|
|
$smarty->assign("iprange1", $iprange1); |
|
|
|
$smarty->assign("iprange1", $iprange1); |
|
|
|
$smarty->assign("iprange2", $page2); |
|
|
|
$smarty->assign("iprange2", $page2); |
|
|
@ -238,7 +235,7 @@ if ($subnet_mask>=24) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// get nodes for this subnetview and implement the values into the array |
|
|
|
// get nodes for this subnetview and implement the values into the array |
|
|
|
$query = "SELECT |
|
|
|
$sql = "SELECT |
|
|
|
asset.asset_name, |
|
|
|
asset.asset_name, |
|
|
|
assetclassgroup.assetclassgroup_color, |
|
|
|
assetclassgroup.assetclassgroup_color, |
|
|
|
node.node_id, |
|
|
|
node.node_id, |
|
|
@ -249,34 +246,38 @@ $query = "SELECT |
|
|
|
assetclassgroup, |
|
|
|
assetclassgroup, |
|
|
|
node |
|
|
|
node |
|
|
|
WHERE |
|
|
|
WHERE |
|
|
|
node.node_ip IN ('".implode("','",array_keys($subnet))."') |
|
|
|
node.node_ip IN ('".implode("','",array_keys($subnetdata))."') |
|
|
|
AND node.subnet_id='$subnet_id' |
|
|
|
AND node.subnet_id=? |
|
|
|
AND asset.asset_id=node.asset_id |
|
|
|
AND asset.asset_id=node.asset_id |
|
|
|
AND assetclass.assetclass_id=asset.assetclass_id |
|
|
|
AND assetclass.assetclass_id=asset.assetclass_id |
|
|
|
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id"; |
|
|
|
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id"; |
|
|
|
|
|
|
|
|
|
|
|
$nodes = $db->db_select($query); |
|
|
|
$sth = $dbh->prepare($sql); |
|
|
|
|
|
|
|
$sth->execute([$subnet_id]); |
|
|
|
|
|
|
|
$smarty->assign("locations", $sth->fetchAll()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$nodes = $sth->fetchAll(); |
|
|
|
|
|
|
|
|
|
|
|
$node_counter = count($nodes); |
|
|
|
$node_counter = count($nodes); |
|
|
|
if ($node_counter>0) { |
|
|
|
if ($node_counter > 0) { |
|
|
|
// get objects |
|
|
|
// get objects |
|
|
|
foreach($nodes AS $node) { |
|
|
|
foreach ($nodes AS $node) { |
|
|
|
// add node-values to ip in subnet-array |
|
|
|
// add node-values to ip in subnet-array |
|
|
|
$subnet[$node['node_ip']] = $node; |
|
|
|
$subnetdata[$node['node_ip']] = $node; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// replace ip's in subnet-array (if necessary) |
|
|
|
// replace ip's in subnet-array (if necessary) |
|
|
|
// check for subnet address |
|
|
|
// check for subnet address |
|
|
|
if(array_key_exists($subnet_address, $subnet)) { |
|
|
|
if (array_key_exists($subnet_address, $subnet)) { |
|
|
|
// replace |
|
|
|
// replace |
|
|
|
$subnet[$subnet_address] = array("subnet_address"); |
|
|
|
$subnetdata[$subnet_address] = array("subnet_address"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// check for broadcast address |
|
|
|
// check for broadcast address |
|
|
|
if(array_key_exists($broadcast_address, $subnet)) { |
|
|
|
if (array_key_exists($broadcast_address, $subnet)) { |
|
|
|
// replace |
|
|
|
// replace |
|
|
|
$subnet[$broadcast_address] = array("broadcast_address"); |
|
|
|
$subnetdata[$broadcast_address] = array("broadcast_address"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$dhcpstart = 0; |
|
|
|
$dhcpstart = 0; |
|
|
@ -289,13 +290,13 @@ if ($subnet_dhcpstart && $subnet_dhcpend) { |
|
|
|
// start counter |
|
|
|
// start counter |
|
|
|
// $i=1; |
|
|
|
// $i=1; |
|
|
|
// loop subnet-array |
|
|
|
// loop subnet-array |
|
|
|
foreach ($subnet AS $node_ip => $node) { |
|
|
|
foreach ($subnetdata AS $node_ip => $node) { |
|
|
|
|
|
|
|
|
|
|
|
// make new line? |
|
|
|
// make new line? |
|
|
|
// if(($i%$_SESSION['suser_imagecount']==0 && $i!=$nodes_displayed) ? $tr="</tr><tr>" : $tr=""); |
|
|
|
// if(($i%$_SESSION['suser_imagecount']==0 && $i!=$nodes_displayed) ? $tr="</tr><tr>" : $tr=""); |
|
|
|
|
|
|
|
|
|
|
|
// check if node-ip in DHCP-area |
|
|
|
// check if node-ip in DHCP-area |
|
|
|
$subnet[$node_ip]["dynamic"] = false; |
|
|
|
$subnetdata[$node_ip]["dynamic"] = false; |
|
|
|
if ($dhcpstart > 0) { |
|
|
|
if ($dhcpstart > 0) { |
|
|
|
$ipval = ip2long($node_ip); |
|
|
|
$ipval = ip2long($node_ip); |
|
|
|
if (($ipval >= $dhcpstart) and ($ipval <= $dhcpend)) { |
|
|
|
if (($ipval >= $dhcpstart) and ($ipval <= $dhcpend)) { |
|
|
@ -306,28 +307,28 @@ foreach ($subnet AS $node_ip => $node) { |
|
|
|
// check node |
|
|
|
// check node |
|
|
|
if (empty($node)) { |
|
|
|
if (empty($node)) { |
|
|
|
// empty node to tpl |
|
|
|
// empty node to tpl |
|
|
|
$subnet[$node_ip]["url"] = 'assigniptonode.php?subnet_id=' . $subnet_id . '&node_ip='. $node_ip; |
|
|
|
$subnetdata[$node_ip]["url"] = 'assigniptonode.php?subnet_id=' . $subnet_id . '&node_ip='. $node_ip; |
|
|
|
$subnet[$node_ip]["remotetext"] = $node_ip; |
|
|
|
$subnetdata[$node_ip]["remotetext"] = $node_ip; |
|
|
|
if ($subnet[$node_ip]["dynamic"]) { |
|
|
|
if ($subnetdata[$node_ip]["dynamic"]) { |
|
|
|
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_dynamic; |
|
|
|
$subnetdata[$node_ip]["assetclassgroup_color"] = $config_color_dynamic; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_unused; |
|
|
|
$subnetdata[$node_ip]["assetclassgroup_color"] = $config_color_unused; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (array_key_exists(0, $node) && $node[0]=="subnet_address") { |
|
|
|
} else if (array_key_exists(0, $node) && $node[0]=="subnet_address") { |
|
|
|
// subnet address to tpl |
|
|
|
// subnet address to tpl |
|
|
|
$subnet[$node_ip]["url"] = ""; |
|
|
|
$subnetdata[$node_ip]["url"] = ""; |
|
|
|
$subnet[$node_ip]["remotetext"] = $node_ip . ' ' . $lang['lang_subnet_subnetaddress']; |
|
|
|
$subnetdata[$node_ip]["remotetext"] = $node_ip . ' ' . $lang['lang_subnet_subnetaddress']; |
|
|
|
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_blocked; |
|
|
|
$subnetdata[$node_ip]["assetclassgroup_color"] = $config_color_blocked; |
|
|
|
} else if (array_key_exists(0, $node) && $node[0]=="broadcast_address") { |
|
|
|
} else if (array_key_exists(0, $node) && $node[0]=="broadcast_address") { |
|
|
|
// broadcast address to tpl |
|
|
|
// broadcast address to tpl |
|
|
|
$subnet[$node_ip]["url"] = ""; |
|
|
|
$subnetdata[$node_ip]["url"] = ""; |
|
|
|
$subnet[$node_ip]["remotetext"] = $node_ip . ' ' . $lang['lang_subnet_broadcastaddress']; |
|
|
|
$subnetdata[$node_ip]["remotetext"] = $node_ip . ' ' . $lang['lang_subnet_broadcastaddress']; |
|
|
|
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_blocked; |
|
|
|
$subnetdata[$node_ip]["assetclassgroup_color"] = $config_color_blocked; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// node to tpl |
|
|
|
// node to tpl |
|
|
|
$subnet[$node_ip]["url"] = 'nodeview.php?node_id=' . $node['node_id']; |
|
|
|
$subnetdata[$node_ip]["url"] = 'nodeview.php?node_id=' . $node['node_id']; |
|
|
|
$subnet[$node_ip]["remotetext"] = $node_ip . ' ' . $node['asset_name']; |
|
|
|
$subnetdata[$node_ip]["remotetext"] = $node_ip . ' ' . $node['asset_name']; |
|
|
|
$subnet[$node_ip]["assetclassgroup_color"] = $node['assetclassgroup_color']; |
|
|
|
$subnetdata[$node_ip]["assetclassgroup_color"] = $node['assetclassgroup_color']; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// update counter |
|
|
|
// update counter |
|
|
@ -335,43 +336,30 @@ foreach ($subnet AS $node_ip => $node) { |
|
|
|
|
|
|
|
|
|
|
|
} // foreach |
|
|
|
} // foreach |
|
|
|
|
|
|
|
|
|
|
|
$smarty->assign("subnet", $subnet); |
|
|
|
$smarty->assign("subnetdata", $subnetdata); |
|
|
|
$smarty->assign("imagewrap", $_SESSION['suser_imagecount']); |
|
|
|
$smarty->assign("imagewrap", $_SESSION['suser_imagecount']); |
|
|
|
|
|
|
|
|
|
|
|
// vlan |
|
|
|
// vlans |
|
|
|
$query = "SELECT |
|
|
|
$sql = "SELECT v.vlan_id AS id, v.vlan_name AS name, |
|
|
|
vlan.vlan_id AS vlan_id, |
|
|
|
v.vlan_number AS number |
|
|
|
vlan.vlan_name AS vlan_name, |
|
|
|
FROM subnetvlan AS s JOIN vlan AS v USING (vlan_id) |
|
|
|
vlan.vlan_number AS vlan_number |
|
|
|
WHERE s.subnet_id=? |
|
|
|
FROM |
|
|
|
ORDER BY v.vlan_name"; |
|
|
|
subnetvlan, |
|
|
|
$sth = $dbh->prepare($sql); |
|
|
|
vlan |
|
|
|
$sth->execute([$subnet_id]); |
|
|
|
WHERE |
|
|
|
$smarty->assign("vlans", $sth->fetchAll()); |
|
|
|
subnetvlan.subnet_id=" . $subnet_id . " |
|
|
|
|
|
|
|
AND vlan.vlan_id=subnetvlan.vlan_id |
|
|
|
// locations |
|
|
|
ORDER BY |
|
|
|
$sql = "SELECT l.location_id, l.location_name |
|
|
|
vlan.vlan_name"; |
|
|
|
FROM location AS l LEFT JOIN subnetlocation AS s USING (location_id) |
|
|
|
|
|
|
|
WHERE s.subnet_id=? |
|
|
|
// run query |
|
|
|
ORDER BY l.location_name"; |
|
|
|
$vlans = $db->db_select($query); |
|
|
|
$sth = $dbh->prepare($sql); |
|
|
|
$smarty->assign("vlans", $vlans); |
|
|
|
$sth->execute([$subnet_id]); |
|
|
|
|
|
|
|
$smarty->assign("locations", $sth->fetchAll()); |
|
|
|
// location |
|
|
|
|
|
|
|
$query = "SELECT |
|
|
|
// assetclassgroups |
|
|
|
l.location_id, |
|
|
|
$sql = "SELECT |
|
|
|
l.location_name |
|
|
|
|
|
|
|
FROM |
|
|
|
|
|
|
|
location AS l LEFT JOIN subnetlocation AS s USING (location_id) |
|
|
|
|
|
|
|
WHERE |
|
|
|
|
|
|
|
s.subnet_id=". $subnet_id . " |
|
|
|
|
|
|
|
ORDER BY |
|
|
|
|
|
|
|
l.location_name"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$locations = $db->db_select($query); |
|
|
|
|
|
|
|
$smarty->assign("locations", $locations); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// assetclassgroup |
|
|
|
|
|
|
|
$query = "SELECT |
|
|
|
|
|
|
|
assetclassgroup_id AS id, |
|
|
|
assetclassgroup_id AS id, |
|
|
|
assetclassgroup_name AS name, |
|
|
|
assetclassgroup_name AS name, |
|
|
|
assetclassgroup_color AS color, |
|
|
|
assetclassgroup_color AS color, |
|
|
@ -381,13 +369,12 @@ $query = "SELECT |
|
|
|
LEFT JOIN asset USING (asset_id) |
|
|
|
LEFT JOIN asset USING (asset_id) |
|
|
|
LEFT JOIN assetclass USING (assetclass_id) |
|
|
|
LEFT JOIN assetclass USING (assetclass_id) |
|
|
|
LEFT JOIN assetclassgroup USING (assetclassgroup_id) |
|
|
|
LEFT JOIN assetclassgroup USING (assetclassgroup_id) |
|
|
|
WHERE subnet_id=" . $subnet_id . " |
|
|
|
WHERE subnet_id=? |
|
|
|
GROUP BY assetclass_id |
|
|
|
GROUP BY assetclass_id |
|
|
|
ORDER BY counter DESC"; |
|
|
|
ORDER BY counter DESC"; |
|
|
|
|
|
|
|
$sth = $dbh->prepare($sql); |
|
|
|
// run query |
|
|
|
$sth->execute([$subnet_id]); |
|
|
|
$assetclassgroups = $db->db_select($query); |
|
|
|
$smarty->assign("assetclassgroups", $sth->fetchAll()); |
|
|
|
$smarty->assign("assetclassgroups", $assetclassgroups); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$smarty->display("subnetview.tpl"); |
|
|
|
$smarty->display("subnetview.tpl"); |
|
|
|
|
|
|
|
|
|
|
|