Example #1
0
 public function index($page_key = 'about-us')
 {
     $data = array();
     $content_data = $this->redis_functions->get_static_page_content($page_key);
     if (!empty($content_data)) {
         $page_title = stripslashes($content_data->page_title);
         $page_content = stripslashes($content_data->content);
         $input_arr = array(base_url() => 'Home', '#' => $page_title);
         $breadcrumbs = get_breadcrumbs($input_arr);
         $data["content"] = $page_content;
         $data["breadcrumbs"] = $breadcrumbs;
         $data["page_title"] = $page_title;
         $data['meta_title'] = $page_title . " - " . $this->redis_functions->get_site_setting('SITE_NAME');
         $data['meta_description'] = getNWordsFromString($page_content, 50);
         $this->template->write_view("content", "pages/staticpage/static-content", $data);
         $this->template->render();
     } else {
         display_404_page();
     }
 }
Example #2
0
    <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;
                }
Example #3
0
 public function viewProfile($username)
 {
     $data = array();
     $model = new Common_model();
     $custom_model = new Custom_model();
     $pageNotFound = FALSE;
     if ($username) {
         $record = $model->is_exists("*", TABLE_USERS, array("username" => $username));
         if (!empty($record)) {
             $record = $record[0];
             $pageNotFound = TRUE;
             $is_friend = FALSE;
             $is_accepted = "0";
             if (isset($this->session->userdata["user_id"])) {
                 //                        $is_friend_record = $model->is_exists("friend_id, is_accepted", TABLE_FRIENDS, array("sent_from" => $this->session->userdata["user_id"], "sent_to" => $record["user_id"]));
                 $is_friend_record = $custom_model->isFriend($this->session->userdata["user_id"], $record["user_id"], "friend_id, is_accepted");
                 if (!empty($is_friend_record)) {
                     $is_friend = TRUE;
                     $is_accepted = $is_friend_record[0]["is_accepted"];
                 }
             }
             $trips_record = $model->fetchSelectedData("trip_title, url_key", TABLE_TRIPS, array("trip_user_id" => $record["user_id"], "trip_status" => "1"), "trip_id", "DESC", "0,5");
             //                    prd($trips_record);
             $my_connects_record = $custom_model->getMyFriends($record["user_id"], "first_name, last_name, user_facebook_id, username, user_id", "0,8");
             $data["meta_title"] = ucwords($record["first_name"] . " " . $record["last_name"]) . " | " . $this->redis_functions->get_site_setting('SITE_NAME');
             $data["meta_description"] = getNWordsFromString($record["user_bio"], 30);
             $data["record"] = $record;
             $data["is_friend"] = $is_friend;
             $data["is_accepted"] = $is_accepted;
             $data["trips_record"] = $trips_record;
             $data["my_connects_record"] = $my_connects_record;
             $data["my_connects_totalcount"] = $custom_model->getMyFriendsCount($record["user_id"]);
             $this->template->write_view("content", "pages/user/view-profile", $data);
             $this->template->render();
         }
     }
     if ($pageNotFound == FALSE) {
         $this->template->write_view("content", "pages/index/page-not-found", $data);
         $this->template->render();
     }
 }
Example #4
0
    echo base_url('delete-chat/' . $to_user_username);
    ?>
" class="msg-del-icon" onclick="return confirm('Sure to delete this conversation? Action cannot be undone!')"><span class="fa fa-trash"></span></a></div>
                            </div>
                            <div class="h-liked-row">
                                <div class="h-liked-item">
                                    <div class="h-liked-item-i">
                                        <div class="chat-log">
                                            <?php 
    $latest_timestamp = time();
    if (!empty($records)) {
        foreach ($records as $key => $value) {
            $from_fullname = stripslashes($value['from_fullname']);
            $from_profile_picture = base_url(getImage($value['from_profile_picture']));
            $from_username = stripslashes($value['from_username']);
            $message_text = getNWordsFromString(stripslashes($value['message_text']), 20);
            $message_date_time = get_message_timestamp_readable($value['message_timestamp']);
            $latest_timestamp = $value['message_timestamp'];
            ?>
                                                    <!-- // -->
                                                    <div class="h-liked-item">
                                                        <div class="h-liked-item-i">
                                                            <div class="h-liked-item-l">
                                                                <a href="<?php 
            echo base_url('user/' . $from_username);
            ?>
"><img alt="<?php 
            echo $from_fullname;
            ?>
" src="<?php 
            echo $from_profile_picture;
Example #5
0
 public function trip_details($post_url_key)
 {
     $redis_functions = new Redisfunctions();
     $user_id = isset($this->session->userdata["user_id"]) == TRUE ? $this->session->userdata["user_id"] : NULL;
     $post_details = $this->redis_functions->get_trip_details($post_url_key);
     if (!empty($post_details)) {
         $data = array();
         $page_title = stripslashes($post_details['post_title']);
         $is_interested = $in_wishlist = FALSE;
         if ($user_id != NULL) {
             if (!empty($post_details['post_travelers'])) {
                 foreach ($post_details['post_travelers'] as $traveler_info) {
                     if ($user_id == $traveler_info->pt_traveler_user_id) {
                         $is_interested = TRUE;
                         break;
                     }
                 }
             }
             $user_profile_data = $redis_functions->get_user_profile_data($this->session->userdata["user_username"]);
             if (!empty($user_profile_data['my_wishlist'])) {
                 foreach ($user_profile_data['my_wishlist'] as $wish_value) {
                     if ($wish_value->post_url_key == $post_url_key) {
                         $in_wishlist = TRUE;
                         break;
                     }
                 }
             }
         }
         $input_arr = array(base_url() => 'Home', base_url('trips') => 'Trips', '#' => $page_title);
         $breadcrumbs = get_breadcrumbs($input_arr);
         $data["is_interested"] = $is_interested;
         $data["in_wishlist"] = $in_wishlist;
         $data["post_details"] = $post_details;
         $data["breadcrumbs"] = $breadcrumbs;
         $data["page_title"] = $page_title;
         $data['meta_title'] = $data["page_title"] . ' - ' . $this->redis_functions->get_site_setting('SITE_NAME');
         $data['meta_description'] = getNWordsFromString(stripslashes($post_details['post_description']), 150);
         $this->template->write_view("content", "pages/trip/trip-detail", $data);
         $this->template->render();
     } else {
         display_404_page();
     }
 }