Subversion-Projekte lars-tiefland.ci

Revision

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

Revision 1711 Revision 1743
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
3
class Directory_model extends CI_Model
3
class Directory_model extends CI_Model
4
{
4
{
5
	public function get_list($dir=-1)
5
	public function __construct()
-
 
6
	{
-
 
7
		parent::__construct();
-
 
8
		$this->load->model('metatags_model', 'metatags');
-
 
9
	}
-
 
10
	public function get_list($dir = -1)
6
	{
11
	{
7
		$sql="SELECT
12
		$sql = "SELECT
8
				*
13
				*
9
			FROM
14
			FROM
10
				directory
15
				directory
11
			WHERE
16
			WHERE
Zeile 27... Zeile 32...
27
			WHERE
32
			WHERE
28
				id=".$id."
33
				id=".$id."
29
		";
34
		";
30
		$res = $this->db->query($sql);
35
		$res = $this->db->query($sql);
31
		$row = $res->unbuffered_row('array');
36
		$row = $res->unbuffered_row('array');
32
		$sql = "SELECT
-
 
33
				meta_content,
-
 
34
				meta_type
-
 
35
			FROM
-
 
36
				metatags
-
 
37
			WHERE
-
 
38
				table_foreign='directory'
-
 
39
			AND
-
 
40
				data_foreign=".$id."
-
 
41
		";
-
 
42
		$res = $this->db->query($sql);
-
 
43
		while ($metaRow = $res->unbuffered_row('array'))
-
 
44
		{
-
 
45
			$row[$metaRow["meta_type"]] = $metaRow["meta_content"];
37
		$row["metatags"] = $this->metatags->get($row["ID"], 'directory');
46
		}
-
 
47
		return $row;
38
		return $row;
48
	}
39
	}
Zeile 49... Zeile 40...
49
 
40
 
50
	public function save($daten)
41
	public function save($daten)
Zeile 62... Zeile 53...
62
		$sql .= "
53
		$sql .= "
63
			WHERE
54
			WHERE
64
				id=".$this->input->post('ID')."
55
				id=".$this->input->post('ID')."
65
		";
56
		";
66
		$res = $GLOBALS["order_db"]->query($sql);
57
		$res = $GLOBALS["order_db"]->query($sql);
67
		if($res)
58
		if ($res)
68
		{
59
		{
69
			echo "Daten wurden erfolgreich geändert!";
60
			echo "Daten wurden erfolgreich geändert!";
70
		}
61
		}
71
		else
62
		else
72
		{
63
		{