Subversion-Projekte lars-tiefland.ci

Revision

Revision 1968 | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php

class Herstellerkatalog extends CI_Controller
{
        public function __construct()
        {
                parent::__construct();
                $this->load->model('herstellerkatalog_model', 'herstellerkatalog');
                $robots = array(
                        "index,follow",
                        "index,nofollow",
                        "noindex,follow",
                        "noindex,nofollow",
                        );
                $this->smarty->assign('robots', $robots);
        }

        public function index()
        {
                $hersteller = $this->herstellerkatalog->get_list();
                $this->smarty->assign('title', 'Herstellerliste');
                $this->smarty->assign('hersteller', $hersteller);
                $this->smarty->view('herstellerkatalog.tpl');
        }
        public function edit($id = null)
        {
                $hst = array();
                if ($id)
                {
                        $hst = $this->herstellerkatalog->get($id);
                }
                $this->smarty->assign('daten', $hst);
                $this->smarty->view('single_hersteller.tpl');
        }

        public function save()
        {
                $daten = $this->input->post('herstellerkatalog');
                $this->herstellerkatalog->save($daten);
        }

        public function del($id = null)
        {
                if ($id)
                {
                        $daten = $this->herstellerkatalog->get($id);
                        $name = $daten["Name"];
                        $typ = "Hersteller";
                        $this->smarty->assign('name', $name);
                        $this->smarty->assign('id', $id);
                        $this->smarty->assign('typ', $typ);
                        $this->smarty->view('del.tpl');
                }
                elseif ($this->input->post('id'))
                {
                        $this->herstellerkatalog->del($this->input->post('id'));
                }
        }

}