Changes adopted from version 0.5

master v0.5
Thomas Hooge 2 years ago
parent faf5f368f5
commit 76ccecca7f
  1. 47
      about.php
  2. 127
      asset.php
  3. 85
      assetadd.php
  4. 91
      assetclass.php
  5. 86
      assetclassadd.php
  6. 69
      assetclassdel.php
  7. 110
      assetclassedit.php
  8. 87
      assetclassgroup.php
  9. 38
      assetclassgroupadd.php
  10. 69
      assetclassgroupdel.php
  11. 72
      assetclassgroupedit.php
  12. 122
      assetclassgroupview.php
  13. 121
      assetclassview.php
  14. 108
      assetdel.php
  15. 123
      assetedit.php
  16. 138
      assetview.php
  17. 76
      assigniptoasset.php
  18. 69
      assigniptonode.php
  19. 65
      assignlocationtosubnet.php
  20. 133
      assignnodetoasset.php
  21. 66
      assignvlantosubnet.php
  22. 6
      comments.php
  23. 73
      config.php
  24. 5
      dbconnect.php
  25. 20
      footer.php
  26. 117
      header.php
  27. 112
      image.php
  28. BIN
      images/add.gif
  29. BIN
      images/background.png
  30. BIN
      images/check.gif
  31. BIN
      images/comment.png
  32. BIN
      images/comments.gif
  33. BIN
      images/control_fastforward_blue.png
  34. BIN
      images/control_rewind_blue.png
  35. BIN
      images/del.gif
  36. BIN
      images/edit.gif
  37. BIN
      images/error.png
  38. BIN
      images/logo.png
  39. BIN
      images/magnifier.png
  40. BIN
      images/next.gif
  41. BIN
      images/page_add.png
  42. BIN
      images/page_delete.png
  43. BIN
      images/page_edit.png
  44. BIN
      images/page_red.png
  45. BIN
      images/page_save.png
  46. BIN
      images/prev.gif
  47. BIN
      images/save.gif
  48. BIN
      images/search.gif
  49. BIN
      images/shield.ico
  50. BIN
      images/shield.png
  51. 80
      includes.php
  52. 117
      index.php
  53. 142
      install/install.sql
  54. 24
      install/install.txt
  55. 143
      install/mysql.sql
  56. 116
      lang/en.php
  57. 40
      lib.php
  58. 5
      lib/changelink.js
  59. 3
      lib/changetext.js
  60. 59
      lib/db.class.php
  61. 63
      lib/functions.php
  62. 115
      lib/user.class.php
  63. 0
      lib/yapter.php
  64. 174
      location.php
  65. 147
      locationadd.php
  66. 66
      locationdel.php
  67. 190
      locationedit.php
  68. 107
      locationsubnetadd.php
  69. 102
      locationsubnetdel.php
  70. 66
      locationsubnetedit.php
  71. 276
      locationview.php
  72. 87
      login.php
  73. 16
      logout.php
  74. 111
      natadd.php
  75. 105
      natdel.php
  76. 65
      natedit.php
  77. 108
      node.php
  78. 136
      nodeadd.php
  79. 67
      nodedel.php
  80. 186
      nodeedit.php
  81. 79
      nodelist.php
  82. 190
      nodeview.php
  83. 35
      options.php
  84. 111
      optionseditdisplay.php
  85. 38
      optionseditpassword.php
  86. 365
      search.php
  87. 1305
      submit.php
  88. 92
      subnet.php
  89. 41
      subnetadd.php
  90. 111
      subnetdel.php
  91. 85
      subnetedit.php
  92. 108
      subnetlocationadd.php
  93. 102
      subnetlocationdel.php
  94. 63
      subnetlocationedit.php
  95. 642
      subnetview.php
  96. 109
      subnetvlanadd.php
  97. 104
      subnetvlandel.php
  98. 63
      subnetvlanedit.php
  99. 125
      tpl/about.tpl
  100. 44
      tpl/asset.tpl
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,25 +20,28 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// start output
include("header.php");
// set template
$tp = new Template("tpl/about.tpl");
// set language variables
$tp->setvars($lang);
// set vars
$tp->set("config_version", $config_version);
// output
$tp->parse();
$tp->spit();
// end output
include("footer.php");
// start page
// includes
include("includes.php");
// start output
include("header.php");
// set template
$tp = new Template("tpl/about.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// setup page
// set vars
$tp->set("config_version", $config_version);
// end page
// output
$tp->parse();
$tp->spit();
// end output
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,35 +20,110 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// check authorisation
$auth = auth("asset", $config_auth_assetview, 0);
// start page
// includes
include("includes.php");
// start output
include("header.php");
// set template
$tp = new Template("tpl/asset.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// start output
include("header.php");
// create letter links
// build query
$query = "SELECT
SUBSTRING(UPPER(asset.asset_name),1,1) AS asset_letter
FROM
asset
GROUP BY
asset_letter
ORDER BY
asset_letter";
// run query
$alphabet = $db->db_select($query);
// count results
$alphabet_counter = count($alphabet);
// set template
$tp = new Template("tpl/asset.tpl");
// any letters?
if ($alphabet_counter>0) {
// get objects
foreach($alphabet AS $alphabet_letter) {
// to tpl
$tp->set("asset_letter", strtoupper($alphabet_letter['asset_letter']));
// parse every row
$tp->parse("letter_row");
}
}
// parse block
$tp->parse("letter_table");
// set language variables
$tp->setvars($lang);
// setup asset
// setup current letter
if(isset($_GET['asset_letter'])) {
$asset_letter = sanitize($_GET['asset_letter']);
} else {
$asset_letter = $alphabet[0]['asset_letter'];
}
// build query
$query = "SELECT
asset.asset_id AS asset_id,
asset.asset_name AS asset_name,
assetclass.assetclass_id AS assetclass_id,
assetclass.assetclass_name AS assetclass_name
FROM
asset,
assetclass
WHERE
SUBSTRING(asset.asset_name,1,1) = '" . $asset_letter . "'
AND assetclass.assetclass_id=asset.assetclass_id
ORDER BY
asset.asset_name";
// run query
$assets = $db->db_select($query);
// count results
$asset_counter = count($assets);
// counter to tpl
$tp->set("asset_counter", $asset_counter);
// get asset info
$result = mysql_query("SELECT a.asset_id, a.asset_name, a.assetclass_id, ac.assetclass_name FROM asset a, assetclass ac WHERE ac.assetclass_id=a.assetclass_id ORDER BY a.asset_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("asset_id", $row->asset_id);
$tp->set("asset_name", $row->asset_name);
$tp->set("assetclass_id", $row->assetclass_id);
$tp->set("assetclass_name", $row->assetclass_name);
$tp->parse("assetrow");
}
if (($i>0) ? $tp->parse("asset") : $tp->hide("asset"));
// any assets?
if ($asset_counter>0) {
// get objects
foreach($assets AS $asset) {
// send to tpl
$tp->set("asset_id", $asset['asset_id']);
$tp->set("asset_name", $asset['asset_name']);
$tp->set("assetclass_id", $asset['assetclass_id']);
$tp->set("assetclass_name", $asset['assetclass_name']);
// parse row
$tp->parse("asset_row");
}
// parse block
$tp->parse("asset_table");
} else {
// hide block
$tp->hide("asset_table");
}
// output
$tp->parse();
$tp->spit();
// end page
// output
$tp->parse();
$tp->spit();
include("footer.php");
// end output
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,37 +20,58 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// start page
// includes
include("includes.php");
// get id
if((isset($_GET['assetclass_id'])) ? $assetclass_id = sanitize($_GET['assetclass_id']) : $assetclass_id = "");
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetadd.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// get id
if((isset($_GET['assetclass_id'])) ? $assetclass_id = $_GET['assetclass_id'] : $assetclass_id = "");
// setup assetclass
// build query
$query = "SELECT
assetclass.assetclass_id AS assetclass_id,
assetclass.assetclass_name AS assetclass_name
FROM
assetclass
ORDER BY
assetclass.assetclass_name";
// run query
$assetclasses = $db->db_select($query);
foreach($assetclasses AS $assetclass) {
// send to tpl
$tp->set("assetclass_id", $assetclass['assetclass_id']);
$tp->set("assetclass_name", $assetclass['assetclass_name']);
if($assetclass['assetclass_id']==$assetclass_id) {
$tp->set("assetclass_selected", "selected");
} else {
$tp->set("assetclass_selected", "");
}
// parse block
$tp->parse("assetclass_row");
}
// parse block
$tp->parse("assetclass_table");
// check authorisation
$auth = auth("asset", $config_auth_assetadd, 0);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetadd.tpl");
// set language variables
$tp->setvars($lang);
// get assetclassgroup information
$result = mysql_query("SELECT assetclass_id, assetclass_name FROM assetclass ORDER BY assetclass_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
if (($row->assetclass_id==$assetclass_id) ? $tp->set("assetclass_selected", "selected") : $tp->set("assetclass_selected", ""));
$tp->set("assetclass_id", $row->assetclass_id);
$tp->set("assetclass_name", $row->assetclass_name);
$tp->parse("assetclassrow");
}
if (($i>0) ? $tp->parse("assetclass") : $tp->hide("assetclass"));
// output
$tp->parse();
$tp->spit();
include("footer.php");
// end page
// output
$tp->parse();
$tp->spit();
// end output
include("footer.php");
?>

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

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,37 +20,59 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// start page
// includes
include("includes.php");
// get id
if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = sanitize($_GET['assetclassgroup_id']) : $assetclassgroup_id = "");
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassadd.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// get id
if((isset($_GET['assetclassgroup_id'])) ? $assetclassgroup_id = $_GET['assetclassgroup_id'] : $assetclassgroup_id = "");
// setup assetclassgroup
// build query
$query = "SELECT
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
assetclassgroup.assetclassgroup_name AS assetclassgroup_name
FROM
assetclassgroup
ORDER BY
assetclassgroup.assetclassgroup_name";
// run query
$assetclassgroup = $db->db_select($query);
// get objects
foreach($assetclassgroup AS $assetclassgroup) {
// send to tpl
$tp->set("assetclassgroup_id", $assetclassgroup['assetclassgroup_id']);
$tp->set("assetclassgroup_name", $assetclassgroup['assetclassgroup_name']);
if($assetclassgroup['assetclassgroup_id']==$assetclassgroup_id) {
$tp->set("assetclassgroup_selected", "selected");
} else {
$tp->set("assetclassgroup_selected", "");
}
// parse block
$tp->parse("assetclassgroup_row");
}
// parse block
$tp->parse("assetclassgroup_table");
// check authorisation
$auth = auth("assetclass", $config_auth_assetclassadd, $assetclass_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassadd.tpl");
// set language variables
$tp->setvars($lang);
// get assetclassgroup information
$result = mysql_query("SELECT assetclassgroup_id, assetclassgroup_name FROM assetclassgroup ORDER BY assetclassgroup_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
if (($row->assetclassgroup_id==$assetclassgroup_id) ? $tp->set("assetclassgroup_selected", "selected") : $tp->set("assetclassgroup_selected", ""));
$tp->set("assetclassgroup_id", $row->assetclassgroup_id);
$tp->set("assetclassgroup_name", $row->assetclassgroup_name);
$tp->parse("assetclassgrouprow");
}
if (($i>0) ? $tp->parse("assetclassgroup") : $tp->hide("assetclassgroup"));
// output
$tp->parse();
$tp->spit();
include("footer.php");
// end page
// output
$tp->parse();
$tp->spit();
// end output
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,33 +20,44 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// get id
$assetclass_id = $_GET['assetclass_id'];
// check authorisation
$auth = auth("assetclass", $config_auth_assetclassdel, $assetclass_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassdel.tpl");
// set language variables
$tp->setvars($lang);
// get assetclass info
$result = mysql_query("SELECT assetclass_id, assetclass_name FROM assetclass WHERE assetclass_id='$assetclass_id'") or die(mysql_error());
$row=mysql_fetch_object($result);
$tp->set("assetclass_id", $row->assetclass_id);
$tp->set("assetclass_name", $row->assetclass_name);
// output
$tp->parse();
$tp->spit();
// start page
// includes
include("includes.php");
// get id
$assetclass_id = sanitize($_GET['assetclass_id']);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassdel.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// setup assetclass
// build query
$query = "SELECT
assetclass.assetclass_id AS assetclass_id,
assetclass.assetclass_name AS assetclass_name
FROM
assetclass
WHERE
assetclass.assetclass_id=" . $assetclass_id;
// run query
$assetclass = $db->db_select($query);
// send to tpl
$tp->set("assetclass_id", $assetclass[0]['assetclass_id']);
$tp->set("assetclass_name", $assetclass[0]['assetclass_name']);
// end page
// output
$tp->parse();
$tp->spit();
include("footer.php");
// end output
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,45 +20,77 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// get id
$assetclass_id = $_GET['assetclass_id'];
// check authorisation
$auth = auth("assetclass", $config_auth_assetclassedit, $assetclass_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassedit.tpl");
// set language variables
$tp->setvars($lang);
// start page
// includes
include("includes.php");
// get assetclass information
$result = mysql_query("SELECT assetclass_name, assetclassgroup_id FROM assetclass WHERE assetclass_id='$assetclass_id'") or die(mysql_error());
$row=mysql_fetch_object($result);
$assetclassgroup_id = $row->assetclassgroup_id;
$tp->set("assetclass_id", $assetclass_id);
$tp->set("assetclass_name", $row->assetclass_name);
$tp->set("assetclassgroup_id", $assetclassgroup_id);
// get assetclassgroup information
$result = mysql_query("SELECT assetclassgroup_id, assetclassgroup_name FROM assetclassgroup ORDER BY assetclassgroup_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
if (($row->assetclassgroup_id==$assetclassgroup_id) ? $tp->set("selected", "selected") : $tp->set("selected", ""));
$tp->set("assetclassgroup_id", $row->assetclassgroup_id);
$tp->set("assetclassgroup_name", $row->assetclassgroup_name);
$tp->parse("assetclassgrouprow");
}
if (($i>0) ? $tp->parse("assetclassgroup") : $tp->hide("assetclassgroup"));
// get id
$assetclass_id = sanitize($_GET['assetclass_id']);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassedit.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// setup assetclass
// build query
$query = "SELECT
assetclass.assetclass_id AS assetclass_id,
assetclass.assetclass_name AS assetclass_name,
assetclass.assetclassgroup_id AS assetclassgroup_id
FROM
assetclass
WHERE
assetclass.assetclass_id=" . $assetclass_id;
// run query
$assetclass = $db->db_select($query);
// send to tpl
$tp->set("assetclass_id", $assetclass[0]['assetclass_id']);
$tp->set("assetclass_name", $assetclass[0]['assetclass_name']);
// output
$tp->parse();
$tp->spit();
// setup assetclassgroup
// build query
$query = "SELECT
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
assetclassgroup.assetclassgroup_name AS assetclassgroup_name
FROM
assetclassgroup
ORDER BY
assetclassgroup.assetclassgroup_name";
// run query
$assetclassgroups = $db->db_select($query);
// get objects
foreach($assetclassgroups AS $assetclassgroup) {
// send to tpl
$tp->set("assetclassgroup_id", $assetclassgroup['assetclassgroup_id']);
$tp->set("assetclassgroup_name", $assetclassgroup['assetclassgroup_name']);
if($assetclassgroup['assetclassgroup_id']==$assetclass[0]['assetclassgroup_id']) {
$tp->set("assetclassgroup_selected", "selected");
} else {
$tp->set("assetclassgroup_selected", "");
}
// parse block
$tp->parse("assetclassgroup_row");
}
// parse block
$tp->parse("assetclassgroup_table");
include("footer.php");
// end page
// output
$tp->parse();
$tp->spit();
// end output
include("footer.php");
?>

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

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,24 +20,24 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// start page
// includes
include("includes.php");
// check authorisation
$auth = auth("assetclassgroup", $config_auth_assetclassgroupadd, 0);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassgroupadd.tpl");
// set language variables
$tp->setvars($lang);
// output
$tp->parse();
$tp->spit();
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassgroupadd.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
include("footer.php");
// end page
// output
$tp->parse();
$tp->spit();
// end output
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,33 +20,44 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// get id
$assetclassgroup_id = $_GET['assetclassgroup_id'];
// check authorisation
$auth = auth("assetclassgroup", $config_auth_assetclassgroupdel, $assetclassgroup_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassgroupdel.tpl");
// set language variables
$tp->setvars($lang);
// get assetclass info
$result = mysql_query("SELECT assetclassgroup_id, assetclassgroup_name FROM assetclassgroup WHERE assetclassgroup_id='$assetclassgroup_id'") or die(mysql_error());
$row=mysql_fetch_object($result);
$tp->set("assetclassgroup_id", $row->assetclassgroup_id);
$tp->set("assetclassgroup_name", $row->assetclassgroup_name);
// output
$tp->parse();
$tp->spit();
// start page
// includes
include("includes.php");
// get id
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassgroupdel.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// setup assetclassgroup
// build query
$query = "SELECT
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
assetclassgroup.assetclassgroup_name AS assetclassgroup_name
FROM
assetclassgroup
WHERE
assetclassgroup.assetclassgroup_id=" . $assetclassgroup_id;
// run query
$assetclassgroup = $db->db_select($query);
// send to tpl
$tp->set("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
$tp->set("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
// end page
// output
$tp->parse();
$tp->spit();
include("footer.php");
// end output
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,34 +20,46 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// get id
$assetclassgroup_id = $_GET['assetclassgroup_id'];
// check authorisation
$auth = auth("assetclassgroup", $config_auth_assetclassgroupedit, $assetclassgroup_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassgroupedit.tpl");
// set language variables
$tp->setvars($lang);
// get assetclass information
$result = mysql_query("SELECT assetclassgroup_name, color FROM assetclassgroup WHERE assetclassgroup_id='$assetclassgroup_id'") or die(mysql_error());
$row=mysql_fetch_object($result);
$tp->set("assetclassgroup_id", $assetclassgroup_id);
$tp->set("assetclassgroup_name", $row->assetclassgroup_name);
$tp->set("color", $row->color);
// output
$tp->parse();
$tp->spit();
// start page
// includes
include("includes.php");
// get id
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassgroupedit.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// 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
$tp->set("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
$tp->set("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
$tp->set("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
include("footer.php");
// end page
// output
$tp->parse();
$tp->spit();
// end output
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,42 +20,86 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// get id
$assetclassgroup_id = $_GET['assetclassgroup_id'];
// check authorisation
$auth = auth("assetclassgroup", $config_auth_assetclassgroupview, $assetclassgroup_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassgroupview.tpl");
// set language variables
$tp->setvars($lang);
// get assetclassgroup info
$result = mysql_query("SELECT assetclassgroup_name, color FROM assetclassgroup WHERE assetclassgroup_id='$assetclassgroup_id'") or die(mysql_error());
$row=mysql_fetch_object($result);
$tp->set("assetclassgroup_id", $assetclassgroup_id);
$tp->set("assetclassgroup_name", $row->assetclassgroup_name);
$tp->set("color", $row->color);
$result = mysql_query("SELECT assetclass_id, assetclass_name FROM assetclass WHERE assetclassgroup_id='$assetclassgroup_id' ORDER BY assetclass_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("assetclass_name", $row->assetclass_name);
$tp->set("assetclass_id", $row->assetclass_id);
$tp->parse("assetclassrow");
}
if (($i>0) ? $tp->parse("assetclass") : $tp->hide("assetclass"));
// output
$tp->parse();
$tp->spit();
include("footer.php");
// start page
// includes
include("includes.php");
// get id
$assetclassgroup_id = sanitize($_GET['assetclassgroup_id']);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassgroupview.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// 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
$tp->set("assetclassgroup_id", $assetclassgroup[0]['assetclassgroup_id']);
$tp->set("assetclassgroup_name", $assetclassgroup[0]['assetclassgroup_name']);
$tp->set("assetclassgroup_color", $assetclassgroup[0]['assetclassgroup_color']);
// setup assetclass
// build query
$query = "SELECT
assetclass.assetclass_id AS assetclass_id,
assetclass.assetclass_name AS assetclass_name
FROM
assetclass
WHERE
assetclass.assetclassgroup_id=" . $assetclassgroup_id . "
ORDER BY
assetclass.assetclass_name";
// run query
$assetclasses = $db->db_select($query);
// count results
$assetclass_counter = count($assetclasses);
// counter to tpl
$tp->set("assetclass_counter", $assetclass_counter);
// any assets?
if ($assetclass_counter>0) {
// get objects
foreach($assetclasses AS $assetclass) {
// send to tpl
$tp->set("assetclass_id", $assetclass['assetclass_id']);
$tp->set("assetclass_name", $assetclass['assetclass_name']);
// parse row
$tp->parse("assetclass_row");
}
// parse block
$tp->parse("assetclass_table");
} else {
// hide block
$tp->hide("assetclass_table");
}
// end page
// output
$tp->parse();
$tp->spit();
// end output
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,44 +20,95 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// get id
$assetclass_id = $_GET['assetclass_id'];
// start page
// includes
include("includes.php");
// check authorisation
$auth = auth("assetclass", $config_auth_assetclassview, $assetclass_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassview.tpl");
// get id
$assetclass_id = sanitize($_GET['assetclass_id']);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetclassview.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// set language variables
$tp->setvars($lang);
// setup assetclass
// build query
$query = "SELECT
assetclass.assetclass_id AS assetclass_id,
assetclass.assetclass_name AS assetclass_name,
assetclassgroup.assetclassgroup_id AS assetclassgroup_id,
assetclassgroup.assetclassgroup_name AS assetclassgroup_name
FROM
assetclass,
assetclassgroup
WHERE
assetclass.assetclass_id=" . $assetclass_id . "
AND assetclassgroup.assetclassgroup_id=assetclass.assetclassgroup_id";
// run query
$assetclass = $db->db_select($query);
// send to tpl
$tp->set("assetclass_id", $assetclass[0]['assetclass_id']);
$tp->set("assetclass_name", $assetclass[0]['assetclass_name']);
$tp->set("assetclass_selected", "");
$tp->set("assetclassgroup_id", $assetclass[0]['assetclassgroup_id']);
$tp->set("assetclassgroup_name", $assetclass[0]['assetclassgroup_name']);
// get assetclassgroup info
$result = mysql_query("SELECT ac.assetclassgroup_id, ac.assetclass_name, acg.assetclassgroup_name FROM assetclass ac, assetclassgroup acg WHERE ac.assetclass_id='$assetclass_id' AND acg.assetclassgroup_id=ac.assetclassgroup_id") or die(mysql_error());
$row = mysql_fetch_object($result);
$tp->set("assetclass_id", $assetclass_id);
$tp->set("assetclass_name", $row->assetclass_name);
$tp->set("assetclassgroup_id", $row->assetclassgroup_id);
$tp->set("assetclassgroup_name", $row->assetclassgroup_name);
// setup asset
// build query
$query = "SELECT
asset.asset_id AS asset_id,
asset.asset_name AS asset_name
FROM
asset
WHERE
asset.assetclass_id='" . $assetclass_id . "'
ORDER BY
asset.asset_name";
// get assets for this assetclassgroup
$result = mysql_query("SELECT asset_id, asset_name FROM asset WHERE assetclass_id='$assetclass_id' ORDER BY asset_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("asset_id", $row->asset_id);
$tp->set("asset_name", $row->asset_name);
$tp->parse("assetrow");
}
if (($i>0) ? $tp->parse("asset") : $tp->hide("asset"));
// run query
$assets = $db->db_select($query);
// output
$tp->parse();
$tp->spit();
// count results
$asset_counter = count($assets);
// counter to tpl
$tp->set("asset_counter", $asset_counter);
// any assets?
if ($asset_counter>0) {
// sort using "natural order"
// ksort($assets);
// get objects
foreach($assets AS $asset) {
// send to tpl
$tp->set("asset_id", $asset['asset_id']);
$tp->set("asset_name", $asset['asset_name']);
// parse row
$tp->parse("asset_row");
}
// parse block
$tp->parse("asset_table");
} else {
// hide block
$tp->hide("asset_table");
}
// end page
// output
$tp->parse();
$tp->spit();
include("footer.php");
// footer
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,42 +20,80 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// get id
$asset_id = $_GET['asset_id'];
// check authorisation
$auth = auth("asset", $config_auth_assetdel, $asset_id);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetdel.tpl");
// set language variables
$tp->setvars($lang);
// start page
// includes
include("includes.php");
// get id
$asset_id = sanitize($_GET['asset_id']);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetdel.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// get asset info
$result = mysql_query("SELECT asset_name FROM asset WHERE asset_id='$asset_id'") or die(mysql_error());
$row=mysql_fetch_object($result);
$tp->set("asset_id", $asset_id);
$tp->set("asset_name", $row->asset_name);
// setup asset
// build query
$query = "SELECT
asset.asset_name AS asset_name
FROM
asset
WHERE
asset.asset_id=" . $asset_id;
// run query
$asset = $db->db_select($query);
// send to tpl
$tp->set("asset_id", $asset_id);
$tp->set("asset_name", $asset[0]['asset_name']);
// get node info
$result = mysql_query("SELECT n.node_id, n.ip, n.mac, n.dns1, n.dns2, n.node_info, s.subnet_id, s.subnet_address, s.subnet_mask FROM node n, subnet s WHERE asset_id='$asset_id' AND s.subnet_id=n.subnet_id ORDER BY INET_ATON(n.ip)") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
$tp->set("node_id", $row->node_id);
$tp->set("ip", $row->ip);
$tp->parse("noderow");
}
if (($i>0) ? $tp->parse("node") : $tp->hide("node"));
// setup node
// build query
$query = "SELECT
node.node_id AS node_id,
node.node_ip AS node_ip
FROM
node
WHERE
node.asset_id=" . $asset_id . "
ORDER BY
INET_ATON(node.node_ip)";
// 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) {
// set id
$tp->set("node_id", $node['node_id']);
$tp->set("node_ip", $node['node_ip']);
// parse row
$tp->parse("node_row");
}
// parse block
$tp->parse("node_table");
} else {
// hide block
$tp->hide("node_table");
}
// output
$tp->parse();
$tp->spit();
// end page
// output
$tp->parse();
$tp->spit();
include("footer.php");
// footer
include("footer.php");
?>

@ -1,7 +1,7 @@
<?php
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2008 Wietse Warendorff
Copyright (C) 2007-2009 Wietse Warendorff
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,46 +20,89 @@
or contact me at wietsew@users.sourceforge.net
*****************************************************************************/
// includes
include("includes.php");
// start page
// includes
include("includes.php");
// get id
$asset_id = sanitize($_GET['asset_id']);
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetedit.tpl", $config_yapter_error);
// set language variables
$tp->setvars($lang);
// get id
$asset_id = $_GET['asset_id'];
// setup asset
// build query
$query = "SELECT
asset.asset_name AS asset_name,
asset.asset_hostname AS asset_hostname,
asset.asset_info AS asset_info,
asset.assetclass_id AS assetclass_id
FROM
asset
WHERE
asset.asset_id=" . $asset_id;
// run query
$asset = $db->db_select($query);
// send to tpl
$tp->set("asset_id", $asset_id);
$tp->set("asset_name", $asset[0]['asset_name']);
$tp->set("asset_hostname", $asset[0]['asset_hostname']);
$tp->set("asset_info", $asset[0]['asset_info']);
// check authorisation
$auth = auth("asset", $config_auth_assetedit, $asset_id);
// setup assetclass
// build query
$query = "SELECT
assetclass.assetclass_id AS assetclass_id,
assetclass.assetclass_name AS assetclass_name
FROM
assetclass
ORDER BY
assetclass.assetclass_name";
// run query
$assetclasses = $db->db_select($query);
// count results
$assetclass_counter = count($assetclasses);
// any nodes?
if ($assetclass_counter>0) {
// get objects
foreach($assetclasses AS $assetclass) {
// send to tpl
$tp->set("assetclass_id", $assetclass['assetclass_id']);
$tp->set("assetclass_name", $assetclass['assetclass_name']);
// set select box
if($assetclass['assetclass_id']==$asset[0]['assetclass_id']) {
$tp->set("assetclass_selected", "selected");
} else {
$tp->set("assetclass_selected", "");
}
// parse block
$tp->parse("assetclass_row");
}
// parse block
$tp->parse("assetclass_table");
} else {
// parse block
$tp->hide("assetclass_table");
}
// start output
include("header.php");
// set template
$tp = new Template("tpl/assetedit.tpl");
// set language variables
$tp->setvars($lang);
// get asset information
$result = mysql_query("SELECT asset_name, hostname, assetclass_id, asset_info FROM asset WHERE asset_id='$asset_id'") or die(mysql_error());
$row = mysql_fetch_object($result);
$assetclass_id = $row->assetclass_id;
$tp->set("asset_id", $asset_id);
$tp->set("asset_name", $row->asset_name);
$tp->set("hostname", $row->hostname);
$tp->set("asset_info", $row->asset_info);
// get assetclass information
$result = mysql_query("SELECT assetclass_id, assetclass_name FROM assetclass ORDER BY assetclass_name") or die(mysql_error());
for ($i=0;$row=mysql_fetch_object($result);$i++) {
if (($row->assetclass_id==$assetclass_id) ? $tp->set("selected", "selected") : $tp->set("selected", ""));