Example #1
0
 public function index()
 {
     extract($this->input->get());
     $this->form_validation->set_error_delimiters('<p>', '</p>');
     if ($this->input->post('book_it_button')) {
         if ($this->input->post('payment_method') == 'cc') {
             $this->submissionCC();
         } else {
             if ($this->input->post('payment_method') == 'paypal') {
                 $this->submission($room_id);
             } else {
                 if ($this->input->post('payment_method') == '2c') {
                     $this->submissionTwoc();
                 } else {
                     redirect('info');
                 }
             }
         }
     }
     $data['id'] = $this->session->userdata('Lid');
     $data['amt'] = $this->session->userdata('amount');
     $data['full_cretids'] = 'off';
     $data['result'] = $this->Common_model->getTableData('payments')->result();
     $data['title'] = get_meta_details('Payment_Option', 'title');
     $data["meta_keyword"] = get_meta_details('Payment_Option', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Payment_Option', 'meta_description');
     $data['message_element'] = "payments/view_listPay";
     $this->load->view('template', $data);
 }
Example #2
0
 public function cancellation_policy()
 {
     $data['title'] = get_meta_details('cancellation_policy', 'title');
     $data["meta_keyword"] = get_meta_details('cancellation_policy', 'meta_keyword');
     $data["meta_description"] = get_meta_details('cancellation_policy', 'meta_description');
     $data['message_element'] = 'view_cancellation_policy';
     $this->load->view('template', $data);
 }
Example #3
0
 public function users_wishlist()
 {
     $data['title'] = get_meta_details('wish_list', 'title');
     $data["meta_keyword"] = $this->Common_model->getTableData('settings', array('code' => 'META_KEYWORD'))->row()->string_value;
     $data["meta_description"] = $this->Common_model->getTableData('settings', array('code' => 'META_DESCRIPTION'))->row()->string_value;
     $data['message_element'] = "wishlist/view_users_wishlist";
     $this->load->view('template', $data);
 }
Example #4
0
 public function deny()
 {
     $data['title'] = get_meta_details('Access_Deny', 'title');
     $data["meta_keyword"] = get_meta_details('Access_Deny', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Access_Deny', 'meta_description');
     $data['message_element'] = 'view_deny';
     $this->load->view('template', $data);
 }
Example #5
0
 public function cancellation_policy()
 {
     $data['title'] = get_meta_details('cancellation_policy', 'title');
     $data["meta_keyword"] = get_meta_details('cancellation_policy', 'meta_keyword');
     $data["meta_description"] = get_meta_details('cancellation_policy', 'meta_description');
     $data['cancellationDetails'] = $this->Common_model->getTableData('cancellation_policy');
     $data['cancellation_standard'] = $this->Common_model->getTableData('cancellation_policy', array('is_standard' => "1"));
     $data['message_element'] = 'view_cancellation_policy';
     $this->load->view('template', $data);
 }
Example #6
0
 public function view_statistics_graph()
 {
     $room_id = $this->uri->segment(3);
     $conditions = array("list_id" => $room_id);
     $data['results'] = $this->Common_model->get_statistics($conditions);
     $check = $this->db->where('id', $room_id)->get('list');
     if ($check->num_rows() == 0) {
         redirect('info');
     }
     $data['title'] = get_meta_details('Statistics', 'title');
     $data["meta_keyword"] = get_meta_details('Statistics', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Statistics', 'meta_description');
     $data['message_element'] = 'statistics/view_statistics';
     $this->load->view('template', $data);
 }
Example #7
0
 public function inbox()
 {
     if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
         $conditions = array("messages.userto " => $this->dx_auth->get_user_id());
         $data['messages'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
         //var_dump($data['messages']); exit;
         $data['title'] = get_meta_details('Inbox', 'title');
         $data["meta_keyword"] = get_meta_details('Inbox', 'meta_keyword');
         $data["meta_description"] = get_meta_details('Inbox', 'meta_description');
         $data['message_element'] = 'message/inbox';
         $this->load->view('template', $data);
     } else {
         redirect('users/signin');
     }
 }
Example #8
0
 function form($param = '')
 {
     $refer = $this->db->query("select * from `referral_management` where `id`=1 ")->row();
     //$data['fixed_status']=$refer->fixed_status;
     $refamt = $refer->fixed_amt;
     $refcur = $refer->currency;
     $type = $refer->type;
     $trip_amt = $refer->trip_amt;
     $trip_per = $refer->trip_per;
     $rent_amt = $refer->rent_amt;
     $rent_per = $refer->rent_per;
     $ref_total = get_currency_value2($refcur, 'USD', $refamt);
     if ($type == 1) {
         $trip_amt0 = $trip_amt;
         $rent_amt0 = $rent_amt;
         $trip = get_currency_value2($refcur, 'USD', $trip_amt);
         $rent = get_currency_value2($refcur, 'USD', $rent_amt);
     }
     if ($type == 0) {
         $trip = $trip_per / 100 * $ref_total;
         $rent = $rent_per / 100 * $ref_total;
         $current = $this->session->userdata("locale_currency");
     }
     $check_paypal = $this->db->where('is_enabled', 1)->get('payments')->num_rows();
     if ($check_paypal == 0) {
         $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate("Payment gateway is not enabled. Please contact admin.")));
         redirect('rooms/' . $param);
     }
     if ($this->input->get('contact')) {
         $contact_key = $this->input->get('contact');
         $contact_result = $this->Common_model->getTableData('contacts', array('contact_key' => $contact_key))->row();
         if ($contact_result->status == 10) {
             $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Access denied.')));
             redirect('rooms/' . $param, "refresh");
         }
         if ($contact_result->userby != $this->dx_auth->get_user_id()) {
             $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('You are not a valid user to use this link.')));
             redirect('rooms/' . $param, "refresh");
         }
         $checkin = $contact_result->checkin;
         $checkout = $contact_result->checkout;
         $daysexist = $this->db->query("SELECT id,list_id,booked_days FROM `calendar` WHERE `list_id` = '" . $param . "' AND (`booked_days` >= '" . get_gmt_time(strtotime($checkin)) . "' AND `booked_days` <= '" . get_gmt_time(strtotime($checkout)) . "') GROUP BY `list_id`");
         if ($daysexist->num_rows() == 1) {
             $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Already Those dates are booked')));
             redirect('rooms/' . $param, "refresh");
         }
         $data['guests'] = $contact_result->no_quest;
         $data['contact_key'] = $contact_result->contact_key;
         $data['offer'] = $contact_result->offer;
     } else {
         if ($this->session->userdata('formCheckout')) {
             $checkin = $this->session->userdata('Lcheckin');
             $checkout = $this->session->userdata('Lcheckout');
             $data['guests'] = $this->session->userdata('number_of_guests');
         } else {
             if ($this->input->get()) {
                 $checkin = $this->input->get('checkin');
                 $checkout = $this->input->get('checkout');
                 $data['guests'] = $this->input->get('guest');
             } else {
                 $checkin = $this->input->post('checkin');
                 $checkout = $this->input->post('checkout');
                 $data['guests'] = $this->input->post('number_of_guests');
             }
         }
     }
     $data['checkin'] = $checkin;
     $data['checkout'] = $checkout;
     $date1 = new DateTime(date('Y-m-d H:i:s', strtotime($checkin)));
     $date2 = new DateTime(date('Y-m-d H:i:s', strtotime($checkout)));
     $interval = $date1->diff($date2);
     if ($interval->days >= 28) {
         $data['flash_message'] = "Your reservation is 28 or more days. So, the cacellation policy will be changed to Long Term.";
     }
     $ckin = explode('/', $checkin);
     $ckout = explode('/', $checkout);
     $id = $param;
     if ($ckin[0] == "mm") {
         //$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error','Sorry! Access denied.'));
         redirect('rooms/' . $id, "refresh");
     }
     if ($ckout[0] == "mm") {
         //	$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error','Sorry! Access denied.'));
         redirect('rooms/' . $id, "refresh");
     }
     $xprice = $this->Common_model->getTableData('price', array('id' => $param))->row();
     //  print_r($xprice);
     /* if($this->input->get())
     			{
     				$price = $this->input->get('subtotal');	
     			}
     	       else {*/
     $price = $xprice->night;
     // print_r($price);
     //}
     $placeid = $xprice->id;
     $guests = $xprice->guests;
     if (isset($xprice->cleaning)) {
         $cleaning = $xprice->cleaning;
     } else {
         $cleaning = 0;
     }
     if (isset($xprice->security)) {
         $security = $xprice->security;
     } else {
         $security = 0;
     }
     $data['cleaning'] = $cleaning;
     //print_r($data);
     $data['security'] = $security;
     //print_r($data);
     if (isset($xprice->week)) {
         $Wprice = $xprice->week;
     } else {
         $Wprice = 0;
     }
     if (isset($xprice->month)) {
         $Mprice = $xprice->month;
     } else {
         $Mprice = 0;
     }
     $query = $this->Common_model->getTableData('list', array('id' => $id));
     $list = $query->row();
     $data['address'] = $list->address;
     $data['room_type'] = $list->room_type;
     $data['total_guests'] = $list->capacity;
     $data['tit'] = $list->title;
     $data['manual'] = $list->house_rule;
     $diff = strtotime($ckout[2] . '-' . $ckout[0] . '-' . $ckout[1]) - strtotime($ckin[2] . '-' . $ckin[0] . '-' . $ckin[1]);
     $days = ceil($diff / (3600 * 24));
     /*$amt = $price * $days * $data['guests'];*/
     if ($data['guests'] > $guests) {
         $diff_days = $data['guests'] - $guests;
         $amt = get_currency_value1($id, $price) * $days + $days * get_currency_value1($id, $xprice->addguests) * $diff_days;
         $data['extra_guest_price'] = get_currency_value1($id, $xprice->addguests) * $diff_days;
     } else {
         $amt = get_currency_value1($id, $price) * $days;
     }
     //Entering it into data variables
     $data['id'] = $id;
     $data['price'] = $xprice->night;
     //exit;
     $data['days'] = $days;
     $data['full_cretids'] = 'off';
     $data['commission'] = 0;
     if ($days >= 7 && $days < 30) {
         if (!empty($Wprice)) {
             $finalAmount = $Wprice;
             $differNights = $days - 7;
             $perDay = $Wprice / 7;
             $per_night = $price = round($perDay, 2);
             if ($differNights > 0) {
                 $addAmount = $differNights * $per_night;
                 $finalAmount = $Wprice + $addAmount;
             }
             $amt = $finalAmount;
         }
     } else {
         $finalAmount = $amt;
     }
     if ($days >= 30) {
         if (!empty($Mprice)) {
             $finalAmount = $Mprice;
             $differNights = $days - 30;
             $perDay = $Mprice / 30;
             $per_night = $price = round($perDay, 2);
             if ($differNights > 0) {
                 $addAmount = $differNights * $per_night;
                 $finalAmount = $Mprice + $addAmount;
             }
             $amt = $finalAmount;
         }
     } else {
         $finalAmount = $amt;
     }
     //Update the daily price
     $data['price'] = $xprice->night;
     //Cleaning fee
     if ($cleaning != 0) {
         $amt = $amt + get_currency_value1($id, $cleaning);
         // print_r($amt);
     }
     if ($security != 0) {
         $amt = $amt + get_currency_value1($id, $security);
         //	print_r($amt);
     } else {
         $amt = $amt;
     }
     $session_coupon = $this->session->userdata("coupon");
     if ($this->input->get('contact')) {
         $amt = get_currency_value_lys($contact_result->currency, get_currency_code(), $contact_result->price);
         $data['subtotal'] = $amt;
         $this->session->set_userdata("total_price_'" . $id . "'_'" . $this->dx_auth->get_user_id() . "'", $amt);
         $query = $this->Common_model->getTableData('paymode', array('id' => 2));
         $row = $query->row();
         /*if($row->is_premium == 1)
         		{
         		  if($row->is_fixed == 1)
         				{
         				   $fix                = $row->fixed_amount; 
         				   $amt                = $amt + get_currency_value_lys($row->currency,get_currency_code(),$fix);
         				   $data['commission'] = get_currency_value_lys($row->currency,get_currency_code(),$fix);
         				}
         				else
         				{  
         				   $per                = $row->percentage_amount; 
         				   $camt               = floatval(($amt * $per) / 100);
         				   $amt                = $amt + $camt;
         				   $data['commission'] = round($camt,2);
         				   $this->session->set_userdata('contact_commission',$camt);
         				}
         				
         		}
         		else
         		{
         		$amt  = $amt;
         		}*/
     } else {
         // $amt=$this->session->userdata("total_price_'".$id."'_'".$this->dx_auth->get_user_id()."'");
     }
     $this->session->set_userdata("total_price_'" . $id . "'_'" . $this->dx_auth->get_user_id() . "'", $amt);
     $this->session->unset_userdata('coupon_code_used');
     //Coupon Starts
     if ($this->input->post('apply_coupon')) {
         $is_coupon = 0;
         //Get All coupons
         $query = $this->Common_model->get_coupon();
         $row = $query->result_array();
         $list_id = $this->input->post('hosting_id');
         $coupon_code = $this->input->post('coupon_code');
         $user_id = $this->dx_auth->get_user_id();
         if ($coupon_code != "") {
             $is_list_already = $this->Common_model->getTableData('coupon_users', array('list_id' => $list_id, 'user_id' => $user_id));
             $is_coupon_already = $this->Common_model->getTableData('coupon_users', array('used_coupon_code' => $coupon_code, 'user_id' => $user_id, 'status' => 1));
             //Check the list is already access with the coupon by the host or not
             /*if($is_list_already->num_rows() != 0)
             		{
             			$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error','Sorry! You cannot use coupons for this list'));	
             			redirect('rooms/'.$list_id, "refresh");
             		}
             		//Check the host already used the coupon or not
             		else*/
             if ($is_coupon_already->num_rows() != 0) {
                 $this->session->unset_userdata('coupon_code_used');
                 $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your coupon is invalid')));
                 redirect('rooms/' . $list_id, "refresh");
             } else {
                 //Coupon Discount calculation
                 foreach ($row as $code) {
                     if ($coupon_code == $code['couponcode']) {
                         //Currecy coversion
                         $is_coupon = 1;
                         $current_currency = get_currency_code();
                         $coupon_currency = $code['currency'];
                         //if($current_currency == $coupon_currency)
                         $Coupon_amt = $code['coupon_price'];
                         //else
                         //$Coupon_amt = get_currency_value_coupon($code['coupon_price'],$coupon_currency);
                     }
                 }
                 if ($is_coupon == 1) {
                     //echo $Coupon_amt.'<br>';
                     $list_currency = $this->db->where('id', $list_id)->get('list')->row()->currency;
                     //if($coupon_currency != $list_currency)
                     $Coupon_amt = get_currency_value_lys1($coupon_currency, get_currency_code(), $Coupon_amt);
                     //echo $Coupon_amt.'<br>';exit;
                     //echo $amt.'<br>';
                     if ($Coupon_amt >= $amt) {
                         $this->session->unset_userdata('coupon_code_used');
                         $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! There is equal money or more money in your coupon to book this list.')));
                         redirect('rooms/' . $list_id, "refresh");
                     } else {
                         //Get the result amount & store the coupon informations
                         //echo $Coupon_amt;exit;
                         $amt = $amt - $Coupon_amt;
                         //echo $Coupon_amt.' - '.$amt;
                         //echo get_currency_value1($list_id,$amt);exit;
                         if ($amt < get_currency_value_lys('USD', get_currency_code(), 1)) {
                             $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your payment should be greater than 0.')));
                             redirect('rooms/' . $id, "refresh");
                         }
                         $insertData = array('list_id' => $list_id, 'used_coupon_code' => $coupon_code, 'user_id' => $user_id, 'status' => 0);
                         $this->Common_model->inserTableData('coupon_users', $insertData);
                         /*   $this->db->where('couponcode',$coupon_code)->update('coupon',array('status'=>1));*/
                         $this->session->set_userdata("total_price_'" . $list_id . "'_'" . $user_id . "'", $amt);
                         $this->session->set_userdata('coupon_code_used', 1);
                         $this->session->set_userdata('coupon_code', $coupon_code);
                         $this->session->set_userdata('coupon_amt', $Coupon_amt);
                         //echo	$this->session->userdata("coupon_amt");exit;
                     }
                 } else {
                     $this->session->unset_userdata('coupon_code_used');
                     $this->session->unset_userdata('coupon_code');
                     $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your coupon does not match.')));
                     redirect('rooms/' . $list_id, "refresh");
                 }
             }
         } else {
             $this->session->unset_userdata('coupon_code_used');
             $this->session->unset_userdata('coupon_code');
             $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your coupon does not match.')));
             redirect('rooms/' . $list_id, "refresh");
         }
     } else {
         $this->session->unset_userdata('coupon_code_used');
         $this->session->unset_userdata('coupon_code');
     }
     //Coupon Ends
     //echo $amt;exit;
     if ($is_coupon != 1) {
         if (!$this->input->get('contact')) {
             $data['subtotal'] = round($amt, 2);
         }
     } else {
         $data['subtotal'] = round($amt, 2);
         //echo "$data";
     }
     //if($this->session->userdata("total_price_'".$id."'_'".$this->dx_auth->get_user_id()."'") == "")
     //{ echo 'total';exit;
     //redirect('rooms/'.$param, "refresh");
     //	$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error','Please! Try Again'));
     //}
     //check admin premium condition and apply so for
     $query = $this->Common_model->getTableData('paymode', array('id' => 2));
     $row = $query->row();
     //if($is_coupon != 1)
     //{
     //if(!$this->input->get('contact'))
     //{
     if ($row->is_premium == 1) {
         if ($row->is_fixed == 1) {
             $fix = $row->fixed_amount;
             $amt = $amt + get_currency_value_lys($row->currency, get_currency_code(), $fix);
             $data['commission'] = get_currency_value_lys($row->currency, get_currency_code(), $fix);
         } else {
             $per = $row->percentage_amount;
             $finalAmount = $finalAmount + $cleaning + $security;
             $camt = floatval($finalAmount * $per / 100);
             $amt = $amt + $camt;
             $data['commission'] = round($camt, 2);
         }
     } else {
         $amt = $amt;
     }
     //	}
     //	}
     // Coupon Code Starts
     $ref_total1 = $ref_total + 10;
     if ($amt > get_currency_value1($id, $ref_total1)) {
         if ($this->db->select('referral_amount')->where('id', $this->dx_auth->get_user_id())->get('users')->row()->referral_amount != 0) {
             $data['amt'] = $amt;
             $data['referral_amount'] = $this->db->select('referral_amount')->where('id', $this->dx_auth->get_user_id())->get('users')->row()->referral_amount;
         } else {
             $data['amt'] = $amt;
         }
     } else {
         $data['amt'] = $amt;
     }
     if ($amt < 0) {
         $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your payment should be greater than 0.')));
         redirect('rooms/' . $id, "refresh");
     }
     if ($amt <= get_currency_value_lys('USD', get_currency_code(), 10)) {
         $validation_amt = get_currency_value1($id, 10);
         $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate("Sorry! Your payment should be greater than or equal to {$validation_amt}.")));
         redirect('rooms/' . $id, "refresh");
     }
     $data['result'] = $this->Common_model->getTableData('payments')->result();
     $array_items = array('list_id' => '', 'Lcheckin' => '', 'Lcheckout' => '', 'number_of_guests' => '', 'formCheckout' => '');
     $this->session->unset_userdata($array_items);
     //$id = $list_id;
     $checkin_time = get_gmt_time(strtotime($checkin));
     $checkout_time = get_gmt_time(strtotime($checkout));
     $travel_dates = array();
     $seasonal_prices = array();
     $total_nights = 1;
     $total_price = 0;
     $is_seasonal = 0;
     $i = $checkin_time;
     //print_r($i);
     //exit;
     while ($i < $checkout_time) {
         $checkin_date = date('m/d/Y', $i);
         $checkin_date = explode('/', $checkin_date);
         $travel_dates[$total_nights] = $checkin_date[1] . $checkin_date[0] . $checkin_date[2];
         $i = get_gmt_time(strtotime('+1 day', $i));
         $total_nights++;
     }
     for ($i = 1; $i < $total_nights; $i++) {
         $seasonal_prices[$travel_dates[$i]] = "";
     }
     //Store seasonal price of a list in an array
     //
     $seasonal_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id));
     $seasonal_result = $seasonal_query->result_array();
     //print_r($seasonal_result);
     if ($seasonal_query->num_rows() > 0) {
         foreach ($seasonal_result as $time) {
             //Get Seasonal price
             $seasonalprice_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id, 'start_date' => $time['start_date'], 'end_date' => $time['end_date']));
             $seasonalprice = $seasonalprice_query->row()->price;
             //Days between start date and end date -> seasonal price
             $start_time = $time['start_date'];
             $end_time = $time['end_date'];
             $i = $start_time;
             //print_r($i);
             //exit;
             while ($i <= $end_time) {
                 $start_date = date('m/d/Y', $i);
                 $s_date = explode('/', $start_date);
                 //print_r($s_data);
                 $s_date = $s_date[1] . $s_date[0] . $s_date[2];
                 $seasonal_prices[$s_date] = $seasonalprice;
                 //print_r($seasonal_prices[$s_date]);
                 $i = get_gmt_time(strtotime('+1 day', $i));
             }
         }
         //Total Price
         //print_r($total_nights);
         for ($i = 1; $i < $total_nights; $i++) {
             if ($seasonal_prices[$travel_dates[$i]] == "") {
                 $xprice = $this->Common_model->getTableData('price', array('id' => $id))->row();
                 //print_r($xprice);
                 $total_price = get_currency_value1($id, $total_price) + get_currency_value1($id, $xprice->night);
                 // echo "$total_price";
             } else {
                 $total_price = get_currency_value1($id, $total_price) + get_currency_value1($id, $seasonal_prices[$travel_dates[$i]]);
                 //echo "$total_price";
                 $is_seasonal = 1;
             }
         }
         //Additional Guests
         if ($data['guests'] > $guests) {
             $days = $total_nights - 1;
             $diff_guests = $data['guests'] - $guests;
             $total_price = get_currency_value1($id, $total_price) + $days * get_currency_value1($id, $xprice->addguests) * $diff_guests;
             $data['extra_guest_price'] = get_currency_value1($id, $xprice->addguests) * $diff_guests;
         }
         //	print_r($data['subtotal']);
         //	$data['avg_price'] = $data['subtotal']/$days;
         //price
         if ($is_seasonal == 1) {
             $data['avg_price'] = $data['subtotal'] / ($days + 1);
         } else {
             $data['price'] = $xprice->night;
         }
         //price
         //print_r($data['avg_price']);
         //Cleaning
         if ($cleaning != 0) {
             $cleaning_price = get_currency_value1($id, $cleaning);
             $total_price = $total_price + get_currency_value1($id, $cleaning);
         }
         if ($security != 0) {
             $total_price = $total_price + get_currency_value1($id, $security);
         }
         //Admin Commission
         //$data['commission'] = 0;
     }
     if ($is_seasonal == 1) {
         //Total days
         $days = $total_nights;
         //Final price
         $data['avg_price'] = ($total_price - $data['security'] - $data['cleaning']) / ($days - 1);
         //    $data['avg_price'] = get_currency_value1($id,$total_price)/($days-1);
         if ($contact_key != '') {
             $amt = $data['subtotal'];
             $total_price = $amt;
         } else {
             $amt = $data['avg_price'];
         }
         $query = $this->Common_model->getTableData('paymode', array('id' => 2));
         $row = $query->row();
         if ($row->is_premium == 1) {
             if ($row->is_fixed == 1) {
                 $fix = $row->fixed_amount;
                 $amt = $amt + get_currency_value_lys($row->currency, get_currency_code(), $fix);
                 $data['commission'] = get_currency_value_lys($row->currency, get_currency_code(), $fix);
             } else {
                 $per = $row->percentage_amount;
                 $percentage = $per / 100;
                 $amount = $total_price * $percentage;
                 $data['commission'] = $amount;
                 /* $per                = $row->percentage_amount; 
                 	    $camt               = floatval(($data['avg_price'] * $per) / 100);
                 	   //print_r($camt);
                 	   $amt                = $amt + $camt;
                 	  // print_r($amt);
                 	   $data['commission'] = round($camt,2);
                 	  //print_r($data['commission']);*/
             }
         } else {
             $amt = $amt;
         }
         if ($this->session->userdata('coupon_code_used') == 1) {
             if ($contact_key != '') {
                 //echo "success";
                 $total_price = $amt + $this->session->userdata("coupon_amt");
                 $data['subtotal'] = $total_price - $this->session->userdata("coupon_amt");
                 $data['amt'] = $data['subtotal'] + $data['commission'];
                 //	$amt=$data['amt']+$cleaning+$security+$data['commission'];
                 $amt = $data['amt'];
                 $this->session->set_userdata('topay', $amt);
             } else {
                 $amt = $amt - $this->session->userdata("coupon_amt");
                 $data['subtotal'] = $total_price - $this->session->userdata("coupon_amt");
                 $data['amt'] = $data['subtotal'] + $data['commission'];
                 //	$amt=$data['amt']+$cleaning+$security+$data['commission'];
                 $amt = $data['amt'];
                 // print_r($amt);
                 $this->session->set_userdata('topay', $amt);
             }
         } else {
             $data['subtotal'] = $total_price;
             //print_r($data['subtotal']);
             //$data['amt'] = $data['avg_price'] * ($days-1)+$cleaning+$security+$data['commission'];
             $data['amt'] = $total_price + $data['commission'];
             $amt = $data['amt'];
             // $amt; exit;
             $this->session->set_userdata('topay', $amt);
         }
     }
     //$data['subtotal']= $data['subtotal']+$cleaning_price;
     $data['amt'] = round($amt, 2);
     $data['policy'] = $this->Common_model->getTableData('cancellation_policy', array('id' => $list->cancellation_policy))->row()->name;
     // Advertisement popup 1 start
     $data['PagePopupContent'] = GetPagePopupContent('step2');
     // Advertisement popup 1 end
     $data['countries'] = $this->Common_model->getCountries()->result();
     $data['title'] = get_meta_details('Confirm_your_booking', 'title');
     $data["meta_keyword"] = get_meta_details('Confirm_your_booking', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Confirm_your_booking', 'meta_description');
     $data['message_element'] = "payments/view_booking";
     $this->load->view('template', $data);
 }
