Subversion-Projekte lars-tiefland.ci

Revision

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

Revision 1850 Revision 1871
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: 1850 $
8
 * @version $Rev: 1871 $
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 1850 2016-12-22 14:10:23Z lars $
17
 * @version $Id: Directory_to_auspraegung_model.php 1871 2016-12-22 16:39:37Z 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 46... Zeile 46...
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
			$row["wertebereich"] = $this->get_werte($row["id"], $dir, false);
52
			$rows[] = $row;
52
			$rows[] = $row;
53
		}
53
		}
54
		return $rows;
54
		return $rows;
55
	}
55
	}
Zeile 72... Zeile 72...
72
	 * Auspraegung_model::get()
72
	 * Auspraegung_model::get()
73
	 * 
73
	 * 
74
	 * @param mixed $id
74
	 * @param mixed $id
75
	 * @return
75
	 * @return
76
	 */
76
	 */
77
	public function get_werte($id, $father)
77
	public function get_werte($id, $father, $vererbung = true)
78
	{
78
	{
-
 
79
		if ($vererbung === true)
-
 
80
		{
79
		$path = array_reverse(getPath($father, true));
81
			$path = array_reverse(getPath($father, true));
80
		$werte = array();
82
			$werte = array();
81
		foreach ($path as $dir)
83
			foreach ($path as $dir)
-
 
84
			{
-
 
85
				$directory = $dir["ID"];
-
 
86
				$sql = "SELECT
-
 
87
						dta.wertebereich
-
 
88
					FROM
-
 
89
						directory_to_auspraegung dta
-
 
90
					WHERE
-
 
91
						auspraegung=".$id."
-
 
92
					AND
-
 
93
						directory=".$directory."
-
 
94
				";
-
 
95
				$res = $this->db->query($sql);
-
 
96
				while ($row = $res->unbuffered_row('array'))
-
 
97
				{
-
 
98
					$werte[$row["wertebereich"]] = $row["wertebereich"];
-
 
99
				}
-
 
100
			}
-
 
101
		}
-
 
102
		else
82
		{
103
		{
83
			$directory = $dir["ID"];
-
 
84
			$sql = "SELECT
104
			$sql = "SELECT
85
					dta.wertebereich
105
					dta.wertebereich
86
				FROM
106
				FROM
87
					directory_to_auspraegung dta
107
					directory_to_auspraegung dta
88
				WHERE
108
				WHERE
89
					auspraegung=".$id."
109
					auspraegung=".$id."
90
				AND
110
				AND
91
					directory=".$directory."
111
					directory=".$father."
92
			";
112
			";
93
			$res = $this->db->query($sql);
113
			$res = $this->db->query($sql);
94
			while ($row = $res->unbuffered_row('array'))
114
			while ($row = $res->unbuffered_row('array'))
95
			{
115
			{
96
				$werte[$row["wertebereich"]] = $row["wertebereich"];
116
				$werte[$row["wertebereich"]] = $row["wertebereich"];