<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Hotels extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
	
$data["oteller"]=$this->db->get("hotels")->result();
		$this->lang->load('information',$this->session->userdata('site_lang'));
		$this->load->view('otel_listesi',isset($data) ? $data : NULL);
	}


	public function detay($seo=NULL)
	{
$this->db->where("seo",$seo);
$otel=$data["otel_detay"]=$this->db->get("hotels")->row();
if(count($otel)==0){
	redirect("/hotels");
}

$this->db->where("hotel_id",$otel->Id);
$this->db->where("lang",Genel::site_dili());
$this->db->order_by("siralama","ASC");
$sonuc=$data["otel_bilgi"]=$this->db->get("hotels_info")->result();




$this->db->where("hotel_id",$otel->Id);

$data["otel_galeri"]=$this->db->get("hotels_gallery")->result();

		$this->lang->load('information',$this->session->userdata('site_lang'));
		$this->load->view('otel_detay',isset($data) ? $data : NULL);
	}

}
