Subversion-Projekte lars-tiefland.ci

Revision

Revision 2090 | Revision 2224 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 2090 Revision 2176
Zeile 7... Zeile 7...
7
		parent::__construct();
7
		parent::__construct();
8
		$this->load->model('artikel_model', 'artikel');
8
		$this->load->model('artikel_model', 'artikel');
9
		$this->load->model('herstellerkatalog_model', 'hersteller');
9
		$this->load->model('herstellerkatalog_model', 'hersteller');
10
		$this->load->model('preise_model', 'preise');
10
		$this->load->model('preise_model', 'preise');
11
		$this->load->model('medien_model', 'medien');
11
		$this->load->model('medien_model', 'medien');
12
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"])
12
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]) {
13
		{
-
 
14
			$artikelstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]);
13
			$artikelstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]);
15
			$this->smarty->assign('artikelstatus', $artikelstatus);
14
			$this->smarty->assign('artikelstatus', $artikelstatus);
16
		}
15
		}
17
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"])
16
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]) {
18
		{
-
 
19
			$lieferstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]);
17
			$lieferstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]);
20
			$this->smarty->assign('lieferstatus', $lieferstatus);
18
			$this->smarty->assign('lieferstatus', $lieferstatus);
21
		}
19
		}
22
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]) &&
20
		if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]) &&
23
			$GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"])
21
			$GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]) {
24
		{
-
 
25
			$lieferstatusMaintainer = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]);
22
			$lieferstatusMaintainer = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]);
26
			$this->smarty->assign('lieferstatusMaintainer', $lieferstatusMaintainer);
23
			$this->smarty->assign('lieferstatusMaintainer', $lieferstatusMaintainer);
27
		}
24
		}
28
		$robots = array(
25
		$robots = array(
29
			"index,follow",
26
			"index,follow",
30
			"index,nofollow",
27
			"index,nofollow",
31
			"noindex,follow",
28
			"noindex,follow",
32
			"noindex,nofollow",
29
			"noindex,nofollow",
33
			);
30
			);
34
		$hersteller = $this->hersteller->get_list('dropdown');
31
		$hersteller = $this->hersteller->get_list('dropdown');
35
		$preiseNamen = explode(";", ";".$GLOBALS["web_rechte"]["online_shop"]["artikel"]["preise"]);
32
		$preiseNamen = explode(";", ";" . $GLOBALS["web_rechte"]["online_shop"]["artikel"]["preise"]);
36
		$this->smarty->assign('preisNamen', $preiseNamen);
33
		$this->smarty->assign('preisNamen', $preiseNamen);
37
		$this->smarty->assign('robots', $robots);
34
		$this->smarty->assign('robots', $robots);
38
		$this->smarty->assign('hersteller', $hersteller);
35
		$this->smarty->assign('hersteller', $hersteller);
39
	}
36
	}
Zeile 45... Zeile 42...
45
		$this->smarty->view('artikel.tpl');
42
		$this->smarty->view('artikel.tpl');
46
	}
43
	}
47
	public function edit($id = null)
44
	public function edit($id = null)
48
	{
45
	{
49
		$daten = array();
46
		$daten = array();
50
		if ($id)
47
		if ($id) {
51
		{
-
 
52
			$daten = $this->artikel->get($id);
48
			$daten = $this->artikel->get($id);
53
		}
49
		}
54
		$this->smarty->assign('daten', $daten);
50
		$this->smarty->assign('daten', $daten);
55
		$this->smarty->view('artikel.tpl');
51
		$this->smarty->view('artikel.tpl');
56
	}
52
	}
Zeile 57... Zeile 53...
57
 
53
 
58
	public function medien($id)
54
	public function medien($id)
59
	{
55
	{
-
 
56
		$medien = $this->medien->get_artikel_medien($id);
60
		$medien = $this->medien->get_artikel_medien($id);
57
		$this->smarty->assign("artikelId", $id);
61
		$this->smarty->assign('medien', $medien);
58
		$this->smarty->assign('medien', $medien);
62
		$this->smarty->view('medien.tpl');
59
		$this->smarty->view('medien.tpl');
Zeile 63... Zeile 60...
63
	}
60
	}
64
 
61
 
65
	public function del($id = null)
62
	public function del($id = null)
66
	{
-
 
67
		if ($id)
63
	{
68
		{
64
		if ($id) {
69
			$daten = $this->artikel->get($id);
65
			$daten = $this->artikel->get($id);
70
			$name = $daten["kurzbezeichnung"];
66
			$name = $daten["kurzbezeichnung"];
71
			$typ = "Artikel";
67
			$typ = "Artikel";
72
			$this->smarty->assign('name', $name);
68
			$this->smarty->assign('name', $name);
73
			$this->smarty->assign('id', $id);
69
			$this->smarty->assign('id', $id);
74
			$this->smarty->assign('typ', $typ);
-
 
75
			$this->smarty->view('del.tpl');
70
			$this->smarty->assign('typ', $typ);
76
		}
-
 
77
		elseif ($this->input->post('id'))
71
			$this->smarty->view('del.tpl');
78
		{
72
		} elseif ($this->input->post('id')) {
79
			$this->artikel->del($this->input->post('id'));
73
			$this->artikel->del($this->input->post('id'));
Zeile 80... Zeile 74...
80
		}
74
		}
Zeile 85... Zeile 79...
85
		$res = $this->artikel->reset_cache($id);
79
		$res = $this->artikel->reset_cache($id);
86
	}
80
	}
Zeile 87... Zeile 81...
87
 
81
 
88
	public function save()
82
	public function save()
89
	{
83
	{
90
		if ($this->form_validation->run() !== false)
-
 
91
		{
84
		if ($this->form_validation->run() !== false) {
92
			$artikel = $this->input->post('artikel');
85
			$artikel = $this->input->post('artikel');
93
			$this->artikel->save($artikel);
-
 
94
		}
86
			$this->artikel->save($artikel);
95
		else
-
 
96
		{
87
		} else {
97
			echo validation_errors();
88
			echo validation_errors();
98
		}
89
		}
99
	}
90
	}