Subversion-Projekte lars-tiefland.ci

Revision

Revision 1590 | Revision 1940 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1583 lars 1
<?php
2
 
3
/**
4
 * @author Lars Tiefland
5
 * @copyright 2016
6
 */
7
 
8
/**
9
 * Herstellerkatalog_model
10
 *
11
 * @package WebanOS CI
12
 * @author Lars Tiefland
13
 * @copyright 2016
14
 * @version $Id: Herstellerkatalog_model.php 1744 2016-12-02 22:30:43Z lars $
15
 * @access public
16
 */
17
class Herstellerkatalog_model extends CI_Model
18
{
19
	/**
20
	 * Herstellerkatalog_model::__construct()
21
	 *
22
	 * @return
23
	 */
24
	public function __construct()
25
	{
26
		parent::__construct();
1744 lars 27
		$this->load->model('metatags_model', 'metatags');
1583 lars 28
	}
29
 
30
	/**
31
	 * Herstellerkatalog_model::get_info()
32
	 *
33
	 * Infos zu einem Hersteller
34
	 *
35
	 * @param mixed $hId
36
	 * @return
37
	 */
38
	public function get_list($mode = 'list')
39
	{
1587 lars 40
		$result = array();
1583 lars 41
		switch ($mode)
42
		{
43
			case "list":
44
				$sql = "SELECT
45
						id,
46
						name
47
					FROM
48
						Herstellerkatalog
1589 lars 49
					ORDER BY
1590 lars 50
						name
1583 lars 51
				";
52
				$res = $this->db->query($sql);
53
				$result = $res->result_array();
1744 lars 54
				$result["metatags"] = $this->metatags->get($result["id"], 'Herstellerkatalog');
1583 lars 55
				break;
56
			case "dropdown":
1587 lars 57
				$result[0] = "--- Bitte wählen ---";
1583 lars 58
				$sql = "SELECT
59
						id,
60
						name
61
					FROM
62
						Herstellerkatalog
1589 lars 63
					ORDER BY
1590 lars 64
						name
1583 lars 65
				";
66
				$res = $this->db->query($sql);
67
				while ($row = $res->unbuffered_row('array'))
68
				{
69
					$result[$row["id"]] = $row["name"];
70
				}
71
				break;
72
		}
73
		return $result;
74
	}
75
}
76
 
77
?>