Example #9
0
 public function response($param = '')
 {
     if (isset($param)) {
         $contact_id = $param;
         $conditions = array('contacts.id' => $contact_id, 'contacts.userby' => $this->dx_auth->get_user_id());
         $result = $this->Contacts_model->get_contacts($conditions);
         if ($result->num_rows() == 0) {
             redirect('info');
         }
         $data['result'] = $result->row();
         $list_id = $data['result']->list_id;
         $key = $data['result']->contact_key;
         $data['list'] = $this->Common_model->getTableData('list', array('id' => $list_id))->row()->title;
         $no_quest = $data['result']->no_quest;
         $data['no_quest'] = $no_quest;
         $x = $this->Common_model->getTableData('price', array('id' => $list_id));
         $data['per_night'] = $price = $x->row()->night;
         $data['send_date'] = $result->row()->send_date;
         $data['cleaning'] = $result->row()->cleaning;
         $data['security'] = $result->row()->security;
         $checkin = $data['result']->checkin;
         $data['checkin'] = $checkin;
         $checkout = $data['result']->checkout;
         $data['checkout'] = $checkout;
         $diff = abs(strtotime($checkout) - strtotime($checkin));
         $data['nights'] = $days = floor($diff / (60 * 60 * 24));
         $data['subtotal'] = $result->row()->price;
         $data['status'] = $this->Common_model->getTableData('contacts', array('id' => $data['result']->id))->row()->status;
         if ($data['status'] == 4) {
             $data['message'] = $this->Common_model->getTableData('messages', array('contact_id' => $data['result']->id, 'message_type' => '8'))->row()->message;
         } else {
             $data['message'] = $this->Common_model->getTableData('messages', array('contact_id' => $data['result']->id, 'message_type' => '8'))->row()->message;
         }
         $data['url'] = base_url() . "payments/form/" . $list_id . "?contact=" . $key;
         $data['status'] = $this->Common_model->getTableData('contacts', array('id' => $data['result']->id))->row()->status;
         $data['commission'] = $result->row()->admin_commission;
         $data['total_payout'] = $amt;
         $data['totalprice'] = round($result->row()->price + $data['commission']);
         $data['title'] = get_meta_details('Contact_Request', 'title');
         $data["meta_keyword"] = get_meta_details('Contact_Request', 'meta_keyword');
         $data["meta_description"] = get_meta_details('Contact_Request', 'meta_description');
         $data['message_element'] = 'contacts/response';
         $this->load->view('template', $data);
     } else {
         redirect('info');
     }
 }
