Changes adopted from version 0.5

This commit is contained in:
2023-02-13 10:42:09 +01:00
parent faf5f368f5
commit 76ccecca7f
198 changed files with 10261 additions and 5068 deletions

View File

@@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,34 +20,64 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// start page
// includes
include("includes.php");
// start output
include("header.php");
// set template
$tp = new Template("tpl/vlan.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// check authorisation
$auth = auth("vlan", $config_auth_vlanview, 0);
// setup vlan
// build query
$query = "SELECT
vlan.vlan_id AS vlan_id,
vlan.vlan_number AS vlan_number,
vlan.vlan_name AS vlan_name
FROM
vlan
ORDER BY
vlan.vlan_number";
// run query
$vlans = $db->db_select($query);
// count results
$vlan_counter = count($vlans);
// counter to tpl
$tp->set("vlan_counter", $vlan_counter);
// start output
include("header.php");
// any vlans?
if ($vlan_counter>0) {
// get objects
foreach($vlans AS $vlan) {
// send to tpl
$tp->set("vlan_id", $vlan['vlan_id']);
$tp->set("vlan_number", $vlan['vlan_number']);
$tp->set("vlan_name", $vlan['vlan_name']);
// parse row
$tp->parse("vlan_row");
}
// parse block
$tp->parse("vlan_table");
} else {
// hide block
$tp->hide("vlan_table");
}
// set template
$tp = new Template("tpl/vlan.tpl");
// set language variables
$tp->setvars($lang);
// get vlan info
$result = mysql_query("SELECT vlan_id, vlan_number, vlan_name FROM vlan ORDER BY vlan_number") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("vlan_id", $row->vlan_id);
$tp->set("vlan_name", $row->vlan_name);
$tp->set("vlan_number", $row->vlan_number);
$tp->parse("vlanrow");
}
if (($i>0) ? $tp->parse("vlan") : $tp->hide("vlan"));
// output
$tp->parse();
$tp->spit();
include("footer.php");
// end page
// output
$tp->parse();
$tp->spit();
// end output
include("footer.php");
?>