Subversion-Projekte lars-tiefland.medien

Revision

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

Revision 98 Revision 101
Zeile 7... Zeile 7...
7
		function __construct($id=0)
7
		function __construct($id=0)
8
		{
8
		{
9
			global $db, $prefix, $common;
9
			global $db, $prefix, $common;
10
			if ($id)
10
			if ($id)
11
			{
11
			{
12
				$sql="SELECT * FROM $prefix"."genres WHERE g_id=$id";
12
				$sql="SELECT * FROM $prefix"."dvd_genres WHERE g_id=$id";
13
				$res=$db->query($sql);
13
				$res=$db->query($sql);
14
				$row=$res->fetchRow();
14
				$row=$res->fetchRow();
15
				$this->id=$id;
15
				$this->id=$id;
16
				$this->name=stripslashes(($row["g_id"]!=1)?$row["g_name"]:$common["various"]);
16
				$this->name=stripslashes(($row["g_id"]!=1)?$row["g_name"]:$common["various"]);
17
			}
17
			}
Zeile 36... Zeile 36...
36
		{
36
		{
37
			global $db, $prefix;
37
			global $db, $prefix;
38
			switch ($mode)
38
			switch ($mode)
39
			{
39
			{
40
				case "save":
40
				case "save":
41
					$sql="INSERT INTO $prefix"."genres (g_name) VALUES ('$this->name')";
41
					$sql="INSERT INTO $prefix"."dvd_genres (g_name) VALUES ('$this->name')";
42
					break;
42
					break;
43
				case "update":
43
				case "update":
44
					$sql="UPDATE $prefix"."genres SET g_name='$this->name' WHERE g_id=$this->id";
44
					$sql="UPDATE $prefix"."dvd_genres SET g_name='$this->name' WHERE g_id=$this->id";
45
					break;
45
					break;
46
				case "del":
46
				case "del":
47
					break;
47
					break;
48
			}
48
			}
49
			return $db->query($sql);
49
			return $db->query($sql);
50
		}
50
		}
Zeile 51... Zeile 51...
51
 
51
 
52
		function Liste($start=0,$anz=0)
52
		function Liste($start=0,$anz=0)
53
		{
53
		{
54
			global $db, $prefix, $common;
54
			global $db, $prefix, $common;
55
			$sql="SELECT * FROM $prefix"."genres";
55
			$sql="SELECT * FROM $prefix"."dvd_genres";
56
			if ($anz > 0)
56
			if ($anz > 0)
57
			{
57
			{
58
				$res=$db->limitquery($sql,$start,$anz);
58
				$res=$db->limitquery($sql,$start,$anz);
59
				$id=0;
59
				$id=0;
Zeile 74... Zeile 74...
74
		}
74
		}
Zeile 75... Zeile 75...
75
 
75
 
76
		function getGenres()
76
		function getGenres()
77
		{
77
		{
78
			global $db, $prefix, $common;
78
			global $db, $prefix, $common;
79
			$sql="SELECT * FROM $prefix"."genres ORDER by g_name";
79
			$sql="SELECT * FROM $prefix"."dvd_genres ORDER by g_name";
80
			$res=$db->query($sql);
80
			$res=$db->query($sql);
81
			$ret["-1"]=$common["please_select"];
81
			$ret["-1"]=$common["please_select"];
82
			while ($row=$res->fetchRow())
82
			while ($row=$res->fetchRow())
83
			{
83
			{