Subversion-Projekte lars-tiefland.em_wm

Revision

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

Revision 30 Revision 31
Zeile 8... Zeile 8...
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_type;
12
		var $g_type;
13
 
13
		
14
		function __construct($g_id)
14
		function __construct($g_id)
15
		{
15
		{
16
			global $db, $db_meld, $error, $meld, $user;
16
			global $db, $db_meld, $error, $meld, $user;
17
			$sql="SELECT * FROM games WHERE g_id=$g_id";
17
			$sql="SELECT * FROM games WHERE g_id=$g_id";
18
			$res=$db->query($sql);
18
			$res=$db->query($sql);
Zeile 35... Zeile 35...
35
				$this->g_location=$row["g_location"];
35
				$this->g_location=$row["g_location"];
36
				$this->g_date=$row["g_date"];
36
				$this->g_date=$row["g_date"];
37
				$this->g_type=$row["g_type"];
37
				$this->g_type=$row["g_type"];
38
				return $this;
38
				return $this;
39
			}
39
			}
40
  		}
40
		}
41
 
41
		
42
		function Spiele($g_id)
42
		function Spiele($g_id)
43
		{
43
		{
44
			$this->__construct($g_id);
44
			$this->__construct($g_id);
45
		}
45
		}
46
 
-
 
47
		function ListSpiele($limit, $start=0)
-
 
48
		{
-
 
49
			global $db, $db_meld, $error, $meld, $user;
-
 
50
			$sql="SELECT * FROM games";
-
 
51
//			echo $db->provides('limit');
-
 
52
			if ($db->provides('limit') && $limit > 0)
-
 
53
			{
-
 
54
				$res=$db->limitquery($sql, $start, $limit);
-
 
55
			}
-
 
56
			else
-
 
57
			{
-
 
58
				$res=$db->query($sql);
-
 
59
			}
-
 
60
			if (true == DB::isError($res))
-
 
61
			{
-
 
62
				$error=true;
-
 
63
				$meld="Ein Fehler ist aufgetreten!";
-
 
64
				$db_meld=$res->getUserInfo();
-
 
65
			}
-
 
66
			return $res;
-
 
67
		}
-
 
Zeile 68... Zeile 46...
68
		
46
		
69
		function update($g_name, $g_m1, $g_m2, $g_g1, $g_g2, $g_location, $g_date, $g_type)
47
		function update($g_name, $g_m1, $g_m2, $g_g1, $g_g2, $g_location, $g_date, $g_type)
70
		{
48
		{
71
			$this->g_name=addslashes($g_name);
49
			$this->g_name=$g_name;
72
			$this->g_m1=intval($g_m1);
50
			$this->g_m1=$g_m1;
73
			$this->g_m2=intval($g_m2);
51
			$this->g_m2=$g_m2;
74
			$this->g_g1=intval($g_g1);
52
			$this->g_g1=$g_g1;
75
			$this->g_g2=intval($g_g2);
53
			$this->g_g2=$g_g2;
76
			$this->g_location=intval($g_location);
54
			$this->g_location=$g_location;
77
			$this->g_date=intval($g_date);
55
			$this->g_date=$g_date;
78
			$this->g_type=intval($g_type);
56
			$this->g_type=$g_type;
79
		}
57
		}
80
		function save($op)
58
		function save($op)
81
		{
59
		{
82
			global $db;
60
			global $db;
Zeile 93... Zeile 71...
93
					$sql="DELETE FROM games WHERE g_id=$this->g_id";
71
					$sql="DELETE FROM games WHERE g_id=$this->g_id";
94
					break;
72
					break;
95
			}
73
			}
96
			return $db->query($sql);
74
			return $db->query($sql);
97
		}
75
		}
-
 
76
		
-
 
77
		function ListSpiele($limit, $start=0)
-
 
78
		{
-
 
79
			global $db, $db_meld, $error, $meld, $user;
-
 
80
			$sql="SELECT * FROM games";
-
 
81
			if ($db->provides('limit') && $limit > 0)
-
 
82
			{
-
 
83
				$res=$db->limitquery($sql, $start, $limit);
-
 
84
			}
-
 
85
			else
-
 
86
			{
-
 
87
				$res=$db->query($sql);
-
 
88
			}
-
 
89
			if (true == DB::isError($res))
-
 
90
			{
-
 
91
				$error=true;
-
 
92
				$meld="Ein Fehler ist aufgetreten!";
-
 
93
				$db_meld=$res->getUserInfo();
-
 
94
			}
-
 
95
			return $res;
-
 
96
		}
98
	}
97
	}
99
?>
98
?>