Subversion-Projekte lars-tiefland.ci

Revision

Revision 1583 | Revision 1589 | 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 1587 2016-11-19 20:49:59Z 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();
27
	}
28
 
29
	/**
30
	 * Herstellerkatalog_model::get_info()
31
	 *
32
	 * Infos zu einem Hersteller
33
	 *
34
	 * @param mixed $hId
35
	 * @return
36
	 */
37
	public function get_list($mode = 'list')
38
	{
1587 lars 39
		$result = array();
1583 lars 40
		switch ($mode)
41
		{
42
			case "list":
43
				$sql = "SELECT
44
						id,
45
						name
46
					FROM
47
						Herstellerkatalog
48
				";
49
				$res = $this->db->query($sql);
50
				$result = $res->result_array();
51
				break;
52
			case "dropdown":
1587 lars 53
				$result[0] = "--- Bitte wählen ---";
1583 lars 54
				$sql = "SELECT
55
						id,
56
						name
57
					FROM
58
						Herstellerkatalog
59
				";
60
				$res = $this->db->query($sql);
61
				while ($row = $res->unbuffered_row('array'))
62
				{
63
					$result[$row["id"]] = $row["name"];
64
				}
65
				break;
66
		}
67
		return $result;
68
	}
69
}
70
 
71
?>