Example #10
0
 public function add_my_shortlist()
 {
     if (!$this->dx_auth->is_logged_in() && !$this->facebook_lib->logged_in()) {
         $this->session->set_userdata('redirect_to', base_url() . 'rooms/add_my_shortlist/' . $this->uri->segment(3));
         redirect('users/signin');
     } else {
         $list_id = $this->uri->segment(3);
         $user_id = $this->dx_auth->get_user_id();
         $shortlist = $this->Common_model->getTableData('users', array('id' => $this->dx_auth->get_user_id()))->row()->shortlist;
         if ($shortlist == "") {
             $data = array('shortlist' => $list_id);
             $this->db->where('id', $user_id);
             $this->db->update('users', $data);
         } else {
             $my_shortlist = $shortlist . ',' . $list_id;
             $data = array('shortlist' => $my_shortlist);
             $this->db->where('id', $user_id);
             $this->db->update('users', $data);
         }
         redirect('account/mywishlist');
         $shortlist = $this->Common_model->getTableData('users', array('id' => $this->dx_auth->get_user_id()))->row()->shortlist;
         //Remove the selected list from the All short lists
         $result = "";
         $my = explode(',', $shortlist);
         foreach ($my as $list) {
             if ($list != $list_id) {
                 $result .= $list . ",";
             }
         }
         //Remove Comma from last character
         if (substr($result, -1) == ',') {
             $my_shortlist = substr_replace($result, "", -1);
         } else {
             $my_shortlist = $result;
         }
         $data['title'] = get_meta_details('My Wishlist', 'title');
         $data["meta_keyword"] = get_meta_details('My Wishlist', 'meta_keyword');
         $data["meta_description"] = get_meta_details('My Wishlist', 'meta_description');
         $data['message_element'] = "account/view_wishlist";
         $this->load->view('template', $data);
     }
 }
