Subversion-Projekte lars-tiefland.ci

Revision

Revision 1207 | Revision 1209 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1137 lars 1
<?php
2
 
3
/**
4
 *
5
 * @package WebanOS CI
6
 * @author Lars Tiefland <ltiefland@gmail.com>
7
 * @copyright 2016
8
 * @version $Rev: 1208 $
9
 */
10
 
11
class Artikel_to_bestellung_model extends CI_Model
12
{
13
	public function __construct()
14
	{
15
		parent::__construct();
16
	}
17
 
18
	public function get($id)
19
	{
1208 lars 20
		$sql = "SELECT
1207 lars 21
				`database`
22
			FROM
23
				shops s
24
			JOIN
25
				Bestellung b
26
			ON
27
				s.id=b.shops_ID
28
		";
29
		$res = $GLOBALS['order_db']->query($sql);
30
		$row = $res->unbuffered_row('array');
31
		$database = $row['database'];
1137 lars 32
		$artikel = array();
33
		$sql = "SELECT
1207 lars 34
				ab.*,
35
				a.Father
1137 lars 36
			FROM
1207 lars 37
				artikel_to_Bestellung ab
38
			JOIN
39
				".$db.".artikel a
40
			ON
41
				a.id=ab.artikel
1137 lars 42
			WHERE
43
				bestellung = ".$id."
44
		";
45
		$res = $GLOBALS['order_db']->query($sql);
1144 lars 46
		while ($row = $res->unbuffered_row('array'))
1137 lars 47
		{
1144 lars 48
			$artikel[] = $row;
1137 lars 49
		}
50
		return $artikel;
51
	}
52
 
53
}
54
 
55
?>