Beispiel #1
0
    }
    /////////////////////////////////////////
    ///////////// AJAX METHODS  /////////////
    ///////////// ///////////////////////////
    public function load_rates_async()
    {
        $data = $_POST;
        $resp = new ajax_response($data['action'], true);
        $resp->set_status(true);
        $resp->set_data(array('loadable_content' => $this->get_all_rates()));
        echo $resp->encode_response();
        die;
    }
    public function update_rates()
    {
        $data = $_POST;
        $resp = new ajax_response($data['action'], true);
        if ($data['hotel_id'] != null) {
            $hotel = new Hotel((int) $data['hotel_id']);
            if ($hotel instanceof Hotel) {
                $result = $hotel->save_rate_data($data);
                $result ? $resp->set_status(true) : '';
            }
        }
        echo $resp->encode_response();
        die;
    }
}
$rates = new Rates();
$rates->init_actions();