Subversion-Projekte lars-tiefland.ci

Revision

Revision 1754 | Revision 1793 | 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');
828 lars 11
	}
1584 lars 12
 
13
	public function edit($id = null)
1577 lars 14
	{
1702 lars 15
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"])
16
		{
17
			$artikelstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]);
18
			$this->smarty->assign('artikelstatus', $artikelstatus);
19
		}
20
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"])
21
		{
22
			$lieferstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]);
23
			$this->smarty->assign('lieferstatus', $lieferstatus);
24
		}
25
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]) &&
26
			$GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"])
27
		{
28
			$lieferstatusMaintainer = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]);
29
			$this->smarty->assign('lieferstatusMaintainer', $lieferstatusMaintainer);
30
		}
1618 lars 31
		$robots = array(
32
			"index,follow",
33
			"index,nofollow",
34
			"noindex,follow",
35
			"noindex,nofollow",
36
			);
1588 lars 37
		$hersteller = $this->hersteller->get_list('dropdown');
1577 lars 38
		$daten = array();
1584 lars 39
		if ($id)
1577 lars 40
		{
41
			$daten = $this->artikel->get($id);
42
		}
1737 lars 43
		$preiseNamen = explode(";", ";".$GLOBALS["web_rechte"]["online_shop"]["artikel"]["preise"]);
44
		$this->smarty->assign('preisNamen', $preiseNamen);
1618 lars 45
		$this->smarty->assign('robots', $robots);
1586 lars 46
		$this->smarty->assign('hersteller', $hersteller);
1584 lars 47
		$this->smarty->assign('daten', $daten);
1577 lars 48
		$this->smarty->view('artikel.tpl');
49
	}
1673 lars 50
 
1754 lars 51
	public function del($id = null)
52
	{
53
		if ($id)
54
		{
55
			$daten = $this->artikel->get($id);
56
			$name = $daten["kurzbezeichnung"];
57
			$typ = "Artikel";
58
			$this->smarty->assign('name', $name);
59
			$this->smarty->assign('id', $id);
60
			$this->smarty->assign('typ', $typ);
61
			$this->smarty->view('del.tpl');
62
		}
63
		elseif ($this->input->post('id'))
64
		{
65
			$this->artikel->del($this->input->post('id'));
66
		}
67
	}
1763 lars 68
 
69
	public function reset_cache($id)
70
	{
71
		$res = $this->artikel->reset_cache($id);
72
	}
73
 
1673 lars 74
	public function save()
75
	{
76
		$artikel = $this->input->post('artikel');
77
		$this->artikel->save($artikel);
78
	}
1577 lars 79
}