Subversion-Projekte lars-tiefland.em_wm

Revision

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

Revision 21 Revision 28
Zeile 7... Zeile 7...
7
		var $g_m2;
7
		var $g_m2;
8
		var $g_g1;
8
		var $g_g1;
9
		var $g_g2;
9
		var $g_g2;
10
		var $g_location;
10
		var $g_location;
11
		var $g_date;
11
		var $g_date;
12
		var $g_time;
-
 
13
		var $g_type;
12
		var $g_type;
Zeile 14... Zeile 13...
14
 
13
 
15
		function __construct($g_id)
14
		function __construct($g_id)
16
		{
15
		{
17
		  	global $db, $db_meld, $error, $meld, $user;
16
			global $db, $db_meld, $error, $meld, $user;
18
			$sql="SELECT * FROM games WHERE g_id=$g_id";
17
			$sql="SELECT * FROM games WHERE g_id=$g_id";
19
			$res=$db->query($sql);
18
			$res=$db->query($sql);
20
			if (true == DB::isError($res))
19
			if (true == DB::isError($res))
21
			{
20
			{
Zeile 25... Zeile 24...
25
				return $error;
24
				return $error;
26
			}
25
			}
27
			else
26
			else
28
			{
27
			{
29
				$row=$res->fetchRow(DB_FETCHMODE_ASSOC);
28
				$row=$res->fetchRow(DB_FETCHMODE_ASSOC);
30
				$this->g_id=$row["g_id"];
29
				$this->g_id=$g_id;
31
				$this->g_name=$row["g_name"];
30
				$this->g_name=$row["g_name"];
32
				$this->g_m1=$row["g_m1"];
31
				$this->g_m1=$row["g_m1"];
33
				$this->g_m2=$row["g_m2"];
32
				$this->g_m2=$row["g_m2"];
34
				$this->g_g1=$row["g_g1"];
33
				$this->g_g1=$row["g_g1"];
35
				$this->g_g2=$row["g_g2"];
34
				$this->g_g2=$row["g_g2"];
36
				$this->g_location=$row["g_location"];
35
				$this->g_location=$row["g_location"];
37
				$this->g_date=$row["g_date"];
36
				$this->g_date=$row["g_date"];
38
				$this->g_time=$row["g_time"];
-
 
39
				$this->g_type=$row["g_type"];
37
				$this->g_type=$row["g_type"];
40
				return $this;
38
				return $this;
41
			}
39
			}
42
  		}
40
  		}
Zeile 65... Zeile 63...
65
				$meld="Ein Fehler ist aufgetreten!";
63
				$meld="Ein Fehler ist aufgetreten!";
66
				$db_meld=$res->getUserInfo();
64
				$db_meld=$res->getUserInfo();
67
			}
65
			}
68
			return $res;
66
			return $res;
69
		}
67
		}
-
 
68
		
-
 
69
		function update($g_name, $g_m1, $g_m2, $g_g1, $g_g2, $g_location, $g_date, $g_type)
-
 
70
		{
-
 
71
			$this->g_name=addslashes($g_name);
-
 
72
			$this->g_m1=intval($g_m1);
-
 
73
			$this->g_m2=intval($g_m2);
-
 
74
			$this->g_g1=intval($g_g1);
-
 
75
			$this->g_g2=intval($g_g2);
-
 
76
			$this->g_location=intval($g_location);
-
 
77
			$this->g_date=intval($g_date);
-
 
78
			$this->g_type=intval($g_type);
-
 
79
		}
-
 
80
		function save($op)
-
 
81
		{
-
 
82
			global $meld, $db_meld;
-
 
83
			switch($op)
-
 
84
			{
-
 
85
				case "save":
-
 
86
					$sql="INSERT INTO games (g_name, g_m1, g_m2, g_g1, g_g2, g_location, g_date, g_type)
-
 
87
						VALUES ('$this->g_name', $this->g_m1, $this->g_m2, $this->g_g1, $this->g_g2, $this->g_location, $this->g_date, $this->g_type)";
-
 
88
					break;
-
 
89
				case "update":
-
 
90
					$sql="UPDATE games SET g_name='$this->g_name', g_m1=$this->g_m1, g_m2=$this->g_m2, g_g1=$this->g_g1, g_g2=$this->g_g2, g_location=$this->g_location, g_date=$this->g_date, g_type=$this->g_type WHERE g_id=$this->g_id";
-
 
91
					break;
-
 
92
				case "del":
-
 
93
					$sql="DELETE FROM games WHERE g_id=$this->g_id";
-
 
94
					break;
-
 
95
			}
-
 
96
			echo $sql;
-
 
97
		}
70
	}
98
	}
71
?>
99
?>