Revision 94 | Revision 118 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?php/*** @author Lars Tiefland* @copyright 2016*/class Category_model extends CI_Model{public function __construct(){parent::__construct();$this->load->model('artikel_model', 'artikel');$this->load->model('alias_model', 'alias');$this->load->model('preise_model', 'preise');}public function get_dir_items($father){if (is_numeric($father) && $father > 0){$link = $this->get_link($father);header("Location: ".$link);}elseif (!is_numeric($father)){$query = $this->db->get_where('alias', array("alias" => $father.'.html',"type_id" => 2,));$row = $query->row_array();$father = $row["id"];}$dir_info["items"] = $this->artikel->list_artikel($father);$dir_info["subdirs"] = $this->list_directory($father);$dir_info["medien"] = $this->medien->get_category_medien($father);return $dir_info;}public function list_directory($father){$subdirs = array();$query = $this->db->get_where('directory', array("father" => $father,"language" => "DE","status" => 0,));while ($row = $query->unbuffered_row('array')){$row["dirLink"] = $this->get_link($row["ID"]);$subdirs[] = $row;}return $subdirs;}public function get_dir($id){if (is_numeric($id)){$link = $this->get_link($id);header("Location: ".$link);}else{$query = $this->db->get_where('alias', array("alias" => $id.'.html',"type_id" => 2,));$row = $query->row_array();$id = $row["id"];$query = $this->db->get_where('directory', array('id' => $id,"language" => "DE",));$row = $query->row_array();return $row;}}private function get_link($id){$link = $this->alias->get_link($id, 2);return "/category/view/".$link;}}?>