<?php
/**
 * ホテル モデル
 */
class Hotel_model extends Model {
    
    public $hotelid = 0;
    public $hotel_name = '';
    public $postcode = '';
    public $prefecture = '';
    public $city = '';
    public $street = '';
    public $phone = '';
    public $email = '';
    public $url = '';
    public $res1_mail = '';
    public $res2_mail = '';
    public $res_cancel_mail = '';
    public $tentative_reservation = '';
    
    function Hotel_model()
    {
        parent::Model();
    }
    
    function load($hotelid)
    {
        // hotel情報をロードする。
        $this->db->where('hotelid', $hotelid);
        $query = $this->db->get('hotels', 1);
        if ($query->num_rows() > 0)
        {
            $data = $query->row_array();
            $this->hotelid = $data['hotelid'];
            $this->hotel_name = $data['hotel_name'];
            $this->postcode = $data['postcode'];
            $this->prefecture = $data['prefecture'];
            $this->city = $data['city'];
            $this->street = $data['street'];
            $this->phone = $data['phone'];
            $this->email = $data['email'];
            $this->url = $data['url'];
            $this->res1_mail = $data['res1_mail'];
            $this->res2_mail = $data['res2_mail'];
            $this->res_cancel_mail = $data['res_cancel_mail'];
            $this->tentative_reservation = $data['tentative_reservation'];
        }
    }
}
