コード例 #1
0
ファイル: class-rates.php プロジェクト: TrevorMW/wp-lrsgen
 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;
 }
コード例 #2
0
 public function filter_dashboard_dates()
 {
     $data = $_POST;
     $dash = new Dashboard();
     $resp = new ajax_response($data['action'], true);
     if ($data['dashboard_date_count'] != '') {
         $resp->set_status(true);
         $resp->set_data(array('dashboard_dates' => $dash->get_dashboard_data((int) $data['dashboard_date_count'])));
     }
     echo $resp->encode_response();
     die;
 }
コード例 #3
0
 public function user_login()
 {
     global $wpdb;
     $data = $_POST;
     $resp = new ajax_response($data['action'], true);
     $login_data['user_login'] = $wpdb->escape($data['user_name']);
     $login_data['user_password'] = $wpdb->escape($data['pass']);
     $user_verify = wp_signon($login_data, false);
     if (is_wp_error($user_verify)) {
         $resp->set_message('Incorrect Login credentials. Please try again.');
     } else {
         $resp->set_status(true);
         $resp->set_message('Login successful. Redirecting your now..');
         $resp->set_data(array('redirect_url' => '/dashboard'));
     }
     echo $resp->encode_response();
     die;
 }
コード例 #4
0
ファイル: class-hotel.php プロジェクト: TrevorMW/wp-lrsgen
 public function load_hotels_async()
 {
     $data = $_POST;
     $hotel = new Hotel();
     $resp = new ajax_response($data['action'], true);
     $resp->set_status(true);
     $resp->set_data(array('loadable_content' => $hotel->get_all_hotels($args)));
     echo $resp->encode_response();
     die;
 }