Blame | Letzte Änderung | Log anzeigen | RSS feed
<?php//$Id: ip.class.php 109 2008-05-09 22:19:52Z lars $/*** @author Lars Tiefland* @copyright 2008* @package Inventar Datenbank**/class IP{protected $ip;protected $id;function __construct($ip=NULL){if(!is_null($ip)){$sql="SELECT * FROM ips WHERE ip='$ip'";$res=$GLOBALS["db"]->query($sql);$row=$res->fetchRow();$this->id=$row["id"];$this->ip=$row["ip"];}else{$this->ip='';$this->id=0;}}function toArray(){$out["ip"]=$this->ip;$out["id"]=$this->id;return $out;}static function getIP($ip_id){$sql="SELECT * FROM ips WHERE id=$ip_id";$res=$GLOBALS["db"]->query($sql);$row=$res->fetchRow();$ip=new IP($row["ip"]);return $ip->toArray();}static function getIPs($hn=1, $used=0, $dns=0, $gw=0){/* $sql="SELECT id, ip FROM ips WHERE dns=$dns AND gw=$gw AND hn=$hn";$res=$GLOBALS["db"]->query($sql);$out[-1]="Bitte wählen!";while($row=$res->fetchRow()){if(!$used){$sql2="SELECT * FROM host_2_ip WHERE ip='".$row["id"]."'";$res2=$db->query($sql2);if(!$res2->numRows()){$out[$row["id"]]=$row["ip"];}}}return $out;*/}}?>