Example #11
0
 function form()
 {
     $id = $this->input->get('id');
     $checkin = $this->input->get('checkin');
     $checkout = $this->input->get('checkout');
     $data['guests'] = $this->input->get('guest');
     $param = $id;
     $data['checkin'] = $checkin;
     $data['checkout'] = $checkout;
     $ckin = explode('/', $checkin);
     $ckout = explode('/', $checkout);
     $pay = $this->Common_model->getTableData('paywhom', array('id' => 1));
     $paywhom = $pay->result();
     $paywhom = $paywhom[0]->whom;
     $id = $param;
     if ($ckin[0] == "mm") {
         //$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error','Sorry! Access denied.'));
         redirect('rooms/' . $id, "refresh");
     }
     if ($ckout[0] == "mm") {
         //	$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error','Sorry! Access denied.'));
         redirect('rooms/' . $id, "refresh");
     }
     $xprice = $this->Common_model->getTableData('price', array('id' => $param))->row();
     /* if($this->input->get())
        {
        $price = $this->input->get('subtotal');
        }
        else { */
     $price = $xprice->night;
     //}
     $placeid = $xprice->id;
     $guests = $xprice->guests;
     if (isset($xprice->cleaning)) {
         $cleaning = $xprice->cleaning;
     } else {
         $cleaning = 0;
     }
     if (isset($xprice->week)) {
         $Wprice = $xprice->week;
     } else {
         $Wprice = 0;
     }
     if (isset($xprice->month)) {
         $Mprice = $xprice->month;
     } else {
         $Mprice = 0;
     }
     if ($paywhom) {
         $query = $this->Common_model->getTableData('list', array('id' => $id))->row();
         $email = $query->email;
     } else {
         $query = $this->Common_model->getTableData('users', array('role_id' => 2))->row();
         $email = $query->email;
     }
     $query = $this->Common_model->getTableData('list', array('id' => $id));
     $list = $query->row();
     $data['address'] = $list->address;
     $data['room_type'] = $list->room_type;
     $data['total_guests'] = $list->capacity;
     $data['tit'] = $list->title;
     $data['manual'] = $list->manual;
     $diff = strtotime($ckout[2] . '-' . $ckout[0] . '-' . $ckout[1]) - strtotime($ckin[2] . '-' . $ckin[0] . '-' . $ckin[1]);
     $days = ceil($diff / (3600 * 24));
     /* $amt = $price * $days * $data['guests']; */
     if ($data['guests'] > $guests) {
         $diff_days = $data['guests'] - $guests;
         $amt = $price * $days + $days * $xprice->addguests * $diff_days;
     } else {
         $amt = $price * $days;
     }
     //Entering it into data variables
     $data['id'] = $id;
     $data['price'] = $xprice->night;
     $data['days'] = $days;
     $data['full_cretids'] = 'off';
     $data['commission'] = 0;
     if ($days >= 7 && $days < 30) {
         if (!empty($Wprice)) {
             $finalAmount = $Wprice;
             $differNights = $days - 7;
             $perDay = $Wprice / 7;
             $per_night = $price = round($perDay, 2);
             if ($differNights > 0) {
                 $addAmount = $differNights * $per_night;
                 $finalAmount = $Wprice + $addAmount;
             }
             $amt = $finalAmount;
         }
     }
     if ($days >= 30) {
         if (!empty($Mprice)) {
             $finalAmount = $Mprice;
             $differNights = $days - 30;
             $perDay = $Mprice / 30;
             $per_night = $price = round($perDay, 2);
             if ($differNights > 0) {
                 $addAmount = $differNights * $per_night;
                 $finalAmount = $Mprice + $addAmount;
             }
             $amt = $finalAmount;
         }
     }
     //Update the daily price
     $data['price'] = $xprice->night;
     //Cleaning fee
     if ($cleaning != 0) {
         $amt = $amt + $cleaning;
     } else {
         $amt = $amt;
     }
     $session_coupon = $this->session->userdata("coupon");
     if ($this->input->get('contact')) {
         $amt = $contact_result->price;
         $this->session->set_userdata("total_price_'" . $id . "'_'" . $this->dx_auth->get_user_id() . "'", $amt);
     } else {
         //$amt=$this->session->userdata("total_price_'".$id."'_'".$this->dx_auth->get_user_id()."'");
     }
     //Coupon Starts
     if ($this->input->post('apply_coupon')) {
         $is_coupon = 0;
         //Get All coupons
         $query = $this->Common_model->get_coupon();
         $row = $query->result_array();
         $list_id = $this->input->post('hosting_id');
         $coupon_code = $this->input->post('coupon_code');
         $user_id = $this->dx_auth->get_user_id();
         if ($coupon_code != "") {
             $is_list_already = $this->Common_model->getTableData('coupon_users', array('list_id' => $list_id, 'user_id' => $user_id));
             $is_coupon_already = $this->Common_model->getTableData('coupon_users', array('used_coupon_code' => $coupon_code, 'user_id' => $user_id));
             //Check the list is already access with the coupon by the host or not
             /* if($is_list_already->num_rows() != 0)
                {
                $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error','Sorry! You cannot use coupons for this list'));
                redirect('rooms/'.$list_id, "refresh");
                }
                //Check the host already used the coupon or not
                else */
             if ($is_coupon_already->num_rows() != 0) {
                 $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your coupon is invalid')));
                 redirect('rooms/' . $list_id, "refresh");
             } else {
                 //Coupon Discount calculation
                 foreach ($row as $code) {
                     if ($coupon_code == $code['couponcode']) {
                         //Currecy coversion
                         $is_coupon = 1;
                         $current_currency = get_currency_code();
                         $coupon_currency = $code['currency'];
                         if ($current_currency == $coupon_currency) {
                             $Coupon_amt = $code['coupon_price'];
                         } else {
                             $Coupon_amt = get_currency_value_coupon($code['coupon_price'], $coupon_currency);
                         }
                     }
                 }
                 if ($is_coupon == 1) {
                     if ($Coupon_amt >= get_currency_value1($list_id, $amt)) {
                         $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! There is equal money or more money in your coupon to book this list.')));
                         redirect('rooms/' . $list_id, "refresh");
                     } else {
                         //Get the result amount & store the coupon informations
                         $amt = $amt - $Coupon_amt;
                         $insertData = array('list_id' => $list_id, 'used_coupon_code' => $coupon_code, 'user_id' => $user_id, 'status' => 0);
                         $this->Common_model->inserTableData('coupon_users', $insertData);
                         $this->db->where('couponcode', $coupon_code)->update('coupon', array('status' => 1));
                         $this->session->set_userdata("total_price_'" . $list_id . "'_'" . $user_id . "'", $amt);
                     }
                 } else {
                     $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your coupon does not match.')));
                     redirect('rooms/' . $list_id, "refresh");
                 }
             }
         } else {
             $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your coupon does not match.')));
             redirect('rooms/' . $list_id, "refresh");
         }
     }
     //Coupon Ends
     $data['subtotal'] = $amt;
     //if($this->session->userdata("total_price_'".$id."'_'".$this->dx_auth->get_user_id()."'") == "")
     //{ echo 'total';exit;
     //redirect('rooms/'.$param, "refresh");
     //	$this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error','Please! Try Again'));
     //}
     //check admin premium condition and apply so for
     $query = $this->Common_model->getTableData('paymode', array('id' => 2));
     $row = $query->row();
     if ($row->is_premium == 1) {
         if ($row->is_fixed == 1) {
             $fix = $row->fixed_amount;
             $amt = $amt + $fix;
             $data['commission'] = $fix;
         } else {
             $per = $row->percentage_amount;
             $camt = floatval($amt * $per / 100);
             $amt = $amt + $camt;
             $data['commission'] = $camt;
         }
     } else {
         $amt = $amt;
     }
     // Coupon Code Starts
     //print_r($amt);exit;
     if ($amt > 110) {
         $da = array();
         $this->db->select('*');
         $this->db->where('id', $this->dx_auth->get_user_id());
         $this->db->from('users');
         $value = $this->db->get()->result();
         foreach ($value as $val) {
             $da = $val->referral_amount;
         }
         if ($da != 0) {
             $data['amt'] = $amt;
             $data['referral_amount'] = $da;
         } else {
             $data['amt'] = $amt;
         }
     } else {
         $data['amt'] = $amt;
     }
     if ($amt < 0) {
         $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Your payment should be greater than 0.')));
         redirect('rooms/' . $id, "refresh");
     }
     $dat['result'] = $this->Common_model->getTableData('payments')->result();
     $array_items = array('list_id' => '', 'Lcheckin' => '', 'Lcheckout' => '', 'number_of_guests' => '', 'formCheckout' => '');
     $this->session->unset_userdata($array_items);
     //$id = $list_id;
     $checkin_time = get_gmt_time(strtotime($checkin));
     $checkout_time = get_gmt_time(strtotime($checkout));
     $travel_dates = array();
     $seasonal_prices = array();
     $total_nights = 1;
     $total_price = 0;
     $is_seasonal = 0;
     $i = $checkin_time;
     while ($i < $checkout_time) {
         $checkin_date = date('m/d/Y', $i);
         $checkin_date = explode('/', $checkin_date);
         $travel_dates[$total_nights] = $checkin_date[1] . $checkin_date[0] . $checkin_date[2];
         $i = get_gmt_time(strtotime('+1 day', $i));
         $total_nights++;
     }
     for ($i = 1; $i < $total_nights; $i++) {
         $seasonal_prices[$travel_dates[$i]] = "";
     }
     //Store seasonal price of a list in an array
     $seasonal_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id));
     $seasonal_result = $seasonal_query->result_array();
     if ($seasonal_query->num_rows() > 0) {
         foreach ($seasonal_result as $time) {
             //Get Seasonal price
             $seasonalprice_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id, 'start_date' => $time['start_date'], 'end_date' => $time['end_date']));
             $seasonalprice = $seasonalprice_query->row()->price;
             //Days between start date and end date -> seasonal price
             $start_time = $time['start_date'];
             $end_time = $time['end_date'];
             $i = $start_time;
             while ($i <= $end_time) {
                 $start_date = date('m/d/Y', $i);
                 $s_date = explode('/', $start_date);
                 $s_date = $s_date[1] . $s_date[0] . $s_date[2];
                 $seasonal_prices[$s_date] = $seasonalprice;
                 $i = get_gmt_time(strtotime('+1 day', $i));
             }
         }
         //Total Price
         for ($i = 1; $i < $total_nights; $i++) {
             if ($seasonal_prices[$travel_dates[$i]] == "") {
                 $xprice = $this->Common_model->getTableData('price', array('id' => $id))->row();
                 $total_price = $total_price + $xprice->night;
             } else {
                 $total_price = $total_price + $seasonal_prices[$travel_dates[$i]];
                 $is_seasonal = 1;
             }
         }
         //Additional Guests
         if ($data['guests'] > $guests) {
             $days = $total_nights - 1;
             $diff_guests = $data['guests'] - $guests;
             $total_price = $total_price + $days * $xprice->addguests * $diff_guests;
         }
         //Cleaning
         if ($cleaning != 0) {
             $total_price = $total_price + $cleaning;
         }
         //Admin Commission
         //$data['commission'] = 0;
     }
     if ($is_seasonal == 1) {
         //Total days
         $days = $total_nights;
         //Final price
         $data['subtotal'] = $total_price;
         $data['avg_price'] = $total_price / ($days - 1);
         //echo $data['avg_price'];exit;
         $amt = $data['subtotal'];
         $query = $this->Common_model->getTableData('paymode', array('id' => 2));
         $row = $query->row();
         if ($row->is_premium == 1) {
             if ($row->is_fixed == 1) {
                 $fix = $row->fixed_amount;
                 $amt = $amt + $fix;
                 $data['commission'] = $fix;
             } else {
                 $per = $row->percentage_amount;
                 $camt = floatval($amt * $per / 100);
                 $amt = $amt + $camt;
                 $data['commission'] = $camt;
             }
         } else {
             $amt = $amt;
         }
         $data['amt'] = $amt;
         $this->session->set_userdata('topay', $amt);
     }
     $data['img'] = getListImage($id);
     $data['env'] = 'mobile';
     $data['countries'] = $this->Common_model->getCountries()->result();
     $data['title'] = get_meta_details('Confirm_your_booking', 'title');
     $data["meta_keyword"] = 'mobile';
     $data["meta_description"] = get_meta_details('Confirm_your_booking', 'meta_description');
     $data['message_element'] = "payments/view_booking";
     $this->load->view('template', $data);
 }
