<?php
/**
 * Roomtypes
 * @package     ci-hotel
 * @author      Teruki Hosokawa <hosotk@gmail.com>
 * @licence     New BSD Licence
 */
class Roomtypes extends MY_Controller {

    function Roomtypes()
    {
        parent::MY_Controller();
        $this->load->model('Common_model');
    }
    
    /**
     * 部屋タイプ一覧
     */
    public function index()
    {
        $this->load->helper(array('form', 'url'));
        //$this->db->order_by('ordering ASC');
        $query = $this->db->get('roomtypes');
        $data['roomtypes'] = $query->result_array();
        
        $data['title'] = "Roomtypes";
        $data['headline'] = "";
        $this->load->vars($data);
        
        $this->load->view('roomtypes/index');
    }
    
    /**
     * 部屋タイプ詳細
     */
    function detail($roomtypeid)
    {
        $this->load->helper(array('form', 'url'));
        
        $data['title'] = "Roomtypes";
        $data['headline'] = "";
        
        $this->db->where('roomtypeid', $roomtypeid);
        $query = $this->db->get('roomtypes', 1);
        if ($query->num_rows() > 0)
        {
            $row = $query->row_array();
            $data = $row;
            $this->load->vars($data);
        }
        
        $this->load->view('roomtypes/detail');
    }
}

/* End of file roomtypes.php */
