function count_users_notfree() { // get all agents (that have package id <> 1 (means not a free package) and not is admin) $this->db->select('*'); $this->db->from('users'); $this->db->join('user_meta', 'user_meta.user_id = users.id'); $this->db->where(array('users.status' => 1, 'users.banned' => 0, 'users.user_type <> ' => 1)); $this->db->where(array('user_meta.key' => 'current_package', 'user_meta.value <>' => '1')); if ($this->input->post('agent_key') != '') { $key = $this->input->post('agent_key'); $this->db->where("( `dbc_users`.`first_name` LIKE '%{$key}%' OR `dbc_users`.`last_name` LIKE '%{$key}%' OR `dbc_users`.`user_email` LIKE '%{$key}%' )"); } $query = $this->db->get(); $total = 0; foreach ($query->result() as $user) { $is_expired = is_user_package_expired($user->user_id); if ($is_expired) { continue; } else { $total++; } } return $total; }
</style> <?php $map_id = isset($map_id) ? $map_id : 'general-map-view'; if ($query->num_rows() <= 0) { ?> <div class="alert alert-warning"><?php echo lang_key('no_estates_found'); ?> </div> <?php } else { $data = array(); $estates = array(); foreach ($query->result() as $row) { if (get_settings('realestate_settings', 'hide_posts_if_expired', 'No') == 'Yes') { $is_expired = is_user_package_expired($row->created_by); if ($is_expired) { continue; } } $title = get_title_for_edit_by_id_lang($row->id, $curr_lang); $estate = array(); $estate['estate_id'] = $row->id; $estate['estate_title'] = $title; $estate['featured_image_url'] = get_featured_photo_by_id($row->featured_img); $estate['latitude'] = $row->latitude; $estate['longitude'] = $row->longitude; $estate['estate_type'] = $row->type; $estate['estate_type_lang'] = lang_key($row->type); $estate['estate_status'] = $row->status; $estate['estate_price'] = show_price($row->total_price);
<span class="input-group-btn"> <button type="submit" class="btn btn-warning OS_but_se"><i class="fa fa-search"></i></button> </span> </div> </form> <div class="clearfix"></div> <div class="agent-container" id="panel"> <?php foreach ($query->result() as $user) { if (get_settings('realestate_settings', 'show_admin_agent', 'Yes') == 'No' && $user->user_type == 1) { continue; } ?> <?php $is_expired = is_user_package_expired($user->user_id); if ($is_expired) { continue; } ?> <div class="agent-holder clearfix "> <div class="agent-image-holder "> <a href="<?php echo site_url('show/agentproperties/' . $user->user_id); ?> "><img width="150" height="150" src="<?php echo get_profile_photo_by_id($user->user_id, 'thumb'); ?> "></a>