From: paulr Date: Sat, 11 Sep 2010 19:40:28 +0000 (+1000) Subject: added some db functionality X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=671b623794ad8bd9d8a57f28436a46a62b12ef66;p=PHPIPManager.git added some db functionality --- diff --git a/lib/db.php b/lib/db.php index 77a9068..e7afc6e 100644 --- a/lib/db.php +++ b/lib/db.php @@ -22,7 +22,6 @@ class db { try { $this->dbobject = new PDO("$DB_URI"); - error_log("channy is a poof"); } catch(PDOException $exep) { error_log("execpt on db open"); } diff --git a/lib/ip.php b/lib/ip.php index 91d7013..6775fba 100644 --- a/lib/ip.php +++ b/lib/ip.php @@ -111,7 +111,7 @@ class ip { return false; } - function addSubnet($subnet) + function addSubnet($name, $subnet, $mask, $desc, $super) { } diff --git a/lib/www.php b/lib/www.php index 2ec7c73..70274f5 100644 --- a/lib/www.php +++ b/lib/www.php @@ -1,7 +1,10 @@ // now we search for sub's echo "
"; } + + echo "dump database restore database"; } function printError() @@ -132,7 +137,7 @@ function www_ip_addSuperRange() } } -function www_ip_allocateSubRange() +function www_ip_allocateRange() { global $db, $wwwConnector; @@ -146,12 +151,12 @@ function www_ip_allocateSubRange() $wwwConnector->header(); $wwwConnector->printError(); ?> -sql is
+ - +
Subnet Name
Subnet IP
Subnet Mask
Subnet Mask
Description
@@ -161,4 +166,30 @@ sql is
$wwwConnector->footer(); } +function www_ip_allocateSubRange() +{ + global $db, $wwwConnector; + + $superid = $_REQUEST["superid"]; + $name = $_REQUEST["subname"]; + $subip = $_REQUEST["subip"]; + $mask = $_REQUEST["submask"]; + $desc = $_REQUEST["subdesc"]; + + $myip = new ip(); + if($myip->addSubnet($name, $subip, $mask, $desc, $superid)) { + header("Location: index.php?notice=range added"); + } else { + header("Location: index.php?error=invalid ipaddress"); + } +} + +function www_db_dumpdb() +{ +} + +function www_db_restoredb() +{ +} + ?> \ No newline at end of file