Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 26 | Revision 29 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php
        //$Id$
/**
 * @author Lars Tiefland
 * @copyright 2007
 
 */


        class IP
        {
                protected $ip;
                protected $used;
                protected $dns;
                protected $gw;
                function __construct($ip, $used=0, $dns=0, $gw=0)
                {
                        $this->ip=$ip;
                        $this->used=$used;
                        $this->dns=$dns;
                        $this->gw=$gw;
                }
                
                function toArray()
                {
                        $out["ip"]=$this->ip;
                        $out["dns"]=$this->dns;
                        $out["gw"]=$this->gw;
                        $out["used"]=$this->used;
                        return $out;
                }

                function getIPs($used=1, $dns=0, $gw=0)         
                {
                        global $db;
                        $sql="SELECT id, ip FROM ips WHERE used=$used AND dns=$dns AND gw=$gw";
                        $res=$db->query($sql);
                        while($row=$res->fetchRow())
                        {
                                $out[]=$row;
                        }
                        return $out;
                }
        }
?>