Example #12
0
 function settings()
 {
     if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
         $data['title'] = get_meta_details('Setting', 'title');
         $data["meta_keyword"] = get_meta_details('Setting', 'meta_keyword');
         $data["meta_description"] = get_meta_details('Setting', 'meta_description');
         $data['message_element'] = "account/setting";
         $this->load->view('template', $data);
     } else {
         redirect(base_url());
     }
 }
Example #13
0
 public function billing($param = '')
 {
     if (isset($param)) {
         $reservation_id = $param;
         $conditions = array('reservation.id' => $reservation_id, 'reservation.userby' => $this->dx_auth->get_user_id());
         $result = $this->Trips_model->get_reservation($conditions);
         if ($result->num_rows() == 0) {
             redirect('info');
         }
         $data['result'] = $result->row();
         $list_id = $data['result']->list_id;
         $no_quest = $data['no_quest'] = $data['result']->no_quest;
         $x = $this->Common_model->getTableData('price', array('id' => $list_id));
         $data['per_night'] = $price = $x->row()->night;
         $diff = $data['result']->checkout - $data['result']->checkin;
         $data['nights'] = $days = ceil($diff / (3600 * 24));
         $amt = $data['subtotal'] = $result->row()->topay;
         $data['commission'] = 0;
         $data['policy'] = $this->Common_model->getTableData('cancellation_policy', array('id' => $result->row()->policy))->row()->name;
         //check admin premium condition and apply so for
         $query = $this->Common_model->getTableData('paymode', array('id' => 3));
         $row = $query->row();
         $data['cleaning'] = $result->row()->cleaning;
         $data['security'] = $result->row()->security;
         $guests = $result->row()->no_quest;
         /*	if($guests > $result->row()->guest_count)
         	        {
         	        	
         			$diff_days          = $guests - $result->row()->guest_count;
         			$data['extra_guest_price'] = $result->row()->extra_guest_price * $diff_days;
         	        $data['per_night'] = $result->row()->topay-$result->row()->cleaning-$result->row()->security-$data['extra_guest_price'];
         	        
         			}  
         			else 
         			{
         			$data['per_night'] = $result->row()->topay-$result->row()->cleaning-$result->row()->security;	
         			} */
         /* 
         				 //*if($row->is_premium == 1)
         				{
         						if($row->is_fixed == 1)
         						{
         									$fix           = $row->fixed_amount; 
         									$amt           = $amt - $fix;
         									$data['commission'] = $amt ;
         						}
         						else
         						{  
         									$per           = $row->percentage_amount; 
         									$camt          = floatval(($amt * $per) / 100);
         									$amt           = $amt - $camt;
         									$data['commission']  = $camt ;
         						}
         				}
         				else
         				{*/
         $amt = $amt;
         //	}
         $data['total_payout'] = $amt;
         $data['title'] = get_meta_details('Reservation_Request', 'title');
         $data["meta_keyword"] = get_meta_details('Reservation_Request', 'meta_keyword');
         $data["meta_description"] = get_meta_details('Reservation_Request', 'meta_description');
         $data['message_element'] = 'trips/request_traveller';
         $this->load->view('template', $data);
     } else {
         redirect('info');
     }
 }
Example #14
0
 public function change_status()
 {
     if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
         $sow_hide = $this->input->get('stat');
         $row_id = $this->input->get('rid');
         if ($sow_hide == 1) {
             $condition = array("id" => $row_id);
             $data['status'] = 0;
             $this->Common_model->updateTableData('list', NULL, $condition, $data);
             $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('success', translate('Status change successfully.')));
             redirect('hosting');
         } else {
             $condition = array("id" => $row_id);
             $data['show_or_hide'] = 1;
             $this->Common_model->updateTableData('list', NULL, $condition, $data);
             $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('success', translate('Status change successfully.')));
             redirect('hosting');
         }
         $data['title'] = get_meta_details('Manage_Listings', 'title');
         $data["meta_keyword"] = get_meta_details('Manage_Listings', 'meta_keyword');
         $data["meta_description"] = get_meta_details('Manage_Listings', 'meta_description');
         $data['message_element'] = "hosting/view_hosting";
         $this->load->view('template', $data);
     } else {
         redirect('users/signin');
     }
 }
