Subversion-Projekte lars-tiefland.openvz_admin

Revision

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

Revision Autor Zeilennr. Zeile
26 lars 1
<?php
2
	//$Id$
3
/**
4
 * @author Lars Tiefland
5
 * @copyright 2007
6
 
7
 */
8
 
9
 
10
	class IP
11
	{
12
		protected $ip;
13
		protected $used;
14
		protected $dns;
15
		protected $gw;
16
		function __construct($ip, $used=0, $dns=0, $gw=0)
17
		{
18
			$this->ip=$ip;
19
			$this->used=$used;
20
			$this->dns=$dns;
21
			$this->gw=$gw;
22
		}
23
 
24
		function toArray()
25
		{
26
			$out["ip"]=$this->ip;
27
			$out["dns"]=$this->dns;
28
			$out["gw"]=$this->gw;
29
			$out["used"]=$this->used;
30
			return $out;
31
		}
32
 
33
		function getIPs($used=1, $dns=0, $gw=0)
34
		{
35
			global $db;
27 lars 36
			$sql="SELECT id, ip FROM ips WHERE used=$used AND dns=$dns AND gw=$gw";
26 lars 37
			$res=$db->query($sql);
38
			while($row=$res->fetchRow())
39
			{
40
				$out[]=$row;
41
			}
42
			return $out;
43
		}
44
	}
45
?>