a semi-functional bit of code... lots of todos and error checking
[PHPIPManager.git] / lib / db.php
index e7afc6e..6c6a4d5 100644 (file)
@@ -30,9 +30,35 @@ class db {
                        error_log("db open for init");
                        $this->init();
                }
+               
        }
 
        public $dbobject = "";
+       
+       function dump() {
+               $sql = "select * from supernet";
+               $res = $this->dbobject->query($sql);
+               
+               foreach($res as $row) {
+                       echo "sn:".$row["sn_id"].":".$row["sn_name"].":".$row["sn_ip"].":".$row["sn_mask"].":".$row["sn_desc"]."\n";
+               }
+               $sql = "select * from subnet";
+               $res = $this->dbobject->query($sql);
+               
+               foreach($res as $row) {
+                       echo "sbn:".$row["sn_id"].":".$row["snid_id"].":".$row["sn_name"].":".$row["sn_ip"].":".$row["sn_mask"].":".$row["sn_desc"]."\n";
+               }
+               $sql = "select * from hosts";
+               $res = $this->dbobject->query($sql);
+               
+               foreach($res as $row) {
+                       echo "hst:".$row["ho_id"].":".$row["ho_sn_id"].":".$row["ho_ip"].":".$row["ho_name"].":".$row["ho_desc"]."\n";
+               }
+       }
+       
+       function restore($restorefile) {
+               
+       }
 }