Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 80 | Revision 84 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 80 Revision 81
Zeile 8... Zeile 8...
8
 */
8
 */
Zeile 9... Zeile 9...
9
 
9
 
10
 
10
 
-
 
11
	class HN
11
	class HN
12
	{
12
	{
13
		protected $id;
13
		protected $ip;
14
		protected $ip;
14
		protected $name;
15
		protected $name;
Zeile 15... Zeile 16...
15
		protected $ve_start;
16
		protected $ve_start;
16
		protected $ve_end;
17
		protected $ve_end;
-
 
18
		
-
 
19
		function __construct($ip=NULL,$name,$ve_start,$ve_end)
-
 
20
		{
-
 
21
			global $db;
-
 
22
			if(!is_null($ip))
-
 
23
			{
-
 
24
				$sql="SELECT * FROM hardwarenodes WHERE ip='$ip'";
-
 
25
				$res=$db->query($sql);
-
 
26
				$row=$res->fetchRow();
-
 
27
				$this->id=$row["id"];
-
 
28
				$this->ip=$row["ip"];
-
 
29
				$this->name=$row["h_name"];
-
 
30
				$this->ve_start=$row["ve_start"];
-
 
31
				$this->ve_end=$row["ve_end"];
-
 
32
			}
-
 
33
			else
-
 
34
			{
-
 
35
				$this->id=0;
-
 
36
				$this->ip=$ip;
-
 
37
				$this->used=$used;
-
 
38
				$this->dns=$dns;
17
		
39
				$this->gw=$gw;
-
 
40
			}
-
 
41
		}
-
 
42
		
-
 
43
		function toArray()
-
 
44
		{
-
 
45
			$out["id"]=$this->id;
-
 
46
			$out["ip"]=$this->ip;
-
 
47
			$out["name"]=$this->dns;
-
 
48
			$out["ve_start"]=$this->gw;
-
 
49
			$out["ve_end"]=$this->used;
-
 
50
			return $out;
-
 
51
		}
-
 
52
 
-
 
53
		static function getHN($hn_id=1)
-
 
54
		{
-
 
55
			global $db;
-
 
56
			$sql="SELECT * FROM hardwarenodes WHERE hn_id=$hn_id";
-
 
57
			$res=$db->query($sql);
18
		function __construct($ip,$name,$ve_start,$ve_end)
58
			$row=$res->fetchRow();
Zeile 19... Zeile 59...
19
		{
59
			$hn=new HN($row["ip"]);
20
			
60
			return $hn->toArray();
21
		}
61
		}