Example #15
0
 public function inbox()
 {
     if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
         if ($this->input->get()) {
             extract($this->input->get());
         }
         if ($this->input->get('type') == 'all') {
             $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_archived" => 0);
             $query = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
             $param = (int) $this->uri->segment(4, 0);
             $param = rtrim($this->input->get('per_page'), '0') + 1;
             // Number of record showing per page
             $data['row_count'] = 10;
             if ($param > 0) {
                 $data['offset'] = ($param - 1) * $data['row_count'];
             } else {
                 $data['offset'] = $param * $data['row_count'];
             }
             $this->db->limit($data['row_count'], $data['offset']);
             $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_archived" => 0);
             $data['messages'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
             // Pagination config
             $p_config['base_url'] = site_url('message/inbox?type=' . $type);
             $p_config['uri_segment'] = 4;
             $p_config['num_links'] = 5;
             $p_config['total_rows'] = $query->num_rows();
             $p_config['per_page'] = $data['row_count'];
             $p_config['page_query_string'] = TRUE;
             // Init pagination
             $this->pagination->initialize($p_config);
             // Create pagination links
             $data['pagination'] = $this->pagination->create_links();
         } else {
             if ($this->input->get('type') == 'starred') {
                 $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_starred" => 1, "messages.is_archived" => 0);
                 $query = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                 $param = (int) $this->uri->segment(4, 0);
                 $param = rtrim($this->input->get('per_page'), '0') + 1;
                 // Number of record showing per page
                 $data['row_count'] = 10;
                 if ($param > 0) {
                     $data['offset'] = ($param - 1) * $data['row_count'];
                 } else {
                     $data['offset'] = $param * $data['row_count'];
                 }
                 $this->db->limit($data['row_count'], $data['offset']);
                 $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_starred" => 1, "messages.is_archived" => 0);
                 $data['messages'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                 // Pagination config
                 $p_config['base_url'] = site_url('message/inbox?type=' . $type);
                 $p_config['uri_segment'] = 4;
                 $p_config['num_links'] = 5;
                 $p_config['total_rows'] = $query->num_rows();
                 $p_config['per_page'] = $data['row_count'];
                 $p_config['page_query_string'] = TRUE;
                 // Init pagination
                 $this->pagination->initialize($p_config);
                 // Create pagination links
                 $data['pagination'] = $this->pagination->create_links();
             } else {
                 if ($this->input->get('type') == 'unread') {
                     $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_read" => 0, "messages.is_archived" => 0);
                     $query = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                     $param = (int) $this->uri->segment(4, 0);
                     $param = rtrim($this->input->get('per_page'), '0') + 1;
                     // Number of record showing per page
                     $data['row_count'] = 10;
                     if ($param > 0) {
                         $data['offset'] = ($param - 1) * $data['row_count'];
                     } else {
                         $data['offset'] = $param * $data['row_count'];
                     }
                     $this->db->limit($data['row_count'], $data['offset']);
                     $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_read" => 0, "messages.is_archived" => 0);
                     $data['messages'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                     // Pagination config
                     $p_config['base_url'] = site_url('message/inbox?type=' . $type);
                     $p_config['uri_segment'] = 4;
                     $p_config['num_links'] = 5;
                     $p_config['total_rows'] = $query->num_rows();
                     $p_config['per_page'] = $data['row_count'];
                     $p_config['page_query_string'] = TRUE;
                     // Init pagination
                     $this->pagination->initialize($p_config);
                     // Create pagination links
                     $data['pagination'] = $this->pagination->create_links();
                 } else {
                     if ($this->input->get('type') == 'reservations') {
                         $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.message_type" => 1, "messages.is_archived" => 0);
                         $query = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                         $param = (int) $this->uri->segment(4, 0);
                         $param = rtrim($this->input->get('per_page'), '0') + 1;
                         // Number of record showing per page
                         $data['row_count'] = 10;
                         if ($param > 0) {
                             $data['offset'] = ($param - 1) * $data['row_count'];
                         } else {
                             $data['offset'] = $param * $data['row_count'];
                         }
                         $this->db->limit($data['row_count'], $data['offset']);
                         $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.message_type" => 1, "messages.is_archived" => 0);
                         $data['messages'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                         // Pagination config
                         $p_config['base_url'] = site_url('message/inbox?type=' . $type);
                         $p_config['uri_segment'] = 4;
                         $p_config['num_links'] = 5;
                         $p_config['total_rows'] = $query->num_rows();
                         $p_config['per_page'] = $data['row_count'];
                         $p_config['page_query_string'] = TRUE;
                         // Init pagination
                         $this->pagination->initialize($p_config);
                         // Create pagination links
                         $data['pagination'] = $this->pagination->create_links();
                     } else {
                         if ($this->input->get('type') == 'never_responded') {
                             $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_respond" => 0, "messages.is_archived" => 0);
                             $query = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                             $param = (int) $this->uri->segment(4, 0);
                             $param = rtrim($this->input->get('per_page'), '0') + 1;
                             // Number of record showing per page
                             $data['row_count'] = 10;
                             if ($param > 0) {
                                 $data['offset'] = ($param - 1) * $data['row_count'];
                             } else {
                                 $data['offset'] = $param * $data['row_count'];
                             }
                             $this->db->limit($data['row_count'], $data['offset']);
                             $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_respond" => 0, "messages.is_archived" => 0);
                             $data['messages'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                             // Pagination config
                             $p_config['base_url'] = site_url('message/inbox?type=' . $type);
                             $p_config['uri_segment'] = 4;
                             $p_config['num_links'] = 5;
                             $p_config['total_rows'] = $query->num_rows();
                             $p_config['per_page'] = $data['row_count'];
                             $p_config['page_query_string'] = TRUE;
                             // Init pagination
                             $this->pagination->initialize($p_config);
                             // Create pagination links
                             $data['pagination'] = $this->pagination->create_links();
                         } else {
                             if ($this->input->get('type') == 'hidden') {
                                 $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_archived" => 1);
                                 $query = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                                 $param = (int) $this->uri->segment(4, 0);
                                 $param = rtrim($this->input->get('per_page'), '0') + 1;
                                 // Number of record showing per page
                                 $data['row_count'] = 10;
                                 if ($param > 0) {
                                     $data['offset'] = ($param - 1) * $data['row_count'];
                                 } else {
                                     $data['offset'] = $param * $data['row_count'];
                                 }
                                 $this->db->limit($data['row_count'], $data['offset']);
                                 $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_archived" => 1);
                                 $data['messages'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                                 // Pagination config
                                 $p_config['base_url'] = site_url('message/inbox?type=' . $type);
                                 $p_config['uri_segment'] = 4;
                                 $p_config['num_links'] = 5;
                                 $p_config['total_rows'] = $query->num_rows();
                                 $p_config['per_page'] = $data['row_count'];
                                 $p_config['page_query_string'] = TRUE;
                                 // Init pagination
                                 $this->pagination->initialize($p_config);
                                 // Create pagination links
                                 $data['pagination'] = $this->pagination->create_links();
                             } else {
                                 $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_archived" => 0);
                                 $query = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                                 $param = (int) $this->uri->segment(4, 0);
                                 //$param = rtrim($this->input->get('per_page'),'0')+1;
                                 // Number of record showing per page
                                 $data['row_count'] = 10;
                                 if ($param > 0) {
                                     $data['offset'] = ($param - 1) * $data['row_count'];
                                 } else {
                                     $data['offset'] = $param * $data['row_count'];
                                 }
                                 $this->db->limit($data['row_count'], $data['offset']);
                                 $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_archived" => 0);
                                 $data['messages'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'));
                                 // Pagination config
                                 $p_config['base_url'] = site_url('message/inbox/index');
                                 $p_config['uri_segment'] = 4;
                                 $p_config['num_links'] = 5;
                                 $p_config['total_rows'] = $query->num_rows();
                                 $p_config['per_page'] = $data['row_count'];
                                 //$p_config['page_query_string'] = TRUE;
                                 // Init pagination
                                 $this->pagination->initialize($p_config);
                                 // Create pagination links
                                 $data['pagination'] = $this->pagination->create_links2();
                             }
                         }
                     }
                 }
             }
         }
         $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_archived" => 0);
         $data['all_count'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'))->num_rows();
         $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_starred" => 1);
         $data['starred_count'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'))->num_rows();
         $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_read" => 0);
         $data['unread_count'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'))->num_rows();
         $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.message_type" => 1);
         $data['reservations_count'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'))->num_rows();
         $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_respond" => 0);
         $rc = $data['respond_count'] = $this->Message_model->get_messages($conditions, NULL, array('messages.userby', 'desc'))->num_rows();
         //echo $rc;
         //$data['respond_count'] =$this->db->query('select * from `messages` where `messages`.`userto`='.$this->dx_auth->get_user_id().' and `is_respond`=0')->num_rows();
         //echo $this->db->last_query();
         //exit;
         $conditions = array("messages.userto " => $this->dx_auth->get_user_id(), "messages.is_archived" => 1);
         $data['hidden_count'] = $this->Message_model->get_messages($conditions, NULL, array('messages.id', 'desc'))->num_rows();
         //var_dump($data['messages']); exit;
         $data['type'] = $this->input->get('type');
         $data['title'] = get_meta_details('Inbox', 'title');
         $data["meta_keyword"] = get_meta_details('Inbox', 'meta_keyword');
         $data["meta_description"] = get_meta_details('Inbox', 'meta_description');
         $data['message_element'] = 'message/inbox';
         $this->load->view('template', $data);
     } else {
         redirect('users/signin');
     }
 }
Example #16
0
 public function index()
 {
     //Get the checkin and chekout dates
     $checkin = '';
     $checkout = '';
     $stack = array();
     $room_types = array();
     $checkin = $this->input->post('checkin');
     $checkout = $this->input->post('checkout');
     $nof_guest = $this->input->post('number_of_guests');
     if ($this->input->post('room_types1')) {
         $room_types1 = $this->input->post('room_types1');
         $data['room_types1'] = $room_types1;
     }
     if ($this->input->post('room_types2')) {
         $room_types2 = $this->input->post('room_types2');
         $data['room_types2'] = $room_types2;
     }
     if ($this->input->post('room_types3')) {
         $room_types3 = $this->input->post('room_types3');
         $data['room_types3'] = $room_types3;
     }
     if ($this->input->post('room_types4')) {
         $room_types1 = $this->input->post('room_types4');
         $data['room_types1'] = $room_types1;
     }
     if ($this->input->post('room_types5')) {
         $room_types2 = $this->input->post('room_types5');
         $data['room_types2'] = $room_types2;
     }
     if ($this->input->post('room_types6')) {
         $room_types3 = $this->input->post('room_types6');
         $data['room_types3'] = $room_types3;
     }
     if ($this->input->post('room_types11')) {
         $room_types1 = $this->input->post('room_types11');
         $data['room_types1'] = $room_types1;
     }
     if ($this->input->post('room_types22')) {
         $room_types2 = $this->input->post('room_types22');
         $data['room_types2'] = $room_types2;
     }
     if ($this->input->post('room_types33')) {
         $room_types3 = $this->input->post('room_types33');
         $data['room_types3'] = $room_types3;
     }
     $min = $this->input->post('min');
     $max = $this->input->post('max');
     //get starred list status
     $star = $this->input->get('starred');
     $page = $this->input->get('page', 1);
     $data['page'] = $page;
     $array_items = array('Vcheckin' => '', 'Vcheckout' => '', 'Vcheckout' => '');
     $this->session->unset_userdata($array_items);
     if ($this->input->post('checkin') != '' || $this->input->post('checkin') != 'mm/dd/yy') {
         $freshdata = array('Vcheckin' => $this->input->post('checkin'), 'Vcheckout' => $this->input->post('checkout'), 'Vnumber_of_guests' => $this->input->post('number_of_guests'));
         $this->session->set_userdata($freshdata);
     }
     if ($this->input->post('location')) {
         $location = $this->input->post('location');
         //$this->session->unset_userdata('location1');
         //$this->session->set_userdata('location',$location);
     } else {
         if ($this->input->get('location')) {
             $location = $this->input->get('location');
         } else {
             if ($this->session->userdata('ajax_search_location') != '') {
                 //$location = $this->session->userdata('ajax_search_location');
             }
         }
     }
     $ser = $this->input->post('searchbox');
     if ($this->input->post('searchbox') != '') {
         $location = $this->input->post('searchbox');
         //$this->session->unset_userdata('location');
         //$this->session->set_userdata('location1',$location);
     }
     if (!isset($location)) {
         $location = '';
     }
     if (isset($location)) {
         $pieces = explode(",", $location);
         $data['pieces'] = $pieces;
         $check = $this->input->post('checkin');
         if (isset($check)) {
             $checkin = $this->input->post('checkin');
             //$this->session->set_userdata('checkin',$checkin);
         } else {
             $checkin = 'mm/dd/yy';
         }
         $check_out = $this->input->post('checkout');
         if (isset($check_out)) {
             $checkout = $this->input->post('checkout');
             //$this->session->set_userdata('checkout',$checkout);
         } else {
             $checkout = 'mm/dd/yy';
         }
         if ($this->input->post('number_of_guests')) {
             $number_of_guests = $this->input->post('number_of_guests');
             //$this->session->set_userdata('number_of_guests',$number_of_guests);
         } else {
             $number_of_guests = '1';
         }
         /*	if(!$this->input->post('location'))
         		{
         			$location = $this->session->userdata('location');			
         		}
         		if($location == '')
         			{
         				$location = $this->session->userdata('location1');
         			}
         			if($this->input->get('location'))
         			{
         				$location = $this->input->get('location');
         			}*/
         if (!$this->input->post('checkin')) {
             //$checkin = $this->session->userdata('checkin');
         }
         if (!$this->input->post('checkout')) {
             //$checkout = $this->session->userdata('checkout');
         }
         if (!$this->input->post('number_of_guests')) {
             //$number_of_guests = $this->session->userdata('number_of_guests');
         }
         $data['property_type'] = $this->Common_model->getTableData('property_type')->result_array();
         $data['query'] = $location;
         $data['checkin'] = $checkin;
         $data['checkout'] = $checkout;
         $data['number_of_guests'] = $number_of_guests;
         $data['room_types'] = $room_types;
         $data['min'] = $min;
         $data['max'] = $max;
         $data['amnities'] = $this->Rooms_model->get_amnities();
         $data['lat'] = $this->input->post('lat');
         $data['lng'] = $this->input->post('lng');
         if ($this->input->post('lat') != '') {
             $this->session->set_userdata('lat', $data['lat']);
             $this->session->set_userdata('lng', $data['lng']);
         } else {
             $data['lat'] = $this->session->userdata('lat');
             $data['lng'] = $this->session->userdata('lng');
         }
         //echo $this->input->post('lat1');exit;
     }
     $data['wishlist_category'] = $this->Common_model->getTableData('wishlists', array('user_id' => $this->dx_auth->get_user_id()));
     $data['user_wishlist'] = $this->Common_model->getTableData('user_wishlist', array('user_id' => $this->dx_auth->get_user_id()));
     // $data['query']            = '';
     //$data['property_type']    = $this->Common_model->getTableData('property_type')->result_array();
     // Advertisement popup 1 start
     $data['PagePopupContent'] = GetPagePopupContent('search');
     // Advertisement popup 1 end
     $data['title'] = get_meta_details('Search_Elements', 'title');
     $data["meta_keyword"] = get_meta_details('Search_Elements', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Search_Elements', 'meta_description');
     $data['message_element'] = 'view_search_result';
     $this->load->view('template', $data);
 }
Example #17
0
 public function logout()
 {
     $data["title"] = get_meta_details('Logout_Shortly', 'title');
     $data["meta_keyword"] = get_meta_details('Logout_Shortly', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Logout_Shortly', 'meta_description');
     $is_banned = $this->db->where('id', $this->dx_auth->get_user_id())->where('banned', 1)->get('users')->num_rows();
     $this->dx_auth->logout();
     $user = array('DX_user_id' => '', 'DX_username' => '', 'DX_emailId' => '', 'DX_refId' => '', 'DX_role_id' => '', 'DX_role_name' => '', 'DX_parent_roles_id' => '', 'DX_parent_roles_name' => '', 'DX_permission' => '', 'DX_parent_permissions' => '', 'DX_logged_in' => TRUE);
     $this->session->unset_userdata($user);
     $this->session->unset_userdata('image_url');
     if ($this->facebook_lib->logged_in()) {
         $facebook->destroySession();
         $this->session->sess_destroy();
     }
     redirect('');
 }
Example #18
0
 public function traveler_review($param = '')
 {
     if (isset($param)) {
         $reservation_id = $param;
         $conditions = array('reservation.id' => $reservation_id, 'reservation.userby' => $this->dx_auth->get_user_id());
         $result = $this->Trips_model->get_reservation($conditions);
         if ($result->num_rows() == 0) {
             redirect('info');
         }
         $conditions = array('reservation_id' => $reservation_id, 'userby' => $this->dx_auth->get_user_id());
         $result = $this->Trips_model->get_review($conditions);
         $data['result'] = $result->row();
         $data['title'] = get_meta_details('View_your_review', 'title');
         $data["meta_keyword"] = get_meta_details('View_your_review', 'meta_keyword');
         $data["meta_description"] = get_meta_details('View_your_review', 'meta_description');
         $data['message_element'] = 'trips/view_traveler_review';
         $this->load->view('template', $data);
     } else {
         redirect('info');
     }
 }
Example #19
0
 public function tell_a_friend()
 {
     $ref_id = $this->input->get('ref', TRUE);
     $referData = array('ref_id' => $ref_id);
     $this->session->set_userdata($referData);
     $data['title'] = get_meta_details('Tell_A_Friend', 'title');
     $data["meta_keyword"] = get_meta_details('Tell_A_Friend', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Tell_A_Friend', 'meta_description');
     $data['message_element'] = 'referrals/view_tell_friend';
     $this->load->view('template', $data);
 }
Example #20
0
 public function mywishlist()
 {
     //echo "My Wishlist";
     if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
         $list_id = $this->input->post('list_id');
         $user_id = $this->dx_auth->get_user_id();
         $shortlist = $this->Common_model->getTableData('users', array('id' => $this->dx_auth->get_user_id()))->row()->shortlist;
         //Remove the selected list from the All short lists
         $result = "";
         $my = explode(',', $shortlist);
         foreach ($my as $list) {
             if ($list != $list_id) {
                 $result .= $list . ",";
             }
         }
         //Remove Comma from last character
         if (substr($result, -1) == ',') {
             $my_shortlist = substr_replace($result, "", -1);
         } else {
             $my_shortlist = $result;
         }
         $data = array('shortlist' => $my_shortlist);
         $this->db->where('id', $user_id);
         $this->db->update('users', $data);
         $data['title'] = get_meta_details('My Wishlist', 'title');
         $data["meta_keyword"] = get_meta_details('My Wishlist', 'meta_keyword');
         $data["meta_description"] = get_meta_details('My Wishlist', 'meta_description');
         $data['message_element'] = "account/view_wishlist";
         $this->load->view('template', $data);
     } else {
         redirect('users/signin');
     }
 }
Example #21
0
 public function single($param = '')
 {
     if ($param) {
         if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
             $check_calendar = $this->db->where('id', $this->uri->segment(3))->where('user_id', $this->dx_auth->get_user_id())->get('list');
             if ($check_calendar->num_rows() == 0) {
                 redirect('info');
             }
             $list_id = $param;
             $day = date("d");
             $month = $this->input->get('month', TRUE);
             $year = $this->input->get('year', TRUE);
             if (!empty($month) && !empty($year)) {
                 $month = $month;
                 $year = $year;
             } else {
                 $month = date("m");
                 $year = date("Y");
             }
             if ($month > 12 || $month < 1) {
                 $month = date("m");
             } else {
                 $month = $month;
             }
             if ($year == $year - 3 || $year == $year + 3) {
                 redirect('calendar/single/' . $list_id . '?month=' . $month . '&year=' . date("Y"));
             }
             if ($this->Common_model->getTableData('list', array('id' => $param))->num_rows() == 0) {
                 redirect('info/deny');
             }
             $row = $this->Common_model->getTableData('list', array('id' => $param))->row();
             $data['list_title'] = $row->title;
             $data['list_price'] = $row->price;
             $conditions = array('list_id' => $list_id);
             $data['result'] = $this->Trips_model->get_calendar($conditions)->result();
             $data['list_id'] = $list_id;
             $data['day'] = $day;
             $data['month'] = $month;
             $data['year'] = $year;
             //Remove incorrect list from seasonal price
             $query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $list_id));
             $res = $query->result_array();
             foreach ($res as $seasonal) {
                 $starttime = $seasonal['start_date'];
                 $gmtTime = $seasonal['end_date'];
                 if ($gmtTime < $starttime) {
                     $list_id = $seasonal['list_id'];
                     $remove_query = "delete from seasonalprice where list_id='" . $list_id . "' and start_date='" . $seasonal['start_date'] . "' and end_date='" . $seasonal['end_date'] . "'";
                     $remove_exe = $this->db->query($remove_query);
                 }
             }
             $data['title'] = get_meta_details('Calendar', 'title');
             $data["meta_keyword"] = get_meta_details('Calendar', 'meta_keyword');
             $data["meta_description"] = get_meta_details('Calendar', 'meta_description');
             $data['message_element'] = 'rooms/view_calendar_single';
             $this->load->view('template', $data);
         } else {
             $this->session->set_userdata('redirect_to', 'calendar/single/' . $param);
             redirect('users/signin', 'refresh');
         }
     }
 }
Example #22
0
 public function hidehelp()
 {
     $row_hide = $this->input->post('stat');
     $row_id = $this->input->get('id');
     if ($row_hide == 1) {
         $data['status'] = 1;
         $condition = array("id" => $row_id);
         $this->Common_model->updateTableData('list', NULL, $condition, $data);
         redirect('administrator/help/viewhelp');
         echo "hi";
         exit;
     } else {
         $data['status'] = 1;
         $condition = array("id" => $row_id);
         $this->Common_model->updateTableData('list', NULL, $condition, $data);
         redirect('administrator/help/viewhelp');
     }
     $this->load->view('template', $data);
     $data['title'] = get_meta_details('Manage_help', 'title');
     $data["meta_keyword"] = get_meta_details('Manage_Listings', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Manage_Listings', 'meta_description');
     $data['message_element'] = "administrator/help/viewhelp";
     $this->load->view('template', $data);
     redirect('administrator/help/viewhelp');
 }
Example #23
0
 function verify()
 {
     if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
         $data['users'] = $this->db->where('id', $this->dx_auth->get_user_id())->from('users')->get()->row();
         $data['profiles'] = $this->db->where('id', $this->dx_auth->get_user_id())->from('profiles')->get()->row();
         $data['fb_app_id'] = $this->db->get_where('settings', array('code' => 'SITE_FB_API_ID'))->row()->string_value;
         $data['fb_app_secret'] = $this->db->get_where('settings', array('code' => 'SITE_FB_API_SECRET'))->row()->string_value;
         $data['fb_app_secret'] = $this->db->get_where('settings', array('code' => 'SITE_FB_API_SECRET'))->row()->string_value;
         $data['title'] = get_meta_details('Verify', 'title');
         $data["meta_keyword"] = get_meta_details('Verify', 'meta_keyword');
         $data["meta_description"] = get_meta_details('Verify', 'meta_description');
         $data['message_element'] = 'home/verify';
         $this->load->view('template', $data);
     } else {
         redirect('users/signin');
     }
 }
Example #24
0
 public function policies()
 {
     if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
         $data['title'] = get_meta_details('Stand_Bys', 'title');
         $data["meta_keyword"] = get_meta_details('Stand_Bys', 'meta_keyword');
         $data["meta_description"] = get_meta_details('Stand_Bys', 'meta_description');
         $data['message_element'] = "hosting/view_policies";
         $this->load->view('template', $data);
     } else {
         redirect('users/signin');
     }
 }
Example #25
0
 public function verify()
 {
     if ($this->dx_auth->is_logged_in() || $this->facebook_lib->logged_in()) {
         if ($this->input->get()) {
             $passkey = $this->input->get('passkey');
             $result = $this->db->where('email_verification_code', $passkey)->where('id', $this->dx_auth->get_user_id())->select('*')->from('users')->get();
             if ($result->num_rows() == 1) {
                 $this->db->where('email_verification_code', $passkey)->update('users', array('email_verify' => 'yes'));
                 //  $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('success','Email Address Successfully Verified.'));
             } else {
                 $this->db->where('email_verification_code', $passkey)->update('users', array('email_verify' => 'no'));
                 //	 $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error','Email Address Not Verified.'));
             }
         }
         $data['title'] = get_meta_details('Verification', 'title');
         $data["meta_keyword"] = get_meta_details('Verification', 'meta_keyword');
         $data["meta_description"] = get_meta_details('Verification', 'meta_description');
         $data['fb_app_id'] = $this->db->get_where('settings', array('code' => 'SITE_FB_API_ID'))->row()->string_value;
         $data['users'] = $this->db->where('id', $this->dx_auth->get_user_id())->from('users')->get()->row();
         $data['profiles'] = $this->db->where('id', $this->dx_auth->get_user_id())->from('profiles')->get()->row();
         $data['message_element'] = "users/view_verify";
         $this->load->view('template', $data);
     } else {
         redirect('users/signin');
     }
 }
Example #26
0
 public function index()
 {
     extract($this->input->get());
     $this->form_validation->set_error_delimiters('<p>', '</p>');
     $check_paypal = $this->db->where('is_enabled', 1)->where('payment_name', 'Paypal')->get('payments')->num_rows();
     $check_credit_card = $this->db->where('is_enabled', 1)->where('payment_name', 'CreditCard')->get('payments')->num_rows();
     //print_r($check_paypal);exit;
     //if($check_paypal == 0 && $check_credit_card ==0 )
     if ($check_paypal == 0 && $check_credit_card == 0) {
         $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate("Payment gateway is not enabled. Please contact admin.")));
         redirect('rooms/' . $this->session->userdata('Lid'));
     }
     $check_room_user = $this->Common_model->getTableData('list', array('id' => $room_id, 'user_id' => $this->dx_auth->get_user_id()));
     if ($check_room_user->num_rows() == 0) {
         redirect('info');
     }
     $check_room_id = $this->db->where('id', $room_id)->where('is_enable', 0)->where('list_pay', 0)->get('list');
     if ($check_room_id->num_rows() == 0) {
         redirect('info');
     }
     if ($this->input->post('book_it_button')) {
         if ($this->input->post('payment_method') == 'braintree') {
             $this->submission_cc($param);
         } else {
             if ($this->input->post('payment_method') == 'paypal') {
                 $this->submission($room_id);
             } else {
                 if ($this->input->post('payment_method') == '2c') {
                     $this->submissionTwoc();
                 } else {
                     redirect('info');
                 }
             }
         }
     }
     $data['id'] = $this->session->userdata('Lid');
     $row1 = $this->Common_model->getTableData('paymode', array('id' => '1'))->row();
     if ($row1->is_premium == 1) {
         if ($row1->is_fixed == 1) {
             $fix = $row1->fixed_amount;
             $amt = get_currency_value_lys($row1->currency, get_currency_code(), $fix);
         } else {
             $per = $row1->percentage_amount;
             $list_price = $check_room_user->row()->price;
             $list_price = get_currency_value_lys($row1->currency, get_currency_code(), $list_price);
             $camt = floatval($list_price * $per / 100);
             $amt = $camt;
         }
     }
     if (!isset($amt)) {
         $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', "Administrator has disabled this commission setup. Please try again."));
         //redirect('rooms/'.$data['id'], "refresh");
     }
     $data['amt'] = round($amt, 2);
     $data['full_cretids'] = 'off';
     $data['result'] = $this->Common_model->getTableData('payments')->result();
     $data['title'] = get_meta_details('Payment_Option', 'title');
     $data["meta_keyword"] = get_meta_details('Payment_Option', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Payment_Option', 'meta_description');
     $data['message_element'] = "payments/view_listPay";
     $this->load->view('template', $data);
 }
Example #27
0
 function city_detail($city = '', $place_id = '')
 {
     $city = $this->Common_model->city_name($city);
     $place = $this->Common_model->place_name($place_id);
     if ($this->db->where('place', $place)->get('neigh_post')->num_rows() == 0) {
         redirect('info/deny');
     }
     $data['cities'] = $this->db->where('city_name', $city)->get('neigh_city');
     $data['detail_place'] = $this->db->where('city', $city)->where('place', $place)->where('is_featured', 1)->get('neigh_post');
     $data['categories'] = $this->db->get('neigh_category');
     $this->db->distinct()->select('neigh_city_place.place_name')->where('neigh_city_place.is_featured', 1)->where('neigh_city_place.city_name', $city);
     $this->db->join('neigh_post', 'neigh_post.place = neigh_city_place.place_name');
     $this->db->from('neigh_city_place');
     $place_ = $this->db->get();
     if ($place_->num_rows() != 0) {
         foreach ($place_->result() as $row) {
             $city_place[] = $row->place_name;
         }
         $data['places'] = $this->db->where('id', $place_id)->get('neigh_city_place');
     }
     $data['lists'] = $this->db->like('address', $place)->where('is_featured', 1)->order_by('page_viewed')->get('list');
     $this->db->select('*')->where('neigh_city_place.is_featured', 1)->where('neigh_city_place.city_name', $city)->where_not_in('neigh_city_place.city_name', $city);
     $this->db->from('neigh_city_place');
     $this->db->join('neigh_post', 'neigh_post.place = neigh_city_place.place_name');
     $data['index_places'] = $this->db->limit(3)->get();
     $data['photographers'] = $this->db->where('city', $city)->where('place', $place)->where('is_featured', 1)->get('neigh_photographer');
     $data['list_count'] = $this->db->like('address', $place)->where('is_enable', 1)->get('list')->num_rows();
     $data['place_map'] = $this->db->where('id', $place_id)->where('is_featured', 1)->get('neigh_city_place');
     $data['tag'] = $this->db->where('city', $city)->where('place', $place)->where('shown', 1)->get('neigh_tag');
     $data['knowledges'] = $this->db->where('city', $city)->where('place', $place)->where('shown', 1)->get('neigh_knowledge');
     $data['title'] = get_meta_details('Neighbourhoods', 'title');
     $data["meta_keyword"] = get_meta_details('Neighbourhoods', 'meta_keyword');
     $data["meta_description"] = get_meta_details('Neighbourhoods', 'meta_description');
     $data['message_element'] = "neighbourhoods/detail_place";
     $this->load->view('template', $data);
 }