Subversion-Projekte lars-tiefland.ci

Revision

Revision 1590 | Revision 1958 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php

/**
 * @author Lars Tiefland
 * @copyright 2016
 */

/**
 * Herstellerkatalog_model
 * 
 * @package WebanOS CI
 * @author Lars Tiefland
 * @copyright 2016
 * @version $Id: Herstellerkatalog_model.php 1744 2016-12-02 22:30:43Z lars $
 * @access public
 */
class Herstellerkatalog_model extends CI_Model
{
        /**
         * Herstellerkatalog_model::__construct()
         * 
         * @return
         */
        public function __construct()
        {
                parent::__construct();
                $this->load->model('metatags_model', 'metatags');
        }

        /**
         * Herstellerkatalog_model::get_info()
         * 
         * Infos zu einem Hersteller
         * 
         * @param mixed $hId
         * @return
         */
        public function get_list($mode = 'list')
        {
                $result = array();
                switch ($mode)
                {
                        case "list":
                                $sql = "SELECT
                                                id,
                                                name
                                        FROM
                                                Herstellerkatalog
                                        ORDER BY
                                                name
                                ";
                                $res = $this->db->query($sql);
                                $result = $res->result_array();
                                $result["metatags"] = $this->metatags->get($result["id"], 'Herstellerkatalog');
                                break;
                        case "dropdown":
                                $result[0] = "--- Bitte wählen ---";
                                $sql = "SELECT
                                                id,
                                                name
                                        FROM
                                                Herstellerkatalog
                                        ORDER BY
                                                name
                                ";
                                $res = $this->db->query($sql);
                                while ($row = $res->unbuffered_row('array'))
                                {
                                        $result[$row["id"]] = $row["name"];
                                }
                                break;
                }
                return $result;
        }
}

?>