Subversion-Projekte lars-tiefland.ci

Revision

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

Revision Autor Zeilennr. Zeile
1939 lars 1
<?php
2
 
3
class Herstellerkatalog extends CI_Controller
4
{
5
	public function __construct()
6
	{
7
		parent::__construct();
1957 lars 8
		$this->load->model('herstellerkatalog_model', 'herstellerkatalog');
1962 lars 9
		$robots = array(
10
			"index,follow",
11
			"index,nofollow",
12
			"noindex,follow",
13
			"noindex,nofollow",
14
			);
15
		$this->smarty->assign('robots', $robots);
1939 lars 16
	}
1957 lars 17
 
1939 lars 18
	public function index()
19
	{
20
		$hersteller = $this->herstellerkatalog->get_list();
1957 lars 21
		$this->smarty->assign('title', 'Herstellerliste');
22
		$this->smarty->assign('hersteller', $hersteller);
1939 lars 23
		$this->smarty->view('herstellerkatalog.tpl');
24
	}
1957 lars 25
	public function edit($id = null)
1939 lars 26
	{
1957 lars 27
		$hst = array();
28
		if ($id)
29
		{
30
			$hst = $this->herstellerkatalog->get($id);
31
		}
32
		$this->smarty->assign('daten', $hst);
33
		$this->smarty->view('single_hersteller.tpl');
1939 lars 34
	}
1968 lars 35
 
36
	public function save()
37
	{
38
		$daten = $this->input->post('herstellerkatalog');
39
		$this->herstellerkatalog->save($daten);
40
	}
41
 
42
	public function del($id = null)
43
	{
44
		if ($id)
45
		{
46
			$daten = $this->hertellerkatalog->get($id);
47
			$name = $daten["Name"];
48
			$typ = "Hersteller";
49
			$this->smarty->assign('name', $name);
50
			$this->smarty->assign('id', $id);
51
			$this->smarty->assign('typ', $typ);
52
			$this->smarty->view('del.tpl');
53
		}
54
		elseif ($this->input->post('id'))
55
		{
56
			$this->herstellerkatalog->del($this->input->post('id'));
57
		}
58
	}
59
 
1939 lars 60
}