Subversion-Projekte lars-tiefland.ci

Revision

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

Revision 1832 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: 1832 $
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: Artikel_to_auspraegung_model.php 1832 2016-12-21 22:13:50Z lars $
17
 * @version $Id: Artikel_to_auspraegung_model.php 1836 2016-12-21 22:48:38Z lars $
18
 * @access public
18
 * @access public
19
 */
19
 */
20
class Artikel_to_auspraegung_model extends CI_Model
20
class Artikel_to_auspraegung_model extends CI_Model
21
{
21
{
Zeile 25... Zeile 25...
25
	 * @return
25
	 * @return
26
	 */
26
	 */
27
	public function __construct()
27
	public function __construct()
28
	{
28
	{
29
		parent::__construct();
29
		parent::__construct();
-
 
30
		$this->load->model('directory_to_auspraegung_model', 'directory_to_auspraegung');
30
		$this->load->model('auspraegung_model','auspraegung');
31
		$this->load->model('auspraegung_model', 'auspraegung');
31
	}
32
	}
Zeile 32... Zeile 33...
32
 
33
 
33
	/**
34
	/**
34
	 * Auspraegung_model::get_list()
35
	 * Auspraegung_model::get_list()
35
	 * 
36
	 * 
36
	 * @return
37
	 * @return
37
	 */
38
	 */
38
	public function get_list($artikel)
39
	public function get_list($artikel)
-
 
40
	{
-
 
41
		$sql = "SELECT
-
 
42
				father
-
 
43
			FROM
-
 
44
				artikel
-
 
45
			WHERE
-
 
46
				id=".$artikel."
-
 
47
		";
-
 
48
		$res = $this->db->query($sql);
-
 
49
		$row = $res->unbuffered_row('array');
39
	{
50
		$father = $row["father"];
40
		$sql = "SELECT DISTINCT
51
		$sql = "SELECT DISTINCT
41
				auspraegung AS id
52
				auspraegung AS id
42
			FROM
53
			FROM
43
				artikel_to_auspraegung
54
				artikel_to_auspraegung
Zeile 48... Zeile 59...
48
		$rows = array();
59
		$rows = array();
49
		while ($row = $res->unbuffered_row('array'))
60
		while ($row = $res->unbuffered_row('array'))
50
		{
61
		{
51
			$row = $this->auspraegung->get($row["id"]);
62
			$row = $this->auspraegung->get($row["id"]);
52
			$row["werte"] = $this->get_werte($row["id"], $artikel);
63
			$row["werte"] = $this->get_werte($row["id"], $artikel);
-
 
64
			$row["wertebereich"] = $this->directory_to_auspraegung->get_werte($row["id"], $father);
53
			$rows[$row["id"]] = $row;
65
			$rows[$row["id"]] = $row;
54
		}
66
		}
55
		return $rows;
67
		return $rows;
56
	}
68
	}