Subversion-Projekte lars-tiefland.ci

Revision

Revision 528 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
58 lars 1
<?php
2
 
3
/**
4
 * @author Lars Tiefland
5
 * @copyright 2016
6
 */
7
 
519 lars 8
/**
9
 * Preise_model
10
 *
11
 * Liest alle Preise eines Artikels aus.
12
 *
527 lars 13
 * @package WebanOS CI
14
 * @author Lars Tiefland
15
 * @copyright 2016
16
 * @version $Id: Preise_model.php 528 2016-09-15 11:20:18Z lars $
519 lars 17
 * @access public
18
 */
58 lars 19
class Preise_model extends CI_Model
20
{
519 lars 21
	/**
22
	 * Preise_model::get_prices()
23
	 *
24
	 * git alle Preise eines Artikels zurück.
25
	 *
26
	 * @param mixed $artikel_id
27
	 * @return
28
	 */
58 lars 29
	public function get_prices($artikel_id)
30
	{
345 lars 31
		$preise = array();
58 lars 32
		$query = $this->db->get_where('preise', array(
33
			"artikel_id" => $artikel_id,
34
			"language" => "DE",
35
			));
36
		while ($row = $query->unbuffered_row('array'))
37
		{
59 lars 38
			$preise["preis".$row["preis_index"]] = $row["preis"];
58 lars 39
		}
40
		return $preise;
41
	}
519 lars 42
	/**
43
	 * Preise_model::get_single_price()
44
	 *
45
	 * Gibt nur den über $preis_index spezifizierten Preis zurück.
46
	 *
47
	 * @param mixed $artikel_id
48
	 * @param integer $preis_index
49
	 * @return
50
	 */
58 lars 51
	public function get_single_price($artikel_id,$preis_index=1)
52
	{
53
		$query = $this->db->get_where('preise', array(
54
			"artikel_id" => $artikel_id,
55
            "preis_index" => $preis_index,
56
			"language" => "DE",
57
			));
59 lars 58
            $preis = $query->result_array();
59
            return $preis["preis"];
58 lars 60
	}
61
 
62
}
63
 
64
?>