function prepare_map_json_from_query($query)
 {
     $CI = get_instance();
     $data = array();
     $posts = array();
     $i = 0;
     foreach ($query->result() as $row) {
         $i++;
         $post = array();
         $post['post_id'] = $row->id;
         $post['post_title'] = get_post_data_by_lang($row, 'title');
         $post['post_purpose'] = '';
         $post['featured_image_url'] = get_featured_photo_by_id($row->featured_img);
         $post['latitude'] = $row->latitude;
         $post['longitude'] = $row->longitude;
         $post['price'] = '';
         $post['rating'] = $row->rating;
         $post['post_short_address'] = get_location_name_by_id($row->city);
         $post['detail_link'] = post_detail_url($row);
         $post['parent_category'] = get_category_title_by_id($row->category);
         $post['fa_icon'] = get_category_fa_icon($row->category);
         if ($i % 3 == 1) {
             $color = "#ed5441";
         } else {
             if ($i % 3 == 2) {
                 $color = "#51d466";
             } else {
                 $color = "#609cec";
             }
         }
         $post['fa_color'] = $color;
         array_push($posts, $post);
     }
     $data['posts'] = $posts;
     return $data;
 }
Example #2
0
?>
                                    </div>
                                    <!-- Carousel controls (arrows). If you don't need controls, remove the below section -->
                                    <a class="left carousel-control" href="#bs-carousel-1" role="button" data-slide="prev">
                                        <span class="fa fa-chevron-left"></span>
                                    </a>
                                    <a class="right carousel-control" href="#bs-carousel-1" role="button" data-slide="next">
                                        <span class="fa fa-chevron-right"></span>
                                    </a>
                                </div>


                                <hr />
                                <div class="info-box">
                                    <?php 
$fa_icon = get_category_fa_icon($post->parent_category);
?>
                                    <i class="fa <?php 
echo $fa_icon;
?>
 bg-red category"></i>
                                    <div class="sub-cat">
                                        <a href="http://joinwebs.co.uk/products/classify/category/fashion/bags-beauty-products/"><?php 
echo get_category_title_by_id($post->category);
?>
</a>
                                    </div>
                                    <div class="ad-detail-info">
                                        <span class="span-left"><i class="fa fa-clock-o"></i> <?php 
echo lang_key('added');
?>
        ?>
" />
                                        </li>
                                        <?php 
    }
}
?>

                                    </ul>
                                </div>
                                <div class="clearfix"></div>

                                <hr />
                                <div class="info-box">
                                    <?php 
$fa_icon = get_category_fa_icon($post->category);
$category_title = get_category_title_by_id($post->category);
?>
                                    <i class="fa <?php 
echo $fa_icon;
?>
 bg-red category"></i>
                                    <div class="sub-cat">
                                        <a href="<?php 
echo site_url('show/categoryposts/' . $post->category . '/' . $category_title);
?>
"><?php 
echo $category_title;
?>
</a>
                                    </div>
			<!-- Blog meta -->
			<div class="blog-meta">
				<!-- Date -->
				<a href="//<?php 
        echo $post->website;
        ?>
" target="_blank"><i class="fa fa-link"></i> &nbsp; <?php 
        echo $post->website;
        ?>
</a> &nbsp;
				<!-- Author -->
				<a href="<?php 
        echo site_url('show/categoryposts/' . $post->category . '/' . dbc_url_title(lang_key(get_category_title_by_id($post->category))));
        ?>
"><i class="fa <?php 
        echo get_category_fa_icon($post->category);
        ?>
"></i> &nbsp; <?php 
        echo get_category_title_by_id($post->category);
        ?>
</a> &nbsp;
				<!-- Comments -->
				<a href="<?php 
        echo site_url('location-posts/' . $post->city . '/city/' . dbc_url_title(get_location_name_by_id($post->city)));
        ?>
"><i class="fa fa-map-marker"></i> &nbsp; <?php 
        echo get_location_name_by_id($post->city);
        ?>
</a> &nbsp;

				<i class="fa fa-phone"></i> &nbsp; <?php