Subversion-Projekte lars-tiefland.ci

Revision

Revision 1699 | Revision 1737 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php

class Artikel extends CI_Controller
{
        public function __construct()
        {
                parent::__construct();
                $this->load->model('artikel_model', 'artikel');
                $this->load->model('herstellerkatalog_model', 'hersteller');
        }

        public function edit($id = null)
        {
                if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"])
                {
                        $artikelstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["status"]);
                        $this->smarty->assign('artikelstatus', $artikelstatus);
                }
                if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]) && $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"])
                {
                        $lieferstatus = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["Lieferstatus"]);
                        $this->smarty->assign('lieferstatus', $lieferstatus);
                }
                if (isset($GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]) &&
                        $GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"])
                {
                        $lieferstatusMaintainer = explode(";", $GLOBALS["web_rechte"]["online_shop"]["artikel"]["LieferstatusMaintainer"]);
                        $this->smarty->assign('lieferstatusMaintainer', $lieferstatusMaintainer);
                }
                $robots = array(
                        "index,follow",
                        "index,nofollow",
                        "noindex,follow",
                        "noindex,nofollow",
                        );
                $hersteller = $this->hersteller->get_list('dropdown');
                $daten = array();
                if ($id)
                {
                        $daten = $this->artikel->get($id);
                }
                $this->smarty->assign('robots', $robots);
                $this->smarty->assign('hersteller', $hersteller);
                $this->smarty->assign('daten', $daten);
                $this->smarty->view('artikel.tpl');
        }

        public function save()
        {
                $artikel = $this->input->post('artikel');
                $meta = $this->input->post('metatgs');
                $preise = $this->input->post('preise');
                $auispraegungen = $this->input->post('auspraegung');
                $optionen = $this->input->post('optionen');
                $this->artikel->save($artikel);
        }
}