Subversion-Projekte lars-tiefland.ci

Revision

Revision 1587 | Revision 1590 | 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 1589 2016-11-19 20:51:29Z 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
1589 lars 48
					ORDER BY
49
						id
1583 lars 50
				";
51
				$res = $this->db->query($sql);
52
				$result = $res->result_array();
53
				break;
54
			case "dropdown":
1587 lars 55
				$result[0] = "--- Bitte wählen ---";
1583 lars 56
				$sql = "SELECT
57
						id,
58
						name
59
					FROM
60
						Herstellerkatalog
1589 lars 61
					ORDER BY
62
						id
1583 lars 63
				";
64
				$res = $this->db->query($sql);
65
				while ($row = $res->unbuffered_row('array'))
66
				{
67
					$result[$row["id"]] = $row["name"];
68
				}
69
				break;
70
		}
71
		return $result;
72
	}
73
}
74
 
75
?>