parent
808ae831bf
commit
37f4bd4185
@ -1,2 +1,3 @@ |
|||||||
*~ |
*~ |
||||||
tpl_c/*.php |
tpl_c/*.php |
||||||
|
config.php |
||||||
|
@ -1,82 +1,55 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
// create letter links |
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
SUBSTRING(UPPER(asset.asset_name),1,1) AS asset_letter |
||||||
|
FROM |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
asset |
||||||
or contact me at wietsew@users.sourceforge.net |
GROUP BY |
||||||
*****************************************************************************/ |
asset_letter |
||||||
|
ORDER BY |
||||||
// start page |
asset_letter"; |
||||||
// includes |
|
||||||
include("includes.php"); |
$alphabet = $db->db_select($query); |
||||||
|
$smarty->assign("alphabet", $alphabet); |
||||||
// start output |
|
||||||
include("header.php"); |
// setup current letter |
||||||
|
if(isset($_GET['asset_letter'])) { |
||||||
// set language variables |
$asset_letter = sanitize($_GET['asset_letter']); |
||||||
$smarty->assign($lang); |
} else { |
||||||
|
$asset_letter = $alphabet[0]['asset_letter']; |
||||||
// create letter links |
} |
||||||
// build query |
|
||||||
$query = "SELECT |
$query = "SELECT |
||||||
SUBSTRING(UPPER(asset.asset_name),1,1) AS asset_letter |
a.asset_id, |
||||||
FROM |
IF(LENGTH(a.asset_name)>0, a.asset_name, '...') AS asset_name, |
||||||
asset |
a.asset_info, |
||||||
GROUP BY |
c.assetclass_id, |
||||||
asset_letter |
c.assetclass_name |
||||||
ORDER BY |
FROM |
||||||
asset_letter"; |
asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id) |
||||||
|
WHERE |
||||||
// run query |
SUBSTRING(a.asset_name,1,1) = '" . $asset_letter . "' |
||||||
$alphabet = $db->db_select($query); |
ORDER BY |
||||||
$smarty->assign("alphabet", $alphabet); |
a.asset_name"; |
||||||
|
|
||||||
// setup asset |
$assets = $db->db_select($query); |
||||||
// setup current letter |
|
||||||
if(isset($_GET['asset_letter'])) { |
$smarty->assign("assets", $assets); |
||||||
$asset_letter = sanitize($_GET['asset_letter']); |
|
||||||
} else { |
$smarty->display("asset.tpl"); |
||||||
$asset_letter = $alphabet[0]['asset_letter']; |
|
||||||
} |
include("footer.php"); |
||||||
|
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
a.asset_id, |
|
||||||
IF(LENGTH(a.asset_name)>0, a.asset_name, '...') AS asset_name, |
|
||||||
a.asset_info, |
|
||||||
c.assetclass_id, |
|
||||||
c.assetclass_name |
|
||||||
FROM |
|
||||||
asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id) |
|
||||||
WHERE |
|
||||||
SUBSTRING(a.asset_name,1,1) = '" . $asset_letter . "' |
|
||||||
ORDER BY |
|
||||||
a.asset_name"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assets = $db->db_select($query); |
|
||||||
|
|
||||||
// counter to tpl |
|
||||||
$smarty->assign("assets", $assets); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("asset.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
@ -1,59 +1,33 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
if((isset($_GET['assetclass_id'])) ? $assetclass_id = sanitize($_GET['assetclass_id']) : $assetclass_id = ""); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
assetclass_id, |
||||||
|
assetclass_name |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
assetclass |
||||||
*****************************************************************************/ |
ORDER BY |
||||||
|
assetclass_name"; |
||||||
// start page |
|
||||||
// includes |
$assetclasses = $db->db_select($query); |
||||||
include("includes.php"); |
foreach ($assetclasses as $assetclass) { |
||||||
|
$assetclass_options[$assetclass['assetclass_id']] = $assetclass['assetclass_name']; |
||||||
// get id |
} |
||||||
if((isset($_GET['assetclass_id'])) ? $assetclass_id = sanitize($_GET['assetclass_id']) : $assetclass_id = ""); |
|
||||||
|
$smarty->assign("assetclass_options", $assetclass_options); |
||||||
// start output |
$smarty->display("assetadd.tpl"); |
||||||
include("header.php"); |
|
||||||
|
include("footer.php"); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup assetclass |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
assetclass_id, |
|
||||||
assetclass_name |
|
||||||
FROM |
|
||||||
assetclass |
|
||||||
ORDER BY |
|
||||||
assetclass_name"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assetclasses = $db->db_select($query); |
|
||||||
foreach ($assetclasses as $assetclass) { |
|
||||||
$assetclass_options[$assetclass['assetclass_id']] = $assetclass['assetclass_name']; |
|
||||||
} |
|
||||||
$smarty->assign("assetclass_options", $assetclass_options); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,59 +1,30 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
include("header.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
$query = "SELECT |
||||||
GNU General Public License for more details. |
a.assetclass_id, |
||||||
|
a.assetclass_name, |
||||||
You should have received a copy of the GNU General Public License |
g.assetclassgroup_id, |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
g.assetclassgroup_name, |
||||||
|
g.assetclassgroup_color |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id) |
||||||
*****************************************************************************/ |
ORDER BY |
||||||
|
a.assetclass_name"; |
||||||
// start page |
|
||||||
// includes |
$assetclasses = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
$smarty->assign("assetclasses", $assetclasses); |
||||||
// start output |
$smarty->display("assetclass.tpl"); |
||||||
include("header.php"); |
|
||||||
|
include("footer.php"); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup assetclass |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
a.assetclass_id, |
|
||||||
a.assetclass_name, |
|
||||||
g.assetclassgroup_id, |
|
||||||
g.assetclassgroup_name, |
|
||||||
g.assetclassgroup_color |
|
||||||
FROM |
|
||||||
assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id) |
|
||||||
ORDER BY |
|
||||||
a.assetclass_name"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assetclasses = $db->db_select($query); |
|
||||||
|
|
||||||
// counter to tpl |
|
||||||
$smarty->assign("assetclasses", $assetclasses); |
|
||||||
|
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclass.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,45 +1,20 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']) : $assetclassgroup_id = ""); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup()); |
||||||
// includes |
$smarty->display("assetclassadd.tpl"); |
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// get id |
include("footer.php"); |
||||||
if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']) : $assetclassgroup_id = ""); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup assetclassgroup |
|
||||||
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup()); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclassadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,59 +1,32 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$assetclass_id = sanitize($_GET['assetclass_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
assetclass_id, |
||||||
|
assetclass_name |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
assetclass |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
assetclass_id=" . $assetclass_id; |
||||||
// start page |
|
||||||
// includes |
$assetclass = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']); |
||||||
// get id |
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']); |
||||||
$assetclass_id = sanitize($_GET['assetclass_id']); |
|
||||||
|
$smarty->display("assetclassdel.tpl"); |
||||||
// start output |
|
||||||
include("header.php"); |
include("footer.php"); |
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup assetclass |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
assetclass_id, |
|
||||||
assetclass_name |
|
||||||
FROM |
|
||||||
assetclass |
|
||||||
WHERE |
|
||||||
assetclass_id=" . $assetclass_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assetclass = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']); |
|
||||||
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclassdel.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,65 +1,35 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$assetclass_id = sanitize($_GET['assetclass_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
include("header.php"); |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$query = "SELECT |
||||||
or contact me at wietsew@users.sourceforge.net |
assetclass_id, |
||||||
*****************************************************************************/ |
assetclass_name, |
||||||
|
assetclassgroup_id |
||||||
|
FROM |
||||||
|
assetclass |
||||||
|
WHERE |
||||||
|
assetclass_id=" . $assetclass_id; |
||||||
|
|
||||||
// start page |
$assetclass = $db->db_select($query); |
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// get id |
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']); |
||||||
$assetclass_id = sanitize($_GET['assetclass_id']); |
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']); |
||||||
|
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']); |
||||||
|
|
||||||
// start output |
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup()); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
$smarty->display("assetclassedit.tpl"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup assetclass |
include("footer.php"); |
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
assetclass_id, |
|
||||||
assetclass_name, |
|
||||||
assetclassgroup_id |
|
||||||
FROM |
|
||||||
assetclass |
|
||||||
WHERE |
|
||||||
assetclass_id=" . $assetclass_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assetclass = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']); |
|
||||||
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']); |
|
||||||
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']); |
|
||||||
|
|
||||||
// setup assetclassgroup |
|
||||||
// build query |
|
||||||
$smarty->assign("assetclassgroup_options", $db->options_assetclassgroup()); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclassedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,54 +1,29 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
include("header.php"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$query = "SELECT |
||||||
or contact me at wietsew@users.sourceforge.net |
assetclassgroup_id, |
||||||
*****************************************************************************/ |
assetclassgroup_name, |
||||||
|
assetclassgroup_color |
||||||
|
FROM |
||||||
|
assetclassgroup |
||||||
|
ORDER BY |
||||||
|
assetclassgroup_name"; |
||||||
|
|
||||||
// start page |
$assetclassgroups = $db->db_select($query); |
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("assetclassgroups", $assetclassgroups); |
||||||
include("header.php"); |
$smarty->display("assetclassgroup.tpl"); |
||||||
|
|
||||||
// set language variables |
include("footer.php"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup assetclassgroup |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
assetclassgroup_id, |
|
||||||
assetclassgroup_name, |
|
||||||
assetclassgroup_color |
|
||||||
FROM |
|
||||||
assetclassgroup |
|
||||||
ORDER BY |
|
||||||
assetclassgroup_name"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assetclassgroups = $db->db_select($query); |
|
||||||
$smarty->assign("assetclassgroups", $assetclassgroups); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclassgroup.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,39 +1,16 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$smarty->display("assetclassgroupadd.tpl"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("footer.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclassgroupadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,59 +1,34 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$smarty->assign($lang); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
$query = "SELECT |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
assetclassgroup_id, |
||||||
or contact me at wietsew@users.sourceforge.net |
assetclassgroup_name |
||||||
*****************************************************************************/ |
FROM |
||||||
|
assetclassgroup |
||||||
// start page |
WHERE |
||||||
// includes |
assetclassgroup_id=" . $assetclassgroup_id; |
||||||
include("includes.php"); |
|
||||||
|
$assetclassgroup = $db->db_select($query); |
||||||
// get id |
|
||||||
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']); |
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']); |
||||||
|
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']); |
||||||
// start output |
|
||||||
include("header.php"); |
$smarty->display("assetclassgroupdel.tpl"); |
||||||
|
|
||||||
// set language variables |
include("footer.php"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup assetclassgroup |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
assetclassgroup_id, |
|
||||||
assetclassgroup_name |
|
||||||
FROM |
|
||||||
assetclassgroup |
|
||||||
WHERE |
|
||||||
assetclassgroup_id=" . $assetclassgroup_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assetclassgroup = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']); |
|
||||||
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclassgroupdel.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,62 +1,37 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
$smarty->assign("scripts", 'jscolor.js'); |
||||||
|
include("header.php"); |
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$smarty->assign($lang); |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$query = "SELECT |
||||||
or contact me at wietsew@users.sourceforge.net |
assetclassgroup_id, |
||||||
*****************************************************************************/ |
assetclassgroup_name, |
||||||
|
assetclassgroup_color |
||||||
// start page |
FROM |
||||||
// includes |
assetclassgroup |
||||||
include("includes.php"); |
WHERE |
||||||
|
assetclassgroup_id=" . $assetclassgroup_id; |
||||||
// get id |
|
||||||
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']); |
$assetclassgroup = $db->db_select($query); |
||||||
|
|
||||||
// start output |
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']); |
||||||
$smarty->assign("scripts", 'jscolor.js'); |
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']); |
||||||
include("header.php"); |
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']); |
||||||
|
|
||||||
// set language variables |
$smarty->display("assetclassgroupedit.tpl"); |
||||||
$smarty->assign($lang); |
|
||||||
|
include("footer.php"); |
||||||
// setup assetclassgroup |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
assetclassgroup.assetclassgroup_id AS assetclassgroup_id, |
|
||||||
assetclassgroup.assetclassgroup_name AS assetclassgroup_name, |
|
||||||
assetclassgroup.assetclassgroup_color AS assetclassgroup_color |
|
||||||
FROM |
|
||||||
assetclassgroup |
|
||||||
WHERE |
|
||||||
assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assetclassgroup = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']); |
|
||||||
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']); |
|
||||||
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclassgroupedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,77 +1,47 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$query = "SELECT |
||||||
// includes |
assetclassgroup_id, |
||||||
include("includes.php"); |
assetclassgroup_name, |
||||||
|
assetclassgroup_color |
||||||
|
FROM |
||||||
|
assetclassgroup |
||||||
|
WHERE |
||||||
|
assetclassgroup_id=" . $assetclassgroup_id; |
||||||
|
|
||||||
// get id |
$assetclassgroup = $db->db_select($query); |
||||||
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']); |
||||||
include("header.php"); |
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']); |
||||||
|
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']); |
||||||
|
|
||||||
// set language variables |
$query = "SELECT |
||||||
$smarty->assign($lang); |
assetclass_id, |
||||||
|
assetclass_name |
||||||
|
FROM |
||||||
|
assetclass |
||||||
|
WHERE |
||||||
|
assetclassgroup_id=" . $assetclassgroup_id . " |
||||||
|
ORDER BY |
||||||
|
assetclass_name"; |
||||||
|
|
||||||
// setup assetclassgroup |
$assetclasses = $db->db_select($query); |
||||||
// build query |
$smarty->assign("assetclasses", $assetclasses); |
||||||
$query = "SELECT |
|
||||||
assetclassgroup_id, |
|
||||||
assetclassgroup_name, |
|
||||||
assetclassgroup_color |
|
||||||
FROM |
|
||||||
assetclassgroup |
|
||||||
WHERE |
|
||||||
assetclassgroup_id=" . $assetclassgroup_id; |
|
||||||
|
|
||||||
// run query |
$smarty->display("assetclassgroupview.tpl"); |
||||||
$assetclassgroup = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
include("footer.php"); |
||||||
$smarty->assign("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']); |
|
||||||
$smarty->assign("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']); |
|
||||||
$smarty->assign("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']); |
|
||||||
|
|
||||||
// setup assetclass |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
assetclass_id, |
|
||||||
assetclass_name |
|
||||||
FROM |
|
||||||
assetclass |
|
||||||
WHERE |
|
||||||
assetclassgroup_id=" . $assetclassgroup_id . " |
|
||||||
ORDER BY |
|
||||||
assetclass_name"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assetclasses = $db->db_select($query); |
|
||||||
$smarty->assign("assetclasses", $assetclasses); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclassgroupview.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,82 +1,51 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$assetclass_id = sanitize($_GET['assetclass_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$query = "SELECT |
||||||
// includes |
a.assetclass_id, a.assetclass_name, |
||||||
include("includes.php"); |
g.assetclassgroup_id, g.assetclassgroup_name, g.assetclassgroup_color |
||||||
|
FROM |
||||||
|
assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id) |
||||||
|
WHERE |
||||||
|
a.assetclass_id=" . $assetclass_id; |
||||||
|
|
||||||
// get id |
$assetclass = $db->db_select($query); |
||||||
$assetclass_id = sanitize($_GET['assetclass_id']); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']); |
||||||
include("header.php"); |
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']); |
||||||
|
$smarty->assign("assetclass_selected", ""); |
||||||
|
|
||||||
// set language variables |
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']); |
||||||
$smarty->assign($lang); |
$smarty->assign("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']); |
||||||
|
$smarty->assign("assetclassgroup_color", $assetclass[0]['assetclassgroup_color']); |
||||||
|
|
||||||
// setup assetclass |
$query = "SELECT |
||||||
// build query |
asset_id, |
||||||
$query = "SELECT |
asset_name, |
||||||
a.assetclass_id, a.assetclass_name, |
CONCAT(LEFT(asset_info, 80), IF(CHAR_LENGTH(asset_info)>80,'...','')) AS asset_info |
||||||
g.assetclassgroup_id, g.assetclassgroup_name, g.assetclassgroup_color |
FROM |
||||||
FROM |
asset |
||||||
assetclass AS a LEFT OUTER JOIN assetclassgroup AS g USING (assetclassgroup_id) |
WHERE |
||||||
WHERE |
assetclass_id='" . $assetclass_id . "' |
||||||
a.assetclass_id=" . $assetclass_id; |
ORDER BY |
||||||
|
asset_name"; |
||||||
|
|
||||||
// run query |
$assets = $db->db_select($query); |
||||||
$assetclass = $db->db_select($query); |
$smarty->assign("assets", $assets); |
||||||
|
|
||||||
// send to tpl |
$smarty->display("assetclassview.tpl"); |
||||||
$smarty->assign("assetclass_id", $assetclass[0]['assetclass_id']); |
|
||||||
$smarty->assign("assetclass_name", $assetclass[0]['assetclass_name']); |
|
||||||
$smarty->assign("assetclass_selected", ""); |
|
||||||
|
|
||||||
$smarty->assign("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']); |
include("footer.php"); |
||||||
$smarty->assign("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']); |
|
||||||
$smarty->assign("assetclassgroup_color", $assetclass[0]['assetclassgroup_color']); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
// setup asset |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
asset_id, |
|
||||||
asset_name, |
|
||||||
CONCAT(LEFT(asset_info, 80), IF(CHAR_LENGTH(asset_info)>80,'...','')) AS asset_info |
|
||||||
FROM |
|
||||||
asset |
|
||||||
WHERE |
|
||||||
assetclass_id='" . $assetclass_id . "' |
|
||||||
ORDER BY |
|
||||||
asset_name"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$assets = $db->db_select($query); |
|
||||||
$smarty->assign("assets", $assets); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetclassview.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
@ -1,74 +1,44 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$asset_id = sanitize($_GET['asset_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$query = "SELECT |
||||||
// includes |
asset_name |
||||||
include("includes.php"); |
FROM |
||||||
|
asset |
||||||
|
WHERE |
||||||
|
asset_id=" . $asset_id; |
||||||
|
|
||||||
// get id |
$asset = $db->db_select($query); |
||||||
$asset_id = sanitize($_GET['asset_id']); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("asset_id", $asset_id); |
||||||
include("header.php"); |
$smarty->assign("asset_name", $asset[0]['asset_name']); |
||||||
|
|
||||||
// set language variables |
$query = "SELECT |
||||||
$smarty->assign($lang); |
node_id, |
||||||
|
node_ip |
||||||
|
FROM |
||||||
|
node |
||||||
|
WHERE |
||||||
|
asset_id=" . $asset_id . " |
||||||
|
ORDER BY |
||||||
|
INET_ATON(node_ip)"; |
||||||
|
|
||||||
// setup asset |
$nodes = $db->db_select($query); |
||||||
// build query |
$smarty->assign("nodes", $nodes); |
||||||
$query = "SELECT |
|
||||||
asset_name |
|
||||||
FROM |
|
||||||
asset |
|
||||||
WHERE |
|
||||||
asset_id=" . $asset_id; |
|
||||||
|
|
||||||
// run query |
$smarty->display("assetdel.tpl"); |
||||||
$asset = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
include("footer.php"); |
||||||
$smarty->assign("asset_id", $asset_id); |
|
||||||
$smarty->assign("asset_name", $asset[0]['asset_name']); |
|
||||||
|
|
||||||
// setup node |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
node_id, |
|
||||||
node_ip |
|
||||||
FROM |
|
||||||
node |
|
||||||
WHERE |
|
||||||
asset_id=" . $asset_id . " |
|
||||||
ORDER BY |
|
||||||
INET_ATON(node_ip)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$nodes = $db->db_select($query); |
|
||||||
$smarty->assign("nodes", $nodes); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetdel.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,62 +1,35 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$asset_id = sanitize($_GET['asset_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
asset_id, |
||||||
|
asset_name, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
asset_hostname, |
||||||
or contact me at wietsew@users.sourceforge.net |
asset_info, |
||||||
*****************************************************************************/ |
assetclass_id |
||||||
|
FROM |
||||||
// start page |
asset |
||||||
// includes |
WHERE |
||||||
include("includes.php"); |
asset_id=" . $asset_id; |
||||||
|
|
||||||
// get id |
$asset = $db->db_select($query); |
||||||
$asset_id = sanitize($_GET['asset_id']); |
$smarty->assign("asset", $asset[0]); |
||||||
|
|
||||||
// start output |
$smarty->assign("assetclass_options", $db->options_assetclass()); |
||||||
include("header.php"); |
|
||||||
|
$smarty->display("assetedit.tpl"); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
include("footer.php"); |
||||||
|
|
||||||
// setup asset |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
asset_id, |
|
||||||
asset_name, |
|
||||||
asset_hostname, |
|
||||||
asset_info, |
|
||||||
assetclass_id |
|
||||||
FROM |
|
||||||
asset |
|
||||||
WHERE |
|
||||||
asset_id=" . $asset_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$asset = $db->db_select($query); |
|
||||||
$smarty->assign("asset", $asset[0]); |
|
||||||
|
|
||||||
// setup assetclass |
|
||||||
$smarty->assign("assetclass_options", $db->options_assetclass()); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetedit.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,84 +1,54 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$asset_id = sanitize($_GET['asset_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
a.asset_name, |
||||||
|
a.asset_hostname, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
a.asset_info, |
||||||
or contact me at wietsew@users.sourceforge.net |
c.assetclass_id, |
||||||
*****************************************************************************/ |
c.assetclass_name |
||||||
|
FROM |
||||||
// start page |
asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id) |
||||||
// includes |
WHERE |
||||||
include("includes.php"); |
a.asset_id=" . $asset_id; |
||||||
|
|
||||||
// get id |
$asset = $db->db_select($query); |
||||||
$asset_id = sanitize($_GET['asset_id']); |
|
||||||
|
$smarty->assign("asset_id", $asset_id); |
||||||
// start output |
$smarty->assign("asset_name", $asset[0]['asset_name']); |
||||||
include("header.php"); |
$smarty->assign("asset_hostname", $asset[0]['asset_hostname']); |
||||||
|
$smarty->assign("asset_info", nl2br($asset[0]['asset_info'])); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
$smarty->assign("assetclass_id", $asset[0]['assetclass_id']); |
||||||
|
$smarty->assign("assetclass_name", $asset[0]['assetclass_name']); |
||||||
// setup asset |
|
||||||
// build query |
$query = "SELECT |
||||||
$query = "SELECT |
node_id, |
||||||
a.asset_name, |
node_ip, |
||||||
a.asset_hostname, |
LEFT(node_info, 40) as node_info |
||||||
a.asset_info, |
FROM |
||||||
c.assetclass_id, |
node |
||||||
c.assetclass_name |
WHERE |
||||||
FROM |
asset_id=" . $asset_id . " |
||||||
asset AS a LEFT OUTER JOIN assetclass AS c USING (assetclass_id) |
ORDER BY |
||||||
WHERE |
INET_ATON(node_ip)"; |
||||||
a.asset_id=" . $asset_id; |
|
||||||
|
$nodes = $db->db_select($query); |
||||||
// run query |
$smarty->assign("nodes", $nodes); |
||||||
$asset = $db->db_select($query); |
|
||||||
|
$smarty->display("assetview.tpl"); |
||||||
// send to tpl |
|
||||||
$smarty->assign("asset_id", $asset_id); |
include("footer.php"); |
||||||
$smarty->assign("asset_name", $asset[0]['asset_name']); |
|
||||||
$smarty->assign("asset_hostname", $asset[0]['asset_hostname']); |
|
||||||
$smarty->assign("asset_info", nl2br($asset[0]['asset_info'])); |
|
||||||
|
|
||||||
$smarty->assign("assetclass_id", $asset[0]['assetclass_id']); |
|
||||||
$smarty->assign("assetclass_name", $asset[0]['assetclass_name']); |
|
||||||
|
|
||||||
// setup node |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
node_id, |
|
||||||
node_ip, |
|
||||||
LEFT(node_info, 40) as node_info |
|
||||||
FROM |
|
||||||
node |
|
||||||
WHERE |
|
||||||
asset_id=" . $asset_id . " |
|
||||||
ORDER BY |
|
||||||
INET_ATON(node_ip)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$nodes = $db->db_select($query); |
|
||||||
$smarty->assign("nodes", $nodes); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assetview.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
@ -1,61 +1,35 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$node_ip = sanitize($_GET['node_ip']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
GNU General Public License for more details. |
|
||||||
|
include("header.php"); |
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$query = "SELECT |
||||||
|
subnet_address, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
subnet_mask |
||||||
or contact me at wietsew@users.sourceforge.net |
FROM |
||||||
*****************************************************************************/ |
subnet |
||||||
|
WHERE |
||||||
// start page |
subnet_id=" . $subnet_id; |
||||||
// includes |
|
||||||
include("includes.php"); |
$subnet = $db->db_select($query); |
||||||
|
|
||||||
// get ip and id |
$smarty->assign("subnet_id", $subnet_id); |
||||||
$node_ip = sanitize($_GET['node_ip']); |
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
$smarty->assign("node_ip", $node_ip); |
||||||
// start output |
|
||||||
include("header.php"); |
$smarty->display("assigniptonode.tpl"); |
||||||
|
|
||||||
// set language variables |
include("footer.php"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
subnet_address, |
|
||||||
subnet_mask |
|
||||||
FROM |
|
||||||
subnet |
|
||||||
WHERE |
|
||||||
subnet_id=" . $subnet_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnet = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("subnet_id", $subnet_id); |
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
|
||||||
$smarty->assign("node_ip", $node_ip); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assigniptonode.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,79 +1,49 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$asset_id = sanitize($_GET['asset_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$node_ip = sanitize($_GET['node_ip']); |
||||||
|
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$smarty->assign("node_ip", $node_ip); |
||||||
// includes |
$smarty->assign("asset_id", $asset_id); |
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// get id |
$query = "SELECT |
||||||
$asset_id = sanitize($_GET['asset_id']); |
asset_id, |
||||||
$node_ip = sanitize($_GET['node_ip']); |
asset_name |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
FROM |
||||||
|
asset |
||||||
|
ORDER BY |
||||||
|
asset_name"; |
||||||
|
|
||||||
// start output |
$assets = $db->db_select($query); |
||||||
include("header.php"); |
foreach ($assets as $asset) { |
||||||
|
$asset_options[$asset['asset_id']] = $asset['asset_name']; |
||||||
|
} |
||||||
|
$smarty->assign("asset_options", $asset_options); |
||||||
|
|
||||||
// set language variables |
$query = "SELECT subnet_id, |
||||||
$smarty->assign($lang); |
CONCAT_WS('/', subnet_address, subnet_mask) AS subnet_name |
||||||
|
FROM subnet |
||||||
|
ORDER BY INET_ATON(subnet_address)"; |
||||||
|
|
||||||
// to tpl |
$subnets = $db->db_select($query); |
||||||
$smarty->assign("node_ip", $node_ip); |
foreach ($subnets as $subnet) { |
||||||
|
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_name']; |
||||||
|
} |
||||||
|
$smarty->assign("subnet_options", $subnet_options); |
||||||
|
|
||||||
// setup asset |
$smarty->display("assignnodetoasset.tpl"); |
||||||
$smarty->assign("asset_id", $asset_id); |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
asset_id, |
|
||||||
asset_name |
|
||||||
FROM |
|
||||||
asset |
|
||||||
ORDER BY |
|
||||||
asset_name"; |
|
||||||
|
|
||||||
// run query |
include("footer.php"); |
||||||
$assets = $db->db_select($query); |
|
||||||
foreach ($assets as $asset) { |
|
||||||
$asset_options[$asset['asset_id']] = $asset['asset_name']; |
|
||||||
} |
|
||||||
$smarty->assign("asset_options", $asset_options); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
// build query |
|
||||||
$query = "SELECT subnet_id, |
|
||||||
CONCAT_WS('/', subnet_address, subnet_mask) AS subnet_name |
|
||||||
FROM subnet |
|
||||||
ORDER BY INET_ATON(subnet_address)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnets = $db->db_select($query); |
|
||||||
foreach ($subnets as $subnet) { |
|
||||||
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_name']; |
|
||||||
} |
|
||||||
$smarty->assign("subnet_options", $subnet_options); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("assignnodetoasset.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,42 +1,22 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
include("header.php"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
|
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// includes |
$comments = sanitize($_GET['comments']); |
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("comments", $lang['lang_comments_' . $comments]); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
$smarty->display("comments.tpl"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// get error |
include("footer.php"); |
||||||
$comments = sanitize($_GET['comments']); |
|
||||||
|
|
||||||
// set veriables |
|
||||||
$smarty->assign("comments", $lang['lang_comments_' . $comments]); |
|
||||||
|
|
||||||
// output |
|
||||||
$smarty->display("comments.tpl"); |
|
||||||
|
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,41 +0,0 @@ |
|||||||
<?php
|
|
||||||
/***************************************************************************** |
|
||||||
IP Reg, a PHP/MySQL IPAM tool |
|
||||||
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 |
|
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
|
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// version |
|
||||||
$config_version = 'v0.7'; |
|
||||||
|
|
||||||
// db connection |
|
||||||
$config_mysql_host = 'localhost'; |
|
||||||
$config_mysql_username = 'ipreg'; |
|
||||||
$config_mysql_password = 'changeme!'; |
|
||||||
$config_mysql_dbname = 'ipreg'; |
|
||||||
|
|
||||||
// default values for IP blocks |
|
||||||
$config_color_blocked = 'dcdcdc'; |
|
||||||
$config_color_unused = 'ffffff'; |
|
||||||
$config_color_dynamic = 'e0e0e0'; |
|
||||||
|
|
||||||
// language |
|
||||||
$config_lang = array('de', 'en'); |
|
||||||
$config_lang_default = 'en'; |
|
||||||
|
|
||||||
?> |
|
@ -0,0 +1,28 @@ |
|||||||
|
<?php |
||||||
|
/***************************************************************************** |
||||||
|
IP Reg, a PHP/MySQL IPAM tool |
||||||
|
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
|
*****************************************************************************/ |
||||||
|
|
||||||
|
// version |
||||||
|
$config_version = 'v0.7'; |
||||||
|
|
||||||
|
// db connection |
||||||
|
$config_mysql_host = 'localhost'; |
||||||
|
$config_mysql_username = 'ipreg'; |
||||||
|
$config_mysql_password = 'changeme!'; |
||||||
|
$config_mysql_dbname = 'ipreg'; |
||||||
|
|
||||||
|
// default values for IP blocks |
||||||
|
$config_color_blocked = 'dcdcdc'; |
||||||
|
$config_color_unused = 'ffffff'; |
||||||
|
$config_color_dynamic = 'e0e0e0'; |
||||||
|
|
||||||
|
// language |
||||||
|
$config_lang = array('de', 'en'); |
||||||
|
$config_lang_default = 'en'; |
||||||
|
|
||||||
|
?> |
@ -1,28 +1,13 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
$dblink = mysqli_connect($config_mysql_host,$config_mysql_username,$config_mysql_password); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
mysqli_select_db($dblink, $config_mysql_dbname); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
|
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// build connection |
|
||||||
$dblink = mysqli_connect($config_mysql_host,$config_mysql_username,$config_mysql_password); |
|
||||||
|
|
||||||
// select db |
|
||||||
mysqli_select_db($dblink, $config_mysql_dbname); |
|
||||||
?> |
?> |
||||||
|
@ -1,31 +1,13 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
$smarty->assign("config_version", $config_version); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$smarty->display("footer.tpl"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
|
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
|
|
||||||
// get version for the footer-stamp |
|
||||||
$smarty->assign("config_version", $config_version); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("footer.tpl"); |
|
||||||
?> |
?> |
@ -1,69 +1,41 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include('lang/' . $_SESSION['suser_language'] . '.php'); |
||||||
This program is distributed in the hope that it will be useful, |
$smarty->assign($lang); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// search box |
||||||
GNU General Public License for more details. |
if (isset($_POST['search'])) { |
||||||
|
$search = sanitize($_POST['search']); |
||||||
You should have received a copy of the GNU General Public License |
$_SESSION['search'] = $search; |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
} else { |
||||||
|
if (isset($_SESSION['search'])) { |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$search = $_SESSION['search']; |
||||||
or contact me at wietsew@users.sourceforge.net |
} else { |
||||||
*****************************************************************************/ |
$search = ''; |
||||||
|
} |
||||||
// start page |
} |
||||||
// include language file |
|
||||||
include('lang/' . $_SESSION['suser_language'] . '.php'); |
$smarty->assign("config_version", $config_version); |
||||||
|
$smarty->assign("suser_name", $_SESSION['suser_displayname']); |
||||||
// set language variables |
$smarty->assign("search", $search); |
||||||
$smarty->assign($lang); |
|
||||||
|
// menu |
||||||
// search box |
$smarty->assign("menu_assets", $_SESSION['suser_menu_assets']=='on'); |
||||||
// new search? |
$smarty->assign("menu_assetclasses", $_SESSION['suser_menu_assetclasses']=='on'); |
||||||
if (isset($_POST['search'])) { |
$smarty->assign("menu_assetclassgroups", $_SESSION['suser_menu_assetclassgroups']=='on'); |
||||||
// set var |
$smarty->assign("menu_locations", $_SESSION['suser_menu_locations']=='on'); |
||||||
$search = sanitize($_POST['search']); |
$smarty->assign("menu_nodes", $_SESSION['suser_menu_nodes']=='on'); |
||||||
|
$smarty->assign("menu_subnets", $_SESSION['suser_menu_subnets']=='on'); |
||||||
// store var |
$smarty->assign("menu_users", $_SESSION['suser_menu_users']=='on'); |
||||||
$_SESSION['search'] = $search; |
$smarty->assign("menu_vlans", $_SESSION['suser_menu_vlans']=='on'); |
||||||
} else { |
$smarty->assign("menu_zones", $_SESSION['suser_menu_zones']=='on'); |
||||||
// check for stored var |
|
||||||
if(isset($_SESSION['search'])) { |
$smarty->display("header.tpl"); |
||||||
// set var |
|
||||||
$search = $_SESSION['search']; |
|
||||||
} else { |
|
||||||
// empty var |
|
||||||
$search = ''; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
// to tpl |
|
||||||
// set global template vars |
|
||||||
$smarty->assign("config_version", $config_version); |
|
||||||
$smarty->assign("suser_name", $_SESSION['suser_displayname']); |
|
||||||
$smarty->assign("search", $search); |
|
||||||
|
|
||||||
// menu |
|
||||||
$smarty->assign("menu_assets", $_SESSION['suser_menu_assets']=='on'); |
|
||||||
$smarty->assign("menu_assetclasses", $_SESSION['suser_menu_assetclasses']=='on'); |
|
||||||
$smarty->assign("menu_assetclassgroups", $_SESSION['suser_menu_assetclassgroups']=='on'); |
|
||||||
$smarty->assign("menu_locations", $_SESSION['suser_menu_locations']=='on'); |
|
||||||
$smarty->assign("menu_nodes", $_SESSION['suser_menu_nodes']=='on'); |
|
||||||
$smarty->assign("menu_subnets", $_SESSION['suser_menu_subnets']=='on'); |
|
||||||
$smarty->assign("menu_users", $_SESSION['suser_menu_users']=='on'); |
|
||||||
$smarty->assign("menu_vlans", $_SESSION['suser_menu_vlans']=='on'); |
|
||||||
$smarty->assign("menu_zones", $_SESSION['suser_menu_zones']=='on'); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("header.tpl"); |
|
||||||
?> |
?> |
@ -1,109 +1,81 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
if(isset($_GET['icon'])) { |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
$icon = sanitize($_GET['icon']); |
||||||
GNU General Public License for more details. |
|
||||||
|
switch($icon) { |
||||||
You should have received a copy of the GNU General Public License |
case ("add") : |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$png = 'page_add'; |
||||||
|
break; |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
case ("back") : |
||||||
or contact me at wietsew@users.sourceforge.net |
$png = 'control_rewind_blue'; |
||||||
*****************************************************************************/ |
break; |
||||||
|
case ("cancel") : |
||||||
// start page |
$png = 'control_rewind_blue'; |
||||||
// includes |
break; |
||||||
include("includes.php"); |
case ("comment") : |
||||||
|
$png = 'comment'; |
||||||
// icon image |
break; |
||||||
if(isset($_GET['icon'])) { |
case ("delete") : |
||||||
// get desired image |
$png = 'page_delete'; |
||||||
$icon = sanitize($_GET['icon']); |
break; |
||||||
|
case ("shred") : |
||||||
// switch selected |
$png = 'bin'; |
||||||
switch($icon) { |
break; |
||||||
case ("add") : |
case ("edit") : |
||||||
$png = 'page_add'; |
$png = 'page_edit'; |
||||||
break; |
break; |
||||||
case ("back") : |
case ("error") : |
||||||
$png = 'control_rewind_blue'; |
$png = 'error'; |
||||||
break; |
break; |
||||||
case ("cancel") : |
case ("help") : |
||||||
$png = 'control_rewind_blue'; |
$png = 'help'; |
||||||
break; |
break; |
||||||
case ("comment") : |
case ("logo") : |
||||||
$png = 'comment'; |
$png = 'logo'; |
||||||
break; |
break; |
||||||
case ("delete") : |
case ("next") : |
||||||
$png = 'page_delete'; |
$png = 'control_fastforward_blue'; |
||||||
break; |
break; |
||||||
case ("shred") : |
case ("save") : |
||||||
$png = 'bin'; |
$png = 'page_save'; |
||||||
break; |
break; |
||||||
case ("edit") : |
case ("search") : |
||||||
$png = 'page_edit'; |
$png = 'magnifier'; |
||||||
break; |
break; |
||||||
case ("error") : |
} |
||||||
$png = 'error'; |
|
||||||
break; |
$image = imagecreatefrompng("images/" . $png . ".png"); |
||||||
case ("help") : |
|
||||||
$png = 'help'; |
imagealphablending($image, true); |
||||||
break; |
|
||||||
case ("logo") : |
imagesavealpha($image, true); |
||||||
$png = 'logo'; |
|
||||||
break; |
header('Content-type: image/png'); |
||||||
case ("next") : |
imagepng($image); |
||||||
$png = 'control_fastforward_blue'; |
imagedestroy($image); |
||||||
break; |
} |
||||||
case ("save") : |
|
||||||
$png = 'page_save'; |
if(isset($_GET['color'])) { |
||||||
break; |
$color = sanitize($_GET['color']); |
||||||
case ("search") : |
|
||||||
$png = 'magnifier'; |
$image = imagecreatetruecolor($_SESSION['suser_imagesize'], $_SESSION['suser_imagesize']); |
||||||
break; |
|
||||||
} |
$color = imagecolorallocate($image, hexdec(substr($color,0,2)), hexdec(substr($color,2,2)), hexdec(substr($color,4,2))); |
||||||
|
|
||||||
// get image |
imagefill($image, 0, 0, $color); |
||||||
$image = imagecreatefrompng("images/" . $png . ".png"); |
|
||||||
|
header('Content-type: image/png'); |
||||||
// alpha blending |
imagepng($image); |
||||||
imagealphablending($image, true); |
imagedestroy($image); |
||||||
|
} |
||||||
// save alphablending setting |
|
||||||
imagesavealpha($image, true); |
|
||||||
|
|
||||||
// display image |
|
||||||
header('Content-type: image/png'); |
|
||||||
imagepng($image); |
|
||||||
imagedestroy($image); |
|
||||||
} |
|
||||||
|
|
||||||
// colored block |
|
||||||
if(isset($_GET['color'])) { |
|
||||||
// get desired color |
|
||||||
$color = sanitize($_GET['color']); |
|
||||||
|
|
||||||
// create base image |
|
||||||
$image = imagecreatetruecolor($_SESSION['suser_imagesize'], $_SESSION['suser_imagesize']); |
|
||||||
|
|
||||||
// build color |
|
||||||
$color = imagecolorallocate($image, hexdec(substr($color,0,2)), hexdec(substr($color,2,2)), hexdec(substr($color,4,2))); |
|
||||||
|
|
||||||
// fill image with color |
|
||||||
imagefill($image, 0, 0, $color); |
|
||||||
|
|
||||||
// display image |
|
||||||
header('Content-type: image/png'); |
|
||||||
imagepng($image); |
|
||||||
imagedestroy($image); |
|
||||||
} |
|
||||||
?> |
?> |
@ -1,50 +1,26 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
session_name('ipreg'); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
session_start(); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// check for user_id, if unnkown, redirect to login |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
if(empty($_SESSION['suser_id'])) { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("config.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
include("dbconnect.php"); |
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// session |
include("lib.php"); |
||||||
// start session |
|
||||||
session_name('ipreg'); |
|
||||||
session_start(); |
|
||||||
|
|
||||||
// check for user_id, if unnkown, redirect to login |
$language = lang_getfrombrowser($config_lang, $config_lang_default, null, false); |
||||||
if(empty($_SESSION['suser_id'])) { |
|
||||||
// redirect |
|
||||||
header("Location: login.php"); |
|
||||||
exit; |
|
||||||
} |
|
||||||
|
|
||||||
// headers |
|
||||||
// raw http headers |
|
||||||
header("Content-Type: text/html; charset=utf-8"); |
|
||||||
|
|
||||||
// includes |
|
||||||
// includes |
|
||||||
include("config.php"); |
|
||||||
include("dbconnect.php"); |
|
||||||
|
|
||||||
// load lib |
|
||||||
include("lib.php"); |
|
||||||
|
|
||||||
// set language |
|
||||||
$language = lang_getfrombrowser($config_lang, $config_lang_default, null, false); |
|
||||||
|
|
||||||
?> |
?> |
@ -1,118 +1,69 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
// asset |
||||||
|
$query = "SELECT |
||||||
You should have received a copy of the GNU General Public License |
COUNT(asset_id) AS asset_counter |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
FROM |
||||||
|
asset"; |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
|
||||||
or contact me at wietsew@users.sourceforge.net |
$assets = $db->db_select($query); |
||||||
*****************************************************************************/ |
$smarty->assign("asset_counter", $assets[0]['asset_counter']); |
||||||
|
|
||||||
// start page |
// location |
||||||
// includes |
$query = "SELECT |
||||||
include("includes.php"); |
COUNT(location_id) AS location_counter |
||||||
|
FROM |
||||||
// start output |
location"; |
||||||
include("header.php"); |
|
||||||
|
$locations = $db->db_select($query); |
||||||
// set language variables |
$smarty->assign("location_counter", $locations[0]['location_counter']); |
||||||
$smarty->assign($lang); |
|
||||||
|
// node |
||||||
// setup asset |
$query = "SELECT |
||||||
// build query |
COUNT(node_id) AS node_counter |
||||||
$query = "SELECT |
FROM |
||||||
COUNT(asset_id) AS asset_counter |
node"; |
||||||
FROM |
|
||||||
asset"; |
$nodes = $db->db_select($query); |
||||||
|
$smarty->assign("node_counter", $nodes[0]['node_counter']); |
||||||
// run query |
|
||||||
$assets = $db->db_select($query); |
// subnet |
||||||
|
$query = "SELECT |
||||||
// counter to tpl |
COUNT(subnet_id) AS subnet_counter |
||||||
$smarty->assign("asset_counter", $assets[0]['asset_counter']); |
FROM |
||||||
|
subnet"; |
||||||
// setup location |
$subnets = $db->db_select($query); |
||||||
// build query |
$smarty->assign("subnet_counter", $subnets[0]['subnet_counter']); |
||||||
$query = "SELECT |
|
||||||
COUNT(location_id) AS location_counter |
// vlan |
||||||
FROM |
$query = "SELECT |
||||||
location"; |
COUNT(vlan_id) AS vlan_counter |
||||||
|
FROM |
||||||
// run query |
vlan"; |
||||||
$locations = $db->db_select($query); |
|
||||||
|
$vlans = $db->db_select($query); |
||||||
// counter to tpl |
$smarty->assign("vlan_counter", $vlans[0]['vlan_counter']); |
||||||
$smarty->assign("location_counter", $locations[0]['location_counter']); |
|
||||||
|
// zone |
||||||
// setup node |
$query = "SELECT |
||||||
// build query |
COUNT(zone_id) AS zone_counter |
||||||
$query = "SELECT |
FROM |
||||||
COUNT(node_id) AS node_counter |
zone"; |
||||||
FROM |
$zones = $db->db_select($query); |
||||||
node"; |
$smarty->assign("zone_counter", $zones[0]['zone_counter']); |
||||||
|
|
||||||
// run query |
$smarty->display("index.tpl"); |
||||||
$nodes = $db->db_select($query); |
|
||||||
|
include("footer.php"); |
||||||
// counter to tpl |
|
||||||
$smarty->assign("node_counter", $nodes[0]['node_counter']); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
COUNT(subnet_id) AS subnet_counter |
|
||||||
FROM |
|
||||||
subnet"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnets = $db->db_select($query); |
|
||||||
|
|
||||||
// counter to tpl |
|
||||||
$smarty->assign("subnet_counter", $subnets[0]['subnet_counter']); |
|
||||||
|
|
||||||
// setup vlan |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
COUNT(vlan_id) AS vlan_counter |
|
||||||
FROM |
|
||||||
vlan"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$vlans = $db->db_select($query); |
|
||||||
|
|
||||||
// counter to tpl |
|
||||||
$smarty->assign("vlan_counter", $vlans[0]['vlan_counter']); |
|
||||||
|
|
||||||
// setup zone |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
COUNT(zone_id) AS zone_counter |
|
||||||
FROM |
|
||||||
zone"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$zones = $db->db_select($query); |
|
||||||
|
|
||||||
// counter to tpl |
|
||||||
$smarty->assign("zone_counter", $zones[0]['zone_counter']); |
|
||||||
|
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("index.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,48 +1,25 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("lib/functions.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
require("lib/db.class.php"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$db = new Db($dblink); |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
require("lib/user.class.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
$user = new User(); |
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// functions |
require_once('smarty3/Smarty.class.php'); |
||||||
include("lib/functions.php"); |
$smarty = new Smarty(); |
||||||
|
$smarty->template_dir = 'tpl'; |
||||||
|
$smarty->compile_dir = 'tpl_c'; |
||||||
|
$smarty->registerPlugin('function', 'treelist', 'print_tree'); |
||||||
|
$smarty->assign("suser_tooltips", $_SESSION['suser_tooltips']); |
||||||
|
|
||||||
// classes |
|
||||||
// db |
|
||||||
// load class |
|
||||||
require("lib/db.class.php"); |
|
||||||
|
|
||||||
// create instance |
|
||||||
$db = new Db($dblink); |
|
||||||
|
|
||||||
// user |
|
||||||
// load class |
|
||||||
require("lib/user.class.php"); |
|
||||||
|
|
||||||
// create instance |
|
||||||
$user = new User(); |
|
||||||
|
|
||||||
// tpl |
|
||||||
require_once('smarty3/Smarty.class.php'); |
|
||||||
$smarty = new Smarty(); |
|
||||||
$smarty->template_dir = 'tpl'; |
|
||||||
$smarty->compile_dir = 'tpl_c'; |
|
||||||
$smarty->registerPlugin('function', 'treelist', 'print_tree'); |
|
||||||
$smarty->assign("suser_tooltips", $_SESSION['suser_tooltips']); |
|
||||||
?> |
?> |
||||||
|
@ -1,70 +1,46 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
$query = "SELECT |
||||||
|
location_id AS id, |
||||||
You should have received a copy of the GNU General Public License |
location_name AS value, |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
location_parent AS parent_id |
||||||
|
FROM |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
location |
||||||
or contact me at wietsew@users.sourceforge.net |
ORDER BY location_parent, location_sort, location_name"; |
||||||
*****************************************************************************/ |
|
||||||
|
$locations = $db->db_select($query); |
||||||
// start page |
|
||||||
// includes |
// function for recursion |
||||||
include("includes.php"); |
function build_tree($parent_id, $level) { |
||||||
|
global $locations; |
||||||
// start output |
$children = array(); |
||||||
include("header.php"); |
foreach ($locations as $key => $location) { |
||||||
|
if ($location['parent_id'] == $parent_id) { |
||||||
// set language variables |
unset($location['parent_id']); |
||||||
$smarty->assign($lang); |
$location['children'] = build_tree($location['id'], $level+1); |
||||||
|
$location['level'] = $level; |
||||||
// start location |
$location['href'] = 'locationview.php?location_id=' . $location['id']; |
||||||
// look for locations |
$children[] = $location; |
||||||
// build query |
} |
||||||
$query = "SELECT |
} |
||||||
location_id AS id, |
return $children; |
||||||
location_name AS value, |
} |
||||||
location_parent AS parent_id |
|
||||||
FROM |
$tree = build_tree(0, 0); |
||||||
location |
$smarty->assign("locations", $tree); |
||||||
ORDER BY location_parent, location_sort, location_name"; |
|
||||||
|
$smarty->display("location.tpl"); |
||||||
// run query |
|
||||||
$locations = $db->db_select($query); |
include("footer.php"); |
||||||
|
|
||||||
function build_tree($parent_id, $level) { |
|
||||||
global $locations; |
|
||||||
$children = array(); |
|
||||||
foreach ($locations as $key => $location) { |
|
||||||
if ($location['parent_id'] == $parent_id) { |
|
||||||
unset($location['parent_id']); |
|
||||||
$location['children'] = build_tree($location['id'], $level+1); |
|
||||||
$location['level'] = $level; |
|
||||||
$location['href'] = 'locationview.php?location_id=' . $location['id']; |
|
||||||
$children[] = $location; |
|
||||||
} |
|
||||||
} |
|
||||||
return $children; |
|
||||||
} |
|
||||||
$tree = build_tree(0, 0); |
|
||||||
$smarty->assign("locations", $tree); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("location.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,109 +1,78 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$location_parent = sanitize($_GET['location_parent']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// get id |
|
||||||
$location_parent = sanitize($_GET['location_parent']); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
|
|
||||||
// ************* <option value="0">{$lang_option_none}</option> |
// ************* <option value="0">{$lang_option_none}</option> |
||||||
|
|
||||||
|
$query = "SELECT location_id, location_name, location_parent, location_sort |
||||||
// start parent |
FROM location |
||||||
// look for locations |
ORDER BY location_parent, location_sort, location_name"; |
||||||
// build query |
|
||||||
$query = "SELECT location_id, location_name, location_parent, location_sort |
$locations = $db->db_select($query); |
||||||
FROM location |
|
||||||
ORDER BY location_parent, location_sort, location_name"; |
$location_counter = count($locations); |
||||||
|
|
||||||
// run query |
if ($location_counter>0) { |
||||||
$locations = $db->db_select($query); |
// get objects |
||||||
|
foreach ($locations AS $location) { |
||||||
// count results |
// create arrays |
||||||
$location_counter = count($locations); |
$location_names[$location['location_id']] = $location['location_name']; |
||||||
|
$parents[$location['location_parent']][] = $location['location_id']; |
||||||
// any loactions? |
} |
||||||
if ($location_counter>0) { |
} |
||||||
// get objects |
|
||||||
foreach($locations AS $location) { |
// look for parents |
||||||
// create arrays |
// function to look for parents and create a new array for every child |
||||||
$location_names[$location['location_id']] = $location['location_name']; |
function location($parents, $parent = 0) { |
||||||
$parents[$location['location_parent']][] = $location['location_id']; |
// loop array to check |
||||||
} |
foreach ($parents[$parent] as $child) { |
||||||
} |
if (isset($parents[$child])) { |
||||||
|
// element has children |
||||||
// look for parents |
$children[$child] = location($parents, $child); |
||||||
// function to look for parents and create a new array for every child |
} else { |
||||||
function location($parents, $parent = 0) { |
// no children, set NULL |
||||||
// loop array to check |
$children[$child] = NULL; |
||||||
foreach($parents[$parent] as $child) { |
} |
||||||
if(isset($parents[$child])) { |
} |
||||||
// element has children |
|
||||||
$children[$child] = location($parents, $child); |
// and again... |
||||||
} else { |
return $children; |
||||||
// no children, set NULL |
} |
||||||
$children[$child] = NULL; |
|
||||||
} |
// recursive children check to template |
||||||
} |
function checkchildren($locations, $level) { |
||||||
|
global $location_options; |
||||||
// and again... |
global $location_names; |
||||||
return $children; |
global $location_parent; |
||||||
} |
|
||||||
|
foreach ($locations as $parent=>$child) { |
||||||
// recursive children check to template |
$row = str_repeat("- ", $level) . $location_names[$parent]; |
||||||
function checkchildren($locations, $level) { |
$location_options[$parent] = $row; |
||||||
global $location_options; |
if (isset($child)) { |
||||||
global $location_names; |
checkchildren($child, $level+1); |
||||||
global $location_parent; |
} |
||||||
|
} |
||||||
foreach ($locations as $parent=>$child) { |
} |
||||||
$row = str_repeat("- ", $level) . $location_names[$parent]; |
|
||||||
$location_options[$parent] = $row; |
$tree = location($parents); |
||||||
if(isset($child)) { |
$location_options = array(0 => '-'); |
||||||
checkchildren($child, $level+1); |
checkchildren($tree, 0); |
||||||
} |
$smarty->assign("location_options", $location_options); |
||||||
} |
$smarty->assign("location_parent", $location_parent); |
||||||
|
|
||||||
} |
$smarty->display("locationadd.tpl"); |
||||||
|
|
||||||
$tree = location($parents); |
include("footer.php"); |
||||||
$location_options = array(0 => '-'); |
|
||||||
checkchildren($tree, 0); |
|
||||||
$smarty->assign("location_options", $location_options); |
|
||||||
$smarty->assign("location_parent", $location_parent); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("locationadd.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,58 +1,31 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$location_id = sanitize($_GET['location_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
location_name |
||||||
|
FROM |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
location |
||||||
or contact me at wietsew@users.sourceforge.net |
WHERE |
||||||
*****************************************************************************/ |
location_id=" . $location_id; |
||||||
|
|
||||||
// start page |
$location = $db->db_select($query); |
||||||
// includes |
|
||||||
include("includes.php"); |
$smarty->assign("location_id", $location_id); |
||||||
|
$smarty->assign("location_name", $location[0]['location_name']); |
||||||
// get id |
|
||||||
$location_id = sanitize($_GET['location_id']); |
$smarty->display("locationdel.tpl"); |
||||||
|
|
||||||
// start output |
include("footer.php"); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup location |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
location_name |
|
||||||
FROM |
|
||||||
location |
|
||||||
WHERE |
|
||||||
location_id=" . $location_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$location = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("location_id", $location_id); |
|
||||||
$smarty->assign("location_name", $location[0]['location_name']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("locationdel.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,139 +1,104 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$location_id = sanitize($_GET['location_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// location |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$query = "SELECT |
||||||
|
location_name, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
location_parent, |
||||||
or contact me at wietsew@users.sourceforge.net |
location_info, |
||||||
*****************************************************************************/ |
location_sort |
||||||
|
FROM |
||||||
// start page |
location |
||||||
// includes |
WHERE |
||||||
include("includes.php"); |
location_id=" . $location_id; |
||||||
|
|
||||||
// get id |
$location = $db->db_select($query); |
||||||
$location_id = sanitize($_GET['location_id']); |
|
||||||
|
$location_parent = $location[0]['location_parent']; |
||||||
// start output |
|
||||||
include("header.php"); |
$smarty->assign("location_id", $location_id); |
||||||
|
$smarty->assign("location_name", $location[0]['location_name']); |
||||||
// set language variables |
$smarty->assign("location_info", $location[0]['location_info']); |
||||||
$smarty->assign($lang); |
$smarty->assign("location_sort", $location[0]['location_sort']); |
||||||
|
|
||||||
// setup location |
// parent location |
||||||
// build query |
$query = "SELECT |
||||||
$query = "SELECT |
location_id, |
||||||
location_name, |
location_name, |
||||||
location_parent, |
location_parent |
||||||
location_info, |
FROM |
||||||
location_sort |
location |
||||||
FROM |
WHERE |
||||||
location |
location_id != " . $location_id . " |
||||||
WHERE |
ORDER BY |
||||||
location.location_id=" . $location_id; |
location_name"; |
||||||
|
|
||||||
// run query |
$locations = $db->db_select($query); |
||||||
$location = $db->db_select($query); |
|
||||||
|
$location_counter = count($locations); |
||||||
// get parent |
|
||||||
$location_parent = $location[0]['location_parent']; |
$smarty->assign("location_counter", $location_counter); |
||||||
|
|
||||||
// send to tpl |
// any loactions? |
||||||
$smarty->assign("location_id", $location_id); |
if ($location_counter>0) { |
||||||
$smarty->assign("location_name", $location[0]['location_name']); |
foreach($locations AS $location) { |
||||||
$smarty->assign("location_info", $location[0]['location_info']); |
$location_names[$location['location_id']] = $location['location_name']; |
||||||
$smarty->assign("location_sort", $location[0]['location_sort']); |
$parents[$location['location_parent']][] = $location['location_id']; |
||||||
|
} |
||||||
// setup parent location |
} |
||||||
// look for locations |
|
||||||
// build query |
// look for parents |
||||||
$query = "SELECT |
// function to look for parents and create a new array for every child |
||||||
location_id, |
function location($parents, $parent = 0) { |
||||||
location_name, |
// loop array to check |
||||||
location_parent |
foreach($parents[$parent] as $child) { |
||||||
FROM |
if(isset($parents[$child])) { |
||||||
location |
// element has children |
||||||
WHERE |
$children[$child] = location($parents, $child); |
||||||
location_id != " . $location_id . " |
} else { |
||||||
ORDER BY |
// no children, set NULL |
||||||
location.location_name"; |
$children[$child] = NULL; |
||||||
|
} |
||||||
// run query |
} |
||||||
$locations = $db->db_select($query); |
|
||||||
|
// and again... |
||||||
// count results |
return $children; |
||||||
$location_counter = count($locations); |
} |
||||||
|
|
||||||
// counter to tpl |
// recursive children check to template |
||||||
$smarty->assign("location_counter", $location_counter); |
function checkchildren($locations, $level) { |
||||||
|
global $location_options; |
||||||
// any loactions? |
global $location_names; |
||||||
if ($location_counter>0) { |
global $location_parent; |
||||||
// get objects |
|
||||||
foreach($locations AS $location) { |
foreach ($locations as $parent=>$child) { |
||||||
// create arrays |
$row = str_repeat("- ", $level) . $location_names[$parent]; |
||||||
$location_names[$location['location_id']] = $location['location_name']; |
$location_options[$parent] = $row; |
||||||
$parents[$location['location_parent']][] = $location['location_id']; |
if(isset($child)) { |
||||||
} |
checkchildren($child, $level+1); |
||||||
} |
} |
||||||
|
} |
||||||
// look for parents |
} |
||||||
// function to look for parents and create a new array for every child |
|
||||||
function location($parents, $parent = 0) { |
$tree = location($parents); |
||||||
// loop array to check |
$location_options = array(0 => '-'); |
||||||
foreach($parents[$parent] as $child) { |
checkchildren($tree, 0); |
||||||
if(isset($parents[$child])) { |
$smarty->assign("location_options", $location_options); |
||||||
// element has children |
$smarty->assign("location_parent", $location_parent); |
||||||
$children[$child] = location($parents, $child); |
|
||||||
} else { |
$smarty->display("locationedit.tpl"); |
||||||
// no children, set NULL |
|
||||||
$children[$child] = NULL; |
include("footer.php"); |
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
// and again... |
|
||||||
return $children; |
|
||||||
} |
|
||||||
|
|
||||||
// recursive children check to template |
|
||||||
function checkchildren($locations, $level) { |
|
||||||
global $location_options; |
|
||||||
global $location_names; |
|
||||||
global $location_parent; |
|
||||||
|
|
||||||
foreach ($locations as $parent=>$child) { |
|
||||||
$row = str_repeat("- ", $level) . $location_names[$parent]; |
|
||||||
$location_options[$parent] = $row; |
|
||||||
if(isset($child)) { |
|
||||||
checkchildren($child, $level+1); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
$tree = location($parents); |
|
||||||
$location_options = array(0 => '-'); |
|
||||||
checkchildren($tree, 0); |
|
||||||
$smarty->assign("location_options", $location_options); |
|
||||||
$smarty->assign("location_parent", $location_parent); |
|
||||||
|
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("locationedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,60 +1,31 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$location_id = sanitize($_GET['location_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$query = "SELECT |
||||||
// includes |
location_name |
||||||
include("includes.php"); |
FROM |
||||||
|
location |
||||||
|
WHERE |
||||||
|
location_id=" . $location_id; |
||||||
|
|
||||||
// get ip and id |
$location = $db->db_select($query); |
||||||
$location_id = sanitize($_GET['location_id']); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("location_id", $location_id); |
||||||
include("header.php"); |
$smarty->assign("location_name", $location[0]['location_name']); |
||||||
|
$smarty->assign("subnet_options", $db->options_subnet()); |
||||||
|
$smarty->display("locationsubnetadd.tpl"); |
||||||
|
|
||||||
// set language variables |
include("footer.php"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup location |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
location_name |
|
||||||
FROM |
|
||||||
location |
|
||||||
WHERE |
|
||||||
location_id=" . $location_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$location = $db->db_select($query); |
|
||||||
|
|
||||||
$smarty->assign("location_id", $location_id); |
|
||||||
$smarty->assign("location_name", $location[0]['location_name']); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
$smarty->assign("subnet_options", $db->options_subnet()); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("locationsubnetadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,76 +1,47 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$location_id = sanitize($_GET['location_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
// location |
||||||
// includes |
$query = "SELECT |
||||||
include("includes.php"); |
location_name |
||||||
|
FROM |
||||||
|
location |
||||||
|
WHERE |
||||||
|
location_id=" . $location_id; |
||||||
|
|
||||||
// get ip and id |
$location = $db->db_select($query); |
||||||
$location_id = sanitize($_GET['location_id']); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("location_id", $location_id); |
||||||
include("header.php"); |
$smarty->assign("location_name", $location[0]['location_name']); |
||||||
|
|
||||||
// set language variables |
// subnet |
||||||
$smarty->assign($lang); |
$query = "SELECT |
||||||
|
s.subnet_id, |
||||||
|
s.subnet_address, |
||||||
|
s.subnet_mask |
||||||
|
FROM |
||||||
|
subnetlocation AS l LEFT JOIN subnet AS s USING (subnet_id) |
||||||
|
WHERE |
||||||
|
l.location_id=" . $location_id . " |
||||||
|
ORDER BY |
||||||
|
INET_ATON(s.subnet_address)"; |
||||||
|
|
||||||
// setup location |
$subnets = $db->db_select($query); |
||||||
// build query |
$smarty->assign($subnets); |
||||||
$query = "SELECT |
|
||||||
location.location_name AS location_name |
|
||||||
FROM |
|
||||||
location |
|
||||||
WHERE |
|
||||||
location.location_id=" . $location_id; |
|
||||||
|
|
||||||
// run query |
$smarty->display("locationsubnetdel.tpl"); |
||||||
$location = $db->db_select($query); |
|
||||||
|
|
||||||
$smarty->assign("location_id", $location_id); |
include("footer.php"); |
||||||
$smarty->assign("location_name", $location[0]['location_name']); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
subnet.subnet_id AS subnet_id, |
|
||||||
subnet.subnet_address AS subnet_address, |
|
||||||
subnet.subnet_mask AS subnet_mask |
|
||||||
FROM |
|
||||||
subnetlocation, |
|
||||||
subnet |
|
||||||
WHERE |
|
||||||
subnetlocation.location_id=" . $location_id . " |
|
||||||
AND subnet.subnet_id=subnetlocation.subnet_id |
|
||||||
ORDER BY |
|
||||||
INET_ATON(subnet.subnet_address)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnets = $db->db_select($query); |
|
||||||
$smarty->assign($subnets); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("locationsubnetdel.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,58 +1,31 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$location_id = sanitize($_GET['location_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
// location |
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
location_name |
||||||
|
FROM |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
location |
||||||
or contact me at wietsew@users.sourceforge.net |
WHERE |
||||||
*****************************************************************************/ |
location_id=" . $location_id; |
||||||
|
|
||||||
// start page |
$location = $db->db_select($query); |
||||||
// includes |
|
||||||
include("includes.php"); |
$smarty->assign("location_id", $location_id); |
||||||
|
$smarty->assign("location_name", $location[0]['location_name']); |
||||||
// get ip and id |
|
||||||
$location_id = sanitize($_GET['location_id']); |
$smarty->display("locationsubnetedit.tpl"); |
||||||
|
|
||||||
// start output |
include("footer.php"); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup location |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
location_name |
|
||||||
FROM |
|
||||||
location |
|
||||||
WHERE |
|
||||||
location_id=" . $location_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$location = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("location_id", $location_id); |
|
||||||
$smarty->assign("location_name", $location[0]['location_name']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("locationsubnetedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,108 +1,80 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$location_id = sanitize($_GET['location_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
// locationcrumb |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$query = "SELECT location_id AS id, |
||||||
or contact me at wietsew@users.sourceforge.net |
location_name AS name, |
||||||
*****************************************************************************/ |
location_parent AS parent_id, |
||||||
|
location_info |
||||||
// start page |
FROM location |
||||||
// includes |
WHERE location_id=" . $location_id; |
||||||
include("includes.php"); |
$location = $db->db_select($query); |
||||||
|
$location[0]['url'] = 'locationview.php?location_id=' . $location[0]['id']; |
||||||
// get id |
$crumbs[] = $location[0]; |
||||||
$location_id = sanitize($_GET['location_id']); |
$level = 1; |
||||||
|
while ($crumbs[0]['parent_id'] != 0) { |
||||||
// start output |
$query = "SELECT location_id AS id, |
||||||
include("header.php"); |
location_name AS name, |
||||||
|
location_parent AS parent_id |
||||||
// set language variables |
FROM location |
||||||
$smarty->assign($lang); |
WHERE location_id=" . $crumbs[0]['parent_id']; |
||||||
|
$result = $db->db_select($query); |
||||||
// start locationcrumb |
$result[0]['url'] = 'locationview.php?location_id=' . $result[0]['id']; |
||||||
// get location crumbs |
array_unshift($crumbs, $result[0]); |
||||||
|
$level++; |
||||||
$query = "SELECT location_id AS id, |
} |
||||||
location_name AS name, |
|
||||||
location_parent AS parent_id, |
$smarty->assign("location_id", $location_id); |
||||||
location_info |
$smarty->assign("location_info", nl2br($location[0]['location_info'])); |
||||||
FROM location |
$smarty->assign("crumbs", $crumbs); |
||||||
WHERE location_id=" . $location_id; |
|
||||||
$location = $db->db_select($query); |
|
||||||
$location[0]['url'] = 'locationview.php?location_id=' . $location[0]['id']; |
// sublocations |
||||||
$crumbs[] = $location[0]; |
$query = "SELECT |
||||||
$level = 1; |
location_id AS sublocation_id, |
||||||
while ($crumbs[0]['parent_id'] != 0) { |
location_name AS sublocation_name, |
||||||
$query = "SELECT location_id AS id, |
LEFT(location_info, 40) AS info_short, |
||||||
location_name AS name, |
CHAR_LENGTH(location_info) AS info_length |
||||||
location_parent AS parent_id |
FROM |
||||||
FROM location |
location |
||||||
WHERE location_id=" . $crumbs[0]['parent_id']; |
WHERE |
||||||
$result = $db->db_select($query); |
location_parent=" . $location_id . " |
||||||
$result[0]['url'] = 'locationview.php?location_id=' . $result[0]['id']; |
ORDER BY |
||||||
array_unshift($crumbs, $result[0]); |
location_name"; |
||||||
$level++; |
|
||||||
} |
$sublocations = $db->db_select($query); |
||||||
|
$smarty->assign("sublocations", $sublocations); |
||||||
// send to tpl |
|
||||||
$smarty->assign("location_id", $location_id); |
// subnets |
||||||
$smarty->assign("location_info", nl2br($location[0]['location_info'])); |
$query = "SELECT |
||||||
$smarty->assign("crumbs", $crumbs); |
s.subnet_id, |
||||||
|
s.subnet_address, |
||||||
|
s.subnet_mask |
||||||
// setup sublocations |
FROM |
||||||
// build query |
subnet AS s LEFT JOIN subnetlocation USING (subnet_id) |
||||||
$query = "SELECT |
WHERE |
||||||
location_id AS sublocation_id, |
subnetlocation.location_id=" . $location_id . " |
||||||
location_name AS sublocation_name, |
ORDER BY |
||||||
LEFT(location_info, 40) AS info_short, |
INET_ATON(s.subnet_address)"; |
||||||
CHAR_LENGTH(location_info) AS info_length |
|
||||||
FROM |
$subnets = $db->db_select($query); |
||||||
location |
$smarty->assign("subnets", $subnets); |
||||||
WHERE |
|
||||||
location_parent=" . $location_id . " |
$smarty->display("locationview.tpl"); |
||||||
ORDER BY |
|
||||||
location_name"; |
include("footer.php"); |
||||||
|
|
||||||
// run query |
|
||||||
$sublocations = $db->db_select($query); |
|
||||||
$smarty->assign("sublocations", $sublocations); |
|
||||||
|
|
||||||
// setup subnets |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
s.subnet_id, |
|
||||||
s.subnet_address, |
|
||||||
s.subnet_mask |
|
||||||
FROM |
|
||||||
subnet AS s LEFT JOIN subnetlocation USING (subnet_id) |
|
||||||
WHERE |
|
||||||
subnetlocation.location_id=" . $location_id . " |
|
||||||
ORDER BY |
|
||||||
INET_ATON(s.subnet_address)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnets = $db->db_select($query); |
|
||||||
$smarty->assign("subnets", $subnets); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("locationview.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,77 +1,47 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
session_name('ipreg'); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
session_start(); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
include("config.php"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
include("dbconnect.php"); |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("lib.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// session |
// include language file |
||||||
// start session |
$language = lang_getfrombrowser($config_lang, $config_lang_default, null, false); |
||||||
session_name('ipreg'); |
include('lang/' . $language . '.php'); |
||||||
session_start(); |
|
||||||
|
|
||||||
// headers |
// check for submit |
||||||
// raw http headers |
if ($_SERVER['REQUEST_METHOD']=="POST" ) { |
||||||
header("Content-Type: text/html; charset=utf-8"); |
/// get post info |
||||||
|
$user_name = sanitize($_POST['user_name']); |
||||||
|
$user_pass = sanitize($_POST['user_pass']); |
||||||
|
|
||||||
// includes |
// login |
||||||
// includes |
$login = $user->user_login($user_name, $user_pass); |
||||||
include("config.php"); |
|
||||||
include("dbconnect.php"); |
|
||||||
|
|
||||||
// load lib |
if($login==TRUE) { |
||||||
include("lib.php"); |
// redirect |
||||||
|
header_location("index.php"); |
||||||
|
} else { |
||||||
|
// not ok, break session |
||||||
|
$_SESSION = array(); |
||||||
|
session_destroy(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
// include language file |
$smarty->assign("config_version", $config_version); |
||||||
$language = lang_getfrombrowser($config_lang, $config_lang_default, null, false); |
$smarty->assign($lang); |
||||||
include('lang/' . $language . '.php'); |
|
||||||
|
|
||||||
// try login? |
$smarty->display("login.tpl"); |
||||||
// check for submit |
|
||||||
if ($_SERVER['REQUEST_METHOD']=="POST" ) { |
|
||||||
/// get post info |
|
||||||
$user_name = sanitize($_POST['user_name']); |
|
||||||
$user_pass = sanitize($_POST['user_pass']); |
|
||||||
|
|
||||||
// login |
include("footer.php"); |
||||||
$login = $user->user_login($user_name, $user_pass); |
|
||||||
|
|
||||||
if($login==TRUE) { |
|
||||||
// redirect |
|
||||||
header_location("index.php"); |
|
||||||
} else { |
|
||||||
// not ok, break session |
|
||||||
$_SESSION = array(); |
|
||||||
session_destroy(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
// start output |
|
||||||
// get version for the footer-stamp |
|
||||||
$smarty->assign("config_version", $config_version); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("login.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,33 +1,17 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// user logout: clear session |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$_SESSION = array(); |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
// redirect to start page |
||||||
or contact me at wietsew@users.sourceforge.net |
header("Location: index.php"); |
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// logout |
|
||||||
// user logout |
|
||||||
$user->user_logout(); |
|
||||||
|
|
||||||
// redirect |
|
||||||
header("Location: index.php"); |
|
||||||
?> |
?> |
@ -1,90 +1,63 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$node_id = sanitize($_GET['node_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// node_ext |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$query = "SELECT |
||||||
|
node_ip AS node_ip_ext |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
node |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
node_id=" . $node_id; |
||||||
// start page |
|
||||||
// includes |
$node = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
$smarty->assign("node_id_ext", $node_id); |
||||||
// get ip and id |
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']); |
||||||
$node_id = sanitize($_GET['node_id']); |
|
||||||
|
// node_int |
||||||
// start output |
$query = "SELECT |
||||||
include("header.php"); |
a.asset_name, |
||||||
|
n.node_id AS node_id_int, |
||||||
// set language variables |
n.node_ip AS node_ip_int |
||||||
$smarty->assign($lang); |
FROM |
||||||
|
asset AS a LEFT JOIN node AS n USING (asset_id) |
||||||
// setup node_ext |
WHERE |
||||||
// build query |
n.node_id NOT IN ( |
||||||
$query = "SELECT |
SELECT |
||||||
node_ip AS node_ip_ext |
nat_int |
||||||
FROM |
FROM |
||||||
node |
nat |
||||||
WHERE |
WHERE |
||||||
node_id=" . $node_id; |
nat_ext=" . $node_id . " |
||||||
|
) |
||||||
// run query |
AND n.node_id!=" . $node_id . " |
||||||
$node = $db->db_select($query); |
ORDER BY |
||||||
|
INET_ATON(n.node_ip)"; |
||||||
$smarty->assign("node_id_ext", $node_id); |
|
||||||
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']); |
$nodes = $db->db_select($query); |
||||||
|
foreach ($nodes as $rec) { |
||||||
// setup node_int |
$node_options[$rec['node_id_int']] = $rec['node_ip_int'] . '/' . $rec['asset_name']; |
||||||
// build query |
} |
||||||
$query = "SELECT |
$smarty->assign("node_options", $node_options); |
||||||
a.asset_name, |
|
||||||
n.node_id AS node_id_int, |
$nat_type_options[1] = $lang['lang_nat_type_1']; |
||||||
n.node_ip AS node_ip_int |
$nat_type_options[2] = $lang['lang_nat_type_2']; |
||||||
FROM |
$nat_type_options[3] = $lang['lang_nat_type_3']; |
||||||
asset AS a LEFT JOIN node AS n USING (asset_id) |
$smarty->assign("nat_type_options", $nat_type_options); |
||||||
WHERE |
|
||||||
n.node_id NOT IN ( |
$smarty->display("natadd.tpl"); |
||||||
SELECT |
|
||||||
nat_int |
include("footer.php"); |
||||||
FROM |
|
||||||
nat |
|
||||||
WHERE |
|
||||||
nat_ext=" . $node_id . " |
|
||||||
) |
|
||||||
AND n.node_id!=" . $node_id . " |
|
||||||
ORDER BY |
|
||||||
INET_ATON(n.node_ip)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$nodes = $db->db_select($query); |
|
||||||
foreach ($nodes as $rec) { |
|
||||||
$node_options[$rec['node_id_int']] = $rec['node_ip_int'] . '/' . $rec['asset_name']; |
|
||||||
} |
|
||||||
$smarty->assign("node_options", $node_options); |
|
||||||
|
|
||||||
$nat_type_options[1] = $lang['lang_nat_type_1']; |
|
||||||
$nat_type_options[2] = $lang['lang_nat_type_2']; |
|
||||||
$nat_type_options[3] = $lang['lang_nat_type_3']; |
|
||||||
$smarty->assign("nat_type_options", $nat_type_options); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("natadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,83 +1,55 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$node_id = sanitize($_GET['node_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// node_ext |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$query = "SELECT |
||||||
|
node_ip AS node_ip_ext |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
node |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
node_id=" . $node_id; |
||||||
// start page |
|
||||||
// includes |
$node = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
$smarty->assign("node_id_ext", $node_id); |
||||||
// get ip and id |
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']); |
||||||
$node_id = sanitize($_GET['node_id']); |
|
||||||
|
// options |
||||||
// start output |
$query = "SELECT |
||||||
include("header.php"); |
a.asset_name, |
||||||
|
n.node_ip, |
||||||
// set language variables |
x.nat_ext |
||||||
$smarty->assign($lang); |
FROM |
||||||
|
asset AS a, |
||||||
// setup node_ext |
nat AS x, |
||||||
// build query |
node AS n |
||||||
$query = "SELECT |
WHERE |
||||||
node_ip AS node_ip_ext |
x.nat_ext=" . $node_id . " |
||||||
FROM |
AND n.node_id=x.nat_int |
||||||
node |
AND a.asset_id=n.asset_id |
||||||
WHERE |
ORDER BY |
||||||
node_id=" . $node_id; |
INET_ATON(n.node_ip)"; |
||||||
|
|
||||||
// run query |
$nodes = $db->db_select($query); |
||||||
$node = $db->db_select($query); |
|
||||||
|
$options = array(); |
||||||
$smarty->assign("node_id_ext", $node_id); |
foreach ($nodes as $rec) { |
||||||
$smarty->assign("node_ip_ext", $node[0]['node_ip_ext']); |
$options[$rec['nat_ext']] = $rec['node_ip'] . '/' . $rec['asset_name']; |
||||||
|
} |
||||||
// setup options |
$smarty->assign("nat_options", $options); |
||||||
// build query |
$smarty->display("natdel.tpl"); |
||||||
$query = "SELECT |
|
||||||
a.asset_name, |
include("footer.php"); |
||||||
n.node_ip, |
|
||||||
x.nat_ext |
|
||||||
FROM |
|
||||||
asset AS a, |
|
||||||
nat AS x, |
|
||||||
node AS n |
|
||||||
WHERE |
|
||||||
x.nat_ext=" . $node_id . " |
|
||||||
AND n.node_id=x.nat_int |
|
||||||
AND a.asset_id=n.asset_id |
|
||||||
ORDER BY |
|
||||||
INET_ATON(n.node_ip)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$nodes = $db->db_select($query); |
|
||||||
|
|
||||||
$options = array(); |
|
||||||
foreach ($nodes as $rec) { |
|
||||||
$options[$rec['nat_ext']] = $rec['node_ip'] . '/' . $rec['asset_name']; |
|
||||||
} |
|
||||||
$smarty->assign("nat_options", $options); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("natdel.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,57 +1,31 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$node_id = sanitize($_GET['node_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$query = "SELECT |
||||||
// includes |
node_ip |
||||||
include("includes.php"); |
FROM |
||||||
|
node |
||||||
|
WHERE |
||||||
|
node.node_id=" . $node_id; |
||||||
|
|
||||||
// get id |
$node = $db->db_select($query); |
||||||
$node_id = sanitize($_GET['node_id']); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("node_id", $node_id); |
||||||
include("header.php"); |
$smarty->assign("node_ip", $node[0]['node_ip']); |
||||||
|
|
||||||
// set language variables |
$smarty->display("natedit.tpl"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup node |
include("footer.php"); |
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
node.node_ip AS node_ip |
|
||||||
FROM |
|
||||||
node |
|
||||||
WHERE |
|
||||||
node.node_id=" . $node_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$node = $db->db_select($query); |
|
||||||
|
|
||||||
$smarty->assign("node_id", $node_id); |
|
||||||
$smarty->assign("node_ip", $node[0]['node_ip']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("natedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,78 +1,40 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
include("header.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
if(isset($_GET['subnet_id'])) { |
||||||
GNU General Public License for more details. |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
|
$subnet_view = "WHERE node.subnet_id=" . $subnet_id; |
||||||
You should have received a copy of the GNU General Public License |
$smarty->assign("subnet_id", $subnet_id); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
} else { |
||||||
|
$smarty->assign("subnet_id", ""); |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
} |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
$query = "SELECT |
||||||
|
asset.asset_id, |
||||||
// start page |
REPLACE(asset.asset_name, ' ', ' ') AS asset_name, |
||||||
// includes |
asset.asset_info, |
||||||
include("includes.php"); |
node.node_id, |
||||||
|
node.node_ip |
||||||
// start output |
FROM |
||||||
include("header.php"); |
asset LEFT JOIN node USING (asset_id) |
||||||
|
" . $subnet_view . " |
||||||
// set language variables |
GROUP BY |
||||||
$smarty->assign($lang); |
node.node_id |
||||||
|
ORDER BY |
||||||
// start node |
INET_ATON(node.node_ip)"; |
||||||
// setup view |
|
||||||
// subnet |
$nodes = $db->db_select($query); |
||||||
if(isset($_GET['subnet_id'])) { |
$smarty->assign("nodes", $nodes); |
||||||
// get id |
$smarty->display("node.tpl"); |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
|
||||||
|
include("footer.php"); |
||||||
// build query part |
|
||||||
$subnet_view = "AND node.subnet_id=" . $subnet_id; |
|
||||||
|
|
||||||
// to tpl |
|
||||||
$smarty->assign("subnet_id", $subnet_id); |
|
||||||
} else { |
|
||||||
// to tpl |
|
||||||
$smarty->assign("subnet_id", ""); |
|
||||||
} |
|
||||||
|
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
asset.asset_id, |
|
||||||
REPLACE(asset.asset_name, ' ', ' ') AS asset_name, |
|
||||||
asset.asset_info, |
|
||||||
node.node_id, |
|
||||||
node.node_ip |
|
||||||
FROM |
|
||||||
asset, |
|
||||||
node |
|
||||||
WHERE |
|
||||||
asset.asset_id=node.asset_id |
|
||||||
" . $subnet_view . " |
|
||||||
GROUP BY |
|
||||||
node.node_id |
|
||||||
ORDER BY |
|
||||||
INET_ATON(node.node_ip)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$nodes = $db->db_select($query); |
|
||||||
$smarty->assign("nodes", $nodes); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("node.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
@ -1,54 +1,26 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
if ((isset($_GET['node_ip'])) ? $node_ip = sanitize($_GET['node_ip']) : $node_ip = ''); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
if ((isset($_GET['subnet_id'])) ? $subnet_id = sanitize($_GET['subnet_id']) : $subnet_id = ''); |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$smarty->assign("user_dns1suffix", $_SESSION['suser_dns1suffix']); |
||||||
// includes |
$smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']); |
||||||
include("includes.php"); |
$smarty->assign("node_ip", $node_ip); |
||||||
|
|
||||||
// check for set ip and/or subnet_id |
$smarty->assign("subnet_options", $db->options_subnet()); |
||||||
if ((isset($_GET['node_ip'])) ? $node_ip = sanitize($_GET['node_ip']) : $node_ip = ''); |
$smarty->assign("assetclass_options", $db->options_assetclass()); |
||||||
if ((isset($_GET['subnet_id'])) ? $subnet_id = sanitize($_GET['subnet_id']) : $subnet_id = ''); |
$smarty->display("nodeadd.tpl"); |
||||||
|
|
||||||
// start output |
include("footer.php"); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// set vars |
|
||||||
$smarty->assign("user_dns1suffix", $_SESSION['suser_dns1suffix']); |
|
||||||
$smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']); |
|
||||||
$smarty->assign("node_ip", $node_ip); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
$smarty->assign("subnet_options", $db->options_subnet()); |
|
||||||
|
|
||||||
// setup assetclass |
|
||||||
$smarty->assign("assetclass_options", $db->options_assetclass()); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("nodeadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,60 +1,35 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$node_id = sanitize($_GET['node_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
asset_id, |
||||||
|
node_ip |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
node |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
node_id=" . $node_id; |
||||||
// start page |
|
||||||
// includes |
// run query |
||||||
include("includes.php"); |
$node = $db->db_select($query); |
||||||
|
|
||||||
// get id |
// send to tpl |
||||||
$node_id = sanitize($_GET['node_id']); |
$smarty->assign("node_id", $node_id); |
||||||
|
$smarty->assign("asset_id", $node[0]['asset_id']); |
||||||
// start output |
$smarty->assign("node_ip", $node[0]['node_ip']); |
||||||
include("header.php"); |
|
||||||
|
$smarty->display("nodedel.tpl"); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
include("footer.php"); |
||||||
|
|
||||||
// setup node |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
asset_id, |
|
||||||
node_ip |
|
||||||
FROM |
|
||||||
node |
|
||||||
WHERE |
|
||||||
node_id=" . $node_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$node = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("node_id", $node_id); |
|
||||||
$smarty->assign("asset_id", $node[0]['asset_id']); |
|
||||||
$smarty->assign("node_ip", $node[0]['node_ip']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("nodedel.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,86 +1,54 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$node_id = sanitize($_GET['node_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
a.asset_id, |
||||||
|
n.node_id, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
n.node_ip, |
||||||
or contact me at wietsew@users.sourceforge.net |
n.node_mac, |
||||||
*****************************************************************************/ |
n.node_dns1, |
||||||
|
n.node_dns2, |
||||||
// start page |
n.node_info, |
||||||
// includes |
s.subnet_id, |
||||||
include("includes.php"); |
n.zone_id |
||||||
|
FROM |
||||||
// get id |
asset AS a, |
||||||
$node_id = sanitize($_GET['node_id']); |
node AS n, |
||||||
|
subnet AS s |
||||||
// start output |
WHERE |
||||||
include("header.php"); |
a.asset_id=n.asset_id |
||||||
|
AND n.node_id=" . $node_id . " |
||||||
// set language variables |
AND s.subnet_id=n.subnet_id"; |
||||||
$smarty->assign($lang); |
|
||||||
|
$node = $db->db_select($query); |
||||||
// setup node |
|
||||||
// build query |
$smarty->assign("node_id", $node[0]['node_id']); |
||||||
$query = "SELECT |
$smarty->assign("node_ip", $node[0]['node_ip']); |
||||||
a.asset_id, |
$smarty->assign("node_mac", write_mac($node[0]['node_mac'])); |
||||||
n.node_id, |
$smarty->assign("node_dns1", $node[0]['node_dns1']); |
||||||
n.node_ip, |
$smarty->assign("node_dns2", $node[0]['node_dns2']); |
||||||
n.node_mac, |
$smarty->assign("node_info", $node[0]['node_info']); |
||||||
n.node_dns1, |
$smarty->assign("asset_id", $node[0]['asset_id']); |
||||||
n.node_dns2, |
$smarty->assign("subnet_id", $node[0]['subnet_id']); |
||||||
n.node_info, |
$smarty->assign("zone_id", $node[0]['zone_id']); |
||||||
s.subnet_id, |
|
||||||
n.zone_id |
$smarty->assign("asset_options", $db->options_asset()); |
||||||
FROM |
$smarty->assign("subnet_options", $db->options_subnet()); |
||||||
asset AS a, |
$smarty->assign("zone_options", $db->options_zone("(keine)")); |
||||||
node AS n, |
|
||||||
subnet AS s |
$smarty->display("nodeedit.tpl"); |
||||||
WHERE |
|
||||||
a.asset_id=n.asset_id |
include("footer.php"); |
||||||
AND n.node_id=" . $node_id . " |
|
||||||
AND s.subnet_id=n.subnet_id"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$node = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("node_id", $node[0]['node_id']); |
|
||||||
$smarty->assign("node_ip", $node[0]['node_ip']); |
|
||||||
$smarty->assign("node_mac", write_mac($node[0]['node_mac'])); |
|
||||||
$smarty->assign("node_dns1", $node[0]['node_dns1']); |
|
||||||
$smarty->assign("node_dns2", $node[0]['node_dns2']); |
|
||||||
$smarty->assign("node_info", $node[0]['node_info']); |
|
||||||
$smarty->assign("asset_id", $node[0]['asset_id']); |
|
||||||
$smarty->assign("subnet_id", $node[0]['subnet_id']); |
|
||||||
$smarty->assign("zone_id", $node[0]['zone_id']); |
|
||||||
|
|
||||||
// setup asset |
|
||||||
$smarty->assign("asset_options", $db->options_asset()); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
$smarty->assign("subnet_options", $db->options_subnet()); |
|
||||||
|
|
||||||
// setup zone |
|
||||||
$smarty->assign("zone_options", $db->options_zone("(keine)")); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("nodeedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,107 +1,85 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
if (isset($_GET['node_id']) && (!empty($_GET['node_id']))) { |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$node_id = sanitize($_GET['node_id']); |
||||||
|
} else { |
||||||
|
// redirect to error page |
||||||
|
header_location("comments.php?comments=error"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
// node |
||||||
*****************************************************************************/ |
$query = "SELECT |
||||||
|
asset.asset_id, |
||||||
|
asset.asset_name, |
||||||
|
node.node_id, |
||||||
|
node.node_ip, |
||||||
|
node.node_mac, |
||||||
|
node.node_dns1, |
||||||
|
node.node_dns2, |
||||||
|
node.node_info, |
||||||
|
node.node_type, |
||||||
|
subnet.subnet_id, |
||||||
|
subnet.subnet_address, |
||||||
|
subnet.subnet_mask, |
||||||
|
zone.zone_origin |
||||||
|
FROM |
||||||
|
node |
||||||
|
JOIN asset USING (asset_id) |
||||||
|
JOIN subnet USING (subnet_id) |
||||||
|
LEFT JOIN zone USING (zone_id) |
||||||
|
WHERE |
||||||
|
node.node_id=" . $node_id; |
||||||
|
|
||||||
// start page |
$node = $db->db_select($query); |
||||||
// includes |
$node[0]['node_mac'] = write_mac($node[0]['node_mac']); |
||||||
include("includes.php"); |
$smarty->assign("node", $node[0]); |
||||||
|
|
||||||
// get id |
// nat |
||||||
$node_id = sanitize($_GET['node_id']); |
$query = "SELECT |
||||||
|
asset_ext.asset_id AS asset_id_ext, |
||||||
|
asset_int.asset_id AS asset_id_int, |
||||||
|
asset_ext.asset_name AS asset_name_ext, |
||||||
|
asset_int.asset_name AS asset_name_int, |
||||||
|
nat.nat_id AS nat_id, |
||||||
|
nat.nat_type AS nat_type, |
||||||
|
nat.nat_ext AS nat_ext, |
||||||
|
nat.nat_int AS nat_int, |
||||||
|
node_ext.node_ip AS node_ip_ext, |
||||||
|
node_int.node_ip AS node_ip_int, |
||||||
|
node_int.node_id AS node_id_int, |
||||||
|
node_ext.node_id AS node_id_ext |
||||||
|
FROM |
||||||
|
asset AS asset_ext, |
||||||
|
asset AS asset_int, |
||||||
|
nat, |
||||||
|
node AS node_ext, |
||||||
|
node AS node_int |
||||||
|
WHERE |
||||||
|
(nat.nat_ext=" . $node_id . " |
||||||
|
OR nat.nat_int=" . $node_id . ") |
||||||
|
AND node_ext.node_id=nat.nat_ext |
||||||
|
AND node_int.node_id=nat.nat_int |
||||||
|
AND asset_ext.asset_id=node_ext.asset_id |
||||||
|
AND asset_int.asset_id=node_int.asset_id |
||||||
|
ORDER BY |
||||||
|
INET_ATON(node_ext.node_ip), |
||||||
|
INET_ATON(node_int.node_ip)"; |
||||||
|
|
||||||
// start output |
$natrules = $db->db_select($query); |
||||||
include("header.php"); |
$smarty->assign("natrules", $natrules); |
||||||
|
|
||||||
// set language variables |
$smarty->display("nodeview.tpl"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup node |
include("footer.php"); |
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
asset.asset_id, |
|
||||||
asset.asset_name, |
|
||||||
node.node_id, |
|
||||||
node.node_ip, |
|
||||||
node.node_mac, |
|
||||||
node.node_dns1, |
|
||||||
node.node_dns2, |
|
||||||
node.node_info, |
|
||||||
node.node_type, |
|
||||||
subnet.subnet_id, |
|
||||||
subnet.subnet_address, |
|
||||||
subnet.subnet_mask, |
|
||||||
zone.zone_origin |
|
||||||
FROM |
|
||||||
node |
|
||||||
JOIN asset USING (asset_id) |
|
||||||
JOIN subnet USING (subnet_id) |
|
||||||
LEFT JOIN zone USING (zone_id) |
|
||||||
WHERE |
|
||||||
node.node_id=" . $node_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$node = $db->db_select($query); |
|
||||||
$node[0]['node_mac'] = write_mac($node[0]['node_mac']); |
|
||||||
$smarty->assign("node", $node[0]); |
|
||||||
|
|
||||||
// setup nat |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
asset_ext.asset_id AS asset_id_ext, |
|
||||||
asset_int.asset_id AS asset_id_int, |
|
||||||
asset_ext.asset_name AS asset_name_ext, |
|
||||||
asset_int.asset_name AS asset_name_int, |
|
||||||
nat.nat_id AS nat_id, |
|
||||||
nat.nat_type AS nat_type, |
|
||||||
nat.nat_ext AS nat_ext, |
|
||||||
nat.nat_int AS nat_int, |
|
||||||
node_ext.node_ip AS node_ip_ext, |
|
||||||
node_int.node_ip AS node_ip_int, |
|
||||||
node_int.node_id AS node_id_int, |
|
||||||
node_ext.node_id AS node_id_ext |
|
||||||
FROM |
|
||||||
asset AS asset_ext, |
|
||||||
asset AS asset_int, |
|
||||||
nat, |
|
||||||
node AS node_ext, |
|
||||||
node AS node_int |
|
||||||
WHERE |
|
||||||
(nat.nat_ext=" . $node_id . " |
|
||||||
OR nat.nat_int=" . $node_id . ") |
|
||||||
AND node_ext.node_id=nat.nat_ext |
|
||||||
AND node_int.node_id=nat.nat_int |
|
||||||
AND asset_ext.asset_id=node_ext.asset_id |
|
||||||
AND asset_int.asset_id=node_int.asset_id |
|
||||||
ORDER BY |
|
||||||
INET_ATON(node_ext.node_ip), |
|
||||||
INET_ATON(node_int.node_ip)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$natrules = $db->db_select($query); |
|
||||||
// counter to tpl |
|
||||||
$smarty->assign("natrules", $natrules); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("nodeview.tpl"); |
|
||||||
|
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
@ -1,39 +1,16 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$smarty->display("options.tpl"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("footer.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("options.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,123 +1,99 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
include("header.php"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$smarty->assign("language", $language); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
if($_SESSION['suser_menu_assets']=='on') { |
||||||
include("header.php"); |
$user_menu_assets_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_assets_checked = ''; |
||||||
|
} |
||||||
|
// assetclasses |
||||||
|
if($_SESSION['suser_menu_assetclasses']=='on') { |
||||||
|
$user_menu_assetclasses_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_assetclasses_checked = ''; |
||||||
|
} |
||||||
|
// assetclassgroups |
||||||
|
if($_SESSION['suser_menu_assetclassgroups']=='on') { |
||||||
|
$user_menu_assetclassgroups_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_assetclassgroups_checked = ''; |
||||||
|
} |
||||||
|
// locations |
||||||
|
if($_SESSION['suser_menu_locations']=='on') { |
||||||
|
$user_menu_locations_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_locations_checked = ''; |
||||||
|
} |
||||||
|
// nodes |
||||||
|
if($_SESSION['suser_menu_nodes']=='on') { |
||||||
|
$user_menu_nodes_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_nodes_checked = ''; |
||||||
|
} |
||||||
|
// subnets |
||||||
|
if($_SESSION['suser_menu_subnets']=='on') { |
||||||
|
$user_menu_subnets_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_subnets_checked = ''; |
||||||
|
} |
||||||
|
// users |
||||||
|
if($_SESSION['suser_menu_users']=='on') { |
||||||
|
$user_menu_users_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_users_checked = ''; |
||||||
|
} |
||||||
|
// vlans |
||||||
|
if($_SESSION['suser_menu_vlans']=='on') { |
||||||
|
$user_menu_vlans_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_vlans_checked = ''; |
||||||
|
} |
||||||
|
// zones |
||||||
|
if($_SESSION['suser_menu_zones']=='on') { |
||||||
|
$user_menu_zones_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_menu_zones_checked = ''; |
||||||
|
} |
||||||
|
// tooltips |
||||||
|
if($_SESSION['suser_tooltips']=='on') { |
||||||
|
$user_tooltips_checked = 'checked'; |
||||||
|
} else { |
||||||
|
$user_tooltips_checked = ''; |
||||||
|
} |
||||||
|
|
||||||
// set language variables |
$smarty->assign("user_id", $_SESSION['suser_id']); |
||||||
$smarty->assign($lang); |
$smarty->assign("user_imagesize", $_SESSION['suser_imagesize']); |
||||||
$smarty->assign("language", $language); |
$smarty->assign("user_imagecount", $_SESSION['suser_imagecount']); |
||||||
|
$smarty->assign("user_mac", $_SESSION['suser_mac']); |
||||||
|
$smarty->assign("user_dateformat", $_SESSION['suser_dateformat']); |
||||||
|
$smarty->assign("user_dns1suffix", $_SESSION['suser_dns1suffix']); |
||||||
|
$smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']); |
||||||
|
$smarty->assign("user_language", $_SESSION['suser_language']); |
||||||
|
$smarty->assign("user_menu_assets_checked", $user_menu_assets_checked); |
||||||
|
$smarty->assign("user_menu_assetclasses_checked", $user_menu_assetclasses_checked); |
||||||
|
$smarty->assign("user_menu_assetclassgroups_checked", $user_menu_assetclassgroups_checked); |
||||||
|
$smarty->assign("user_menu_locations_checked", $user_menu_locations_checked); |
||||||
|
$smarty->assign("user_menu_nodes_checked", $user_menu_nodes_checked); |
||||||
|
$smarty->assign("user_menu_subnets_checked", $user_menu_subnets_checked); |
||||||
|
$smarty->assign("user_menu_users_checked", $user_menu_users_checked); |
||||||
|
$smarty->assign("user_menu_vlans_checked", $user_menu_vlans_checked); |
||||||
|
$smarty->assign("user_menu_zones_checked", $user_menu_zones_checked); |
||||||
|
$smarty->assign("user_tooltips_checked", $user_tooltips_checked); |
||||||
|
|
||||||
// setup options |
$smarty->display("optionseditdisplay.tpl"); |
||||||
// set menu checkboxes |
|
||||||
// assets |
|
||||||
if($_SESSION['suser_menu_assets']=='on') { |
|
||||||
$user_menu_assets_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_menu_assets_checked = ''; |
|
||||||
} |
|
||||||
// assetclasses |
|
||||||
if($_SESSION['suser_menu_assetclasses']=='on') { |
|
||||||
$user_menu_assetclasses_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_menu_assetclasses_checked = ''; |
|
||||||
} |
|
||||||
// assetclassgroups |
|
||||||
if($_SESSION['suser_menu_assetclassgroups']=='on') { |
|
||||||
$user_menu_assetclassgroups_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_menu_assetclassgroups_checked = ''; |
|
||||||
} |
|
||||||
// locations |
|
||||||
if($_SESSION['suser_menu_locations']=='on') { |
|
||||||
$user_menu_locations_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_menu_locations_checked = ''; |
|
||||||
} |
|
||||||
// nodes |
|
||||||
if($_SESSION['suser_menu_nodes']=='on') { |
|
||||||
$user_menu_nodes_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_menu_nodes_checked = ''; |
|
||||||
} |
|
||||||
// subnets |
|
||||||
if($_SESSION['suser_menu_subnets']=='on') { |
|
||||||
$user_menu_subnets_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_menu_subnets_checked = ''; |
|
||||||
} |
|
||||||
// users |
|
||||||
if($_SESSION['suser_menu_users']=='on') { |
|
||||||
$user_menu_users_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_menu_users_checked = ''; |
|
||||||
} |
|
||||||
// vlans |
|
||||||
if($_SESSION['suser_menu_vlans']=='on') { |
|
||||||
$user_menu_vlans_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_menu_vlans_checked = ''; |
|
||||||
} |
|
||||||
// zones |
|
||||||
if($_SESSION['suser_menu_zones']=='on') { |
|
||||||
$user_menu_zones_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_menu_zones_checked = ''; |
|
||||||
} |
|
||||||
// tooltips |
|
||||||
if($_SESSION['suser_tooltips']=='on') { |
|
||||||
$user_tooltips_checked = 'checked'; |
|
||||||
} else { |
|
||||||
$user_tooltips_checked = ''; |
|
||||||
} |
|
||||||
|
|
||||||
// send to tpl |
include("footer.php"); |
||||||
$smarty->assign("user_id", $_SESSION['suser_id']); |
|
||||||
$smarty->assign("user_imagesize", $_SESSION['suser_imagesize']); |
|
||||||
$smarty->assign("user_imagecount", $_SESSION['suser_imagecount']); |
|
||||||
$smarty->assign("user_mac", $_SESSION['suser_mac']); |
|
||||||
$smarty->assign("user_dateformat", $_SESSION['suser_dateformat']); |
|
||||||
$smarty->assign("user_dns1suffix", $_SESSION['suser_dns1suffix']); |
|
||||||
$smarty->assign("user_dns2suffix", $_SESSION['suser_dns2suffix']); |
|
||||||
$smarty->assign("user_language", $_SESSION['suser_language']); |
|
||||||
$smarty->assign("user_menu_assets_checked", $user_menu_assets_checked); |
|
||||||
$smarty->assign("user_menu_assetclasses_checked", $user_menu_assetclasses_checked); |
|
||||||
$smarty->assign("user_menu_assetclassgroups_checked", $user_menu_assetclassgroups_checked); |
|
||||||
$smarty->assign("user_menu_locations_checked", $user_menu_locations_checked); |
|
||||||
$smarty->assign("user_menu_nodes_checked", $user_menu_nodes_checked); |
|
||||||
$smarty->assign("user_menu_subnets_checked", $user_menu_subnets_checked); |
|
||||||
$smarty->assign("user_menu_users_checked", $user_menu_users_checked); |
|
||||||
$smarty->assign("user_menu_vlans_checked", $user_menu_vlans_checked); |
|
||||||
$smarty->assign("user_menu_zones_checked", $user_menu_zones_checked); |
|
||||||
$smarty->assign("user_tooltips_checked", $user_tooltips_checked); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("optionseditdisplay.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,39 +1,16 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$smarty->display("optionseditpassword.tpl"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("footer.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("optionseditpassword.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,178 +1,145 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
include("header.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
// get string that was searched for ($search is already set in header.php) |
||||||
|
if (empty($search)) { |
||||||
You should have received a copy of the GNU General Public License |
// parse nosearch box |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$smarty->assign("nosearch", TRUE); |
||||||
|
} else { |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
// hide nosearch box |
||||||
or contact me at wietsew@users.sourceforge.net |
$smarty->assign("nosearch", FALSE); |
||||||
*****************************************************************************/ |
$smarty->assign("search", $search); |
||||||
|
|
||||||
// start page |
// set needle |
||||||
// includes |
$needle = '%' . $search . '%'; |
||||||
include("includes.php"); |
|
||||||
|
// set counter |
||||||
// start output |
$resultcounter = 0; |
||||||
include("header.php"); |
|
||||||
|
// asset |
||||||
// set language variables |
$query = "SELECT |
||||||
$smarty->assign($lang); |
asset_id AS id, |
||||||
|
asset_name AS name, |
||||||
// get string that was searched for ($search is already set in header.php) |
asset_info AS description |
||||||
if (empty($search)) { |
FROM |
||||||
// parse nosearch box |
asset |
||||||
$smarty->assign("nosearch", TRUE); |
WHERE |
||||||
} else { |
asset_name LIKE '" . $needle . "' |
||||||
// hide nosearch box |
OR asset_hostname LIKE '" . $needle . "' |
||||||
$smarty->assign("nosearch", FALSE); |
OR asset_info LIKE '" . $needle . "' |
||||||
$smarty->assign("search", $search); |
ORDER BY |
||||||
|
asset_name"; |
||||||
// set needle |
|
||||||
$needle = '%' . $search . '%'; |
$assets = $db->db_select($query); |
||||||
|
$resultcounter += count($assets); |
||||||
// set counter |
$smarty->assign("assets", $assets); |
||||||
$resultcounter = 0; |
|
||||||
|
// location |
||||||
// setup asset |
$query = "SELECT |
||||||
// build query |
location_id AS id, |
||||||
$query = "SELECT |
location_name AS name |
||||||
asset.asset_id AS id, |
FROM |
||||||
asset.asset_name AS name, |
location |
||||||
asset.asset_info AS description |
WHERE |
||||||
FROM |
location_name LIKE '" . $needle . "' |
||||||
asset |
OR location_info LIKE '" . $needle . "' |
||||||
WHERE |
ORDER BY |
||||||
asset.asset_name LIKE '" . $needle . "' |
location_name"; |
||||||
OR asset.asset_hostname LIKE '" . $needle . "' |
|
||||||
OR asset.asset_info LIKE '" . $needle . "' |
$locations = $db->db_select($query); |
||||||
ORDER BY |
$resultcounter += count($locations); |
||||||
asset.asset_name"; |
$smarty->assign("locations", $locations); |
||||||
|
|
||||||
// run query |
// node |
||||||
$assets = $db->db_select($query); |
$query = "SELECT |
||||||
$resultcounter += count($assets); |
node_id AS id, |
||||||
$smarty->assign("assets", $assets); |
node_ip AS ip |
||||||
|
FROM |
||||||
// setup location |
node |
||||||
// build query |
WHERE |
||||||
$query = "SELECT |
node_ip LIKE '" . $needle . "' |
||||||
location.location_id AS id, |
OR node_mac LIKE '" . $needle . "' |
||||||
location.location_name AS name |
OR node_dns1 LIKE '" . $needle . "' |
||||||
FROM |
OR node_dns2 LIKE '" . $needle . "' |
||||||
location |
OR node_info LIKE '" . $needle . "' |
||||||
WHERE |
ORDER BY |
||||||
location.location_name LIKE '" . $needle . "' |
node_ip"; |
||||||
OR location.location_info LIKE '" . $needle . "' |
|
||||||
ORDER BY |
$nodes = $db->db_select($query); |
||||||
location.location_name"; |
$resultcounter += count($nodes); |
||||||
|
$smarty->assign("nodes", $nodes); |
||||||
// run query |
|
||||||
$locations = $db->db_select($query); |
// subnet |
||||||
$resultcounter += count($locations); |
$query = "SELECT |
||||||
$smarty->assign("locations", $locations); |
subnet_id AS id, |
||||||
|
subnet_address AS address |
||||||
// setup node |
FROM |
||||||
// build query |
subnet |
||||||
$query = "SELECT |
WHERE |
||||||
node.node_id AS id, |
subnet_address LIKE '" . $needle . "' |
||||||
node.node_ip AS ip |
OR subnet_info LIKE '" . $needle . "' |
||||||
FROM |
ORDER BY |
||||||
node |
subnet_address"; |
||||||
WHERE |
|
||||||
node.node_ip LIKE '" . $needle . "' |
// run query |
||||||
OR node.node_mac LIKE '" . $needle . "' |
$subnets = $db->db_select($query); |
||||||
OR node.node_dns1 LIKE '" . $needle . "' |
$resultcounter += count($subnets); |
||||||
OR node.node_dns2 LIKE '" . $needle . "' |
$smarty->assign("subnets", $subnets); |
||||||
OR node.node_info LIKE '" . $needle . "' |
|
||||||
ORDER BY |
// vlan |
||||||
node.node_ip"; |
$query = "SELECT |
||||||
|
vlan_id AS id, |
||||||
// run query |
vlan_name AS name |
||||||
$nodes = $db->db_select($query); |
FROM |
||||||
$resultcounter += count($nodes); |
vlan |
||||||
$smarty->assign("nodes", $nodes); |
WHERE |
||||||
|
vlan_name LIKE '" . $needle . "' |
||||||
// setup subnet |
OR vlan_info LIKE '" . $needle . "' |
||||||
// build query |
ORDER BY |
||||||
$query = "SELECT |
vlan_name"; |
||||||
subnet.subnet_id AS id, |
|
||||||
subnet.subnet_address AS address |
$vlans = $db->db_select($query); |
||||||
FROM |
$resultcounter += count($vlans); |
||||||
subnet |
$smarty->assign("vlans", $vlans); |
||||||
WHERE |
|
||||||
subnet.subnet_address LIKE '" . $needle . "' |
// setup zone |
||||||
OR subnet.subnet_info LIKE '" . $needle . "' |
$query = "SELECT |
||||||
ORDER BY |
zone_id AS id, |
||||||
subnet.subnet_address"; |
zone_origin AS origin |
||||||
|
FROM |
||||||
// run query |
zone |
||||||
$subnets = $db->db_select($query); |
WHERE |
||||||
$resultcounter += count($subnets); |
zone_origin LIKE '" . $needle . "' |
||||||
$smarty->assign("subnets", $subnets); |
OR zone_soa LIKE '" . $needle . "' |
||||||
|
OR zone_hostmaster LIKE '" . $needle . "' |
||||||
// setup vlan |
OR zone_ns1 LIKE '" . $needle . "' |
||||||
// build query |
OR zone_ns2 LIKE '" . $needle . "' |
||||||
$query = "SELECT |
OR zone_ns3 LIKE '" . $needle . "' |
||||||
vlan.vlan_id AS id, |
OR zone_mx1 LIKE '" . $needle . "' |
||||||
vlan.vlan_name AS name |
OR zone_mx2 LIKE '" . $needle . "' |
||||||
FROM |
OR zone_info LIKE '" . $needle . "' |
||||||
vlan |
ORDER BY |
||||||
WHERE |
zone_origin"; |
||||||
vlan.vlan_name LIKE '" . $needle . "' |
|
||||||
OR vlan.vlan_info LIKE '" . $needle . "' |
$zones = $db->db_select($query); |
||||||
ORDER BY |
$resultcounter += count($zones); |
||||||
vlan.vlan_name"; |
$smarty->assign("zones", $zones); |
||||||
|
|
||||||
// run query |
// grand totals |
||||||
$vlans = $db->db_select($query); |
$smarty->assign("resultcounter", $resultcounter); |
||||||
$resultcounter += count($vlans); |
} |
||||||
$smarty->assign("vlans", $vlans); |
|
||||||
|
$smarty->display("search.tpl"); |
||||||
// setup zone |
|
||||||
// build query |
include("footer.php"); |
||||||
$query = "SELECT |
|
||||||
zone_id AS id, |
|
||||||
zone_origin AS origin |
|
||||||
FROM |
|
||||||
zone |
|
||||||
WHERE |
|
||||||
zone_origin LIKE '" . $needle . "' |
|
||||||
OR zone_soa LIKE '" . $needle . "' |
|
||||||
OR zone_hostmaster LIKE '" . $needle . "' |
|
||||||
OR zone_ns1 LIKE '" . $needle . "' |
|
||||||
OR zone_ns2 LIKE '" . $needle . "' |
|
||||||
OR zone_ns3 LIKE '" . $needle . "' |
|
||||||
OR zone_mx1 LIKE '" . $needle . "' |
|
||||||
OR zone_mx2 LIKE '" . $needle . "' |
|
||||||
OR zone_info LIKE '" . $needle . "' |
|
||||||
ORDER BY |
|
||||||
zone_origin"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$zones = $db->db_select($query); |
|
||||||
$resultcounter += count($zones); |
|
||||||
$smarty->assign("zones", $zones); |
|
||||||
|
|
||||||
// grand totals |
|
||||||
$smarty->assign("resultcounter", $resultcounter); |
|
||||||
} |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("search.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,60 +1,34 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
include("header.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
$query = "SELECT |
||||||
GNU General Public License for more details. |
s.subnet_id, |
||||||
|
s.subnet_address, |
||||||
You should have received a copy of the GNU General Public License |
s.subnet_mask, |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
s.ntp_server, |
||||||
|
LEFT(s.subnet_info, 40) AS subnet_info, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
CHAR_LENGTH(s.subnet_info) AS subnet_length, |
||||||
or contact me at wietsew@users.sourceforge.net |
COUNT(node.subnet_id) AS node_counter |
||||||
*****************************************************************************/ |
FROM |
||||||
|
subnet AS s LEFT JOIN node USING (subnet_id) |
||||||
// start page |
GROUP BY |
||||||
// includes |
s.subnet_id |
||||||
include("includes.php"); |
ORDER BY |
||||||
|
INET_ATON(s.subnet_address)"; |
||||||
// start output |
|
||||||
include("header.php"); |
$subnets = $db->db_select($query); |
||||||
|
|
||||||
// set language variables |
$smarty->assign("subnets", $subnets); |
||||||
$smarty->assign($lang); |
$smarty->display("subnet.tpl"); |
||||||
|
|
||||||
// setup subnet |
include("footer.php"); |
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
s.subnet_id, |
|
||||||
s.subnet_address, |
|
||||||
s.subnet_mask, |
|
||||||
s.ntp_server, |
|
||||||
LEFT(s.subnet_info, 40) AS subnet_info, |
|
||||||
CHAR_LENGTH(s.subnet_info) AS subnet_length, |
|
||||||
COUNT(node.subnet_id) AS node_counter |
|
||||||
FROM |
|
||||||
subnet AS s LEFT JOIN node USING (subnet_id) |
|
||||||
GROUP BY |
|
||||||
s.subnet_id |
|
||||||
ORDER BY |
|
||||||
INET_ATON(s.subnet_address)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnets = $db->db_select($query); |
|
||||||
$smarty->assign("subnets", $subnets); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnet.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
@ -1,61 +1,35 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
if((isset($_GET['vlan_id'])) ? $vlan_id = sanitize($_GET['vlan_id']) : $vlan_id = ""); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
vlan_id, |
||||||
|
vlan_number, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
vlan_name |
||||||
or contact me at wietsew@users.sourceforge.net |
FROM |
||||||
*****************************************************************************/ |
vlan |
||||||
|
ORDER BY |
||||||
// start page |
vlan_name"; |
||||||
// includes |
|
||||||
include("includes.php"); |
$vlans = $db->db_select($query); |
||||||
|
$vlan_options[0] = $lang['lang_option_none']; |
||||||
// get id |
foreach ($vlans as $vlan) { |
||||||
if((isset($_GET['vlan_id'])) ? $vlan_id = sanitize($_GET['vlan_id']) : $vlan_id = ""); |
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name']; |
||||||
|
} |
||||||
// start output |
$smarty->assign("vlan_options", $vlan_options); |
||||||
include("header.php"); |
|
||||||
|
$smarty->display("subnetadd.tpl"); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
include("footer.php"); |
||||||
|
|
||||||
// setup vlan |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
vlan_id, |
|
||||||
vlan_number, |
|
||||||
vlan_name |
|
||||||
FROM |
|
||||||
vlan |
|
||||||
ORDER BY |
|
||||||
vlan_name"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$vlans = $db->db_select($query); |
|
||||||
$vlan_options[0] = $lang['lang_option_none']; |
|
||||||
foreach ($vlans as $vlan) { |
|
||||||
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name']; |
|
||||||
} |
|
||||||
$smarty->assign("vlan_options", $vlan_options); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnetadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,76 +1,48 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
// subnet |
||||||
// includes |
$query = "SELECT |
||||||
include("includes.php"); |
subnet_address, |
||||||
|
subnet_mask |
||||||
|
FROM |
||||||
|
subnet |
||||||
|
WHERE |
||||||
|
subnet_id=" . $subnet_id; |
||||||
|
|
||||||
// get id |
$subnet = $db->db_select($query); |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("subnet_id", $subnet_id); |
||||||
include("header.php"); |
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
||||||
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
|
||||||
// set language variables |
// node |
||||||
$smarty->assign($lang); |
$query = "SELECT |
||||||
|
node_id, |
||||||
|
node_ip |
||||||
|
FROM |
||||||
|
node |
||||||
|
WHERE |
||||||
|
subnet_id=" . $subnet_id . " |
||||||
|
ORDER BY |
||||||
|
INET_ATON(node_ip)"; |
||||||
|
|
||||||
// setup subnet |
$nodes = $db->db_select($query); |
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
subnet_address, |
|
||||||
subnet_mask |
|
||||||
FROM |
|
||||||
subnet |
|
||||||
WHERE |
|
||||||
subnet_id=" . $subnet_id; |
|
||||||
|
|
||||||
// run query |
$smarty->assign("nodes", $nodes); |
||||||
$subnet = $db->db_select($query); |
$smarty->display("subnetdel.tpl"); |
||||||
|
|
||||||
// send to tpl |
include("footer.php"); |
||||||
$smarty->assign("subnet_id", $subnet_id); |
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
|
||||||
|
|
||||||
// setup node |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
node_id, |
|
||||||
node_ip |
|
||||||
FROM |
|
||||||
node |
|
||||||
WHERE |
|
||||||
subnet_id=" . $subnet_id . " |
|
||||||
ORDER BY |
|
||||||
INET_ATON(node_ip)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$nodes = $db->db_select($query); |
|
||||||
$smarty->assign("nodes", $nodes); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnetdel.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,70 +1,43 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
subnet_address, |
||||||
|
subnet_mask, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
protocol_version, |
||||||
or contact me at wietsew@users.sourceforge.net |
subnet_dhcp_start, |
||||||
*****************************************************************************/ |
subnet_dhcp_end, |
||||||
|
ntp_server, |
||||||
// start page |
subnet_info AS subnet_info |
||||||
// includes |
FROM |
||||||
include("includes.php"); |
subnet |
||||||
|
WHERE |
||||||
// get id |
subnet_id=" . $subnet_id; |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
|
||||||
|
$subnet = $db->db_select($query); |
||||||
// start output |
|
||||||
include("header.php"); |
$smarty->assign("subnet_id", $subnet_id); |
||||||
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
||||||
// set language variables |
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
$smarty->assign($lang); |
$smarty->assign("subnet_proto_vers", $subnet[0]['protocol_version']); |
||||||
|
$smarty->assign("subnet_dhcpstart", $subnet[0]['subnet_dhcp_start']); |
||||||
// setup subnet |
$smarty->assign("subnet_dhcpend", $subnet[0]['subnet_dhcp_end']); |
||||||
// build query |
$smarty->assign("subnet_ntp_server", $subnet[0]['ntp_server']); |
||||||
$query = "SELECT |
$smarty->assign("subnet_info", $subnet[0]['subnet_info']); |
||||||
subnet_address, |
|
||||||
subnet_mask, |
$smarty->display("subnetedit.tpl"); |
||||||
protocol_version, |
|
||||||
subnet_dhcp_start, |
include("footer.php"); |
||||||
subnet_dhcp_end, |
|
||||||
ntp_server, |
|
||||||
subnet_info AS subnet_info |
|
||||||
FROM |
|
||||||
subnet |
|
||||||
WHERE |
|
||||||
subnet_id=" . $subnet_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnet = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("subnet_id", $subnet_id); |
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
|
||||||
$smarty->assign("subnet_proto_vers", $subnet[0]['protocol_version']); |
|
||||||
$smarty->assign("subnet_dhcpstart", $subnet[0]['subnet_dhcp_start']); |
|
||||||
$smarty->assign("subnet_dhcpend", $subnet[0]['subnet_dhcp_end']); |
|
||||||
$smarty->assign("subnet_ntp_server", $subnet[0]['ntp_server']); |
|
||||||
$smarty->assign("subnet_info", $subnet[0]['subnet_info']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnetedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
@ -1,63 +1,34 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
subnet_address, |
||||||
|
subnet_mask |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
subnet |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
subnet_id=" . $subnet_id; |
||||||
// start page |
|
||||||
// includes |
$subnet = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
$smarty->assign("subnet_id", $subnet_id); |
||||||
// get ip and id |
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
|
||||||
// start output |
$smarty->assign("location_options", $db->options_location()); |
||||||
include("header.php"); |
$smarty->display("subnetlocationadd.tpl"); |
||||||
|
|
||||||
// set language variables |
include("footer.php"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
subnet.subnet_address AS subnet_address, |
|
||||||
subnet.subnet_mask AS subnet_mask |
|
||||||
FROM |
|
||||||
subnet |
|
||||||
WHERE |
|
||||||
subnet.subnet_id=" . $subnet_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnet = $db->db_select($query); |
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id); |
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
|
||||||
|
|
||||||
// start parent |
|
||||||
// build query |
|
||||||
$smarty->assign("location_options", $db->options_location()); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnetlocationadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,82 +1,54 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// subnet |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$query = "SELECT |
||||||
|
subnet_address, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
subnet_mask |
||||||
or contact me at wietsew@users.sourceforge.net |
FROM |
||||||
*****************************************************************************/ |
subnet |
||||||
|
WHERE |
||||||
// start page |
subnet_id=" . $subnet_id; |
||||||
// includes |
|
||||||
include("includes.php"); |
// run query |
||||||
|
$subnet = $db->db_select($query); |
||||||
// get ip and id |
|
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
$smarty->assign("subnet_id", $subnet_id); |
||||||
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
||||||
// start output |
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
include("header.php"); |
|
||||||
|
// location |
||||||
// set language variables |
$query = "SELECT |
||||||
$smarty->assign($lang); |
l.location_id, |
||||||
|
l.location_name |
||||||
// setup subnet |
FROM |
||||||
// build query |
subnetlocation AS s LEFT JOIN location USING (location_id) |
||||||
$query = "SELECT |
WHERE |
||||||
subnet.subnet_address AS subnet_address, |
s.subnet_id=" . $subnet_id . " |
||||||
subnet.subnet_mask AS subnet_mask |
ORDER BY |
||||||
FROM |
l.location_name"; |
||||||
subnet |
|
||||||
WHERE |
// run query |
||||||
subnet.subnet_id=" . $subnet_id; |
$records = $db->db_select($query); |
||||||
|
$locations = array(); |
||||||
// run query |
foreach ($records as $rec) { |
||||||
$subnet = $db->db_select($query); |
$locations[$rec['location_id']] = $rec['location_name']; |
||||||
|
} |
||||||
$smarty->assign("subnet_id", $subnet_id); |
$smarty->assign("location_options", $locations); |
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
$smarty->display("subnetlocationdel.tpl"); |
||||||
|
|
||||||
// setup location |
include("footer.php"); |
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
location.location_id AS location_id, |
|
||||||
location.location_name AS location_name |
|
||||||
FROM |
|
||||||
subnetlocation, |
|
||||||
location |
|
||||||
WHERE |
|
||||||
subnetlocation.subnet_id=" . $subnet_id . " |
|
||||||
AND location.location_id=subnetlocation.location_id |
|
||||||
ORDER BY |
|
||||||
location.location_name"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$records = $db->db_select($query); |
|
||||||
$locations = array(); |
|
||||||
foreach ($records as $rec) { |
|
||||||
$locations[$rec['location_id']] = $rec['location_name']; |
|
||||||
} |
|
||||||
$smarty->assign("location_options", $locations); |
|
||||||
|
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnetlocationdel.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
@ -1,59 +1,34 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
subnet_address, |
||||||
|
subnet_mask |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
subnet |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
subnet_id=" . $subnet_id; |
||||||
// start page |
|
||||||
// includes |
// run query |
||||||
include("includes.php"); |
$subnet = $db->db_select($query); |
||||||
|
|
||||||
// get ip and id |
$smarty->assign("subnet_id", $subnet_id); |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
||||||
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
// start output |
|
||||||
include("header.php"); |
$smarty->display("subnetlocationedit.tpl"); |
||||||
|
|
||||||
// set language variables |
include("footer.php"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
subnet.subnet_address AS subnet_address, |
|
||||||
subnet.subnet_mask AS subnet_mask |
|
||||||
FROM |
|
||||||
subnet |
|
||||||
WHERE |
|
||||||
subnet.subnet_id=" . $subnet_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnet = $db->db_select($query); |
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id); |
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnetlocationedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,432 +1,395 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
if(isset($_GET['page'])) { |
||||||
|
$page = sanitize($_GET['page']); |
||||||
|
} |
||||||
|
|
||||||
|
$smarty->assign("scripts",'changetext.js'); |
||||||
|
include("header.php"); |
||||||
|
|
||||||
|
// subnet |
||||||
|
$query = "SELECT |
||||||
|
s.subnet_address, |
||||||
|
s.subnet_mask, |
||||||
|
s.subnet_dhcp_start, |
||||||
|
s.subnet_dhcp_end, |
||||||
|
s.subnet_info, |
||||||
|
s.protocol_version, |
||||||
|
s.ntp_server, |
||||||
|
COUNT(node.subnet_id) AS node_counter |
||||||
|
FROM |
||||||
|
subnet AS s LEFT JOIN node USING (subnet_id) |
||||||
|
WHERE |
||||||
|
s.subnet_id=" . $subnet_id . " |
||||||
|
GROUP BY |
||||||
|
s.subnet_id"; |
||||||
|
|
||||||
|
$subnet = $db->db_select($query); |
||||||
|
|
||||||
|
// set needed variables |
||||||
|
$subnet_address = $subnet[0]['subnet_address']; |
||||||
|
$subnet_mask = $subnet[0]['subnet_mask']; |
||||||
|
$subnet_dhcpstart = $subnet[0]['subnet_dhcp_start']; |
||||||
|
$subnet_dhcpend = $subnet[0]['subnet_dhcp_end']; |
||||||
|
$subnet_proto_vers = $subnet[0]['protocol_version']; |
||||||
|
$subnet_ntp_server = $subnet[0]['ntp_server']; |
||||||
|
|
||||||
|
// set counters |
||||||
|
$host_counter = pow(2,(32-$subnet_mask)); |
||||||
|
$node_counter = $subnet[0]['node_counter']; |
||||||
|
$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("subnet_usedpercentage", $subnet_usedpercentage); |
||||||
|
$smarty->assign("config_color_unused", $config_color_unused); |
||||||
|
$smarty->assign("host_counter", $host_counter-2); |
||||||
|
$smarty->assign("free_counter", (($host_counter-2)-$node_counter)); |
||||||
|
|
||||||
|
// subnet |
||||||
|
|
||||||
|
// split up the range |
||||||
|
$iprange = explode('.', $subnet_address); |
||||||
|
$iprange1 = $iprange[0]; |
||||||
|
$iprange2 = $iprange[1]; |
||||||
|
$iprange3 = $iprange[2]; |
||||||
|
$iprange4 = $iprange[3]; |
||||||
|
|
||||||
|
// create empty subnet-array |
||||||
|
$subnet = array(); |
||||||
|
|
||||||
|
// determine range (Class A/B/C) |
||||||
|
if ($subnet_mask>=24) { |
||||||
|
// Class C |
||||||
|
// fill subnet-array with addresses we want to see |
||||||
|
for($i=0;$i<$host_counter;$i++) { |
||||||
|
// build ip |
||||||
|
$ip = $iprange1 . '.' . $iprange2 . '.' . $iprange3 . '.' . ($iprange4+$i); |
||||||
|
|
||||||
|
// fill subnet-array |
||||||
|
$subnet[$ip] = array(); |
||||||
|
} |
||||||
|
|
||||||
|
// calculate broadcast address |
||||||
|
$broadcast_address = $iprange1 . '.' . $iprange2 . '.' . $iprange3 . '.' . ($iprange4+$i-1); |
||||||
|
|
||||||
|
// to tpl |
||||||
|
$smarty->assign("iprange1", $iprange1); |
||||||
|
$smarty->assign("iprange2", $iprange2); |
||||||
|
$smarty->assign("iprange3", $iprange3); |
||||||
|
$smarty->assign("iprange4", $iprange4); |
||||||
|
$smarty->assign("subnetmask1", 255); |
||||||
|
$smarty->assign("subnetmask2", 255); |
||||||
|
$smarty->assign("subnetmask3", 255); |
||||||
|
$smarty->assign("subnetmask4", 256-$host_counter); |
||||||
|
|
||||||
|
// no pagination needed |
||||||
|
$smarty->assign("noselect", TRUE); |
||||||
|
$smarty->assign("one_select", FALSE); |
||||||
|
$smarty->assign("two_select", FALSE); |
||||||
|
|
||||||
|
// set displayed nodes |
||||||
|
$nodes_displayed = $host_counter; |
||||||
|
} else if ($subnet_mask>=16) { |
||||||
|
// Class B |
||||||
|
// which part do we want to see? |
||||||
|
if((empty($page)) ? $page=$subnet_address : $page=$page); |
||||||
|
$page = explode('.', $page); |
||||||
|
$page2 = $page[2]; |
||||||
|
|
||||||
|
// fill subnet-array with addresses we want to see |
||||||
|
for($i=0;$i<256;$i++) { |
||||||
|
// build ip |
||||||
|
$ip = $iprange1 . '.' . $iprange2 . '.' . $page2 . '.' . $i; |
||||||
|
|
||||||
|
// fill subnet-array |
||||||
|
$subnet[$ip] = array(); |
||||||
|
} |
||||||
|
|
||||||
|
// calculate broadcast address |
||||||
|
$broadcast_address = $iprange1 . '.' . $iprange2 . '.' . ($iprange3+$i-1) . '.255'; |
||||||
|
|
||||||
|
// to tpl |
||||||
|
$smarty->assign("iprange1", $iprange1); |
||||||
|
$smarty->assign("iprange2", $iprange2); |
||||||
|
|
||||||
|
// loop addresses in range3 |
||||||
|
for($i=$iprange3;$i<(pow(2,(32-$subnet_mask))/256);$i++) { |
||||||
|
// send to tpl |
||||||
|
$smarty->assign("iprange3", $i); |
||||||
|
$smarty->assign("iprange4", 0); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// set select box |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
if($i==$page2) { |
||||||
|
$smarty->assign("row_selected", "selected"); |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
} else { |
||||||
or contact me at wietsew@users.sourceforge.net |
$smarty->assign("row_selected", ""); |
||||||
*****************************************************************************/ |
} |
||||||
|
|
||||||
// start page |
} |
||||||
// includes |
|
||||||
include("includes.php"); |
$smarty->assign("subnetmask1", 255); |
||||||
|
$smarty->assign("subnetmask2", 255); |
||||||
|
$smarty->assign("subnetmask3", 256-($host_counter/256)); |
||||||
|
$smarty->assign("subnetmask4", 0); |
||||||
|
|
||||||
|
// one select box |
||||||
|
$smarty->assign("noselect", FALSE); |
||||||
|
$smarty->assign("one_select", TRUE); |
||||||
|
$smarty->assign("two_select", FALSE); |
||||||
|
|
||||||
|
// set displayed nodes |
||||||
|
$nodes_displayed = 256; |
||||||
|
} else { |
||||||
|
// Class A |
||||||
|
// which part do we want to see? |
||||||
|
if((empty($page)) ? $page=$subnet_address : $page=$page); |
||||||
|
$page = explode('.', $page); |
||||||
|
$page2 = $page[1]; |
||||||
|
$page3 = $page[2]; |
||||||
|
|
||||||
|
// fill subnet-array with addresses we want to see |
||||||
|
for($i=0;$i<256;$i++) { |
||||||
|
// build ip |
||||||
|
$ip = $iprange1 . '.' . $page2 . '.' . $page3 . '.' . $i; |
||||||
|
|
||||||
|
// fill subnet-array |
||||||
|
$subnet[$ip] = array(); |
||||||
|
} |
||||||
|
|
||||||
|
// calculate broadcast address |
||||||
|
$broadcast_address = $iprange1 . '.' . ($iprange2+$i-1) . '.255.255'; |
||||||
|
|
||||||
|
// to tpl |
||||||
|
$smarty->assign("iprange1", $iprange1); |
||||||
|
$smarty->assign("iprange2", $iprange2); |
||||||
|
|
||||||
|
// loop addresses in range 2 |
||||||
|
for ($i=$iprange2; $i<(pow(2,(24-$subnet_mask))/256); $i++) { |
||||||
|
// send to tpl |
||||||
|
$smarty->assign("iprange1", $iprange1); |
||||||
|
$smarty->assign("iprange2", $i); |
||||||
|
$smarty->assign("iprange3", $page3); |
||||||
|
$smarty->assign("iprange4", $iprange4); |
||||||
|
|
||||||
// get id |
// set select box |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
if($i==$page2) { |
||||||
|
$smarty->assign("row1_selected", "selected"); |
||||||
|
|
||||||
// get page |
} else { |
||||||
if(isset($_GET['page'])) { |
$smarty->assign("row1_selected", ""); |
||||||
$page = sanitize($_GET['page']); |
|
||||||
} |
} |
||||||
|
|
||||||
// start output |
// parse block |
||||||
$smarty->assign("scripts",'changetext.js'); |
$tp->parse("two_select_row1"); |
||||||
include("header.php"); |
} |
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
s.subnet_address, |
|
||||||
s.subnet_mask, |
|
||||||
s.subnet_dhcp_start, |
|
||||||
s.subnet_dhcp_end, |
|
||||||
s.subnet_info, |
|
||||||
s.protocol_version, |
|
||||||
s.ntp_server, |
|
||||||
COUNT(node.subnet_id) AS node_counter |
|
||||||
FROM |
|
||||||
subnet AS s LEFT JOIN node USING (subnet_id) |
|
||||||
WHERE |
|
||||||
s.subnet_id=" . $subnet_id . " |
|
||||||
GROUP BY |
|
||||||
s.subnet_id"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnet = $db->db_select($query); |
|
||||||
|
|
||||||
// set needed variables |
|
||||||
$subnet_address = $subnet[0]['subnet_address']; |
|
||||||
$subnet_mask = $subnet[0]['subnet_mask']; |
|
||||||
$subnet_dhcpstart = $subnet[0]['subnet_dhcp_start']; |
|
||||||
$subnet_dhcpend = $subnet[0]['subnet_dhcp_end']; |
|
||||||
$subnet_proto_vers = $subnet[0]['protocol_version']; |
|
||||||
$subnet_ntp_server = $subnet[0]['ntp_server']; |
|
||||||
|
|
||||||
// set counters |
|
||||||
$host_counter = pow(2,(32-$subnet_mask)); |
|
||||||
$node_counter = $subnet[0]['node_counter']; |
|
||||||
$subnet_usedpercentage = round((($node_counter/($host_counter-2))*100), 1); |
|
||||||
|
|
||||||
|
// loop addresses in range 3 |
||||||
|
for($i=0;$i<256;$i++) { |
||||||
// send to tpl |
// send to tpl |
||||||
$smarty->assign("subnet_id", $subnet_id); |
$smarty->assign("iprange1", $iprange1); |
||||||
$smarty->assign("subnet_address", $subnet_address); |
$smarty->assign("iprange2", $page2); |
||||||
$smarty->assign("subnet_mask", $subnet_mask); |
$smarty->assign("iprange3", $i); |
||||||
$smarty->assign("subnet_dhcpstart", $subnet_dhcpstart); |
$smarty->assign("iprange4", $iprange4); |
||||||
$smarty->assign("subnet_dhcpend", $subnet_dhcpend); |
|
||||||
$smarty->assign("subnet_info", nl2br($subnet[0]['subnet_info'])); |
// set select box |
||||||
$smarty->assign("subnet_proto_vers", $subnet_proto_vers); |
if($i==$page3) { |
||||||
$smarty->assign("subnet_ntp_server", $subnet_ntp_server); |
$smarty->assign("row2_selected", "selected"); |
||||||
$smarty->assign("node_counter", $node_counter); |
|
||||||
$smarty->assign("subnet_usedpercentage", $subnet_usedpercentage); |
} else { |
||||||
$smarty->assign("config_color_unused", $config_color_unused); |
$smarty->assign("row2_selected", ""); |
||||||
$smarty->assign("host_counter", $host_counter-2); |
} |
||||||
$smarty->assign("free_counter", (($host_counter-2)-$node_counter)); |
|
||||||
|
// parse block |
||||||
// setup subnet |
$tp->parse("two_select_row2"); |
||||||
// split up the range |
} |
||||||
$iprange = explode('.', $subnet_address); |
|
||||||
$iprange1 = $iprange[0]; |
$smarty->assign("subnetmask1", 255); |
||||||
$iprange2 = $iprange[1]; |
$smarty->assign("subnetmask2", 256-($host_counter/65536)); |
||||||
$iprange3 = $iprange[2]; |
$smarty->assign("subnetmask3", 0); |
||||||
$iprange4 = $iprange[3]; |
$smarty->assign("subnetmask4", 0); |
||||||
|
|
||||||
// create empty subnet-array |
// one select box |
||||||
$subnet = array(); |
$smarty->assign("noselect", FALSE); |
||||||
|
$smarty->assign("one_select", FALSE); |
||||||
// determine range (Class A/B/C) |
$smarty->assign("two_select", TRUE); |
||||||
if ($subnet_mask>=24) { |
|
||||||
// Class C |
// set displayed nodes |
||||||
// fill subnet-array with addresses we want to see |
$nodes_displayed = 256; |
||||||
for($i=0;$i<$host_counter;$i++) { |
} |
||||||
// build ip |
|
||||||
$ip = $iprange1 . '.' . $iprange2 . '.' . $iprange3 . '.' . ($iprange4+$i); |
// get nodes for this subnetview and implement the values into the array |
||||||
|
$query = "SELECT |
||||||
// fill subnet-array |
asset.asset_name, |
||||||
$subnet[$ip] = array(); |
assetclassgroup.assetclassgroup_color, |
||||||
} |
node.node_id, |
||||||
|
node.node_ip |
||||||
// calculate broadcast address |
FROM |
||||||
$broadcast_address = $iprange1 . '.' . $iprange2 . '.' . $iprange3 . '.' . ($iprange4+$i-1); |
asset, |
||||||
|
assetclass, |
||||||
// to tpl |
assetclassgroup, |
||||||
$smarty->assign("iprange1", $iprange1); |
node |
||||||
$smarty->assign("iprange2", $iprange2); |
WHERE |
||||||
$smarty->assign("iprange3", $iprange3); |
node.node_ip IN ('".implode("','",array_keys($subnet))."') |
||||||
$smarty->assign("iprange4", $iprange4); |
AND node.subnet_id='$subnet_id' |
||||||
$smarty->assign("subnetmask1", 255); |
AND asset.asset_id=node.asset_id |
||||||
$smarty->assign("subnetmask2", 255); |
AND assetclass.assetclass_id=asset.assetclass_id |
||||||
$smarty->assign("subnetmask3", 255); |
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id"; |
||||||
$smarty->assign("subnetmask4", 256-$host_counter); |
|
||||||
|
$nodes = $db->db_select($query); |
||||||
// no pagination needed |
|
||||||
$smarty->assign("noselect", TRUE); |
$node_counter = count($nodes); |
||||||
$smarty->assign("one_select", FALSE); |
if ($node_counter>0) { |
||||||
$smarty->assign("two_select", FALSE); |
// get objects |
||||||
|
foreach($nodes AS $node) { |
||||||
// set displayed nodes |
// add node-values to ip in subnet-array |
||||||
$nodes_displayed = $host_counter; |
$subnet[$node['node_ip']] = $node; |
||||||
} else if ($subnet_mask>=16) { |
} |
||||||
// Class B |
} |
||||||
// which part do we want to see? |
|
||||||
if((empty($page)) ? $page=$subnet_address : $page=$page); |
// replace ip's in subnet-array (if necessary) |
||||||
$page = explode('.', $page); |
// check for subnet address |
||||||
$page2 = $page[2]; |
if(array_key_exists($subnet_address, $subnet)) { |
||||||
|
// replace |
||||||
// fill subnet-array with addresses we want to see |
$subnet[$subnet_address] = array("subnet_address"); |
||||||
for($i=0;$i<256;$i++) { |
} |
||||||
// build ip |
|
||||||
$ip = $iprange1 . '.' . $iprange2 . '.' . $page2 . '.' . $i; |
// check for broadcast address |
||||||
|
if(array_key_exists($broadcast_address, $subnet)) { |
||||||
// fill subnet-array |
// replace |
||||||
$subnet[$ip] = array(); |
$subnet[$broadcast_address] = array("broadcast_address"); |
||||||
} |
} |
||||||
|
|
||||||
// calculate broadcast address |
$dhcpstart = 0; |
||||||
$broadcast_address = $iprange1 . '.' . $iprange2 . '.' . ($iprange3+$i-1) . '.255'; |
if ($subnet_dhcpstart && $subnet_dhcpend) { |
||||||
|
$dhcpstart = ip2long($subnet_dhcpstart); |
||||||
// to tpl |
$dhcpend = ip2long($subnet_dhcpend); |
||||||
$smarty->assign("iprange1", $iprange1); |
} |
||||||
$smarty->assign("iprange2", $iprange2); |
|
||||||
|
|
||||||
// loop addresses in range3 |
|
||||||
for($i=$iprange3;$i<(pow(2,(32-$subnet_mask))/256);$i++) { |
|
||||||
// send to tpl |
|
||||||
$smarty->assign("iprange3", $i); |
|
||||||
$smarty->assign("iprange4", 0); |
|
||||||
|
|
||||||
// set select box |
|
||||||
if($i==$page2) { |
|
||||||
$smarty->assign("row_selected", "selected"); |
|
||||||
|
|
||||||
} else { |
|
||||||
$smarty->assign("row_selected", ""); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
$smarty->assign("subnetmask1", 255); |
|
||||||
$smarty->assign("subnetmask2", 255); |
|
||||||
$smarty->assign("subnetmask3", 256-($host_counter/256)); |
|
||||||
$smarty->assign("subnetmask4", 0); |
|
||||||
|
|
||||||
// one select box |
|
||||||
$smarty->assign("noselect", FALSE); |
|
||||||
$smarty->assign("one_select", TRUE); |
|
||||||
$smarty->assign("two_select", FALSE); |
|
||||||
|
|
||||||
// set displayed nodes |
|
||||||
$nodes_displayed = 256; |
|
||||||
} else { |
|
||||||
// Class A |
|
||||||
// which part do we want to see? |
|
||||||
if((empty($page)) ? $page=$subnet_address : $page=$page); |
|
||||||
$page = explode('.', $page); |
|
||||||
$page2 = $page[1]; |
|
||||||
$page3 = $page[2]; |
|
||||||
|
|
||||||
// fill subnet-array with addresses we want to see |
|
||||||
for($i=0;$i<256;$i++) { |
|
||||||
// build ip |
|
||||||
$ip = $iprange1 . '.' . $page2 . '.' . $page3 . '.' . $i; |
|
||||||
|
|
||||||
// fill subnet-array |
|
||||||
$subnet[$ip] = array(); |
|
||||||
} |
|
||||||
|
|
||||||
// calculate broadcast address |
|
||||||
$broadcast_address = $iprange1 . '.' . ($iprange2+$i-1) . '.255.255'; |
|
||||||
|
|
||||||
// to tpl |
|
||||||
$smarty->assign("iprange1", $iprange1); |
|
||||||
$smarty->assign("iprange2", $iprange2); |
|
||||||
|
|
||||||
// loop addresses in range 2 |
|
||||||
for($i=$iprange2;$i<(pow(2,(24-$subnet_mask))/256);$i++) { |
|
||||||
// send to tpl |
|
||||||
$smarty->assign("iprange1", $iprange1); |
|
||||||
$smarty->assign("iprange2", $i); |
|
||||||
$smarty->assign("iprange3", $page3); |
|
||||||
$smarty->assign("iprange4", $iprange4); |
|
||||||
|
|
||||||
// set select box |
|
||||||
if($i==$page2) { |
|
||||||
$smarty->assign("row1_selected", "selected"); |
|
||||||
|
|
||||||
} else { |
|
||||||
$smarty->assign("row1_selected", ""); |
|
||||||
} |
|
||||||
|
|
||||||
// parse block |
|
||||||
$tp->parse("two_select_row1"); |
|
||||||
} |
|
||||||
|
|
||||||
// loop addresses in range 3 |
|
||||||
for($i=0;$i<256;$i++) { |
|
||||||
// send to tpl |
|
||||||
$smarty->assign("iprange1", $iprange1); |
|
||||||
$smarty->assign("iprange2", $page2); |
|
||||||
$smarty->assign("iprange3", $i); |
|
||||||
$smarty->assign("iprange4", $iprange4); |
|
||||||
|
|
||||||
// set select box |
|
||||||
if($i==$page3) { |
|
||||||
$smarty->assign("row2_selected", "selected"); |
|
||||||
|
|
||||||
} else { |
|
||||||
$smarty->assign("row2_selected", ""); |
|
||||||
} |
|
||||||
|
|
||||||
// parse block |
|
||||||
$tp->parse("two_select_row2"); |
|
||||||
} |
|
||||||
|
|
||||||
$smarty->assign("subnetmask1", 255); |
|
||||||
$smarty->assign("subnetmask2", 256-($host_counter/65536)); |
|
||||||
$smarty->assign("subnetmask3", 0); |
|
||||||
$smarty->assign("subnetmask4", 0); |
|
||||||
|
|
||||||
// one select box |
|
||||||
$smarty->assign("noselect", FALSE); |
|
||||||
$smarty->assign("one_select", FALSE); |
|
||||||
$smarty->assign("two_select", TRUE); |
|
||||||
|
|
||||||
// set displayed nodes |
|
||||||
$nodes_displayed = 256; |
|
||||||
} |
|
||||||
|
|
||||||
// get nodes for this subnetview and implement the values into the array |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
asset.asset_name, |
|
||||||
assetclassgroup.assetclassgroup_color, |
|
||||||
node.node_id, |
|
||||||
node.node_ip |
|
||||||
FROM |
|
||||||
asset, |
|
||||||
assetclass, |
|
||||||
assetclassgroup, |
|
||||||
node |
|
||||||
WHERE |
|
||||||
node.node_ip IN ('".implode("','",array_keys($subnet))."') |
|
||||||
AND node.subnet_id='$subnet_id' |
|
||||||
AND asset.asset_id=node.asset_id |
|
||||||
AND assetclass.assetclass_id=asset.assetclass_id |
|
||||||
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$nodes = $db->db_select($query); |
|
||||||
|
|
||||||
// count results |
|
||||||
$node_counter = count($nodes); |
|
||||||
|
|
||||||
// any nodes? |
|
||||||
if ($node_counter>0) { |
|
||||||
// get objects |
|
||||||
foreach($nodes AS $node) { |
|
||||||
// add node-values to ip in subnet-array |
|
||||||
$subnet[$node['node_ip']] = $node; |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
// replace ip's in subnet-array (if necessary) |
|
||||||
// check for subnet address |
|
||||||
if(array_key_exists($subnet_address, $subnet)) { |
|
||||||
// replace |
|
||||||
$subnet[$subnet_address] = array("subnet_address"); |
|
||||||
} |
|
||||||
|
|
||||||
// check for broadcast address |
|
||||||
if(array_key_exists($broadcast_address, $subnet)) { |
|
||||||
// replace |
|
||||||
$subnet[$broadcast_address] = array("broadcast_address"); |
|
||||||
} |
|
||||||
|
|
||||||
$dhcpstart = 0; |
|
||||||
if ($subnet_dhcpstart && $subnet_dhcpend) { |
|
||||||
$dhcpstart = ip2long($subnet_dhcpstart); |
|
||||||
$dhcpend = ip2long($subnet_dhcpend); |
|
||||||
} |
|
||||||
|
|
||||||
// loop subnet-array and send to template |
// loop subnet-array and send to template |
||||||
// start counter |
// start counter |
||||||
// $i=1; |
// $i=1; |
||||||
// loop subnet-array |
// loop subnet-array |
||||||
foreach($subnet AS $node_ip => $node) { |
foreach ($subnet 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; |
$subnet[$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)) { |
||||||
$subnet[$node_ip]["dynamic"] = True; |
$subnet[$node_ip]["dynamic"] = true; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
// 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; |
$subnet[$node_ip]["url"] = 'assigniptonode.php?subnet_id=' . $subnet_id . '&node_ip='. $node_ip; |
||||||
$subnet[$node_ip]["remotetext"] = $node_ip; |
$subnet[$node_ip]["remotetext"] = $node_ip; |
||||||
if ($subnet[$node_ip]["dynamic"]) { |
if ($subnet[$node_ip]["dynamic"]) { |
||||||
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_dynamic; |
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_dynamic; |
||||||
} else { |
} else { |
||||||
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_unused; |
$subnet[$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"] = ""; |
||||||
$subnet[$node_ip]["url"] = ""; |
$subnet[$node_ip]["remotetext"] = $node_ip . ' ' . $lang['lang_subnet_subnetaddress']; |
||||||
$subnet[$node_ip]["remotetext"] = $node_ip . ' ' . $lang['lang_subnet_subnetaddress']; |
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_blocked; |
||||||
$subnet[$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"] = ""; |
||||||
$subnet[$node_ip]["url"] = ""; |
$subnet[$node_ip]["remotetext"] = $node_ip . ' ' . $lang['lang_subnet_broadcastaddress']; |
||||||
$subnet[$node_ip]["remotetext"] = $node_ip . ' ' . $lang['lang_subnet_broadcastaddress']; |
$subnet[$node_ip]["assetclassgroup_color"] = $config_color_blocked; |
||||||
$subnet[$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']; |
||||||
$subnet[$node_ip]["url"] = 'nodeview.php?node_id=' . $node['node_id']; |
$subnet[$node_ip]["remotetext"] = $node_ip . ' ' . $node['asset_name']; |
||||||
$subnet[$node_ip]["remotetext"] = $node_ip . ' ' . $node['asset_name']; |
$subnet[$node_ip]["assetclassgroup_color"] = $node['assetclassgroup_color']; |
||||||
$subnet[$node_ip]["assetclassgroup_color"] = $node['assetclassgroup_color']; |
} |
||||||
} |
|
||||||
|
// update counter |
||||||
|
// $i++; |
||||||
// update counter |
|
||||||
// $i++; |
} // foreach |
||||||
} |
|
||||||
|
$smarty->assign("subnet", $subnet); |
||||||
$smarty->assign("subnet", $subnet); |
$smarty->assign("imagewrap", $_SESSION['suser_imagecount']); |
||||||
$smarty->assign("imagewrap", $_SESSION['suser_imagecount']); |
|
||||||
|
// vlan |
||||||
// setup vlan |
$query = "SELECT |
||||||
// build query |
vlan.vlan_id AS vlan_id, |
||||||
$query = "SELECT |
vlan.vlan_name AS vlan_name, |
||||||
vlan.vlan_id AS vlan_id, |
vlan.vlan_number AS vlan_number |
||||||
vlan.vlan_name AS vlan_name, |
FROM |
||||||
vlan.vlan_number AS vlan_number |
subnetvlan, |
||||||
FROM |
vlan |
||||||
subnetvlan, |
WHERE |
||||||
vlan |
subnetvlan.subnet_id=" . $subnet_id . " |
||||||
WHERE |
AND vlan.vlan_id=subnetvlan.vlan_id |
||||||
subnetvlan.subnet_id=" . $subnet_id . " |
ORDER BY |
||||||
AND vlan.vlan_id=subnetvlan.vlan_id |
vlan.vlan_name"; |
||||||
ORDER BY |
|
||||||
vlan.vlan_name"; |
// run query |
||||||
|
$vlans = $db->db_select($query); |
||||||
// run query |
$smarty->assign("vlans", $vlans); |
||||||
$vlans = $db->db_select($query); |
|
||||||
$smarty->assign("vlans", $vlans); |
// location |
||||||
|
$query = "SELECT |
||||||
// setup location |
l.location_id, |
||||||
// build query |
l.location_name |
||||||
$query = "SELECT |
FROM |
||||||
l.location_id, |
location AS l LEFT JOIN subnetlocation AS s USING (location_id) |
||||||
l.location_name |
WHERE |
||||||
FROM |
s.subnet_id=". $subnet_id . " |
||||||
location AS l LEFT JOIN subnetlocation AS s USING (location_id) |
ORDER BY |
||||||
WHERE |
l.location_name"; |
||||||
s.subnet_id=". $subnet_id . " |
|
||||||
ORDER BY |
$locations = $db->db_select($query); |
||||||
l.location_name"; |
$smarty->assign("locations", $locations); |
||||||
|
|
||||||
// run query |
// assetclassgroup |
||||||
$locations = $db->db_select($query); |
$query = "SELECT |
||||||
$smarty->assign("locations", $locations); |
assetclassgroup_id AS id, |
||||||
|
assetclassgroup_name AS name, |
||||||
// setup assetclassgroup |
assetclassgroup_color AS color, |
||||||
// build query |
COUNT(assetclass_id) AS counter |
||||||
$query = "SELECT |
FROM subnet |
||||||
assetclassgroup_id AS id, |
LEFT JOIN node USING (subnet_id) |
||||||
assetclassgroup_name AS name, |
LEFT JOIN asset USING (asset_id) |
||||||
assetclassgroup_color AS color, |
LEFT JOIN assetclass USING (assetclass_id) |
||||||
COUNT(assetclass_id) AS counter |
LEFT JOIN assetclassgroup USING (assetclassgroup_id) |
||||||
FROM subnet |
WHERE subnet_id=" . $subnet_id . " |
||||||
LEFT JOIN node USING (subnet_id) |
GROUP BY assetclass_id |
||||||
LEFT JOIN asset USING (asset_id) |
ORDER BY counter DESC"; |
||||||
LEFT JOIN assetclass USING (assetclass_id) |
|
||||||
LEFT JOIN assetclassgroup USING (assetclassgroup_id) |
// run query |
||||||
WHERE subnet_id=" . $subnet_id . " |
$assetclassgroups = $db->db_select($query); |
||||||
GROUP BY assetclass_id |
$smarty->assign("assetclassgroups", $assetclassgroups); |
||||||
ORDER BY counter DESC"; |
|
||||||
|
$smarty->display("subnetview.tpl"); |
||||||
// run query |
|
||||||
$assetclassgroups = $db->db_select($query); |
include("footer.php"); |
||||||
$smarty->assign("assetclassgroups", $assetclassgroups); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnetview.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
||||||
|
@ -1,89 +1,62 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
// subnet |
||||||
|
// build query |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$query = "SELECT |
||||||
or contact me at wietsew@users.sourceforge.net |
subnet_address, |
||||||
*****************************************************************************/ |
subnet_mask |
||||||
|
FROM |
||||||
// start page |
subnet |
||||||
// includes |
WHERE |
||||||
include("includes.php"); |
subnet_id=" . $subnet_id; |
||||||
|
|
||||||
// get ip and id |
// run query |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
$subnet = $db->db_select($query); |
||||||
|
|
||||||
// start output |
$smarty->assign("subnet_id", $subnet_id); |
||||||
include("header.php"); |
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
||||||
|
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
// vlan |
||||||
|
$query = " SELECT |
||||||
// setup subnet |
vlan_id, |
||||||
// build query |
vlan_number, |
||||||
$query = "SELECT |
vlan_name |
||||||
subnet.subnet_address AS subnet_address, |
FROM |
||||||
subnet.subnet_mask AS subnet_mask |
vlan |
||||||
FROM |
WHERE |
||||||
subnet |
vlan_id NOT IN ( |
||||||
WHERE |
SELECT |
||||||
subnet.subnet_id=" . $subnet_id; |
vlan_id |
||||||
|
|
||||||
// run query |
|
||||||
$subnet = $db->db_select($query); |
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id); |
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
|
||||||
|
|
||||||
// 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 |
FROM |
||||||
vlan |
subnetvlan |
||||||
WHERE |
WHERE |
||||||
vlan.vlan_id NOT IN ( |
subnet_id=" . $subnet_id . " |
||||||
SELECT |
) |
||||||
vlan_id |
ORDER BY |
||||||
FROM |
vlan_number"; |
||||||
subnetvlan |
|
||||||
WHERE |
|
||||||
subnet_id=" . $subnet_id . " |
|
||||||
) |
|
||||||
ORDER BY |
|
||||||
vlan.vlan_number"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$vlans = $db->db_select($query); |
|
||||||
foreach ($vlans as $vlan) { |
|
||||||
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name']; |
|
||||||
} |
|
||||||
$smarty->assign("vlan_options", $vlan_options); |
|
||||||
|
|
||||||
// $smarty->assign("vlans", $vlans); |
|
||||||
|
|
||||||
|
$vlans = $db->db_select($query); |
||||||
|
foreach ($vlans as $vlan) { |
||||||
|
$vlan_options[$vlan['vlan_id']] = $vlan['vlan_name']; |
||||||
|
} |
||||||
|
$smarty->assign("vlan_options", $vlan_options); |
||||||
|
|
||||||
// end page |
$smarty->display("subnetvlanadd.tpl"); |
||||||
// output |
|
||||||
$smarty->display("subnetvlanadd.tpl"); |
|
||||||
|
|
||||||
// end output |
include("footer.php"); |
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,78 +1,51 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// subnet |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$query = "SELECT |
||||||
|
subnet_address, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
subnet_mask |
||||||
or contact me at wietsew@users.sourceforge.net |
FROM |
||||||
*****************************************************************************/ |
subnet |
||||||
|
WHERE |
||||||
// start page |
subnet_id=" . $subnet_id; |
||||||
// includes |
|
||||||
include("includes.php"); |
// run query |
||||||
|
$subnet = $db->db_select($query); |
||||||
// get ip and id |
|
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
$smarty->assign("subnet_id", $subnet_id); |
||||||
|
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
||||||
// start output |
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
include("header.php"); |
|
||||||
|
// vlan |
||||||
// set language variables |
$query = "SELECT |
||||||
$smarty->assign($lang); |
v.vlan_id, |
||||||
|
v.vlan_number, |
||||||
// setup subnet |
v.vlan_name |
||||||
// build query |
FROM |
||||||
$query = "SELECT |
subnetvlan AS s LEFT JOIN vlan AS v USING (vlan_id) |
||||||
subnet.subnet_address AS subnet_address, |
WHERE |
||||||
subnet.subnet_mask AS subnet_mask |
s.subnet_id=" . $subnet_id . " |
||||||
FROM |
ORDER BY |
||||||
subnet |
v.vlan_number"; |
||||||
WHERE |
|
||||||
subnet.subnet_id=" . $subnet_id; |
// run query |
||||||
|
$vlans = $db->db_select($query); |
||||||
// run query |
$smarty->assign("vlans", $vlans); |
||||||
$subnet = $db->db_select($query); |
|
||||||
|
$smarty->display("subnetvlandel.tpl"); |
||||||
$smarty->assign("subnet_id", $subnet_id); |
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
include("footer.php"); |
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
|
||||||
|
|
||||||
// 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 |
|
||||||
subnetvlan, |
|
||||||
vlan |
|
||||||
WHERE |
|
||||||
subnetvlan.subnet_id=" . $subnet_id . " |
|
||||||
AND vlan.vlan_id=subnetvlan.vlan_id |
|
||||||
ORDER BY |
|
||||||
vlan.vlan_number"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$vlans = $db->db_select($query); |
|
||||||
$smarty->assign("vlans", $vlans); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnetvlandel.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,59 +1,33 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$subnet_id = sanitize($_GET['subnet_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
subnet_address, |
||||||
|
subnet_mask |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
subnet |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
subnet_id=" . $subnet_id; |
||||||
// start page |
|
||||||
// includes |
$subnet = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
$smarty->assign("subnet_id", $subnet_id); |
||||||
// get ip and id |
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
||||||
$subnet_id = sanitize($_GET['subnet_id']); |
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
||||||
|
|
||||||
// start output |
$smarty->display("subnetvlanedit.tpl"); |
||||||
include("header.php"); |
|
||||||
|
include("footer.php"); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
subnet.subnet_address AS subnet_address, |
|
||||||
subnet.subnet_mask AS subnet_mask |
|
||||||
FROM |
|
||||||
subnet |
|
||||||
WHERE |
|
||||||
subnet.subnet_id=" . $subnet_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnet = $db->db_select($query); |
|
||||||
|
|
||||||
$smarty->assign("subnet_id", $subnet_id); |
|
||||||
$smarty->assign("subnet_address", $subnet[0]['subnet_address']); |
|
||||||
$smarty->assign("subnet_mask", $subnet[0]['subnet_mask']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("subnetvlanedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,54 +1,28 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
user_id, |
||||||
|
user_name, |
||||||
|
user_displayname |
||||||
|
FROM |
||||||
|
user |
||||||
|
ORDER BY |
||||||
|
user_name"; |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$users = $db->db_select($query); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$smarty->assign("users", $users); |
||||||
// includes |
$smarty->display("user.tpl"); |
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
include("footer.php"); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup user |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
user.user_id AS user_id, |
|
||||||
user.user_name AS user_name, |
|
||||||
user.user_displayname AS user_displayname |
|
||||||
FROM |
|
||||||
user |
|
||||||
ORDER BY |
|
||||||
user.user_name"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$users = $db->db_select($query); |
|
||||||
$smarty->assign("users", $users); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("user.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,39 +1,16 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$smarty->display("useradd.tpl"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("footer.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("useradd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,58 +1,31 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$user_id = sanitize($_GET['user_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
user_name |
||||||
|
FROM |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
user |
||||||
or contact me at wietsew@users.sourceforge.net |
WHERE |
||||||
*****************************************************************************/ |
user_id=" . $user_id; |
||||||
|
|
||||||
// start page |
$user = $db->db_select($query); |
||||||
// includes |
|
||||||
include("includes.php"); |
$smarty->assign("user_id", $user_id); |
||||||
|
$smarty->assign("user_name", $user[0]['user_name']); |
||||||
// get id |
|
||||||
$user_id = sanitize($_GET['user_id']); |
$smarty->display("userdel.tpl"); |
||||||
|
|
||||||
// start output |
include("footer.php"); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup user |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
user.user_name AS user_name |
|
||||||
FROM |
|
||||||
user |
|
||||||
WHERE |
|
||||||
user.user_id=" . $user_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$user = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("user_id", $user_id); |
|
||||||
$smarty->assign("user_name", $user[0]['user_name']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("userdel.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,60 +1,33 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$user_id = sanitize($_GET['user_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
user_name, |
||||||
|
user_displayname |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
user |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
user_id=" . $user_id; |
||||||
// start page |
|
||||||
// includes |
$user = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
$smarty->assign("user_id", $user_id); |
||||||
// get id |
$smarty->assign("user_name", $user[0]['user_name']); |
||||||
$user_id = sanitize($_GET['user_id']); |
$smarty->assign("user_displayname", $user[0]['user_displayname']); |
||||||
|
|
||||||
// start output |
$smarty->display("useredit.tpl"); |
||||||
include("header.php"); |
|
||||||
|
include("footer.php"); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup user |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
user.user_name AS user_name, |
|
||||||
user.user_displayname AS user_displayname |
|
||||||
FROM |
|
||||||
user |
|
||||||
WHERE |
|
||||||
user.user_id=" . $user_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$user = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("user_id", $user_id); |
|
||||||
$smarty->assign("user_name", $user[0]['user_name']); |
|
||||||
$smarty->assign("user_displayname", $user[0]['user_displayname']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("useredit.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,60 +1,35 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$user_id = sanitize($_GET['user_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
user_name, |
||||||
|
user_displayname |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
user |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
user_id=" . $user_id; |
||||||
// start page |
|
||||||
// includes |
// run query |
||||||
include("includes.php"); |
$user = $db->db_select($query); |
||||||
|
|
||||||
// get id |
// send to tpl |
||||||
$user_id = sanitize($_GET['user_id']); |
$smarty->assign("user_id", $user_id); |
||||||
|
$smarty->assign("user_name", $user[0]['user_name']); |
||||||
// start output |
$smarty->assign("user_displayname", $user[0]['user_displayname']); |
||||||
include("header.php"); |
|
||||||
|
$smarty->display("userview.tpl"); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
include("footer.php"); |
||||||
|
|
||||||
// setup user |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
user.user_name AS user_name, |
|
||||||
user.user_displayname AS user_displayname |
|
||||||
FROM |
|
||||||
user |
|
||||||
WHERE |
|
||||||
user.user_id=" . $user_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$user = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("user_id", $user_id); |
|
||||||
$smarty->assign("user_name", $user[0]['user_name']); |
|
||||||
$smarty->assign("user_displayname", $user[0]['user_displayname']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("userview.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,55 +1,29 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
vlan_id, |
||||||
|
vlan_number, |
||||||
|
vlan_name, |
||||||
|
LEFT(vlan_info, 60) AS vlan_info |
||||||
|
FROM |
||||||
|
vlan |
||||||
|
ORDER BY |
||||||
|
vlan_number"; |
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$vlans = $db->db_select($query); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$smarty->assign("vlans", $vlans); |
||||||
// includes |
$smarty->display("vlan.tpl"); |
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
include("footer.php"); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup vlan |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
vlan.vlan_id AS vlan_id, |
|
||||||
vlan.vlan_number AS vlan_number, |
|
||||||
vlan.vlan_name AS vlan_name, |
|
||||||
LEFT(vlan.vlan_info, 60) AS vlan_info |
|
||||||
FROM |
|
||||||
vlan |
|
||||||
ORDER BY |
|
||||||
vlan.vlan_number"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$vlans = $db->db_select($query); |
|
||||||
$smarty->assign("vlans", $vlans); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("vlan.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,39 +1,16 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$smarty->display("vlanadd.tpl"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("footer.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("vlanadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,60 +1,32 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$vlan_id = sanitize($_GET['vlan_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
vlan_name, |
||||||
|
vlan_number |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
vlan |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
vlan_id=" . $vlan_id; |
||||||
// start page |
|
||||||
// includes |
$vlan = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
$smarty->assign("vlan_id", $vlan_id); |
||||||
// get id |
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
||||||
$vlan_id = sanitize($_GET['vlan_id']); |
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
||||||
|
$smarty->display("vlandel.tpl"); |
||||||
// start output |
|
||||||
include("header.php"); |
include("footer.php"); |
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup vlan |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
vlan.vlan_name AS vlan_name, |
|
||||||
vlan.vlan_number AS vlan_number |
|
||||||
FROM |
|
||||||
vlan |
|
||||||
WHERE |
|
||||||
vlan.vlan_id=" . $vlan_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$vlan = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("vlan_id", $vlan_id); |
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("vlandel.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,62 +1,35 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$vlan_id = sanitize($_GET['vlan_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// get id |
|
||||||
$vlan_id = sanitize($_GET['vlan_id']); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup vlan |
// setup vlan |
||||||
// build query |
$query = "SELECT |
||||||
$query = "SELECT |
vlan_name, |
||||||
vlan.vlan_name AS vlan_name, |
vlan_number, |
||||||
vlan.vlan_number AS vlan_number, |
vlan_info |
||||||
vlan.vlan_info AS vlan_info |
FROM |
||||||
FROM |
vlan |
||||||
vlan |
WHERE |
||||||
WHERE |
vlan_id=" . $vlan_id; |
||||||
vlan.vlan_id=" . $vlan_id; |
|
||||||
|
$vlan = $db->db_select($query); |
||||||
// run query |
|
||||||
$vlan = $db->db_select($query); |
$smarty->assign("vlan_id", $vlan_id); |
||||||
|
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
||||||
// send to tpl |
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
||||||
$smarty->assign("vlan_id", $vlan_id); |
$smarty->assign("vlan_info", $vlan[0]['vlan_info']); |
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
$smarty->display("vlanedit.tpl"); |
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
|
||||||
$smarty->assign("vlan_info", $vlan[0]['vlan_info']); |
include("footer.php"); |
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("vlanedit.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,86 +1,59 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$vlan_id = sanitize($_GET['vlan_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
// vlan |
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
vlan_name, |
||||||
|
vlan_number |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
vlan |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
vlan_id=" . $vlan_id; |
||||||
// start page |
|
||||||
// includes |
// run query |
||||||
include("includes.php"); |
$vlan = $db->db_select($query); |
||||||
|
|
||||||
// get ip and id |
$smarty->assign("vlan_id", $vlan_id); |
||||||
$vlan_id = sanitize($_GET['vlan_id']); |
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
||||||
|
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
||||||
// start output |
|
||||||
include("header.php"); |
// subnet |
||||||
|
$query = " SELECT |
||||||
// set language variables |
subnet_id, |
||||||
$smarty->assign($lang); |
subnet_address, |
||||||
|
subnet_mask |
||||||
// setup vlan |
FROM |
||||||
// build query |
subnet |
||||||
$query = "SELECT |
WHERE |
||||||
vlan.vlan_name AS vlan_name, |
subnet_id NOT IN ( |
||||||
vlan.vlan_number AS vlan_number |
SELECT |
||||||
FROM |
subnet_id |
||||||
vlan |
|
||||||
WHERE |
|
||||||
vlan.vlan_id=" . $vlan_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$vlan = $db->db_select($query); |
|
||||||
|
|
||||||
$smarty->assign("vlan_id", $vlan_id); |
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
|
||||||
|
|
||||||
// setup subnet |
|
||||||
// build query |
|
||||||
$query = " SELECT |
|
||||||
subnet.subnet_id AS subnet_id, |
|
||||||
subnet.subnet_address AS subnet_address, |
|
||||||
subnet.subnet_mask AS subnet_mask |
|
||||||
FROM |
FROM |
||||||
subnet |
subnetvlan |
||||||
WHERE |
WHERE |
||||||
subnet.subnet_id NOT IN ( |
vlan_id=" . $vlan_id . " |
||||||
SELECT |
) |
||||||
subnet_id |
ORDER BY |
||||||
FROM |
INET_ATON(subnet_address)"; |
||||||
subnetvlan |
|
||||||
WHERE |
|
||||||
vlan_id=" . $vlan_id . " |
|
||||||
) |
|
||||||
ORDER BY |
|
||||||
INET_ATON(subnet.subnet_address)"; |
|
||||||
|
|
||||||
// run query |
$subnets = $db->db_select($query); |
||||||
$subnets = $db->db_select($query); |
foreach ($subnets as $subnet) { |
||||||
foreach ($subnets as $subnet) { |
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_address'].'/'.$subnet['subnet_mask']; |
||||||
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_address'].'/'.$subnet['subnet_mask']; |
} |
||||||
} |
$smarty->assign("subnet_options", $subnet_options); |
||||||
$smarty->assign("subnet_options", $subnet_options); |
|
||||||
|
|
||||||
// end page |
$smarty->display("vlansubnetadd.tpl"); |
||||||
// output |
|
||||||
$smarty->display("vlansubnetadd.tpl"); |
|
||||||
|
|
||||||
// end output |
include("footer.php"); |
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,81 +1,53 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$vlan_id = sanitize($_GET['vlan_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// vlan |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$query = "SELECT |
||||||
|
vlan_name, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
vlan_number |
||||||
or contact me at wietsew@users.sourceforge.net |
FROM |
||||||
*****************************************************************************/ |
vlan |
||||||
|
WHERE |
||||||
// start page |
vlan_id=" . $vlan_id; |
||||||
// includes |
|
||||||
include("includes.php"); |
// run query |
||||||
|
$vlan = $db->db_select($query); |
||||||
// get ip and id |
|
||||||
$vlan_id = sanitize($_GET['vlan_id']); |
$smarty->assign("vlan_id", $vlan_id); |
||||||
|
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
||||||
// start output |
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
||||||
include("header.php"); |
|
||||||
|
// setup subnet |
||||||
// set language variables |
$query = "SELECT |
||||||
$smarty->assign($lang); |
s.subnet_id, |
||||||
|
s.subnet_address, |
||||||
// setup vlan |
s.subnet_mask |
||||||
// build query |
FROM |
||||||
$query = "SELECT |
subnetvlan AS v LEFT JOIN subnet AS s USING(subnet_id) |
||||||
vlan.vlan_name AS vlan_name, |
WHERE |
||||||
vlan.vlan_number AS vlan_number |
v.vlan_id=" . $vlan_id . " |
||||||
FROM |
ORDER BY |
||||||
vlan |
INET_ATON(s.subnet_address)"; |
||||||
WHERE |
|
||||||
vlan.vlan_id=" . $vlan_id; |
$subnets = $db->db_select($query); |
||||||
|
foreach ($subnets as $subnet) { |
||||||
// run query |
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_address'].'/'.$subnet['subnet_mask']; |
||||||
$vlan = $db->db_select($query); |
} |
||||||
|
$smarty->assign("subnet_options", $subnet_options); |
||||||
$smarty->assign("vlan_id", $vlan_id); |
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
$smarty->display("vlansubnetdel.tpl"); |
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
|
||||||
|
include("footer.php"); |
||||||
// setup subnet |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
subnet.subnet_id AS subnet_id, |
|
||||||
subnet.subnet_address AS subnet_address, |
|
||||||
subnet.subnet_mask AS subnet_mask |
|
||||||
FROM |
|
||||||
subnetvlan, |
|
||||||
subnet |
|
||||||
WHERE |
|
||||||
subnetvlan.vlan_id=" . $vlan_id . " |
|
||||||
AND subnet.subnet_id=subnetvlan.subnet_id |
|
||||||
ORDER BY |
|
||||||
INET_ATON(subnet.subnet_address)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnets = $db->db_select($query); |
|
||||||
foreach ($subnets as $subnet) { |
|
||||||
$subnet_options[$subnet['subnet_id']] = $subnet['subnet_address'].'/'.$subnet['subnet_mask']; |
|
||||||
} |
|
||||||
$smarty->assign("subnet_options", $subnet_options); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("vlansubnetdel.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,60 +1,33 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$vlan_id = sanitize($_GET['vlan_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
vlan_name, |
||||||
|
vlan_number |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
FROM |
||||||
or contact me at wietsew@users.sourceforge.net |
vlan |
||||||
*****************************************************************************/ |
WHERE |
||||||
|
vlan_id=" . $vlan_id; |
||||||
// start page |
|
||||||
// includes |
$vlan = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
$smarty->assign("vlan_id", $vlan_id); |
||||||
// get ip and id |
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
||||||
$vlan_id = sanitize($_GET['vlan_id']); |
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
||||||
|
|
||||||
// start output |
$smarty->display("vlansubnetedit.tpl"); |
||||||
include("header.php"); |
|
||||||
|
include("footer.php"); |
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup vlan |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
vlan.vlan_name AS vlan_name, |
|
||||||
vlan.vlan_number AS vlan_number |
|
||||||
FROM |
|
||||||
vlan |
|
||||||
WHERE |
|
||||||
vlan.vlan_id=" . $vlan_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$vlan = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("vlan_id", $vlan_id); |
|
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("vlansubnetedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,82 +1,52 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$vlan_id = sanitize($_GET['vlan_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
// vlan |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
$query = "SELECT |
||||||
|
vlan_name, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
vlan_number, |
||||||
or contact me at wietsew@users.sourceforge.net |
vlan_info |
||||||
*****************************************************************************/ |
FROM |
||||||
|
vlan |
||||||
// start page |
WHERE |
||||||
// includes |
vlan_id=" . $vlan_id; |
||||||
include("includes.php"); |
|
||||||
|
$vlan = $db->db_select($query); |
||||||
// get id |
|
||||||
$vlan_id = sanitize($_GET['vlan_id']); |
$smarty->assign("vlan_id", $vlan_id); |
||||||
|
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
||||||
// start output |
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
||||||
include("header.php"); |
$smarty->assign("vlan_info", nl2br($vlan[0]['vlan_info'])); |
||||||
|
|
||||||
// set language variables |
// subnets |
||||||
$smarty->assign($lang); |
$query = "SELECT |
||||||
|
s.subnet_id, |
||||||
// setup vlan |
s.subnet_address, |
||||||
// build query |
s.subnet_mask, |
||||||
$query = "SELECT |
s.subnet_info |
||||||
vlan.vlan_name AS vlan_name, |
FROM |
||||||
vlan.vlan_number AS vlan_number, |
subnet AS s LEFT JOIN subnetvlan AS v USING (subnet_id) |
||||||
vlan.vlan_info AS vlan_info |
WHERE |
||||||
FROM |
v.vlan_id=" . $vlan_id . " |
||||||
vlan |
ORDER BY |
||||||
WHERE |
INET_ATON(s.subnet_address)"; |
||||||
vlan.vlan_id=" . $vlan_id; |
|
||||||
|
$subnets = $db->db_select($query); |
||||||
// run query |
$smarty->assign("subnets", $subnets); |
||||||
$vlan = $db->db_select($query); |
|
||||||
|
$smarty->display("vlanview.tpl"); |
||||||
// send to tpl |
|
||||||
$smarty->assign("vlan_id", $vlan_id); |
include("footer.php"); |
||||||
$smarty->assign("vlan_name", $vlan[0]['vlan_name']); |
|
||||||
$smarty->assign("vlan_number", $vlan[0]['vlan_number']); |
|
||||||
$smarty->assign("vlan_info", nl2br($vlan[0]['vlan_info'])); |
|
||||||
|
|
||||||
// setup subnets |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
subnet.subnet_id, |
|
||||||
subnet.subnet_address, |
|
||||||
subnet.subnet_mask, |
|
||||||
subnet.subnet_info |
|
||||||
FROM |
|
||||||
subnet, |
|
||||||
subnetvlan |
|
||||||
WHERE |
|
||||||
subnetvlan.vlan_id=" . $vlan_id . " |
|
||||||
AND subnet.subnet_id=subnetvlan.subnet_id |
|
||||||
ORDER BY |
|
||||||
INET_ATON(subnet.subnet_address)"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$subnets = $db->db_select($query); |
|
||||||
$smarty->assign("subnets", $subnets); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("vlanview.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,55 +1,31 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
include("header.php"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
$query = "SELECT |
||||||
or contact me at wietsew@users.sourceforge.net |
zone_id, |
||||||
*****************************************************************************/ |
zone_origin, |
||||||
|
zone_soa, |
||||||
|
zone_hostmaster, |
||||||
|
zone_serial |
||||||
|
FROM |
||||||
|
zone |
||||||
|
ORDER BY |
||||||
|
zone_origin"; |
||||||
|
|
||||||
// start page |
$zones = $db->db_select($query); |
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
$smarty->assign("zones", $zones); |
||||||
include("header.php"); |
$smarty->display("zone.tpl"); |
||||||
|
|
||||||
// set language variables |
include("footer.php"); |
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
zone_id, |
|
||||||
zone_origin, |
|
||||||
zone_soa, |
|
||||||
zone_hostmaster, |
|
||||||
zone_serial |
|
||||||
FROM |
|
||||||
zone |
|
||||||
ORDER BY |
|
||||||
zone_origin"; |
|
||||||
|
|
||||||
// run query |
|
||||||
$zones = $db->db_select($query); |
|
||||||
$smarty->assign("zones", $zones); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("zone.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,39 +1,16 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
include("header.php"); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$smarty->display("zoneadd.tpl"); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("footer.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
|
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// start output |
|
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("zoneadd.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,52 +1,23 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$zone_id = sanitize($_GET['zone_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
|
||||||
*****************************************************************************/ |
|
||||||
|
|
||||||
// start page |
$query = "SELECT zone_id, zone_origin, zone_serial FROM zone WHERE zone_id=" . $zone_id; |
||||||
// includes |
$zone = $db->db_select($query); |
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// get id |
$smarty->assign("zone", $zone[0]); |
||||||
$zone_id = sanitize($_GET['zone_id']); |
$smarty->display("zonedel.tpl"); |
||||||
|
|
||||||
// start output |
include("footer.php"); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup vlan |
|
||||||
// build query |
|
||||||
$query = "SELECT zone_id, zone_origin, zone_serial FROM zone WHERE zone_id=" . $zone_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$zone = $db->db_select($query); |
|
||||||
|
|
||||||
// send to tpl |
|
||||||
$smarty->assign("zone", $zone[0]); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("zonedel.tpl"); |
|
||||||
|
|
||||||
// footer |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,57 +1,30 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
it under the terms of the GNU General Public License as published by |
*****************************************************************************/ |
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
include("includes.php"); |
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$zone_id = sanitize($_GET['zone_id']); |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
|
|
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
include("header.php"); |
||||||
or contact me at wietsew@users.sourceforge.net |
$query = "SELECT |
||||||
*****************************************************************************/ |
zone_id, zone_soa, zone_hostmaster, zone_origin, zone_ttl_default, |
||||||
|
zone_refresh, zone_retry, zone_expire, zone_ttl, zone_serial, |
||||||
|
zone_ns1, zone_ns2, zone_ns3, zone_mx1, zone_mx2, zone_info |
||||||
|
FROM |
||||||
|
zone |
||||||
|
WHERE |
||||||
|
zone_id=" . $zone_id; |
||||||
|
|
||||||
// start page |
$zone = $db->db_select($query); |
||||||
// includes |
|
||||||
include("includes.php"); |
|
||||||
|
|
||||||
// get id |
$smarty->assign("zone", $zone[0]); |
||||||
$zone_id = sanitize($_GET['zone_id']); |
$smarty->display("zoneedit.tpl"); |
||||||
|
|
||||||
// start output |
include("footer.php"); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup assetclassgroup |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
zone_id, zone_soa, zone_hostmaster, zone_origin, zone_ttl_default, |
|
||||||
zone_refresh, zone_retry, zone_expire, zone_ttl, zone_serial, |
|
||||||
zone_ns1, zone_ns2, zone_ns3, zone_mx1, zone_mx2, zone_info |
|
||||||
FROM |
|
||||||
zone |
|
||||||
WHERE |
|
||||||
zone_id=" . $zone_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$zone = $db->db_select($query); |
|
||||||
$smarty->assign("zone", $zone[0]); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("zoneedit.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
@ -1,57 +1,31 @@ |
|||||||
<?php |
<?php |
||||||
/***************************************************************************** |
/***************************************************************************** |
||||||
IP Reg, a PHP/MySQL IPAM tool |
IP Reg, a PHP/MySQL IPAM tool |
||||||
Copyright (C) 2007-2009 Wietse Warendorff |
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5) |
||||||
|
Copyright (C) 2011-2023 Thomas Hooge |
||||||
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 |
SPDX-License-Identifier: GPL-3.0-or-later |
||||||
the Free Software Foundation, either version 3 of the License, or |
*****************************************************************************/ |
||||||
(at your option) any later version. |
|
||||||
|
include("includes.php"); |
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
$zone_id = sanitize($_GET['zone_id']); |
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
include("header.php"); |
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
$query = "SELECT |
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
zone_id, zone_soa, zone_hostmaster, zone_origin, zone_ttl_default, |
||||||
|
zone_refresh, zone_retry, zone_expire, zone_ttl, zone_serial, |
||||||
For more information, visit http://sourceforge.net/projects/ipreg, |
zone_ns1, zone_ns2, zone_ns3, zone_mx1, zone_mx2, zone_info |
||||||
or contact me at wietsew@users.sourceforge.net |
FROM |
||||||
*****************************************************************************/ |
zone |
||||||
|
WHERE |
||||||
// start page |
zone_id=" . $zone_id; |
||||||
// includes |
|
||||||
include("includes.php"); |
$zone = $db->db_select($query); |
||||||
|
|
||||||
// get id |
$smarty->assign("zone", $zone[0]); |
||||||
$zone_id = sanitize($_GET['zone_id']); |
$smarty->display("zoneview.tpl"); |
||||||
|
|
||||||
// start output |
include("footer.php"); |
||||||
include("header.php"); |
|
||||||
|
|
||||||
// set language variables |
|
||||||
$smarty->assign($lang); |
|
||||||
|
|
||||||
// setup assetclassgroup |
|
||||||
// build query |
|
||||||
$query = "SELECT |
|
||||||
zone_id, zone_soa, zone_hostmaster, zone_origin, zone_ttl_default, |
|
||||||
zone_refresh, zone_retry, zone_expire, zone_ttl, zone_serial, |
|
||||||
zone_ns1, zone_ns2, zone_ns3, zone_mx1, zone_mx2, zone_info |
|
||||||
FROM |
|
||||||
zone |
|
||||||
WHERE |
|
||||||
zone_id=" . $zone_id; |
|
||||||
|
|
||||||
// run query |
|
||||||
$zone = $db->db_select($query); |
|
||||||
$smarty->assign("zone", $zone[0]); |
|
||||||
|
|
||||||
// end page |
|
||||||
// output |
|
||||||
$smarty->display("zoneview.tpl"); |
|
||||||
|
|
||||||
// end output |
|
||||||
include("footer.php"); |
|
||||||
?> |
?> |
Reference in new issue