Subversion-Projekte lars-tiefland.ci

Revision

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

Revision 1813 Revision 1836
Zeile 3... Zeile 3...
3
/**
3
/**
4
 *
4
 *
5
 * @package WebanOS CI
5
 * @package WebanOS CI
6
 * @author Lars Tiefland <ltiefland@gmail.com> 
6
 * @author Lars Tiefland <ltiefland@gmail.com> 
7
 * @copyright 2016
7
 * @copyright 2016
8
 * @version $Rev: 1813 $
8
 * @version $Rev: 1836 $
9
 */
9
 */
Zeile 10... Zeile 10...
10
 
10
 
11
/**
11
/**
12
 * Auspraegung_model
12
 * Auspraegung_model
13
 * 
13
 * 
14
 * @package WebanOS CI
14
 * @package WebanOS CI
15
 * @author Lars Tiefland
15
 * @author Lars Tiefland
16
 * @copyright 2016
16
 * @copyright 2016
17
 * @version $Id: Directory_to_auspraegung_model.php 1813 2016-12-15 19:34:39Z lars $
17
 * @version $Id: Directory_to_auspraegung_model.php 1836 2016-12-21 22:48:38Z lars $
18
 * @access public
18
 * @access public
19
 */
19
 */
20
class Directory_to_auspraegung_model extends CI_Model
20
class Directory_to_auspraegung_model extends CI_Model
21
{
21
{
Zeile 34... Zeile 34...
34
	 * 
34
	 * 
35
	 * @return
35
	 * @return
36
	 */
36
	 */
37
	public function get_list($dir)
37
	public function get_list($dir)
38
	{
38
	{
39
		$sql = "SELECT
39
		$sql = "SELECT DISTINCT
40
				id
40
				auspraegung AS id
41
			FROM
41
			FROM
42
				directory_to_auspraegung
42
				directory_to_auspraegung
43
			WHERE
43
			WHERE
44
				directory_id=".$dir."
44
				directory_id=".$dir."
45
		";
45
		";
46
		$res = $this->db->query($sql);
46
		$res = $this->db->query($sql);
47
		$rows = array();
47
		$rows = array();
48
		while ($row = $res->unbuffered_row('array'))
48
		while ($row = $res->unbuffered_row('array'))
49
		{
49
		{
50
			$row = $this->get($row["id"]);
50
			$row = $this->get($row["id"]);
-
 
51
			$row["wertebereich"] = $this->get_werte($row["id"], $dir);
51
			$rows[] = $row;
52
			$rows[] = $row;
52
		}
53
		}
53
		return $rows;
54
		return $rows;
54
	}
55
	}
Zeile 55... Zeile -...
55
 
-
 
56
	/**
-
 
57
	 * Auspraegung_model::get()
-
 
58
	 * 
-
 
59
	 * @param mixed $id
-
 
60
	 * @return
-
 
61
	 */
56
 
62
	private function get($id)
57
	public function get($ausp)
63
	{
58
	{
64
		$sql = "SELECT
59
		$sql = "SELECT
65
				ata.*
60
				*
66
			FROM
-
 
67
				directory_to_auspraegung dta
-
 
68
			JOIN
61
			FROM
69
				auspraegung a
-
 
70
			ON
-
 
71
				a.id=dta.auspraegung
62
				auspraegung
72
			WHERE
63
			WHERE
73
				id=".$id."
64
				id=".$ausp."
74
		";
65
		";
75
		$res = $this->db->query($sql);
66
		$res = $this->db->query($sql);
76
		$row = $res->unbuffered_row($row);
67
		$row = $res->unbuffered_row('array');
77
		return $row;
68
		return $row;
-
 
69
	}
-
 
70
 
-
 
71
	/**
-
 
72
	 * Auspraegung_model::get()
-
 
73
	 * 
-
 
74
	 * @param mixed $id
-
 
75
	 * @return
-
 
76
	 */
-
 
77
	public function get_werte($id, $father)
-
 
78
	{
-
 
79
		$path = array_reverse(getPath($father));
-
 
80
		$werte = array();
-
 
81
		foreach ($path as $dir)
-
 
82
		{
-
 
83
			$directory = $dir["ID"];
-
 
84
			$sql = "SELECT
-
 
85
					dta.wertebereich
-
 
86
				FROM
-
 
87
					directory_to_auspraegung dta
-
 
88
				WHERE
-
 
89
					auspraegung=".$id."
-
 
90
				AND
-
 
91
					directory=".$directory."
-
 
92
			";
-
 
93
			$res = $this->db->query($sql);
-
 
94
			while ($row = $res->unbuffered_row('array'))
-
 
95
			{
-
 
96
				$werte[] = $row["wertebereich"];
-
 
97
			}
-
 
98
		}
-
 
99
		return $werte;
78
	}
100
	}
Zeile 79... Zeile 101...
79
}
101
}
80
 
102