?> review</p> </div> <div class="Sub_Most_View_Rgt clsFloatRight"> <p><a title="<?php echo $row->title; ?> " href="<?php echo site_url() . "rooms/" . $row->id; ?> "><?php echo substr($row->title, 0, 25); ?> </a></p> <p> <?php echo get_currency_symbol($row->id) . get_currency_value1($row->id, $row->price) . ' per night'; ?> </p> <p><img src="<?php echo $profpic; ?> " height='30' width="30" alt="Thump" /></p> </div> </div> <?php } } else { ?> <p> <?php echo translate("Sorry! No records found.");
public function ajax_get_results() { $this->load->library("Ajax_pagination"); //get starred list status $star = $this->input->get('starred'); //Get the checkin and chekout dates $checkin = ''; $checkout = ''; $stack = array(); $room_types = array(); $property_type_id = array(); $this->session->set_userdata('ajax_search_location', $this->input->get('location')); $checkin = $this->input->get('checkin'); $checkout = $this->input->get('checkout'); $nof_guest = $this->input->get('guests'); $room_types = $this->input->get('room_types'); $search_view = $this->input->get('search_view'); $min = $this->input->get('price_min'); $max = $this->input->get('price_max'); $keywords = $this->input->get('keywords'); $search_by_map = $this->input->get('search_by_map'); $sw_lat = $this->input->get('sw_lat'); $sw_lng = $this->input->get('sw_lng'); $ne_lat = $this->input->get('ne_lat'); $ne_lng = $this->input->get('ne_lng'); $min_bedrooms = $this->input->get('min_bedrooms'); $property_type = $this->input->get('property_type'); $min_bathrooms = $this->input->get('min_bathrooms'); $min_beds = $this->input->get('min_beds'); $min_bed_type = $this->input->get('min_bed_type'); $property_type_id = $this->input->get('property_type_id'); $hosting_amenities = $this->input->get('hosting_amenities'); $page = $this->input->get('page'); $sort = $this->input->get('sort'); /* if(empty($sort)) { $sort = 1; } */ $data['page'] = $page; if ($checkin != '--' && $checkout != '--' && $checkin != "yy-mm-dd" && $checkout != "yy-mm-dd") { // Specify the start date. This date can be any English textual format $date_from = $checkin; $date_from = strtotime($date_from); // Convert date to a UNIX timestamp // Specify the end date. This date can be any English textual format $date_to = $checkout; $date_to = strtotime($date_to); // Convert date to a UNIX timestamp $arr = array(); // Loop from the start date to end date and output all dates inbetween for ($i = $date_from; $i <= $date_to; $i += 86400) { $arr[] = $i; } $ans = $this->db->query("SELECT id,list_id FROM `calendar` WHERE `booked_days` = '" . get_gmt_time(strtotime($checkin)) . "' OR `booked_days` = '" . get_gmt_time(strtotime($checkout)) . "' GROUP BY `list_id`"); if ($ans->num_rows() == 0) { $ans = $this->db->where_in('booked_days', $arr)->group_by('list_id')->get('calendar'); } $a = $ans->result(); $this->db->flush_cache(); // Now after the checkin is completed if (!empty($a)) { foreach ($a as $a1) { array_push($stack, $a1->list_id); } } } $condition = ''; $location = $this->input->get('location'); $pieces = explode(",", $location); $print = ""; $len = count($pieces); $condition .= "(`status` != '0')"; if ($search_by_map) { $condition .= "AND (`lat` BETWEEN {$sw_lat} AND {$ne_lat}) AND (`long` BETWEEN {$sw_lng} AND {$ne_lng})"; } else { if ($location != '') { $i = 1; foreach ($pieces as $address) { $this->db->flush_cache(); $address = $this->db->escape_like_str($address); if ($i == $len) { $and = ""; } else { $and = " AND "; } if ($i == 1) { $condition .= " AND ("; } $condition .= "`address` LIKE '%" . $address . "%' OR `neighbor` LIKE '%" . $address . "%'" . $and; if ($i == $len) { $condition .= ")"; } $i++; } } } if (!empty($min_bedrooms)) { $condition .= " AND (`bedrooms` = '" . $min_bedrooms . "')"; } if ($property_type != 1) { $condition .= " AND (`property_id` = '" . $property_type . "')"; } if (!empty($min_bathrooms)) { $condition .= " AND (`bathrooms` = '" . $min_bathrooms . "')"; } if (!empty($min_beds)) { $condition .= " AND (`beds` = '" . $min_beds . "')"; } if (!empty($min_bed_type)) { $condition .= " AND (`bed_type` = '" . $min_bed_type . "')"; } if (!empty($stack)) { $condition .= " AND (`id` NOT IN(" . implode(',', $stack) . "))"; } if ($nof_guest > 1) { $condition .= " AND (`capacity` >= '" . $nof_guest . "')"; } if (is_array($room_types)) { if (count($room_types) > 0) { $i = 1; foreach ($room_types as $room_type) { if ($i == count($room_types)) { $and = ""; } else { $and = " AND "; } $or = " OR "; if ($i == 1) { $condition .= " AND ("; } $condition .= "`room_type` = '" . $room_type . "'" . $or . "`neighbor` = '" . $room_type . "'" . $or . "`neighbor` = '" . $room_type . "'" . $or . "`room_type` = '" . $room_type . "'" . $or . "`room_type` = '" . $room_type . "'" . $and; if ($i == count($room_types)) { $condition .= ")"; } $i++; } } } if (is_array($hosting_amenities)) { if (count($hosting_amenities) > 0) { $i = 1; foreach ($hosting_amenities as $amenity) { if ($i == count($hosting_amenities)) { $and = ""; } else { $and = " AND "; } if ($i == 1) { $condition .= " AND ("; } $condition .= "`amenities` LIKE '%" . $amenity . "%'" . $and; if ($i == count($hosting_amenities)) { $condition .= ")"; } $i++; } } } if (isset($min)) { if ($min > 0) { $condition .= " AND (`price` >= '" . $min . "')"; } } else { if (isset($max)) { $min = 0; } } if (isset($max)) { if ($max > $min) { $condition .= " AND (`price` <= '" . $max . "')"; } } if (is_array($property_type_id)) { if (count($property_type_id) > 0) { $i = 1; foreach ($property_type_id as $property_id) { if ($i == count($property_type_id)) { $and = ""; } else { $and = " OR "; } if ($i == 1) { $condition .= " AND ("; } $condition .= "`property_id` = '" . $property_id . "'" . $and; if ($i == count($property_type_id)) { $condition .= ")"; } $i++; } } } if (!empty($keywords)) { $keywords = $this->db->escape_like_str($keywords); $condition .= " AND (`address` LIKE '%" . $keywords . "%' OR `title` LIKE '%" . $keywords . "%' OR `desc` LIKE '%" . $keywords . "%')"; } //Final query $condition .= " AND (`status` != '0') AND (`user_id` != '0') AND (`address` != '0') AND (`is_enable` = '1')"; // Get offset and limit for page viewing $start = (int) $page; // Number of record showing per page $per_page = 20; if ($start > 0) { $offset = ($start - 1) * $per_page; } else { $offset = $start * $per_page; } if ($sort == 2) { $order = "ORDER BY price ASC"; } else { if ($sort == 3) { $order = "ORDER BY price DESC"; } else { if ($sort == 4) { $order = "ORDER BY id DESC"; } else { $order = "ORDER BY id ASC"; } } } //My ShortLists if ($search_view == 2) { $constraint = ""; $shortlists = $this->db->where('id', $this->dx_auth->get_user_id())->get('users')->row()->shortlist; $my_lists = explode(',', $shortlists); $i = 1; foreach ($my_lists as $list) { if ($i == count($my_lists)) { $OR = ""; } else { $OR = " OR "; } $data['query'] = $this->db->query("SELECT * FROM (`list`) WHERE {$condition} {$order} LIMIT {$offset},{$per_page}"); if ($data['query']->num_rows() != 0) { foreach ($data['query']->result() as $row) { if ($row->id == $list) { $constraint .= "`id`= '" . $list . "'" . $OR; } else { } } } $i++; } if ($constraint == '') { $data['query'] = $this->db->query("SELECT * FROM (`list`) where {$condition} AND id=0 {$order} LIMIT {$offset},{$per_page}"); $total_rows = 0; } else { $data['query'] = $this->db->query("SELECT * FROM (`list`) where {$condition} AND {$constraint} {$order} LIMIT {$offset},{$per_page}"); $total_rows = $this->db->query("SELECT * FROM (`list`) where {$condition} AND {$constraint}")->num_rows(); } } else { $data['query'] = $this->db->query("SELECT * FROM (`list`) WHERE {$condition} {$order} LIMIT {$offset},{$per_page}"); $this->session->unset_userdata('query'); $this->session->set_userdata('query', "SELECT * FROM (`list`) WHERE {$condition} ORDER BY id DESC"); $total_rows = $this->db->query("SELECT * FROM (`list`) WHERE {$condition}")->num_rows(); } $config['base_url'] = site_url('search') . '?checkin=' . urlencode($checkin) . '&checkout=' . urlencode($checkout) . '&guests=' . $nof_guest . '&location=' . urlencode($location) . '&min_bathrooms=' . $min_bathrooms . '&min_bedrooms=' . $min_bedrooms . '&min_beds=' . $min_beds . '&min_bed_type=' . $min_bed_type . '&per_page=' . $per_page . '&search_view=1&sort=' . $sort; $config['per_page'] = $per_page; $config['cur_page'] = $start; $config['total_rows'] = $total_rows; $this->ajax_pagination->initialize($config); $pagination = $this->ajax_pagination->create_links(false); $tCount = $data['query']->num_rows(); $properties = ''; $sno = 1; foreach ($data['query']->result() as $row) { //main photo $url = getListImage($row->id); //for map slider full list images $images = $this->Gallery->get_imagesG($row->id); $picture_ids = ''; foreach ($images->result() as $image) { $picture_ids .= '"' . $image->list_id . '/' . $image->name . '",'; } $profile_pic = $this->Gallery->profilepic($row->user_id, 2); if ($tCount == $sno) { $comma = ''; } else { $comma = ','; } $neighbor = $row->neighbor; $final_price = get_currency_value1($row->id, $row->price); /* Offer price calculate */ if ($checkin != '--' && $checkout != '--' && $checkin != "yy-mm-dd" && $checkout != "yy-mm-dd") { $daysdiff = (strtotime($checkout) - strtotime($checkin)) / (60 * 60 * 24); } //My shortlist $short_listed = 0; $cur_user_id = $this->dx_auth->get_user_id(); if ($cur_user_id) { $shortlist = $this->Common_model->getTableData('users', array('id' => $cur_user_id))->row()->shortlist; $my = explode(',', $shortlist); foreach ($my as $list) { if ($list == $row->id) { $short_listed = 1; } } } /* end of offer calculate */ $properties .= '{ "user_thumbnail_url":"' . $profile_pic . '", "user_is_superhost":false, "lat":' . $row->lat . ', "has_video":false, "recommendation_count":0, "lng":' . $row->long . ', "user_id":' . $row->user_id . ', "user_name":"' . get_user_by_id($row->user_id)->username . '", "symbol":"' . get_currency_symbol($row->id) . '", "review_count":' . $row->review . ', "address":"' . $row->address . '", "name":"' . $row->title . '", "picture_ids":[' . substr($picture_ids, 0, -1) . '], "hosting_thumbnail_url":"' . $url . '", "id":' . $row->id . ', "page_viewed":' . $row->page_viewed . ', "price":' . $final_price . ', "short_listed":' . $short_listed . ' }' . $comma; $sno++; } $startlist = 1 + $offset; $endlist = $offset + $per_page; if ($endlist > $total_rows) { $endlist = $total_rows; } $ajax_result = '{ "results_count_html":"\\n<b>' . $startlist . ' – ' . $endlist . '</b> of <b>' . $total_rows . ' listings</b>", "results_count_top_html":" ' . $total_rows . ' ' . translate('results') . '\\n", "view_type":' . $search_view . ', "results_pagination_html":"' . $pagination . '\\n", "present_standby_option":false, "properties":['; $ajax_result .= $properties; $ajax_result .= '], "banner_info":{}, "sort":' . $sort . ' }'; echo $ajax_result; }
?> </span></span> <span class="data"><span class="inner"><?php echo get_currency_symbol($result->list_id) . get_currency_value1($result->list_id, $commission); ?> </span></span> </li> --> <li class="clearfix"> <span class="label"><span class="inner"><span class="checkout_icon" id="icon_cal"></span><?php echo translate("Total Payout"); ?> </span></span> <span class="data"><span class="inner"><?php echo get_currency_symbol($result->list_id) . get_currency_value1($result->list_id, $subtotal); ?> </span></span> </li> <li class="clearfix bottom"> <span class="label" ><span class="inner"><span class="checkout_icon" id="icon_cal"></span> <?php if ($result->status == 1) { ?> <span id="expires_in"> <?php echo translate("Expires in"); ?> </span> <div id="expired1" style="display: none"><?php echo translate('Expired');
isMonthly: false, nameLocked: false, staggeredPrice: "<?php echo get_currency_symbol($room_id) . get_currency_value1($room_id, $Mprice); ?> ", nightlyPrice: "<?php echo get_currency_symbol($room_id) . get_currency_value1($room_id, $price); ?> ", weeklyPrice: "<?php echo get_currency_symbol($room_id) . get_currency_value1($room_id, $Wprice); ?> ", monthlyPrice: "<?php echo get_currency_symbol($room_id) . get_currency_value1($room_id, $Mprice); ?> "}); page3Slideshow.enableKeypressListener(); <?php if ($this->session->userdata('Vcheckin') != '') { ?> jQuery("#checkin").val('<?php echo $this->session->userdata('Vcheckin'); ?> '); <?php } ?>
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); }
public function ajax_refresh_subtotal() { $id = $this->input->get('hosting_id'); $this->session->unset_userdata("total_price_'" . $id . "'_'" . $this->dx_auth->get_user_id() . "'"); $checkin = $this->input->get('checkin'); $checkout = $this->input->get('checkout'); $data['guests'] = $this->input->get('number_of_guests'); $capacity = $this->Common_model->getTableData('list', array('id' => $id))->row()->capacity; $ckin = explode('/', $checkin); $ckout = explode('/', $checkout); $xprice = $this->Common_model->getTableData('price', array('id' => $id))->row(); $guests = $xprice->guests; $per_night = $xprice->night; if (isset($xprice->cleaning)) { $cleaning = $xprice->cleaning; } else { $cleaning = 0; } if (isset($xprice->security)) { $security = $xprice->security; } else { $security = 0; } if (isset($xprice->night)) { $price = $xprice->night; } else { $price = 0; } if (isset($xprice->week)) { $Wprice = $xprice->week; } else { $Wprice = 0; } if (isset($xprice->month)) { $Mprice = $xprice->month; } else { $Mprice = 0; } $guest_count = $xprice->guests; //check admin premium condition and apply so for $query = $this->Common_model->getTableData('paymode', array('id' => 2)); $row = $query->row(); //Seasonal Price //1. Store all the dates between checkin and checkout in an array $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]] == "") { $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; $extra_guest = 1; $extra_guest_price = $xprice->addguests * $diff_guests; } //Cleaning if ($cleaning != 0) { $total_price = $total_price + $cleaning; } if ($security != 0) { $total_price = $total_price + $security; } //Admin Commission $data['commission'] = 0; if ($row->is_premium == 1) { if ($row->is_fixed == 1) { $fix = $row->fixed_amount; $amt = $total_price + $fix; $data['commission'] = $fix; } else { $per = $row->percentage_amount; $camt = floatval($total_price * $per / 100); $amt = $total_price + $camt; $data['commission'] = $camt; } } } if ($is_seasonal == 1) { //Total days $days = $total_nights; //Final price $data['price'] = $total_price; } else { if ($ckin[0] == "mm" && $ckout[0] == "mm" or $ckin[0] == "" && $ckout[0] == "" or $checkin == 'Check in' or $checkout == 'Check out') { $days = 0; $data['price'] = $price; if ($Wprice == 0) { $data['Wprice'] = $price * 7; } else { $data['Wprice'] = $Wprice; } if ($Mprice == 0) { $data['Mprice'] = $price * 30; } else { $data['Mprice'] = $Mprice; } $data['commission'] = 0; if ($row->is_premium == 1) { if ($row->is_fixed == 1) { $fix = $row->fixed_amount; $amt = $price + $fix; $data['commission'] = $fix; $Fprice = $amt; } else { $per = $row->percentage_amount; $camt = floatval($price * $per / 100); $amt = $price + $camt; $data['commission'] = $camt; $Fprice = $amt; } if ($Wprice == 0) { $data['Wprice'] = $price * 7; } else { $data['Wprice'] = $Wprice; } if ($Mprice == 0) { $data['Mprice'] = $price * 30; } else { $data['Mprice'] = $Mprice; } } } else { $diff = strtotime($ckout[2] . '-' . $ckout[0] . '-' . $ckout[1]) - strtotime($ckin[2] . '-' . $ckin[0] . '-' . $ckin[1]); $days = ceil($diff / (3600 * 24)); $price = $price * $days; //Additional guests if ($data['guests'] > $guests) { $diff_days = $data['guests'] - $guests; $price = $price + $days * $xprice->addguests * $diff_days; $extra_guest = 1; $extra_guest_price = $xprice->addguests * $diff_days; } if ($Wprice == 0) { $data['Wprice'] = $price * 7; } else { $data['Wprice'] = $Wprice; } if ($Mprice == 0) { $data['Mprice'] = $price * 30; } else { $data['Mprice'] = $Mprice; } $data['commission'] = 0; if ($days >= 7 && $days < 30) { if (!empty($Wprice)) { $finalAmount = $Wprice; $differNights = $days - 7; $perDay = $Wprice / 7; $per_night = round($perDay, 2); if ($differNights > 0) { $addAmount = $differNights * $per_night; $finalAmount = $Wprice + $addAmount; } $price = $finalAmount; //Additional guests if ($data['guests'] > $guests) { $diff_days = $data['guests'] - $guests; $price = $price + $days * $xprice->addguests * $diff_days; $extra_guest = 1; $extra_guest_price = $xprice->addguests * $diff_days; } } } if ($days >= 30) { if (!empty($Mprice)) { $finalAmount = $Mprice; $differNights = $days - 30; $perDay = $Mprice / 30; $per_night = round($perDay, 2); if ($differNights > 0) { $addAmount = $differNights * $per_night; $finalAmount = $Mprice + $addAmount; } $price = $finalAmount; //Additional guests if ($data['guests'] > $guests) { $diff_days = $data['guests'] - $guests; $price = $price + $days * $xprice->addguests * $diff_days; $extra_guest = 1; $extra_guest_price = $xprice->addguests * $diff_days; } } } if ($row->is_premium == 1) { if ($row->is_fixed == 1) { $fix = $row->fixed_amount; $amt = $price + $fix; $data['commission'] = $fix; $Fprice = $amt; } else { $per = $row->percentage_amount; $camt = floatval($price * $per / 100); $amt = $price + $camt; $data['commission'] = $camt; $Fprice = $amt; } if ($Wprice == 0) { $data['Wprice'] = $price * 7; } else { $data['Wprice'] = $Wprice; } if ($Mprice == 0) { $data['Mprice'] = $price * 30; } else { $data['Mprice'] = $Mprice; } } $xprice = $this->Common_model->getTableData('list', array('id' => $id))->row(); if ($cleaning != 0) { $price = $price + $cleaning; } if ($security != 0) { $price = $price + $security; } $data['price'] = $price; } } $query = $this->db->query("SELECT id,list_id FROM `calendar` WHERE `list_id` = '" . $id . "' AND (`booked_days` = '" . get_gmt_time(strtotime($checkin)) . "' OR `booked_days` = '" . get_gmt_time(strtotime($checkout)) . "') GROUP BY `list_id`"); $rows = $query->num_rows(); $daysexist = $this->db->query("SELECT id,list_id,booked_days FROM `calendar` WHERE `list_id` = '" . $id . "' AND (`booked_days` >= '" . get_gmt_time(strtotime($checkin)) . "' AND `booked_days` <= '" . get_gmt_time(strtotime($checkout)) . "') GROUP BY `list_id`"); $rowsexist = $daysexist->num_rows(); if ($rowsexist > 0) { if (isset($extra_guest)) { if ($extra_guest == 1) { echo '{"available":false,"extra_guest":1,"extra_guest_price":"' . get_currency_symbol($id) . get_currency_value1($id, $extra_guest_price) . '","total_price":' . $data['price'] . ',"reason_message":"Those dates are not available"}'; } } else { echo '{"available":false,"total_price":' . $data['price'] . ',"reason_message":"Those dates are not available"}'; } } else { if ($data['guests'] > $capacity) { echo '{"available":false,"total_price":' . $data['price'] . ',"reason_message":"' . $capacity . ' guest(s) only allowed"}'; } else { $this->session->set_userdata("total_price_'" . $id . "'_'" . $this->dx_auth->get_user_id() . "'", $data['price']); $staggered_price = ""; if ($days >= 30) { $staggered_price = ',"staggered_price":"' . get_currency_symbol($id) . get_currency_value1($id, $data['price']) . '","staggered":false'; } if (isset($extra_guest)) { if ($extra_guest == 1) { echo '{"service_fee":"' . get_currency_symbol($id) . get_currency_value_lys($row->currency, get_currency_code(), $data['commission']) . '","extra_guest_price":"' . get_currency_symbol($id) . get_currency_value1($id, $extra_guest_price) . '","extra_guest":1,"reason_message":"","price_per_night":"' . get_currency_symbol($id) . get_currency_value1($id, $per_night) . '","nights":' . $days . ',"available":true,"can_instant_book":false,"total_price":"' . get_currency_symbol($id) . get_currency_value1($id, $data['price']) . '"' . $staggered_price . '}'; } } else { echo '{"service_fee":"' . get_currency_symbol($id) . get_currency_value_lys($row->currency, get_currency_code(), $data['commission']) . '","reason_message":"","price_per_night":"' . get_currency_symbol($id) . get_currency_value1($id, $per_night) . '","nights":' . $days . ',"available":true,"can_instant_book":false,"total_price":"' . get_currency_symbol($id) . get_currency_value1($id, $data['price']) . '"' . $staggered_price . '}'; } } } }
?> </a> </span> </strong> <br> <!--<a href="<?php echo base_url() . 'rooms/' . $row->list_id; ?> "><?php echo $city[2] . " - " . get_currency_symbol() . "" . $row->price; ?> </a> <a href="<?php echo base_url() . 'rooms/' . $row->list_id; ?> "><?php echo $city[2] . " - " . get_currency_symbol($row->list_id) . get_currency_value1($row->list_id, "" . $row->price); ?> </a> </div> <span class="thumb_img"> <img src="<?php echo $profile_pic; ?> " height="40" width="40" style="border-radius: 50%;" /> </span> </div> --> </li> <?php } ?> </ul>
<link rel="stylesheet" href="<?php echo css_url(); ?> /jquery-ui.css" /> <script src="<?php echo base_url(); ?> js/jquery-1.8.3.min.js"></script> <script src="<?php echo base_url(); ?> js/jquery-ui.min.js"></script> <?php $currency_code = $this->Common_model->getTableData('currency', array('status' => 1, 'default' => 1))->row()->currency_code; $id = $this->Common_model->getTableData('list')->row()->id; $min_value = get_currency_value1($id, 9); ?> <script> $(function() { $( "#expirein" ).datepicker( { minDate: new Date(), dateFormat: "dd/mm/yy", maxDate: "+2Y", nextText: "", prevText: "", numberOfMonths: 1, showButtonPanel: true } ); });
<br><br><span class="endcap"><b><?php echo get_currency_symbol($list_id) . " " . get_currency_value1($list_id, $price); ?> </b></span> </td> <?php } else { $full_date = $next_month . '/' . $day_nextmonth . '/' . $next_year; $pre_schedules = '<td id="day_' . $i . '" class="realday available"> <span class="dom">' . $day_nextmonth . '</span><br><br><span class="endcap"><b>' . get_currency_symbol($list_id) . ' ' . get_currency_value1($list_id, $price) . '</b></span> </td>'; foreach ($result as $row) { if (get_gmt_time(strtotime($full_date)) == $row->booked_days) { $pre_schedules = '<td id="day_' . $i . '" class="realday unavailable"> <span class="dom">' . $day_nextmonth . '</span><br><br><span class="endcap"><b>' . get_currency_symbol($list_id) . ' ' . get_currency_value1($list_id, $price) . '</b></span> </td>'; } } echo $pre_schedules; } $day_count++; $day_nextmonth++; $i++; $j++; if ($k == 7) { $k = 0; echo '</tr>'; } $k++; }
<!--<?php echo get_currency_symbol($result->list_id) . get_currency_value_lys($result->currency, get_currency_code(), $subtotal); ?> </span> </span>--> </li> <!-- <li class="clearfix"> <span class="label"><span class="inner"><span class="checkout_icon" id="icon_cal"></span><?php echo translate("Host fee"); ?> </span></span> <span class="data"><span class="inner"><?php echo get_currency_symbol($result->list_id) . get_currency_value1($result->list_id, $commission); ?> </span></span> </li> --> <li class="clearfix"> <span class="label col-md-4 col-sm-5 col-xs-12"><span class="inner"><span class="checkout_icon" id="icon_cal"></span><?php echo translate("Total Payout"); ?> </span></span> <span class="data col-md-8 col-sm-7 col-xs-12"><span class="inner"><?php echo get_currency_symbol($result->list_id) . get_currency_value_lys($result->currency, get_currency_code(), $subtotal); if ($result->contacts_offer == 1) { $special_offer = '(Special offer used.)'; } else {
function submission_cc($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"); } $checkin = $this->input->post('checkin'); $checkout = $this->input->post('checkout'); $number_of_guests = $this->input->post('number_of_guests'); $ckin = explode('/', $checkin); $ckout = explode('/', $checkout); $id = $this->uri->segment(3); if ($this->session->userdata('mobile_user_id')) { $user_id = $this->session->userdata('mobile_user_id'); $this->session->unset_userdata('mobile_user_id'); } else { $user_id = $this->dx_auth->get_user_id(); } if ($ckin[0] == "mm") { $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Access denied.'))); redirect('rooms/' . $id, "refresh"); } if ($ckout[0] == "mm") { $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Access denied.'))); redirect('rooms/' . $id, "refresh"); } $xprice = $this->Common_model->getTableData('price', array('id' => $this->uri->segment(3)))->row(); $price = $xprice->night; $placeid = $xprice->id; $guests = $xprice->guests; $extra_guest_price = $xprice->addguests; if (isset($xprice->cleaning)) { $cleaning = $xprice->cleaning; } else { $cleaning = 0; } if (isset($xprice->security)) { $security = $xprice->security; } else { $security = 0; } 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)); $q = $query->result(); $diff = strtotime($ckout[2] . '-' . $ckout[0] . '-' . $ckout[1]) - strtotime($ckin[2] . '-' . $ckin[0] . '-' . $ckin[1]); $days = ceil($diff / (3600 * 24)); $user_travel_cretids = 0; if ($this->session->userdata('travel_cretids')) { $amt = $this->session->userdata('travel_cretids'); $user_travel_cretids = $this->session->userdata('user_travel_cretids'); $is_travelCretids = md5('Yes Travel Cretids'); } else { if ($number_of_guests > $guests) { $diff_days = $number_of_guests - $guests; $amt = $price * $days + $days * $xprice->addguests * $diff_days; } else { $amt = $price * $days; } if ($days >= 7 && $days < 30) { if (!empty($Wprice)) { $finalAmount = $Wprice; $differNights = $days - 7; $perDay = $Wprice / 7; $per_night = 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 = round($perDay, 2); if ($differNights > 0) { $addAmount = $differNights * $per_night; $finalAmount = $Mprice + $addAmount; } $amt = $finalAmount; } } //Cleaning fee if ($cleaning != 0) { $amt = $amt + $cleaning; } if ($security != 0) { $amt = $amt + $cleaning; } else { $amt = $amt; } $to_pay = 0; $admin_commission = 0; //Amount from session // $amt=$this->session->userdata("total_price_'".$id."'_'".$this->dx_auth->get_user_id()."'"); //commission calculation $query = $this->Common_model->getTableData('paymode', array('id' => 2)); $row = $query->row(); if ($row->is_premium == 1) { if ($row->is_fixed == 1) { $to_pay = $amt; $fix = $row->fixed_amount; $amt = $amt + get_currency_value_lys($row->currency, get_currency_code(), $fix); //$amt = $this->session->userdata('topay'); $admin_commission = get_currency_value_lys($row->currency, get_currency_code(), $fix); } else { $to_pay = $amt; $per = $row->percentage_amount; $percentage = $per / 100; $admin_commission = $percentage * $to_pay; /* $camt = floatval(($amt * $per) / 100); $amt = $amt + $camt; $amt = $amt; $admin_commission = $camt+get_currency_value_lys($row->currency,get_currency_code(),$camt); */ // print_r($admin_commission); } } else { $amt = $amt; $to_pay = $amt; print_r($to_pay); } $is_travelCretids = md5('No Travel Cretids'); } //echo $amt;exit; if ($contact_key != '') { $contact_result = $this->db->where('contact_key', $contact_key)->get('contacts')->row(); $amt = $contact_result->price + $contact_result->admin_commission; $this->session->set_userdata('contacts_offer', $contact_result->offer); } $ref_total1 = $ref_total + 10; if ($amt > $ref_total1) { if ($this->db->select('referral_amount')->where('id', $user_id)->get('users')->row()->referral_amount != 0) { $referral_amount = $this->db->select('referral_amount')->where('id', $user_id)->get('users')->row()->referral_amount; if ($referral_amount > $ref_total) { $final_amt = get_currency_value1($id, $amt) - get_currency_value($ref_total); } else { $final_amt = $amt - $referral_amount; } $amt = $final_amt; } else { $amt = $amt; } } else { $amt = $amt; } $amount = $amt; if ($contact_key == "") { $contact_key = "None"; } //Entering it into data variables $row = $this->Common_model->getTableData('payment_details', array('code' => 'PAYPAL_ID'))->row(); $paymode = $this->db->where('payment_name', 'Paypal')->get('payments')->row()->is_live; if ($this->session->userdata('final_amount') != '') { $amt = $this->session->userdata('final_amount'); $this->session->unset_userdata('final_amount'); } else { $amt = get_currency_value1($id, $amt) + $admin_commission; } //seasonal price $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)); // echo "<pre>"; // print_r($i); $total_nights++; } for ($i = 1; $i < $total_nights; $i++) { $seasonal_prices[$travel_dates[$i]] = ""; } $seasonal_query = $this->Common_model->getTableData('seasonalprice', array('list_id' => $id)); $seasonal_result = $seasonal_query->result_array(); // echo "<pre>"; // print_r($seasonal_result); if ($seasonal_query->num_rows() > 0) { foreach ($seasonal_result as $time) { $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)); //echo "<pre>"; //print_r($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) + $seasonal_prices[$travel_dates[$i]]; //echo "$total_price"; $is_seasonal = 1; } } // echo "$total_price"; //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; //echo "$total_price"; $data['extra_guest_price'] = get_currency_value1($id, $xprice->addguests) * $diff_guests; } //echo "$total_price"; //Cleaning if ($cleaning != 0) { $total_price = $total_price + get_currency_value1($id, $cleaning); // echo "$total_price"; } if ($security != 0) { $total_price = $total_price + get_currency_value1($id, $security); // echo "$total_price"; } $data['avg_price'] = $total_price / $days; $per_night = $data['avg_price']; $topay = $per_night * $days - $this->session->userdata("coupon_amt"); $query = $this->Common_model->getTableData('paymode', array('id' => 2)); $row = $query->row(); $percentage = $per / 100; $amount = $per_night * $days * $percentage; $admin_commission = $amount; $amt = $admin_commission + $topay; $total_price = $total_price - $this->session->userdata("coupon_amt"); } // echo "$total_price"; //Seasonal price $this->session->set_userdata('subtotal', $amt); /*if($this->session->userdata('booking_currency_symbol')) {*/ //$custom = $id.'@'.$user_id.'@'.get_gmt_time(strtotime($checkin)).'@'.get_gmt_time(strtotime($checkout)).'@'.$number_of_guests.'@'.$is_travelCretids.'@'.$user_travel_cretids.'@'.$to_pay.'@'.$admin_commission.'@'.$contact_key.'@'.$cleaning.'@'.$security.'@'.$extra_guest_price.'@'.$guests.'@'.$amt.'@'.$this->session->userdata('booking_currency_symbol'); /*} else {*/ //print_r($to_pay); //print_r($admin_commission); //print_r($amt); $custom = $id . '@' . $user_id . '@' . get_gmt_time(strtotime($checkin)) . '@' . get_gmt_time(strtotime($checkout)) . '@' . $number_of_guests . '@' . $is_travelCretids . '@' . $user_travel_cretids . '@' . get_currency_value1($id, $total_price) . '@' . $admin_commission . '@' . $contact_key . '@' . get_currency_value1($id, $cleaning) . '@' . get_currency_value1($id, $security) . '@' . get_currency_value1($id, $extra_guest_price) . '@' . $guests . '@' . $amt . '@' . $this->session->userdata('booking_currency_symbol'); //print_r($custom); //exit; //$custom = $id.'@'.$user_id.'@'.get_gmt_time(strtotime($checkin)).'@'.get_gmt_time(strtotime($checkout)).'@'.$number_of_guests.'@'.$is_travelCretids.'@'.$user_travel_cretids.'@'.$to_pay.'@'.$admin_commission.'@'.$contact_key.'@'.$cleaning.'@'.$security.'@'.$extra_guest_price.'@'.$guests.'@'.$amt.'@'.$this->session->userdata('booking_currency_symbol').'@'.$per_night; //$custom = $id.'@'.$user_id.'@'.get_gmt_time(strtotime($checkin)).'@'.get_gmt_time(strtotime($checkout)).'@'.$number_of_guests.'@'.$is_travelCretids.'@'.$user_travel_cretids.'@'.$amt.'@'.$admin_commission.'@'.$contact_key.'@'.$cleaning.'@'.$security.'@'.$extra_guest_price.'@'.$guests.'@'.$to_pay.'@'.$this->session->userdata('booking_currency_symbol').'@'.$per_night; //} $this->session->set_userdata('custom', $custom); $clientToken = Braintree_ClientToken::generate(array()); if ($clientToken == '401') { $username = $this->dx_auth->get_username(); $list_title = $this->Common_model->getTableData('list', array('id' => $id))->row()->title; $email = $this->Common_model->getTableData('users', array('id' => $this->dx_auth->get_user_id()))->row()->email; $admin_email = $this->Common_model->getTableData('users', array('id' => 1))->row()->email; $admin_email_from = $this->dx_auth->get_site_sadmin(); $admin_name = $this->dx_auth->get_site_title(); $email_name = 'payment_issue_to_admin'; $splVars = array("{payment_type}" => 'Braintree', "{site_name}" => $this->dx_auth->get_site_title(), "{username}" => ucfirst($username), "{list_title}" => $list_title, '{email_id}' => $email); $this->Email_model->sendMail($admin_email, $admin_email_from, ucfirst($admin_name), $email_name, $splVars); $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate("Braintree business account is misconfigured. Please contact your Administrator."))); redirect('rooms/' . $id, "refresh"); } $data['title'] = "Payments"; $data["meta_keyword"] = ""; $data["meta_description"] = ""; $data['clientToken'] = $clientToken; $data['message_element'] = "payments/checkout"; $this->load->view('template', $data); }
function submission($param = '', $contact_key) { $checkin = $this->input->post('checkin'); $checkout = $this->input->post('checkout'); $number_of_guests = $this->input->post('number_of_guests'); $ckin = explode('/', $checkin); $ckout = explode('/', $checkout); $pay = $this->Common_model->getTableData('paywhom', array('id' => 1)); $paywhom = $pay->result(); $paywhom = $paywhom[0]->whom; $id = $this->uri->segment(3); if ($ckin[0] == "mm") { $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Access denied.'))); redirect('rooms/' . $id, "refresh"); } if ($ckout[0] == "mm") { $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('error', translate('Sorry! Access denied.'))); redirect('rooms/' . $id, "refresh"); } $xprice = $this->Common_model->getTableData('price', array('id' => $this->uri->segment(3)))->row(); $price = $xprice->night; //$price = $xprice->night; $placeid = $xprice->id; $guests = $xprice->guests; $extra_guest_price = $xprice->addguests; if (isset($xprice->cleaning)) { $cleaning = $xprice->cleaning; } else { $cleaning = 0; } if (isset($xprice->security)) { $security = $xprice->security; } else { $security = 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)); $q = $query->result(); $diff = strtotime($ckout[2] . '-' . $ckout[0] . '-' . $ckout[1]) - strtotime($ckin[2] . '-' . $ckin[0] . '-' . $ckin[1]); $days = ceil($diff / (3600 * 24)); $user_travel_cretids = 0; if ($this->session->userdata('travel_cretids')) { $amt = $this->session->userdata('travel_cretids'); $user_travel_cretids = $this->session->userdata('user_travel_cretids'); $is_travelCretids = md5('Yes Travel Cretids'); } else { if ($number_of_guests > $guests) { $diff_days = $number_of_guests - $guests; $amt = $price * $days + $days * $xprice->addguests * $diff_days; } else { $amt = $price * $days; } if ($days >= 7 && $days < 30) { if (!empty($Wprice)) { $finalAmount = $Wprice; $differNights = $days - 7; $perDay = $Wprice / 7; $per_night = 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 = round($perDay, 2); if ($differNights > 0) { $addAmount = $differNights * $per_night; $finalAmount = $Mprice + $addAmount; } $amt = $finalAmount; } } //Cleaning fee if ($cleaning != 0) { $amt = $amt + $cleaning; } if ($security != 0) { $amt = $amt + $cleaning; } else { $amt = $amt; } $to_pay = 0; $admin_commission = 0; //Amount from session // $amt=$this->session->userdata("total_price_'".$id."'_'".$this->dx_auth->get_user_id()."'"); //commission calculation $query = $this->Common_model->getTableData('paymode', array('id' => 2)); $row = $query->row(); if ($row->is_premium == 1) { if ($row->is_fixed == 1) { $to_pay = $amt; $fix = $row->fixed_amount; $amt = $amt + $fix; //$amt = $this->session->userdata('topay'); $admin_commission = $fix; } else { $to_pay = $amt; $per = $row->percentage_amount; $camt = floatval($amt * $per / 100); $amt = $amt + $camt; $amt = $amt; $admin_commission = $camt; } } else { $amt = $amt; $to_pay = $amt; } $is_travelCretids = md5('No Travel Cretids'); } //echo $amt;exit; if ($contact_key != '') { $contact_result = $this->db->where('contact_key', $contact_key)->get('contacts')->row(); $amt = $contact_result->price + $contact_result->admin_commission; } if ($amt > 110) { if ($this->db->select('referral_amount')->where('id', $this->dx_auth->get_user_id())->get('users')->row()->referral_amount != 0) { $referral_amount = $this->db->select('referral_amount')->where('id', $this->dx_auth->get_user_id())->get('users')->row()->referral_amount; if ($referral_amount > 100) { $final_amt = get_currency_value1($id, $amt) - get_currency_value(100); } else { $final_amt = $amt - $referral_amount; } $amt = $final_amt; } else { $amt = $amt; } } else { $amt = $amt; } if ($contact_key == "") { $contact_key = "None"; } //Entering it into data variables $row = $this->Common_model->getTableData('payment_details', array('code' => 'PAYPAL_ID'))->row(); $paymode = $this->db->where('payment_name', 'Paypal')->get('payments')->row()->is_live; $custom = $id . '@' . $this->dx_auth->get_user_id() . '@' . get_gmt_time(strtotime($checkin)) . '@' . get_gmt_time(strtotime($checkout)) . '@' . $number_of_guests . '@' . $is_travelCretids . '@' . $user_travel_cretids . '@' . get_currency_value1($id, $to_pay) . '@' . get_currency_value1($id, $admin_commission) . '@' . $contact_key . '@' . get_currency_value1($id, $cleaning) . '@' . get_currency_value1($id, $security) . '@' . get_currency_value1($id, $extra_guest_price) . '@' . $guests; $this->session->set_userdata('custom', $custom); if ($this->session->userdata('final_amount') != '') { $amt = $this->session->userdata('final_amount'); $this->session->unset_userdata('final_amount'); } else { $amt = get_currency_value1($id, $amt); } $to_buy = array('desc' => 'Purchase from ACME Store', 'currency' => get_currency_code(), 'type' => 'sale', 'return_URL' => site_url('payments/paypal_success'), 'cancel_URL' => site_url('payments/paypal_cancel'), 'shipping_amount' => 0, 'get_shipping' => false); // I am just iterating through $this->product from defined // above. In a live case, you could be iterating through // the content of your shopping cart. //foreach($this->product as $p) { $temp_product = array('name' => $this->dx_auth->get_site_title() . ' Transaction', 'number' => $placeid, 'quantity' => 1, 'amount' => $amt); // add product to main $to_buy array $to_buy['products'][] = $temp_product; //} // enquire Paypal API for token $set_ec_return = $this->paypal_ec->set_ec($to_buy); if (isset($set_ec_return['ec_status']) && $set_ec_return['ec_status'] === true) { // redirect to Paypal $this->paypal_ec->redirect_to_paypal($set_ec_return['TOKEN']); // You could detect your visitor's browser and redirect to Paypal's mobile checkout // if they are on a mobile device. Just add a true as the last parameter. It defaults // to false // $this->paypal_ec->redirect_to_paypal( $set_ec_return['TOKEN'], true); } else { $this->_error($set_ec_return); } }
<?php $roomtotal = get_currency_value1($id, $subtotal); ?> <input type="hidden" value=<?php echo $roomtotal; ?> name="roomtotal" /> <?php $commission = get_currency_value1($id, $commission); ?> <input type="hidden" value=<?php echo $commission; ?> name="commission" /> <?php $subtotal = get_currency_value1($id, $amt); ?> <input type="hidden" value=<?php echo $subtotal; ?> name="subtotal" /> <?php //} ?> <!-- Deepak Security Deposit Amount Ends --> <p> <input type="button" name="book_it_button" id="p4_book_it_button" class="btn large blue" value="<?php
echo $nights; ?> </span></span> </li>--> </ul> <ul id="details_breakdown_1" class="dashed_table_1 clearfix"> <li class="top clearfix"> <span class="label col-md-4 col-sm-5 col-xs-12"><span class="inner"><span class="checkout_icon" id="icon_cal"></span><?php echo translate("Rate") . '( ' . translate("per night") . ' )'; ?> </span></span> <span class="data col-md-8 col-sm-7 col-xs-12"><span class="inner"><?php echo get_currency_symbol($result->list_id) . get_currency_value1($result->list_id, $per_night); ?> </span></span> </li> <?php if ($cleaning != 0) { ?> <li class="clearfix"> <span class="label col-md-4 col-sm-5 col-xs-12"><span class="inner"><span class="checkout_icon" id="icon_cal"></span><?php echo translate("Cleaning Fee"); ?> </span></span> <span class="data col-md-8 col-sm-7 col-xs-12"><span class="inner"><?php echo get_currency_symbol($result->list_id) . get_currency_value_lys($result->currency, get_currency_code(), $cleaning); ?>
public function request($param = '') { if (isset($param)) { $contact_id = $param; $conditions = array('contacts.id' => $contact_id, 'contacts.userto' => $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; $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; $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)); $amt = $data['subtotal'] = $result->row()->price; $data['price_original'] = $result->row()->original_price; if ($data['price_original'] == 0) { $data['price_original'] = get_currency_value1($list_id, $data['per_night']); } if ($data['price_original'] == '') { $amt = $data['price_original'] = $result->row()->price; } $data['message'] = $this->Common_model->getTableData('messages', array('contact_id' => $data['result']->id, 'message_type' => '7'))->row()->message; $data['commission'] = $result->admin_commission; //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'] = $amt ; } else { $per = $row->percentage_amount; $camt = floatval(($amt * $per) / 100); $amt = $amt - $camt; $data['commission'] = $camt ; } } else {*/ $amt = $amt; //} $data['send_date'] = $result->row()->send_date; $data['totalprice'] = $result->row()->price; $data['subtotal'] = $result->row()->price; $data['currency'] = $result->row()->currency; $data['per_night'] = $price = $result->row()->price / $days; $data['checkin'] = strtotime($data['result']->checkin); $data['checkout'] = strtotime($data['result']->checkout); $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/request'; //print_r($data); $this->load->view('template', $data); } else { redirect('info'); } }
} ?> </select> </span> </li> <li> <label for="hosting_extras_price_native"><?php echo translate("Cleaning Fees"); ?> </label> <span class="currency_symbol"><?php echo get_currency_symbol($room_id); ?> </span> <input id="hosting_extras_price_native" name="cleaning" size="30" maxlength="3" type="text" value=<?php if ($list_price->cleaning) { echo get_currency_value1($room_id, $list_price->cleaning); } else { echo '""'; } ?> /> </li> </ul> </div> </div> <button style="margin: 10px 0px 0px;" class="btn green gotomsg" type="submit"><span><span><?php echo translate("Save"); ?> </span></span></button> <p id="show" style="display: none; float: right; color:red;margin-right:300px; "></p> <div>
?> <sup></sup><span class="optional_usd"> </span> </span> </span> </li> <?php } ?> <?php if (isset($extra_guest_price)) { if ($extra_guest_price != 0) { ?> <li> <span class="label col-md-3 col-sm-3 col-xs-12" > <span class="inner"><span class="checkout_icon" id="icon_rate_pn"></span><?php echo translate("Additional Guest Fee"); ?> </span> </span> <span class="data col-md-9 col-sm-9 col-xs-12 padding-zero"> <span class="inner"> <?php echo get_currency_symbol($id) . get_currency_value1($id, $extra_guest_price); ?> <sup></sup><span class="optional_usd"> </span> </span> </span> </li> <?php } } ?> <li class="col-md-12 col-sm-12 col-xs-12 padding-zero padding-zero padding-zero"> <span class="label col-md-3 col-sm-3 col-xs-12"><span class="inner"><span class="checkout_icon" id="icon_sub_tot"></span> <?php echo translate("Subtotal"); ?> </span></span> <span class="data col-md-9 col-sm-9 col-xs-12 padding-zero"> <span class="inner"> <?php echo get_currency_symbol($id) . $subtotal; ?>
echo $query["id"]; ?> "><?php echo $query["title"]; ?> </a></div> <?php //echo $query["user_id"]; ?> </td> <div class="wish_address"><?php echo $query["address"]; ?> </div> <div class="wish_address"><?php echo get_currency_symbol($query["id"]) . get_currency_value1($query["id"], $query["price"]); ?> </div> <div class="wish_remove"> <a title="Remove My Wishlist" href="<?php echo base_url() . 'account/remove_my_shortlist/' . $query["id"]; ?> " onclick="return confirm('Are you sure to Remove your Wish list?');"> <img src="<?php echo base_url(); ?> /images/Delete.png" alt="Remove My Wishlist" title="Remove My Wishlist" /></a> </div> </div> <?php } else { echo '<div class="no_wishlist" style="padding:50px;text-align:center;">' . translate("No Wishlist") . '</div>';
function ajax_get_symbol() { extract($this->input->get()); echo '{"symbol":"' . get_currency_symbol($id) . '","min_price":"' . get_currency_value1($id, 10) . '","max_price":"' . get_currency_value1($id, 10000) . '"}'; }
?> > <div style="position:absolute; bottom:0; left:0;"> <table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="bottom" width="75%"> <?php echo '<div class="pop_img_h">' . $query['title'] . '</div>'; echo '<div class="pop_img_h_place">' . $city['2'] . ',' . $query['country'] . '</div>'; ?> </td> <td align="right" valign="bottom" width="25%"> <div class="pop_img_h_dollar" style="position:absolute: right:0; bottom:0;"> <div class="pop_doll"> <?php echo '<p class="dollor_symbol">' . get_currency_symbol($query['id']) . '</p><p class="dollor_price">' . get_currency_value1($query['id'], $query['price']); ?> <p class="per_night"><?php echo translate('per night'); ?> </p> </div> </div> </td> </tr> </table> </div></div></a> </li> <?php } }
</style> <div class="col-6 row-space-4"> <div class=""> <div class="panel-image listing-img img-large"> <a style="background-image:url(<?php echo $image; ?> );background-size: cover;" class="media-photo media-cover wishlist-bg-img" href="/rooms/281390"> </a> <div class="panel-overlay-bottom-left panel-overlay-label panel-overlay-listing-label"> <sup class="h6 text-contrast" style="font-size: 14px;"><?php echo get_currency_symbol1(); ?> </sup> <span class="h3 price-amount" style="font-size: 24px;"><?php echo get_currency_value1($row->list_id, $row->price); ?> </span> <sup class="h6 text-contrast" style="font-size: 14px;"><?php echo get_currency_code(); ?> </sup> </div> <div class="panel-overlay-top-right wl-social-connection-panel"> <span class="rich-toggle wish_list_button wishlist-button not_saved"> <label for=""> <?php $wishlist_user_check = $this->Common_model->getTableData('user_wishlist', array('list_id' => $row->list_id, 'user_id' => $this->dx_auth->get_user_id())); if (!$this->dx_auth->is_logged_in()) {
function fun_friends_fb_id() { $id = $this->input->post('fb_id'); $name = $this->input->post('fb_name'); $friends_count = $this->input->post('friends_count'); $i = 0; // Count for fb user contained Lists foreach ($id as $fb_id) { $result = $this->db->select('*')->where('fb_id', $fb_id)->from('users')->get(); if ($result->num_rows() != 0) { $user_id = $result->row()->id; $list_user_id = $this->db->where('user_id', $user_id)->get('list'); if ($list_user_id->num_rows() != 0) { $i++; foreach ($list_user_id->result() as $list_row) { $conditions = array('list_id' => $list_row->id); $limit = array(1); $result_img = $this->Gallery->get_imagesG(NULL, $conditions, $limit); if ($result_img->num_rows() != 0) { foreach ($result_img->result() as $image) { echo '<div class="fb_main"><a href="' . base_url() . 'rooms/' . $image->list_id . '"> <img src="' . base_url() . 'images/' . $image->list_id . '/' . $image->name . '" width="995" height="427"/></a>'; } } else { echo '<div class="fb_main"><a href="' . base_url() . 'rooms/' . $list_row->id . '"> <img src="' . base_url() . 'images/no_image.jpg" width="995" height="427"/></a>'; } echo '<div class="connect_fb">'; echo '<img src="https://graph.facebook.com/' . $fb_id . '/picture" width="30" height="30"/><br>' . $result->row()->username . ' Saved<br>'; echo '<a class="fb_title" href="' . base_url() . 'rooms/' . $list_row->id . '">' . $list_row->title . '</a><br></div>'; echo '<div class="fb_price_bg"><div class="fb_price"><p class="fb_dollar">' . get_currency_symbol($list_row->id) . '<p>' . get_currency_value1($list_row->id, $list_row->price) . '<br><p class="per_night">' . translate('per night') . '</p></div></div></div>'; } } } } if ($i == 0) { echo '<br><br><div class="list-view" data-feed-container=""> <div class="no-fb-friends-container"> <h2 style="font-size: 24px; line-height: 1.5;">' . translate('Looks like none of your friends have signed up for') . ' ' . $this->dx_auth->get_site_title() . ' ' . translate('yet.') . '</h2> <br><a class="btn green" href="' . base_url() . 'home/dashboard/">' . translate('Invite them now') . '!</a> </div> </div>'; } /* else { echo '<br><br><img src="'.base_url().'images/page2_spinner.gif">'; } */ }
"><?php echo ucfirst(get_user_by_id($row->userby)->username); ?> </a> </span></p> <p style="margin:5px 0 0 0;"><a class="clsLink2_Bg" href="<?php echo site_url('trips/send_message/' . $row->userby); ?> "><?php echo translate("View") . ' / ' . translate("Send") . ' ' . translate("Message"); ?> </a></p> </td> <td width="15%"> <p><?php echo get_currency_symbol($row->list_id) . get_currency_value1($row->list_id, $row->price); ?> </p> <p class="clsBold"><?php echo anchor('trips/request/' . $row->id, translate("View Confirmation")); ?> </p> <?php if ($row->status < 8 && $row->status != 5 && $row->status != 6 && $row->status != 4 && $row->status != 2) { ?> <p class="clsBold"><a id="cancellation_<?php echo $row->id; ?> " href="<?php echo site_url('travelling/cancel_travel/' . $row->id . '/' . $row->list_id); ?>
echo $i; ?> );"> <div class="tile_container"> <div class="day"><?php echo $day_nextmonth; ?> </div> <div class="line_reg" style="z-index:<?php echo $j; ?> ;" id="square_<?php echo $i; ?> "> <span class="startcap"></span> <span class="content"></span> <span class="endcap"><b><?php echo get_currency_symbol($list_id) . get_currency_value1($list_id, $price); ?> </b></span> </div> </div> </div> <?php } ?> <?php $day_count++; $day_nextmonth++; $i++; $j--; if ($k == 7) { $k = 0; echo '<div class="clear"></div></div>';
} if ($row->message_type != 9) { ?> <div class="clsMeg_Off clsFloatRight"> <p> <span><?php echo $row->name; ?> </span> <?php if (isset($topay)) { // $topay = get_currency_value2($currency,$topay); ?> <br> <span><?php echo get_currency_symbol($row->list_id) . get_currency_value1($row->list_id, $topay); ?> </span> <?php } ?> </p> </div> <?php } ?> </li> <?php } } else { ?>
public function wishlists($param) { $this->session->set_userdata('wishlist_id', $param); $wishlists_data = $this->Common_model->getTableData('wishlists', array('id' => $param)); if ($this->dx_auth->get_user_id() == $wishlists_data->row()->user_id) { $data['check_user'] = 1; $query = $this->db->where('user_wishlist.wishlist_id', $param)->join('wishlists', 'wishlists.id = user_wishlist.wishlist_id')->join('list', 'list.id = user_wishlist.list_id')->join('property_type', 'property_type.id = list.property_id')->get('user_wishlist'); } else { $data['check_user'] = 0; $query = $this->db->where('user_wishlist.wishlist_id', $param)->where('wishlists.privacy', 0)->join('wishlists', 'wishlists.id = user_wishlist.wishlist_id')->join('list', 'list.id = user_wishlist.list_id')->join('property_type', 'property_type.id = list.property_id')->get('user_wishlist'); } $data['wishlists'] = $query; $location_og = ''; if ($query->num_rows() != 0) { $i = 1; foreach ($query->result() as $data_list) { $i++; if ($i == $query->num_rows() + 1 && $query->num_rows() != 1) { $location_og .= ' and '; } $location_og .= $data_list->state . ', ' . $data_list->country; if ($i != $query->num_rows() + 1 && $i != $query->num_rows()) { $location_og .= ' , '; } } } $data['wishlist_name'] = $wishlists_data->row()->name; $data['username'] = get_user_by_id($wishlists_data->row()->user_id)->username; $data['og_desc'] = $data['wishlist_name'] . ": " . $query->num_rows() . " unique accommodations in " . $location_og . ". An " . $this->dx_auth->get_site_title() . " Wish List by " . $data['username'] . "."; $locations = ''; if ($query->num_rows() != 0) { foreach ($query->result() as $row) { $conditions = array('list_id' => $row->list_id, "is_featured" => 1); $images = $this->Gallery->get_imagesG(NULL, $conditions); if ($images->num_rows() != 0) { $data['images'] = base_url() . 'images/' . $row->list_id . '/' . $images->row()->name; } else { $data['images'] = base_url() . 'images/' . $row->list_id . '/no_image.jpg'; } $address = $row->state . ', ' . $row->country; $wishlist_user_check = $this->Common_model->getTableData('user_wishlist', array('list_id' => $row->list_id, 'user_id' => $this->dx_auth->get_user_id())); if (!$this->dx_auth->is_logged_in()) { $wishlist_img = base_url() . 'images/search_heart_hover.png'; } else { if ($wishlist_user_check->num_rows() != 0) { $wishlist_img = base_url() . 'images/heart_rose.png'; } else { $wishlist_img = base_url() . 'images/search_heart_hover.png'; } } $locations .= '["' . $row->title . '",' . $row->lat . ',' . $row->long . ',"' . $address . '","' . $data['images'] . '","' . $row->list_id . '","' . get_currency_value1($row->list_id, $row->price) . '","' . get_currency_code() . '","' . $wishlist_img . '"],'; } } else { //redirect('info'); } //echo $locations;exit; $check = $this->Common_model->getTableData('wishlists', array('id' => $param)); if ($check->num_rows() == 0) { redirect('info'); } $locations = rtrim($locations, ","); $data['locations'] = $locations; $data['user_id'] = $wishlists_data->row()->user_id; $data['privacy'] = $wishlists_data->row()->privacy; if ($this->dx_auth->get_user_id() == 0 && $data['privacy'] == 1) { redirect('info'); } $data['wishlist_details'] = $this->Common_model->getTableData('wishlists', array('id' => $param))->row(); $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_inner"; $this->load->view('template', $data); }