Subversion-Projekte lars-tiefland.em_wm

Revision

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

Revision 31 Revision 33
Zeile 1... Zeile 1...
1
<?
1
<?
2
	class Ort
2
	class Ort
3
	{
3
	{
4
		var $o_id;
4
		var $o_id;
5
		var $o_name;
5
		var $o_name;
-
 
6
		var $o_name2;
Zeile 6... Zeile 7...
6
		
7
		
7
		function __construct($o_id)
8
		function __construct($o_id)
8
		{
9
		{
9
			global $db, $db_meld, $error, $meld;
10
			global $db, $db_meld, $error, $meld;
Zeile 20... Zeile 21...
20
			else
21
			else
21
			{
22
			{
22
				$row=$res->fetchRow(DB_FETCHMODE_ASSOC);
23
				$row=$res->fetchRow(DB_FETCHMODE_ASSOC);
23
				$this->o_id=$o_id;
24
				$this->o_id=$o_id;
24
				$this->o_name=$row["l_name"];
25
				$this->o_name=$row["l_name"];
-
 
26
				$this->o_name2=$row["l_name2"];
25
				return $this;
27
				return $this;
26
			}
28
			}
27
		}
29
		}
Zeile 28... Zeile 30...
28
		
30
		
29
		function Ort($o_id)
31
		function Ort($o_id)
30
		{
32
		{
31
			$this->__construct($o_id);
33
			$this->__construct($o_id);
Zeile 32... Zeile 34...
32
		}
34
		}
33
		
35
		
34
		function update($l_name)
36
		function update($l_name, $l_name2)
-
 
37
		{
35
		{
38
			$this->l_name=$l_name;
Zeile 36... Zeile 39...
36
			$this->l_name=$l_name;
39
			$this->l_name2=$l_name2;
37
		}
40
		}
38
		
41
		
39
		function save($op)
42
		function save($op)
40
		{
43
		{
41
			global $db;
44
			global $db;
42
			switch($op)
45
			switch($op)
43
			{
46
			{
44
				case "save":
47
				case "save":
45
					$sql="INSERT INTO locations (l_name)
48
					$sql="INSERT INTO locations (l_name, l_name2)
46
						VALUES ('$this->l_name')";
49
						VALUES ('$this->o_name', '$this->o_name2)";
47
					break;
50
					break;
48
				case "update":
51
				case "update":
49
					$sql="UPDATE locations SET l_name='$this->l_name' WHERE l_id=$this->l_id";
52
					$sql="UPDATE locations SET l_name='$this->o_name', l_name2='$this->o_name2' WHERE l_id=$this->l_id";
50
					break;
53
					break;
51
				case "del":
54
				case "del":