Some more minor GUI improvements
This commit is contained in:
		
							parent
							
								
									6ebaea2d45
								
							
						
					
					
						commit
						f0992b4b64
					
				
							
								
								
									
										28
									
								
								index.php
								
								
								
								
							
							
						
						
									
										28
									
								
								index.php
								
								
								
								
							| 
						 | 
					@ -14,29 +14,45 @@ include("header.php");
 | 
				
			||||||
// Statistics
 | 
					// Statistics
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// asset
 | 
					// asset
 | 
				
			||||||
$sth = $dbh->query("SELECT COUNT(asset_id) AS asset_counter FROM asset");
 | 
					$sth = $dbh->query("SELECT COUNT(asset_id) FROM asset");
 | 
				
			||||||
$smarty->assign("asset_counter", $sth->fetchColumn());
 | 
					$smarty->assign("asset_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// assetclass
 | 
				
			||||||
 | 
					$sth = $dbh->query("SELECT COUNT(assetclass_id) AS asset_counter FROM assetclass");
 | 
				
			||||||
 | 
					$smarty->assign("assetclass_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// assetclassgroup
 | 
				
			||||||
 | 
					$sth = $dbh->query("SELECT COUNT(assetclassgroup_id) FROM assetclassgroup");
 | 
				
			||||||
 | 
					$smarty->assign("assetclassgroup_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// location
 | 
					// location
 | 
				
			||||||
$sth = $dbh->query("SELECT COUNT(location_id) AS location_counter FROM location");
 | 
					$sth = $dbh->query("SELECT COUNT(location_id) FROM location");
 | 
				
			||||||
$smarty->assign("location_counter", $sth->fetchColumn());
 | 
					$smarty->assign("location_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// node
 | 
					// node
 | 
				
			||||||
$sth = $dbh->query("SELECT COUNT(node_id) AS node_counter FROM node");
 | 
					$sth = $dbh->query("SELECT COUNT(node_id) FROM node");
 | 
				
			||||||
$smarty->assign("node_counter", $sth->fetchColumn());
 | 
					$smarty->assign("node_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// subnet
 | 
					// subnet
 | 
				
			||||||
$sth = $dbh->query("SELECT COUNT(subnet_id) AS subnet_counter FROM subnet");
 | 
					$sth = $dbh->query("SELECT COUNT(subnet_id) FROM subnet");
 | 
				
			||||||
$smarty->assign("subnet_counter", $sth->fetchColumn());
 | 
					$smarty->assign("subnet_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//  nat
 | 
				
			||||||
 | 
					$sth = $dbh->query("SELECT COUNT(nat_id) FROM nat");
 | 
				
			||||||
 | 
					$smarty->assign("nat_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//  vlan
 | 
					//  vlan
 | 
				
			||||||
$sth = $dbh->query("SELECT COUNT(vlan_id) AS vlan_counter FROM vlan");
 | 
					$sth = $dbh->query("SELECT COUNT(vlan_id) FROM vlan");
 | 
				
			||||||
$smarty->assign("vlan_counter", $sth->fetchColumn());
 | 
					$smarty->assign("vlan_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// zone
 | 
					// zone
 | 
				
			||||||
$sth = $dbh->query("SELECT COUNT(zone_id) AS zone_counter FROM zone");
 | 
					$sth = $dbh->query("SELECT COUNT(zone_id) FROM zone");
 | 
				
			||||||
$smarty->assign("zone_counter", $sth->fetchColumn());
 | 
					$smarty->assign("zone_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// cable
 | 
				
			||||||
 | 
					$sth = $dbh->query("SELECT COUNT(cable_id) FROM cable");
 | 
				
			||||||
 | 
					$smarty->assign("cable_counter", $sth->fetchColumn());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$smarty->display("index.tpl");
 | 
					$smarty->display("index.tpl");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include("footer.php");
 | 
					include("footer.php");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -99,6 +99,7 @@ $lang = array(
 | 
				
			||||||
    'lang_location_edit' => 'Standort ändern',
 | 
					    'lang_location_edit' => 'Standort ändern',
 | 
				
			||||||
    'lang_location_info' => 'Standortinfo',
 | 
					    'lang_location_info' => 'Standortinfo',
 | 
				
			||||||
    'lang_location_name' => 'Standortname',
 | 
					    'lang_location_name' => 'Standortname',
 | 
				
			||||||
 | 
					    'lang_location_hierarchy' => 'Standorthierarchie',
 | 
				
			||||||
    'lang_location_parent' => 'Übergeordneter Standort',
 | 
					    'lang_location_parent' => 'Übergeordneter Standort',
 | 
				
			||||||
    'lang_sublocation_add' => 'Unterstandort hinzufügen',
 | 
					    'lang_sublocation_add' => 'Unterstandort hinzufügen',
 | 
				
			||||||
    'lang_location_none' => 'Es sind keine Standorte vorhanden',
 | 
					    'lang_location_none' => 'Es sind keine Standorte vorhanden',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -99,6 +99,7 @@ $lang = array(
 | 
				
			||||||
    'lang_location_edit' => 'Modify location',
 | 
					    'lang_location_edit' => 'Modify location',
 | 
				
			||||||
    'lang_location_info' => 'Location info',
 | 
					    'lang_location_info' => 'Location info',
 | 
				
			||||||
    'lang_location_name' => 'Location name',
 | 
					    'lang_location_name' => 'Location name',
 | 
				
			||||||
 | 
					    'lang_location_hierarchy' => 'Location hierarchy',
 | 
				
			||||||
    'lang_location_parent' => 'Parent',
 | 
					    'lang_location_parent' => 'Parent',
 | 
				
			||||||
    'lang_sublocation_add' => 'Add Sub-location',
 | 
					    'lang_sublocation_add' => 'Add Sub-location',
 | 
				
			||||||
    'lang_location_none' => 'There are no locations defined',
 | 
					    'lang_location_none' => 'There are no locations defined',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,6 +16,7 @@ $sql = "SELECT location_id AS id, location_name AS value, location_parent AS par
 | 
				
			||||||
        ORDER BY location_parent, location_sort, location_name";
 | 
					        ORDER BY location_parent, location_sort, location_name";
 | 
				
			||||||
$sth = $dbh->query($sql);
 | 
					$sth = $dbh->query($sql);
 | 
				
			||||||
$locations = $sth->fetchAll();
 | 
					$locations = $sth->fetchAll();
 | 
				
			||||||
 | 
					$smarty->assign('location_count', count($locations));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// function for recursion
 | 
					// function for recursion
 | 
				
			||||||
function build_tree($parent_id, $level) {
 | 
					function build_tree($parent_id, $level) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								node.php
								
								
								
								
							
							
						
						
									
										6
									
								
								node.php
								
								
								
								
							| 
						 | 
					@ -34,9 +34,11 @@ if(isset($_GET['subnet_id'])) {
 | 
				
			||||||
// create sql with optional filter
 | 
					// create sql with optional filter
 | 
				
			||||||
$where = join(' AND ', $w);
 | 
					$where = join(' AND ', $w);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$sql = "SELECT a.asset_id, a.asset_info, 
 | 
					$sql = "SELECT a.asset_id,
 | 
				
			||||||
 | 
					            CONCAT(LEFT(a.asset_info,30), IF(CHAR_LENGTH(a.asset_info)>30,'...','')) AS asset_info,
 | 
				
			||||||
            REPLACE(a.asset_name, ' ', ' ') AS asset_name,
 | 
					            REPLACE(a.asset_name, ' ', ' ') AS asset_name,
 | 
				
			||||||
            n.node_id, n.node_ip
 | 
					            n.node_id, n.node_ip,
 | 
				
			||||||
 | 
					            CONCAT(LEFT(n.node_info,30), IF(CHAR_LENGTH(n.node_info)>30,'...','')) AS node_info
 | 
				
			||||||
        FROM node AS n LEFT JOIN asset AS a USING (asset_id)";
 | 
					        FROM node AS n LEFT JOIN asset AS a USING (asset_id)";
 | 
				
			||||||
if ($where) {
 | 
					if ($where) {
 | 
				
			||||||
    $sql .= ' WHERE ' . $where;
 | 
					    $sql .= ' WHERE ' . $where;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,6 +18,22 @@
 | 
				
			||||||
        <a href="asset.php">{$asset_counter}</a>
 | 
					        <a href="asset.php">{$asset_counter}</a>
 | 
				
			||||||
    </td>
 | 
					    </td>
 | 
				
			||||||
</tr>
 | 
					</tr>
 | 
				
			||||||
 | 
					<tr>
 | 
				
			||||||
 | 
					    <td class="label">
 | 
				
			||||||
 | 
					        {$lang_assetclasses}
 | 
				
			||||||
 | 
					    </td>
 | 
				
			||||||
 | 
					    <td class="value">
 | 
				
			||||||
 | 
					        <a href="assetclass.php">{$assetclass_counter}</a>
 | 
				
			||||||
 | 
					    </td>
 | 
				
			||||||
 | 
					</tr>
 | 
				
			||||||
 | 
					<tr>
 | 
				
			||||||
 | 
					    <td class="label">
 | 
				
			||||||
 | 
					        {$lang_assetclassgroups}
 | 
				
			||||||
 | 
					    </td>
 | 
				
			||||||
 | 
					    <td class="value">
 | 
				
			||||||
 | 
					        <a href="assetclassgroup.php">{$assetclassgroup_counter}</a>
 | 
				
			||||||
 | 
					    </td>
 | 
				
			||||||
 | 
					</tr>
 | 
				
			||||||
<tr>
 | 
					<tr>
 | 
				
			||||||
    <td class="label">
 | 
					    <td class="label">
 | 
				
			||||||
        {$lang_locations}
 | 
					        {$lang_locations}
 | 
				
			||||||
| 
						 | 
					@ -34,6 +50,14 @@
 | 
				
			||||||
        <a href="node.php">{$node_counter}</a>
 | 
					        <a href="node.php">{$node_counter}</a>
 | 
				
			||||||
    </td>
 | 
					    </td>
 | 
				
			||||||
</tr>
 | 
					</tr>
 | 
				
			||||||
 | 
					<tr>
 | 
				
			||||||
 | 
					    <td class="label">
 | 
				
			||||||
 | 
					        {$lang_nat_rules}
 | 
				
			||||||
 | 
					    </td>
 | 
				
			||||||
 | 
					    <td class="value">
 | 
				
			||||||
 | 
					        <a href="nat.php">{$nat_counter}</a>
 | 
				
			||||||
 | 
					    </td>
 | 
				
			||||||
 | 
					</tr>
 | 
				
			||||||
<tr>
 | 
					<tr>
 | 
				
			||||||
    <td class="label">
 | 
					    <td class="label">
 | 
				
			||||||
        {$lang_subnets}
 | 
					        {$lang_subnets}
 | 
				
			||||||
| 
						 | 
					@ -58,4 +82,14 @@
 | 
				
			||||||
        <a href="zone.php">{$zone_counter}</a>
 | 
					        <a href="zone.php">{$zone_counter}</a>
 | 
				
			||||||
    </td>
 | 
					    </td>
 | 
				
			||||||
</tr>
 | 
					</tr>
 | 
				
			||||||
 | 
					{if $suser_admin}
 | 
				
			||||||
 | 
					<tr>
 | 
				
			||||||
 | 
					    <td class="label">
 | 
				
			||||||
 | 
					        {$lang_cables}
 | 
				
			||||||
 | 
					    </td>
 | 
				
			||||||
 | 
					    <td class="value">
 | 
				
			||||||
 | 
					        <a href="cable.php">{$cable_counter}</a>
 | 
				
			||||||
 | 
					    </td>
 | 
				
			||||||
 | 
					</tr>
 | 
				
			||||||
 | 
					{/if}
 | 
				
			||||||
</table>
 | 
					</table>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
<tr>
 | 
					<tr>
 | 
				
			||||||
    <td class="header">
 | 
					    <td class="header">
 | 
				
			||||||
        <img class="icon" src="images/building.png" alt="" />
 | 
					        <img class="icon" src="images/building.png" alt="" />
 | 
				
			||||||
        {$lang_locations} ({$locations|@count})
 | 
					        {$lang_locations} ({$location_count})
 | 
				
			||||||
    </td>
 | 
					    </td>
 | 
				
			||||||
    <td align="right">
 | 
					    <td align="right">
 | 
				
			||||||
{if $suser_add || $suser_admin}
 | 
					{if $suser_add || $suser_admin}
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,7 @@
 | 
				
			||||||
<table class="info">
 | 
					<table class="info">
 | 
				
			||||||
<tr>
 | 
					<tr>
 | 
				
			||||||
    <td class="header">
 | 
					    <td class="header">
 | 
				
			||||||
        {$lang_location_name}
 | 
					        {$lang_location_hierarchy}
 | 
				
			||||||
    </td>
 | 
					    </td>
 | 
				
			||||||
</tr>
 | 
					</tr>
 | 
				
			||||||
<tr>
 | 
					<tr>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,6 +16,9 @@
 | 
				
			||||||
        <td class="header">
 | 
					        <td class="header">
 | 
				
			||||||
            {$lang_ip}
 | 
					            {$lang_ip}
 | 
				
			||||||
        </td>
 | 
					        </td>
 | 
				
			||||||
 | 
					        <td class="header">
 | 
				
			||||||
 | 
					            {$lang_node_info}
 | 
				
			||||||
 | 
					        </td>
 | 
				
			||||||
        <td class="header">
 | 
					        <td class="header">
 | 
				
			||||||
            {$lang_asset_name}
 | 
					            {$lang_asset_name}
 | 
				
			||||||
        </td>
 | 
					        </td>
 | 
				
			||||||
| 
						 | 
					@ -28,6 +31,9 @@
 | 
				
			||||||
        <td class="label">
 | 
					        <td class="label">
 | 
				
			||||||
            <a href="nodeview.php?node_id={$node.node_id}">{if $node.node_ip}{$node.node_ip}{else}(leer){/if}</a>
 | 
					            <a href="nodeview.php?node_id={$node.node_id}">{if $node.node_ip}{$node.node_ip}{else}(leer){/if}</a>
 | 
				
			||||||
        </td>
 | 
					        </td>
 | 
				
			||||||
 | 
					        <td class="value">
 | 
				
			||||||
 | 
					            {$node.node_info}
 | 
				
			||||||
 | 
					        </td>
 | 
				
			||||||
        <td class="value">
 | 
					        <td class="value">
 | 
				
			||||||
            <a href="assetview.php?asset_id={$node.asset_id}">{$node.asset_name}</a>
 | 
					            <a href="assetview.php?asset_id={$node.asset_id}">{$node.asset_name}</a>
 | 
				
			||||||
        </td>
 | 
					        </td>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue