public function __construct() { parent::__construct(); add_meta_title('Booking'); $this->load->library('cart'); $this->load->model('m_user'); $this->load->model('m_page'); $this->load->model('m_promo'); $this->load->model('m_room'); $this->load->model('m_order'); }
public function index($id, $slug) { // Fetch the article $this->data['article'] = $this->Article_M->get_single_article($id); // Retrun 404 if not found count($this->data['article']) or show_404(uri_string()); // Redirect if slug was incorrect $request_slug = $this->uri->segment(3); $set_slug = $this->data['article']->slug; if ($request_slug != $set_slug) { redirect('articles/' . $this->data['article']->id . '/' . $this->data['article']->slug, 'location', '301'); } // Load view add_meta_title(e($this->data['article']->title)); $this->data['subview'] = 'article'; $this->load->view('site/_main_layout', $this->data); }
public function detail($lang, $id, $slug) { $service = $this->service_m->get($id); //Return 404 if not found count($service) || show(uri_string()); //Redirect if slug was incorrect $requested_slug = $this->uri->segment(4); $set_slug = $service->slug; if ($requested_slug != $set_slug) { redirect('service/' . $service->id . '/' . $service->slug, 'location', '301'); } //Load the view $this->data['service'] = $this->service_m->get_excerpt($service); add_meta_title($this->data['service']["name"]); $this->data['subview'] = 'service/detail'; $this->load->view('_main_layout', $this->data); }
public function index() { // Fetch the page template $this->data['page'] = $this->page_m->get_by(['slug' => (string) $this->uri->segment(1)], TRUE); count($this->data['page']) || show_404(current_url()); add_meta_title($this->data['page']->title); // Fetch the page data $method = '_' . $this->data['page']->template; if (method_exists($this, $method)) { $this->{$method}(); } else { log_message('error', 'Could not load template ' . $method . ' in file ' . __FILE__ . ' at line ' . __LINE__); show_error('Could not load template ' . $method); } // Load the view $this->data['subview'] = $this->data['page']->template; $this->load->view('_main_layout', $this->data); }
public function index($id, $slug) { /* Fetch the article */ $this->article_m->set_published(); $this->data['article'] = $this->article_m->get($id); /* Return 404 if not found */ count($this->data['article']) || show_404(uri_string()); /* Redirect if slug was incorrect */ $requested_slug = $this->uri->segment(3); $set_slug = $this->data['article']->slug; if ($requested_slug != $set_slug) { redirect('article/' . $this->data['article']->id . '/' . $this->data['article']->slug, 'location', '301'); } /* Load view */ add_meta_title($this->data['article']->title); $this->data['subview'] = 'article'; $this->load->view('_main_layout', $this->data); }
public function index($id, $slug) { //Fetch all locations //$this->location_m->set_published(); $this->data['location'] = $this->location_m->get_with_join($id, TRUE); add_meta_title($this->data['location']->title); //Return 404 if not found count($this->data['location']) || show_404(uri_string()); //redirect if slug incorrect $requested_slug = $this->uri->segment(3); $set_slug = $this->data['location']->slug; if ($requested_slug != $set_slug) { redirect('location/' . $this->data['location']->id . '/' . $this->data['location']->slug, 'location', '301'); } //Load the locations view $this->data['subview'] = 'location'; // $this->data['subview'] = $this->data['page']->template; $this->load->view('_layout_main', $this->data); }
public function contact() { // Fetch page template $this->data['page'] = $this->page_m->get_by(array('slug' => (string) $this->uri->segment(2)), TRUE); count($this->data['page']) || show_404(); $this->data['page'] = $this->page_m->divide($this->data['page']); add_meta_title($this->data['page']["title"]); $rules = $this->message_m->rules; $this->form_validation->set_rules($rules); //Process the form if ($this->form_validation->run() == TRUE) { $data = $this->message_m->array_from_post(array('email', 'name', 'body')); $this->message_m->save($data); $this->session->set_flashdata('msg', 1); redirect('contact'); } // Load the view $this->data['subview'] = 'home/contact'; $this->load->view('_main_layout', $this->data); }
public function index() { $this->data['page'] = $this->m_page->get_by(array('slug' => (string) $this->uri->segment(1)), TRUE); if (!empty($this->data['page'])) { add_meta_title($this->data['page']->title); $method = '_' . $this->data['page']->template; if (method_exists($this, $method)) { $this->{$method}(); } else { log_message('error', 'Tidak dpt meload template ' . $method . ' di file ' . __FILE__ . ' baris ' . __LINE__); show_error('Tidak dapat meload template ' . $method); } // // // Load the view $this->data['content'] = 'templates/' . $this->data['page']->template; $this->load->view($this->template, $this->data); } else { $this->data['content'] = 'templates/404'; $this->load->view($this->template, $this->data); } }
public function index($id = NULL) { // dump($this->uri->segment(1)); // $this->data['articles']=$this->article_m->get(); $this->data['page'] = $this->page_m->get_by(array('slug' => (string) $this->uri->segment(1)), TRUE); $this->load->library('shortcodes'); $this->data['page']->body = $this->shortcodes->parse($this->data['page']->body); count($this->data['page']) || show_404(current_url()); add_meta_title($this->data['page']->title); // echo '<pre>' . $this->db->last_query() . '</pre>'; $method = '_' . $this->data['page']->template; if (method_exists($this, $method)) { $this->{$method}($id); } else { log_message('error', 'Could not load template ' . $method . ' in file ' . __FILE__ . ' at line ' . __LINE__ . PHP_EOL); show_error('Could not load template ' . $method); } // Load View $this->data['subview'] = $this->data['page']->template; $this->load->view('_layout_main', $this->data); }