Subversion-Projekte lars-tiefland.ci

Revision

Revision 1763 | Revision 1899 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
898 lars 1
<?php
1577 lars 2
 
3
class Artikel extends CI_Controller
4
{
5
	public function __construct()
828 lars 6
	{
1577 lars 7
		parent::__construct();
8
		$this->load->model('artikel_model', 'artikel');
1584 lars 9
		$this->load->model('herstellerkatalog_model', 'hersteller');
1739 lars 10
		$this->load->model('preise_model', 'preise');
1702 lars 11
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"])
12
		{
13
			$artikelstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]);
14
			$this->smarty->assign('artikelstatus', $artikelstatus);
15
		}
16
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"])
17
		{
18
			$lieferstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]);
19
			$this->smarty->assign('lieferstatus', $lieferstatus);
20
		}
21
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]) &&
22
			$GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"])
23
		{
24
			$lieferstatusMaintainer = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]);
25
			$this->smarty->assign('lieferstatusMaintainer', $lieferstatusMaintainer);
26
		}
1618 lars 27
		$robots = array(
28
			"index,follow",
29
			"index,nofollow",
30
			"noindex,follow",
31
			"noindex,nofollow",
32
			);
1588 lars 33
		$hersteller = $this->hersteller->get_list('dropdown');
1793 lars 34
		$preiseNamen = explode(";", ";".$GLOBALS["web_rechte"]["online_shop"]["artikel"]["preise"]);
35
		$this->smarty->assign('preisNamen', $preiseNamen);
36
		$this->smarty->assign('robots', $robots);
37
		$this->smarty->assign('hersteller', $hersteller);
38
	}
39
 
40
	public function create($father)
41
	{
42
		$daten=array("Father"=>$father,);
43
		$this->smarty->assign('daten', $daten);
44
		$this->smarty->view('artikel.tpl');
45
	}
46
	public function edit($id = null)
47
	{
1577 lars 48
		$daten = array();
1584 lars 49
		if ($id)
1577 lars 50
		{
51
			$daten = $this->artikel->get($id);
52
		}
1584 lars 53
		$this->smarty->assign('daten', $daten);
1577 lars 54
		$this->smarty->view('artikel.tpl');
55
	}
1673 lars 56
 
1754 lars 57
	public function del($id = null)
58
	{
59
		if ($id)
60
		{
61
			$daten = $this->artikel->get($id);
62
			$name = $daten["kurzbezeichnung"];
63
			$typ = "Artikel";
64
			$this->smarty->assign('name', $name);
65
			$this->smarty->assign('id', $id);
66
			$this->smarty->assign('typ', $typ);
67
			$this->smarty->view('del.tpl');
68
		}
69
		elseif ($this->input->post('id'))
70
		{
71
			$this->artikel->del($this->input->post('id'));
72
		}
73
	}
1763 lars 74
 
75
	public function reset_cache($id)
76
	{
77
		$res = $this->artikel->reset_cache($id);
78
	}
79
 
1673 lars 80
	public function save()
81
	{
82
		$artikel = $this->input->post('artikel');
83
		$this->artikel->save($artikel);
84
	}
1577 lars 85
}