<?php $this->load->view('pages/trip/listing/list-header-sort-bar'); ?> <div class="catalog-row"> <?php $redis_functions = new Redisfunctions(); if (!empty($post_records)) { foreach ($post_records as $key => $value) { $value = (array) $value; $post_url_key = $value['post_url_key']; $post_details = $redis_functions->get_trip_details($post_url_key); $post_title = stripslashes($post_details['post_title']); $post_description = getNWordsFromString(stripslashes($post_details['post_description']), 40); $post_primary_image = base_url(getImage($post_details['post_primary_image'])); $post_url = getTripUrl($post_details['post_url_key']); $post_total_cost = get_currency_symbol($post_details['post_currency']) . $post_details['post_total_cost']; $post_start_end_date_string = '--'; if (!empty($post_details['post_start_date']) && !empty($post_details['post_end_date'])) { $post_date_format = 'd M Y'; $post_start_end_date_string = date($post_date_format, strtotime($post_details['post_start_date'])) . ' - ' . date($post_date_format, strtotime($post_details['post_end_date'])); } $post_total_days = number_format($post_details['post_total_days']); $post_region_cities = array(); if (!empty($post_details['post_regions'])) { foreach ($post_details['post_regions'] as $region_key => $region_value) { if (!in_array($region_value->pr_source_city, $post_region_cities)) { $post_region_cities[] = $region_value->pr_source_city; } } }
<?php if (!empty($you_may_like_records)) { ?> <div class="h-liked"> <div class="h-liked-lbl">You May Also Like</div> <div class="h-liked-row"> <?php foreach ($you_may_like_records as $ykey => $yvalue) { $post_title = stripslashes($yvalue['post_title']); $post_primary_image = base_url(getImage($yvalue['post_primary_image'])); $post_url = getTripUrl($yvalue['post_url_key']); $post_total_cost = get_currency_symbol($yvalue['post_currency']) . $yvalue['post_total_cost']; ?> <!-- // --> <div class="h-liked-item"> <div class="h-liked-item-i"> <div class="h-liked-item-l"> <a href="<?php echo $post_url; ?> "><img alt="<?php echo $post_title; ?> " src="<?php echo $post_primary_image; ?> "></a> </div> <div class="h-liked-item-c"> <div class="h-liked-item-cb">
public function paypal_success() { if ($this->input->get('trip_url_key') && $this->input->get('plan_key') && $this->input->get('id') && $this->input->post()) { if ($this->input->post('item_number1') == $this->input->get('trip_url_key')) { $user_id = $this->session->userdata['user_id']; $user_email = $this->session->userdata['user_email']; if ($user_id == getEncryptedString($this->input->get('id'), 'decode')) { $model = new Common_model(); $redis_functions = new Redisfunctions(); $trip_url_key = $this->input->get('trip_url_key'); $featured_plan_key = $this->input->get('plan_key'); $post_details = $redis_functions->get_trip_details($trip_url_key); $feature_plan_details = $model->fetchSelectedData('*', TABLE_FEATURED_MASTER, array('pfm_key' => $featured_plan_key)); if (!empty($post_details) && !empty($feature_plan_details)) { if ($post_details['post_user_id'] == $user_id) { $paypal_data = $this->input->post(); $payment_reference_number = getUniquePaymentReferenceNumber(getEncryptedString($paypal_data['txn_id'])); $payment_created_on = date('Y-m-d H:i:s'); $data_array = array('payment_reference_number' => $payment_reference_number, 'payment_user_id' => $user_id, 'payment_pfm_id' => $feature_plan_details[0]['pfm_id'], 'payment_post_id' => $post_details['post_id'], 'payment_txn_id' => $paypal_data['txn_id'], 'payment_amount' => $paypal_data['payment_gross'], 'payment_payer_email' => $paypal_data['payer_email'], 'payment_receiver_email' => $paypal_data['receiver_email'], 'payment_status' => '1', 'payment_json' => json_encode($paypal_data), 'payment_created_on' => $payment_created_on); $is_exists = $model->fetchSelectedData('payment_id', TABLE_PAYMENTS, array('payment_post_id' => $post_details['post_id'], 'payment_txn_id' => $paypal_data['txn_id'])); if (empty($is_exists)) { $model->insertData(TABLE_PAYMENTS, $data_array); $this->session->set_flashdata('success', 'Payment successful'); } else { $this->session->set_flashdata('error', 'Transaction ID already exists'); redirect(getTripUrl($trip_url_key)); } // Adding post to featured table if ($this->add_post_to_featured($post_details['post_id'], $feature_plan_details[0]['pfm_id']) == FALSE) { $this->session->set_flashdata('error', 'Unauthorized access to post'); redirect(getTripUrl($trip_url_key)); } // Updating redis table here $redis_functions->set_trip_details($trip_url_key); $redis_functions->set_featured_trips(); // Sending invoice email here if (USER_IP != '127.0.0.1') { $invoice_data_array = array('payment_reference_number' => $payment_reference_number, 'payment_created_on' => $payment_created_on, 'payer_user_fullname' => $this->session->userdata['user_fullname'], 'payer_user_email' => $user_email, 'payment_txn_id' => $paypal_data['txn_id'], 'post_title' => $post_details['post_title'], 'pfm_title' => $feature_plan_details['pfm_title'], 'payment_currency' => 'USD', 'payment_amount' => $paypal_data['payment_gross']); $email_model = new Email_model(); $invoice_html_data = $email_model->invoice_template($invoice_data_array); $email_model->sendMail($user_email, $invoice_html_data['email_subject'], $invoice_html_data['email_message']); } $page_title = 'Payment confirmed'; $input_arr = array(base_url() => 'Home', '#' => $page_title); $breadcrumbs = get_breadcrumbs($input_arr); $data["post_details"] = $post_details; $data["feature_plan_details"] = $feature_plan_details[0]; $data["payment_reference_number"] = $payment_reference_number; $data["breadcrumbs"] = $breadcrumbs; $data["page_title"] = $page_title; $data['meta_title'] = $data["page_title"] . ' - ' . $this->redis_functions->get_site_setting('SITE_NAME'); $this->template->write_view("content", "pages/payments/paypal-success", $data); $this->template->render(); } else { $this->session->set_flashdata('error', 'Unauthorized access'); display_404_page(); } } else { $this->session->set_flashdata('error', 'No such records found'); display_404_page(); } } else { $this->session->set_flashdata('error', 'Invalid request'); display_404_page(); } } else { $this->session->set_flashdata('error', 'Invalid request'); display_404_page(); } } else { $this->session->set_flashdata('error', 'Invalid request'); display_404_page(); } }
<?php $post_title = stripslashes($post_records['post_title']); $post_description = stripslashes($post_records['post_description']); $post_primary_image = base_url(getImage($post_records['post_primary_image'])); $post_url = getTripUrl($post_records['post_url_key']); $post_total_cost = get_currency_symbol($post_records['post_currency']) . $post_records['post_total_cost']; $post_start_end_date_string = '--'; if (!empty($post_records['post_start_date']) && !empty($post_records['post_end_date'])) { $post_date_format = 'd M Y'; $post_start_end_date_string = date($post_date_format, strtotime($post_records['post_start_date'])) . ' - ' . date($post_date_format, strtotime($post_records['post_end_date'])); } $post_total_days = number_format($post_records['post_total_days']); $post_region_cities = array(); if (!empty($post_records['post_regions'])) { foreach ($post_records['post_regions'] as $region_key => $region_value) { if (!in_array($region_value->pr_source_city, $post_region_cities)) { $post_region_cities[] = $region_value->pr_source_city; } } } ?> <div class="checkout-coll"> <div class="checkout-head"> <div class="checkout-headl" itemscope itemtype="http://schema.org/Event"> <?php if (!empty($post_records['post_primary_image']) && file_exists($post_records['post_primary_image'])) { ?> <a itemprop="url" href="<?php echo $post_url;
public function add_to_wishlist($post_url_key) { if (isset($this->session->userdata['user_id'])) { $user_id = $this->session->userdata['user_id']; $model = new Common_model(); $is_owner = $model->fetchSelectedData('post_id', TABLE_POSTS, array('post_user_id' => $user_id, 'post_url_key' => $post_url_key)); if (!empty($is_owner)) { $this->session->set_flashdata('error', 'Sorry, you cannot add your own trip to your wishlist'); } else { $redis_functions = new Redisfunctions(); $post_details = $redis_functions->get_trip_details($post_url_key); $is_exists = $model->fetchSelectedData('wishlist_id', TABLE_WISHLIST, array('wishlist_post_id' => $post_details['post_id'], 'wishlist_user_id' => $user_id, 'wishlist_status' => '1')); if (!empty($is_exists)) { $model->updateData(TABLE_WISHLIST, array('wishlist_status' => '0'), array('wishlist_id' => $is_exists[0]['wishlist_id'])); $this->session->set_flashdata('error', 'Trip removed from your wishlist'); } else { $data_array = array('wishlist_user_id' => $user_id, 'wishlist_post_id' => $post_details['post_id'], 'wishlist_created_on' => date('Y-m-d H:i:s'), 'wishlist_ipaddress' => USER_IP, 'wishlist_useragent' => USER_AGENT); $model->insertData(TABLE_WISHLIST, $data_array); $this->session->set_flashdata('success', 'Trip added to your wishlist'); } // updating user redis key $redis_functions->set_user_profile_data($this->session->userdata['user_username']); } redirect(getTripUrl($post_url_key)); } else { display_404_page(); } }
public function updateSitemap() { $this->ci =& get_instance(); $this->ci->load->database(); $this->ci->load->model('Common_model'); // $model = $this->ci->Common_model; $model = new Common_model(); $xml = '<?xml version = "1.0" encoding = "UTF-8"?>' . "\n"; $xml .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">' . "\n"; $xml .= '<url><loc>' . base_url() . '</loc><lastmod>' . date('Y-m-d') . 'T' . date('H:i:s') . '+00:00</lastmod><changefreq>weekly</changefreq><priority>1.00</priority></url>' . "\n"; // all the static links $static_links_without_base_url = array('contact-us', 'about-us', 'how-it-works', 'privacy-policy', 'terms', 'login', 'register', 'forgot-password'); foreach ($static_links_without_base_url as $slKey => $slValue) { $xml .= '<url><loc>' . base_url($slValue) . '</loc><lastmod>' . date('Y-m-d') . 'T' . date('H:i:s') . '+00:00</lastmod><changefreq>weekly</changefreq><priority>0.85</priority></url>' . "\n"; } // all the active trips $trip_records = $model->fetchSelectedData('url_key', TABLE_TRIPS, array('trip_status' => '1')); foreach ($trip_records as $trKey => $trValue) { $trip_url = getTripUrl($trValue['url_key']); $xml .= '<url><loc>' . $trip_url . '</loc><lastmod>' . date('Y-m-d') . 'T' . date('H:i:s') . '+00:00</lastmod><changefreq>weekly</changefreq><priority>0.85</priority></url>' . "\n"; } // all the active users $user_records = $model->fetchSelectedData('username', TABLE_USERS, array('user_status' => '1')); foreach ($user_records as $urKey => $urValue) { $public_profile_url = getPublicProfileUrl($urValue['username']); $xml .= '<url><loc>' . $public_profile_url . '</loc><lastmod>' . date('Y-m-d') . 'T' . date('H:i:s') . '+00:00</lastmod><changefreq>weekly</changefreq><priority>0.85</priority></url>' . "\n"; } // all the active blogs $blog_records = $model->fetchSelectedData('blog_url_key', TABLE_BLOGS, array('blog_status' => '1')); foreach ($blog_records as $brKey => $brValue) { $blog_url = base_url('blog/read/' . $brValue['blog_url_key']); $xml .= '<url><loc>' . $blog_url . '</loc><lastmod>' . date('Y-m-d') . 'T' . date('H:i:s') . '+00:00</lastmod><changefreq>weekly</changefreq><priority>0.85</priority></url>' . "\n"; } // all the view photo pages $photo_records = $model->fetchSelectedData('image_name', TABLE_PHOTOS, array('image_name !=' => '', 'album_key !=' => '')); foreach ($photo_records as $prKey => $prValue) { $photo_url = base_url('view/album/' . $prValue['image_name']); $xml .= '<url><loc>' . $photo_url . '</loc><lastmod>' . date('Y-m-d') . 'T' . date('H:i:s') . '+00:00</lastmod><changefreq>weekly</changefreq><priority>0.85</priority></url>' . "\n"; } $xml .= '</urlset>'; // prd($xml); $file = fopen(APPPATH . '/../sitemap.xml', 'w'); fwrite($file, $xml); fclose($file); die; }
echo date('d-M-Y g:i A', time() + $feature_plan_details['pfm_hours'] * 60 * 60); ?> </p> <p>Your payment reference number is <strong>#<?php echo $payment_reference_number; ?> </strong></p> </div> <div class="complete-devider"></div> <div class="complete-txt final"> <h2>Share it with your friends</h2> <p>Let your friends know about it. Spread out a word about your trip on your Facebook wall.</p> <div class="complete-txt-link"><a href="<?php echo getShareWithFacebook(getTripUrl($post_details['post_url_key'])); ?> " target="_blank">Click here to share</a></div> </div> </div> </div> </div> </div> <div class="clear"></div> </div> </div> <div class="sp-page-r"> <?php