public function public_profile($username) { $redis_function = new Redisfunctions(); $record = $redis_function->get_user_profile_data($username); if (!empty($record)) { $page_title = $record["user_fullname"]; $input_arr = array(base_url() => 'Home', '#' => $page_title); $breadcrumbs = get_breadcrumbs($input_arr); $data["record"] = $record; $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/user/public-profile", $data); $this->template->render(); } else { display_404_page(); } }
<?php $redis_functions = new Redisfunctions(); if (!isset($meta_title)) { $meta_title = $redis_functions->get_site_setting('SITE_TITLE'); } if (!isset($meta_keywords)) { $meta_keywords = $redis_functions->get_site_setting('SEO_KEYWORDS'); } if (!isset($meta_description)) { $meta_description = $redis_functions->get_site_setting('SEO_DESCRIPTION'); } if (!isset($meta_logo_image)) { $meta_logo_image = IMAGES_PATH . "/logo.jpg"; } //clearstatcache(); //$this->output->set_header('Expires: Tue, 01 Jan 2000 00:00:00 GMT'); //$this->output->set_header('Last-Modified:' . gmdate('D, d M Y H:i:s') . 'GMT'); //$this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate'); //$this->output->set_header('Cache-Control: post-check=0, pre-check=0', false); //$this->output->set_header('Pragma: no-cache'); // prd($meta_logo_image); $controller = $this->router->fetch_class(); $action = $this->router->fetch_method(); $path = $controller . "/" . $action; ?> <!DOCTYPE html> <!--[if lt IE 8]> <html class="no-js lt-ie10 lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie10 lt-ie9"> <![endif]--> <!--[if IE 9]> <html class="no-js lt-ie10"> <![endif]--> <!--[if gt IE 8]><!-->
<div class="two-colls-right-b"> <div class="padding"> <?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;
public function delete_conversation($other_username) { if (isset($this->session->userdata["user_id"])) { $redis_functions = new Redisfunctions(); $user_id = $this->session->userdata["user_id"]; $me_username = $this->session->userdata["user_username"]; $other_user_records = $redis_functions->get_user_profile_data($other_username); if (!empty($other_user_records)) { $other_user_id = $other_user_records['user_id']; $model = new Common_model(); $sql = 'SELECT message_id FROM ' . TABLE_MESSAGES . ' WHERE ((message_user_from=' . $other_user_id . ' AND message_user_to=' . $user_id . ') OR (message_user_to=' . $other_user_id . ' AND message_user_from=' . $user_id . '))'; $chat_records = $model->query($sql); if (!empty($chat_records)) { $message_id_arr = array(); foreach ($chat_records as $chat_value) { $message_id_arr[] = $chat_value['message_id']; } $redis_functions->set_deleted_message_ids($me_username, $message_id_arr); $this->session->set_flashdata('success', 'Your conversation with ' . stripslashes($other_user_records['user_fullname']) . ' marked as deleted'); } } else { $this->session->set_flashdata('error', 'An error occurred. Please try again later.'); } redirect(base_url('my-chats')); } else { display_404_page(); } }
<?php $redis_functions = new Redisfunctions(); $my_profile = $redis_functions->get_user_profile_data($this->session->userdata['user_username']); ?> <style> .chat-l-div,.chat-r-div{height: calc(100%);display: inline-block;width: 100%;vertical-align: top;} .chat-l-div{max-width: 35%;height: 585px;overflow: auto;background: #fff;} .chat-r-div{max-width: 64%;} .input-message-div textarea{resize: none;width: 100%;border: 1px #e1e1e1 solid;box-shadow: 1px 1px 2px 0px rgba(50, 50, 50, 0.11);border-radius: 3px;font-size: 13px;padding: 5px 10px;} .input-message-div{width: 100%;display: inline-flex;margin-top: 30px;} .h-liked-row{display: inline-block;width: 100%;} .send-msg-btn{width: 50px;padding: 20px;} .chat-log{height: 390px;overflow: auto;margin-top: 20px;} .h-liked-comment,.h-liked-item-l{margin: 0;} .chat-l-div .h-liked-item-i{padding: 5px;} .h-liked-item-i.active, .chat-l-div .h-liked-item-i:hover{background-color: #eae8e8;} .h-liked-price a{color: #ff7200;text-decoration: none;} .h-liked-comment{font-size: 10px;} .unread{background-color: #ff7200 !important;} .unread .h-liked-price, .unread .h-liked-comment{color:#FFFFFF;} </style> <!-- main-cont --> <div class="main-cont"> <div class="body-wrapper" itemscope itemtype="http://schema.org/Event"> <div class="wrapper-padding"> <div class="page-head"> <div class="page-title" itemprop="name"><?php echo $page_title;
<?php $redis_functions = new Redisfunctions(); $controller = $this->router->fetch_class(); $action = $this->router->fetch_method(); $path = $controller . "/" . $action; $unread_chats_count = 0; if (isset($this->session->userdata['user_username'])) { $unread_chats_count = count($redis_functions->get_unread_chats_username($this->session->userdata['user_username'])); } ?> <!-- // mobile menu // --> <div class="mobile-menu"> <nav> <ul> <li><a href="<?php echo base_url(); ?> ">Home</a></li> <?php if ($path != 'index/login' && $path != 'index/register') { ?> <li><a href="<?php echo base_url('trip/post/add'); ?> " <?php echo isset($this->session->userdata['user_id']) == FALSE ? 'onclick="open_authorize_popup();"' : ''; ?> >Publish Your Trip</a></li> <?php }
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 $redis_functions = new Redisfunctions(); $trip_faqs = $redis_functions->get_trip_faqs(); ?> <!-- // content-tabs-i // --> <div class="content-tabs-i"> <h2>FAQ</h2> <p class="small">Most frequently asked questions by backpackers about trips posted on our platform.</p> <div class="todo-devider"></div> <div class="faq-row"> <?php foreach ($trip_faqs as $value) { ?> <!-- // --> <div class="faq-item"> <div class="faq-item-a"> <span class="faq-item-left"><?php echo stripslashes($value->faq_question); ?> </span> <span class="faq-item-i"></span> <div class="clear"></div> </div> <div class="faq-item-b"> <div class="faq-item-p"><?php echo stripslashes($value->faq_answer); ?> </div> </div> </div>
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 invoice_template($invoice_data_array) { $email_subject = 'Payment confirmed #' . $invoice_data_array['payment_reference_number']; $redis_functions = new Redisfunctions(); $str = '<!doctype html> <html> <head> <meta charset="utf-8"> <title>A simple, clean, and responsive HTML invoice template</title> <style> .invoice-box{ max-width:800px; margin:auto; padding:30px; border:1px solid #eee; box-shadow:0 0 10px rgba(0, 0, 0, .15); font-size:16px; line-height:24px; font-family:"Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; color:#555; } .invoice-box table{ width:100%; line-height:inherit; text-align:left; } .invoice-box table td{ padding:5px; vertical-align:top; } .invoice-box table tr td:nth-child(2){ text-align:right; } .invoice-box table tr.top table td{ padding-bottom:20px; } .invoice-box table tr.top table td.title{ font-size:45px; line-height:45px; color:#333; } .invoice-box table tr.information table td{ padding-bottom:40px; } .invoice-box table tr.heading td{ background:#eee; border-bottom:1px solid #ddd; font-weight:bold; } .invoice-box table tr.details td{ padding-bottom:20px; } .invoice-box table tr.item td{ border-bottom:1px solid #eee; } .invoice-box table tr.item.last td{ border-bottom:none; } .invoice-box table tr.total td:nth-child(2){ border-top:2px solid #eee; font-weight:bold; } @media only screen and (max-width: 600px) { .invoice-box table tr.top table td{ width:100%; display:block; text-align:center; } .invoice-box table tr.information table td{ width:100%; display:block; text-align:center; } } </style> </head> <body> <div class="invoice-box"> <table cellpadding="0" cellspacing="0"> <tr class="top"> <td colspan="2"> <table> <tr> <td class="title"><img src="' . IMAGES_PATH . '/logo.png" style="width:100%; max-width:300px;"></td> <td> Invoice #: ' . $invoice_data_array['payment_reference_number'] . '<br> Created: ' . $invoice_data_array['payment_created_on'] . ' </td> </tr> </table> </td> </tr> <tr class="information"> <td colspan="2"> <table> <tr> <td>' . $redis_functions->get_site_setting('SITE_NAME') . '</td> <td>' . stripslashes($invoice_data_array['payer_user_fullname']) . '<br>' . $invoice_data_array['payer_user_email'] . '</td> </tr> </table> </td> </tr> <tr class="heading"> <td>Payment Method</td> <td>Transaction #</td> </tr> <tr class="details"> <td>Paypal</td> <td>' . $invoice_data_array['payment_txn_id'] . '</td> </tr> <tr class="heading"> <td> Trip to feature </td> <td> Price </td> </tr> <tr class="item"> <td>' . stripslashes($invoice_data_array['post_title']) . ' <small>(' . $invoice_data_array['pfm_title'] . ')</small></td> <td>' . get_currency_symbol($invoice_data_array['payment_currency']) . number_format($invoice_data_array['payment_amount'], 2) . '</td> </tr> <tr class="total"> <td></td> <td>Total: ' . get_currency_symbol($invoice_data_array['payment_currency']) . number_format($invoice_data_array['payment_amount'], 2) . '</td> </tr> </table> </div> </body> </html>'; return array('email_subject' => $email_subject, 'email_message' => $str); }
<?php $redis_functions = new Redisfunctions(); $post_owner_records = $redis_functions->get_user_profile_data($post_details['post_user_username']); $post_title = stripslashes($post_details['post_title']); $post_description = stripslashes($post_details['post_description']); $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']); //prd($post_details); $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; } } } ?> <!-- main-cont --> <div class="main-cont"> <div class="body-wrapper"> <div class="wrapper-padding"> <div class="page-head">
public function get_joined_trips($username) { $output_arr = array(); $redis_functions = new Redisfunctions(); $user_profile_data = $redis_functions->get_user_profile_data($username); if (!empty($user_profile_data)) { $user_id = $user_profile_data['user_id']; $sql = 'SELECT p.post_url_key, p.post_published, p.post_status FROM ' . TABLE_POSTS . ' as p left join ' . TABLE_POST_TRAVELERS . ' as pt on pt.pt_post_id = p.post_id WHERE pt_traveler_user_id = ' . $user_id . ' AND p.post_user_id != ' . $user_id . ' GROUP BY p.post_id'; $output_arr = $this->db->query($sql)->result_array(); } return $output_arr; }
<?php $redis_functions = new Redisfunctions(); ?> <div class="main-cont"> <div class="body-wrapper"> <div class="wrapper-padding"> <div class="page-head"> <div class="page-title"><?php echo $page_title; ?> - <span>Itinerary</span></div> <?php if (isset($breadcrumbs) && !empty($breadcrumbs)) { echo $breadcrumbs; } ?> <div class="clear"></div> </div> <div class="sp-page"> <div class="sp-page-a"> <div class="sp-page-l"> <div class="sp-page-lb"> <div class="sp-page-p"> <div class="booking-left"> <form method="POST" action=""> <h2>Itinerary Information</h2> <!--If related data exists-->
<?php $redis_functions = new Redisfunctions(); $featured_trips = $redis_functions->get_featured_trips(); $latest_trips = $redis_functions->get_latest_trips(); ?> <footer class="footer-a"> <div class="wrapper-padding"> <div class="section"> <div class="footer-lbl">Featured trips</div> <div class="footer-tours"> <!-- // --> <?php if (!empty($featured_trips)) { $i = 0; foreach ($featured_trips as $post_url_key) { $trip_details = $redis_functions->get_trip_details($post_url_key); $trip_title = stripslashes($trip_details['post_title']); $trip_description = getNWordsFromString(stripslashes($trip_details['post_description']), 20); $trip_primary_image = base_url(getImage($trip_details['post_primary_image'])); $trip_url = getTripUrl($trip_details['post_url_key']); $trip_total_cost = get_currency_symbol($trip_details['post_currency']) . $trip_details['post_total_cost']; ?> <div class="footer-tour"> <div class="footer-tour-l"> <a href="<?php echo $trip_url; ?> "> <img alt="<?php echo $trip_title;