?>
" /></a>
                        <!-- Heading -->
                        <h4><a href="<?php 
        echo post_detail_url($post);
        ?>
"><?php 
        echo get_post_data_by_lang($post, 'title');
        ?>
</a></h4>
                        <!-- Price -->
                        <div class="price"><strong><?php 
        echo lang_key('city');
        ?>
</strong>: <?php 
        echo get_location_name_by_id($post->city);
        ?>
                            <?php 
        $average_rating = $post->rating;
        ?>
                            <?php 
        $half_star_position = check_half_star_position($average_rating);
        ?>
                            <?php 
        echo get_review_with_half_stars($average_rating, $half_star_position, 'stars-sidebar');
        ?>
                        </div>
                        <div class="clearfix"></div>
                    </li>
                <?php 
    }
Exemple #2
0
                            <div class="property-thumb-meta">
                                <span class="property-price"><?php 
        echo show_price($row->total_price, $row->id);
        ?>
</span>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-9 col-sm-9">
                        <div class="caption" style="padding: 2px;">                            
                            <h2 class="list-estate-title"><?php 
        echo character_limiter($title, 20);
        ?>
</h2>
                            <p><?php 
        echo get_location_name_by_id($row->city) . ',' . get_location_name_by_id($row->state) . ',' . get_location_name_by_id($row->country);
        ?>
</p>

                            <div style="clear:both;">
                                <span style="float:left; font-weight:bold;"><?php 
        echo lang_key('type');
        ?>
:</span>
                                <span style="float:right; "><?php 
        echo lang_key($row->type);
        ?>
</span>
                            </div>

                            <div style="clear:both;">
Exemple #3
0
            $estate['estate_bedroom'] = $row->bedroom;
            $estate['estate_bedroom_label'] = lang_key('Beds');
        } else {
            $estate['estate_bedroom'] = '';
            $estate['estate_bedroom_label'] = '';
        }
        $estate['estate_title'] = character_limiter($title, 20);
        $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_label'] = lang_key('Type');
        $estate['estate_type_lang'] = lang_key($row->type);
        $estate['estate_status'] = $row->status;
        $estate['estate_price'] = show_price($row->total_price);
        $estate['estate_short_address'] = lang_key(get_location_name_by_id($row->city)) . ', ' . lang_key(get_location_name_by_id($row->state)) . ', ' . lang_key(get_location_name_by_id($row->country));
        $estate['detail_link'] = site_url('property/' . $row->unique_id . '/' . dbc_url_title($title));
        array_push($estates, $estate);
    }
    //print_r($estates);
    $data['estates'] = $estates;
}
?>
        
            
<?php 
$curr_lang = $this->uri->segment(1) != '' ? $this->uri->segment(1) : 'en';
if ($curr_lang == 'en') {
    ?>
    <?php 
    $styleL = 'left';
Exemple #4
0
                      <div class="form-group">
                          <label class="col-sm-4 col-lg-3 control-label"><?php 
echo lang_key('city');
?>
:</label>
                          <div class="col-sm-7 col-lg-8 controls">
                              <?php 
$selected_city = set_value('selected_city') != '' ? set_value('selected_city') : $estate->city;
?>
                              <input type="hidden" name="selected_city" id="selected_city" value="<?php 
echo $selected_city;
?>
">
                              <input type="text" id="city" name="city" value="<?php 
echo get_location_name_by_id($selected_city);
?>
" placeholder="<?php 
echo lang_key('city');
?>
" class="form-control input-sm" >
                              <span class="help-inline city-loading">&nbsp;</span>
                              <?php 
echo form_error('city');
?>
                          </div>
                      </div>

                      <div class="form-group">
                          <label class="col-sm-4 col-lg-3 control-label"><?php 
echo lang_key('zip_code');
 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;
 }
Exemple #6
0
            }
        }
        ?>
 
                            </span>
                    </div>
                    <div class="caption" style="padding: 5px !important;">
                       
                     <span class="property-title OS_new-t"><?php 
        echo character_limiter($title, 20);
        ?>
</span>
                        <div class="clearfix"></div>
                        
                        <p class="estate-description-car no_pad"><i class="fa fa-map-marker OS_map-icon"></i><?php 
        echo lang_key(get_location_name_by_id($row->city)) . ', ' . lang_key(get_location_name_by_id($row->state)) . ', ' . lang_key(get_location_name_by_id($row->country));
        ?>
</p>           
                        <div class="clearfix"></div>
                        <span class="property-price" style=""><?php 
        echo show_price($row->total_price);
        ?>
</span>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <?php 
    }
    ?>
                
        </div>
Exemple #7
0


            <div class="divider"></div>



            <div class="info_list">

                <span class="info-title" style=""><?php 
    echo lang_key('country');
    ?>
:</span>

                <span class="info-content"><?php 
    echo get_location_name_by_id($row->country);
    ?>
</span>

            </div>

            <div class="divider"></div>



            <div class="info_list">

                <span class="info-title" style=""><?php 
    echo lang_key('zip_code');
    ?>
:</span>
if ($selected_state == '') {
    ?>
style="display: none;"<?php 
}
?>
>
              <label class="col-sm-4 col-lg-3 control-label"><?php 
echo lang_key('city');
?>
: <span style="color:red;">*</span></label>
              <div class="col-sm-7 col-lg-8 controls">
                  <?php 
$state_id = get_location_id_by_name($selected_state, 'state', $cid);
?>
                  <?php 
$city_name = set_value('city') != '' ? set_value('city') : get_location_name_by_id($estate->city);
?>
                   <select name="city" id="city" class="form-control">
                        <option selected="selected" value=""><?php 
echo lang_key('Select Region');
?>
</option>
                      <?php 
foreach (get_all_regions($state_id)->result() as $row) {
    $sel = trim($row->name) == trim($city_name) ? 'selected="selected"' : '';
    ?>
                          <option <?php 
    echo $sel;
    ?>
 value="<?php 
    echo $row->name;
    jQuery('#state').change(function(){
        <?php 
if ($state_active == 'yes') {
    ?>
        var val = jQuery(this).val();
        var sel_state   = '<?php 
    echo set_value("state") != '' ? set_value("state") : $post->state;
    ?>
';
        var sel_city   = '<?php 
    echo set_value("selected_city") != '' ? set_value("selected_city") : $post->city;
    ?>
';
        var city   = '<?php 
    echo set_value("city") != '' ? set_value("city") : get_location_name_by_id($post->city);
    ?>
';

        if(val==sel_state)
        {
            jQuery('#selected_city').val(sel_city);
            jQuery('#city').val(city);
        }
        else
        {
            jQuery('#selected_city').val('');
            jQuery('#city').val('');            
        }
        <?php 
}
Exemple #10
0
 public function updatepost()
 {
     $state_active = get_settings('classified_settings', 'show_state_province', 'yes');
     $id = $this->input->post('id');
     $page = $this->input->post('page');
     //		$this->form_validation->set_rules('purpose', 			lang_key('purpose'), 			'required');
     $this->form_validation->set_rules('category', lang_key('category'), 'required');
     $this->form_validation->set_rules('contact_for_price', lang_key('contact_for_price'), 'xss_clean');
     if ($this->input->post('contact_for_price') == '') {
         $this->form_validation->set_rules('price', lang_key('price'), 'required');
     }
     $this->form_validation->set_rules('country', lang_key('country'), 'required');
     if ($state_active == 'yes') {
         $this->form_validation->set_rules('state', lang_key('state'), 'required');
     }
     $this->form_validation->set_rules('selected_city', lang_key('city'), 'xss_clean');
     $this->form_validation->set_rules('city', lang_key('city'), 'required');
     $this->form_validation->set_rules('zip_code', lang_key('zip_code'), 'xss_clean');
     $this->form_validation->set_rules('address', lang_key('address'), 'required');
     $this->form_validation->set_rules('latitude', lang_key('latitude'), 'required');
     $this->form_validation->set_rules('longitude', lang_key('longitude'), 'required');
     $this->form_validation->set_rules('title_' . default_lang(), lang_key('title'), 'required');
     $this->form_validation->set_rules('description_' . default_lang(), lang_key('description'), 'required');
     $this->form_validation->set_rules('featured_img', lang_key('featured_img'), 'required');
     $this->update_post_validation();
     if ($this->form_validation->run() == FALSE) {
         $this->editpost($page, $id);
     } else {
         $meta_search_text = '';
         //meta information for simple searching
         $this->load->helper('date');
         $format = 'DATE_RFC822';
         $time = time();
         $data = array();
         $data['purpose'] = 'sell';
         //			$meta_search_text .= $data['purpose'].' ';
         $data['category'] = $this->input->post('category');
         $meta_search_text .= get_category_title_by_id($data['category']) . ' ';
         $data['parent_category'] = get_category_parent_by_id($data['category']);
         $meta_search_text .= get_category_title_by_id($data['parent_category']) . ' ';
         $data['contact_for_price'] = $this->input->post('contact_for_price');
         $data['price'] = $this->input->post('price');
         $data['phone_no'] = $this->input->post('phone_no');
         $data['country'] = $this->input->post('country');
         $meta_search_text .= get_location_name_by_id($data['country']) . ' ';
         $data['state'] = $state_active == 'yes' ? $this->input->post('state') : 0;
         $meta_search_text .= get_location_name_by_id($data['state']) . ' ';
         $selected_city = $this->input->post('selected_city');
         $city = $this->input->post('city');
         if ($selected_city == '') {
             $new_city_id = $this->post_model->get_location_id_by_name($city, 'city', $data['state'], $data['country']);
         } else {
             $new_city_id = $selected_city;
         }
         $data['city'] = $new_city_id;
         $meta_search_text .= get_location_name_by_id($data['city']) . ' ';
         $data['zip_code'] = $this->input->post('zip_code');
         $meta_search_text .= $data['zip_code'] . ' ';
         $data['address'] = $this->input->post('address');
         $meta_search_text .= $data['address'] . ' ';
         $data['latitude'] = $this->input->post('latitude');
         $data['longitude'] = $this->input->post('longitude');
         $this->load->model('admin/system_model');
         $langs = $this->system_model->get_all_langs();
         $titles = array();
         $descriptions = array();
         foreach ($langs as $lang => $long_name) {
             $titles[$lang] = $this->input->post('title_' . $lang);
             $meta_search_text .= $titles[$lang] . ' ';
             $descriptions[$lang] = $this->input->post('description_' . $lang);
         }
         $data['title'] = json_encode($titles);
         $data['description'] = json_encode($descriptions);
         $data['tags'] = $this->input->post('tags');
         $meta_search_text .= $data['tags'] . ' ';
         $data['featured_img'] = $this->input->post('featured_img');
         $data['video_url'] = $this->input->post('video_url');
         $data['gallery'] = $this->input->post('gallery') != false ? json_encode($this->input->post('gallery')) : '[]';
         $data['last_update_time'] = $time;
         $data['search_meta'] = $meta_search_text;
         $this->before_post_update();
         if (constant("ENVIRONMENT") == 'demo') {
             $this->session->set_flashdata('msg', '<div class="alert alert-success">Data updated.[NOT AVAILABLE ON DEMO]</div>');
         } else {
             $post_id = $this->post_model->update_post($data, $id);
             $this->after_post_update($post_id);
             $this->session->set_flashdata('msg', '<div class="alert alert-success">' . lang_key('post_updated') . '</div>');
         }
         redirect(site_url('admin/classified/allposts/' . $page));
     }
 }
        ?>
</td>

                  <td data-title="<?php 
        echo lang_key('price');
        ?>
" class="numeric"><?php 
        echo show_price($row->price, $row->contact_for_price);
        ?>
</td>
                  
                  <td data-title="<?php 
        echo lang_key('city');
        ?>
" class="numeric"><?php 
        echo get_location_name_by_id($row->city);
        ?>
</td>
                  
                  <td data-title="<?php 
        echo lang_key('status');
        ?>
" class="numeric"><?php 
        echo get_status_title_by_value($row->status);
        ?>
</td>
                  
                  <td data-title="<?php 
        echo lang_key('featured');
        ?>
" class="numeric"><?php 
Exemple #12
0
 :  <span class="OS_bold"><?php 
    echo lang_key(get_location_name_by_id($row->city));
    ?>
</span></div>
                <div class="fromrent"><?php 
    echo lang_key('state_province');
    ?>
 : <span class="OS_bold"><?php 
    echo lang_key(get_location_name_by_id($row->state));
    ?>
</span></div>
                <div class="fromrent"><?php 
    echo lang_key('country');
    ?>
 : <span class="OS_bold"> <?php 
    echo lang_key(get_location_name_by_id($row->country));
    ?>
</span></div>
                
                <?php 
    $this->config->load('realcon');
    $enable_custom_fields = $this->config->item('enable_custom_fields');
    if ($enable_custom_fields == 'Yes') {
        ?>
                <?php 
        $fields = $this->config->item('custom_fields');
        foreach ($fields as $field) {
            ?>
                        <?php 
            if ($row->category_type == 'DBC_TYPE_LAND' && ($field['title'] == 'Furnished' || $field['title'] == 'Floor No')) {
                ?>
 public function updatepost()
 {
     $state_active = get_settings('business_settings', 'show_state_province', 'yes');
     $id = $this->input->post('id');
     $page = $this->input->post('page');
     if (!$this->checkpermission($id)) {
         $this->session->set_flashdata('<div class="alert alert-danger">' . lang_key('dont_have_permission') . '</div>');
         redirect(site_url('admin/business/allposts'));
     }
     $this->form_validation->set_rules('category', lang_key('category'), 'required');
     $this->form_validation->set_rules('phone_no', lang_key('phone'), 'required');
     $this->form_validation->set_rules('email', lang_key('email'), 'required');
     $this->form_validation->set_rules('country', lang_key('country'), 'required');
     if ($state_active == 'yes') {
         $this->form_validation->set_rules('state', lang_key('state'), 'required');
     }
     $this->form_validation->set_rules('selected_city', lang_key('city'), 'xss_clean');
     $this->form_validation->set_rules('city', lang_key('city'), 'required');
     $this->form_validation->set_rules('zip_code', lang_key('zip_code'), 'xss_clean');
     $this->form_validation->set_rules('address', lang_key('address'), 'required');
     $this->form_validation->set_rules('latitude', lang_key('latitude'), 'required');
     $this->form_validation->set_rules('longitude', lang_key('longitude'), 'required');
     $this->form_validation->set_rules('title_' . default_lang(), lang_key('title'), 'required');
     $this->form_validation->set_rules('description_' . default_lang(), lang_key('description'), 'required');
     $this->form_validation->set_rules('featured_img', lang_key('featured_img'), 'required');
     $this->update_post_validation();
     if ($this->form_validation->run() == FALSE) {
         $this->editpost($page, $id);
     } else {
         $meta_search_text = '';
         //meta information for simple searching
         $this->load->helper('date');
         $format = 'DATE_RFC822';
         $time = time();
         $data = array();
         $data['category'] = $this->input->post('category');
         $meta_search_text .= get_category_title_by_id($data['category']) . ' ';
         $data['price_range'] = $this->input->post('price_range');
         $data['phone_no'] = $this->input->post('phone_no');
         $data['email'] = $this->input->post('email');
         $data['website'] = $this->input->post('website');
         $data['founded'] = $this->input->post('founded');
         $meta_search_text .= $data['founded'] . ' ';
         $data['country'] = $this->input->post('country');
         $meta_search_text .= get_location_name_by_id($data['country']) . ' ';
         $data['state'] = $state_active == 'yes' ? $this->input->post('state') : 0;
         $meta_search_text .= get_location_name_by_id($data['state']) . ' ';
         $selected_city = $this->input->post('selected_city');
         $city = $this->input->post('city');
         if ($selected_city == '') {
             $new_city_id = $this->post_model->get_location_id_by_name($city, 'city', $data['state'], $data['country']);
         } else {
             $new_city_id = $selected_city;
         }
         $data['city'] = $new_city_id;
         $meta_search_text .= get_location_name_by_id($data['city']) . ' ';
         $data['zip_code'] = $this->input->post('zip_code');
         $meta_search_text .= $data['zip_code'] . ' ';
         $data['address'] = $this->input->post('address');
         $meta_search_text .= $data['address'] . ' ';
         $data['latitude'] = $this->input->post('latitude');
         $data['longitude'] = $this->input->post('longitude');
         $this->load->model('admin/system_model');
         $langs = $this->system_model->get_all_langs();
         $titles = array();
         $descriptions = array();
         foreach ($langs as $lang => $long_name) {
             $titles[$lang] = $this->input->post('title_' . $lang);
             $meta_search_text .= $titles[$lang] . ' ';
             $descriptions[$lang] = $this->input->post('description_' . $lang);
         }
         $data['title'] = json_encode($titles);
         $data['description'] = json_encode($descriptions);
         $data['tags'] = $this->input->post('tags');
         $meta_search_text .= $data['tags'] . ' ';
         $data['featured_img'] = $this->input->post('featured_img');
         $data['video_url'] = $this->input->post('video_url');
         $data['gallery'] = $this->input->post('gallery') != false ? json_encode($this->input->post('gallery')) : '[]';
         $opening_hours = array();
         $days = $this->input->post('days');
         $opening_times = $this->input->post('opening_hour');
         $closing_times = $this->input->post('closing_hour');
         foreach ($days as $key => $day) {
             $opening_hour = array();
             if ($opening_times[$key] == 'Closed') {
                 $opening_hour['day'] = $day;
                 $opening_hour['closed'] = 1;
                 $opening_hour['start_time'] = '';
                 $opening_hour['close_time'] = '';
             } else {
                 $opening_hour['day'] = $day;
                 $opening_hour['closed'] = 0;
                 $opening_hour['start_time'] = $opening_times[$key];
                 $opening_hour['close_time'] = $closing_times[$key];
             }
             array_push($opening_hours, $opening_hour);
         }
         $data['opening_hour'] = json_encode($opening_hours);
         $data['additional_features'] = $this->input->post('additional_features') != '' ? json_encode(array_filter($this->input->post('additional_features'))) : '[]';
         $data['last_update_time'] = $time;
         $data['search_meta'] = $meta_search_text;
         $this->before_post_update();
         if (constant("ENVIRONMENT") == 'demo') {
             $this->session->set_flashdata('msg', '<div class="alert alert-success">Data updated.[NOT AVAILABLE ON DEMO]</div>');
         } else {
             $post_id = $id;
             $this->post_model->update_post($data, $id);
             add_post_meta($post_id, 'facebook_profile', $_POST['facebook_profile']);
             add_post_meta($post_id, 'twitter_profile', $_POST['twitter_profile']);
             add_post_meta($post_id, 'linkedin_profile', $_POST['linkedin_profile']);
             add_post_meta($post_id, 'pinterest_profile', $_POST['pinterest_profile']);
             add_post_meta($post_id, 'googleplus_profile', $_POST['googleplus_profile']);
             add_post_meta($post_id, 'business_logo', $this->input->post('business_logo'));
             $this->after_post_update($post_id);
             $this->session->set_flashdata('msg', '<div class="alert alert-success">' . lang_key('post_updated') . '</div>');
         }
         redirect(site_url('edit-business/' . $page . '/' . $id));
     }
 }
Exemple #14
0
 public function addestate()
 {
     $dl = default_lang();
     $this->config->load('realcon');
     $enable_custom_fields = $this->config->item('enable_custom_fields');
     if ($enable_custom_fields == 'Yes') {
         $fields = $this->config->item('custom_fields');
         foreach ($fields as $field) {
             if ($field['validation'] != '') {
                 $this->form_validation->set_rules($field['name'], $field['title'], $field['validation']);
             }
         }
     }
     $this->form_validation->set_rules('title' . $dl, 'Title', 'required');
     $this->form_validation->set_rules('description' . $dl, 'Description', 'required');
     $this->form_validation->set_rules('type', 'Type', 'required');
     $this->form_validation->set_rules('purpose', 'Purpose', 'required');
     $purpose = $this->input->post('purpose');
     $type = $this->input->post('type');
     $meta_search_text = '';
     //meta information for simple searching
     if ($purpose == 'DBC_PURPOSE_SALE') {
         $this->form_validation->set_rules('total_price', 'Sales Price', 'required');
         $this->form_validation->set_rules('price_per_unit', 'Price per Unit', 'required');
         $this->form_validation->set_rules('price_unit', 'Price unit', 'required');
         $meta_search_text .= 'sale' . ' ';
     } elseif ($purpose == 'DBC_PURPOSE_RENT') {
         $this->form_validation->set_rules('rent_price', 'Rent Price', 'required');
         $this->form_validation->set_rules('rent_price_unit', 'Rent Price unit', 'required');
         $meta_search_text .= 'rent' . ' ';
     } else {
         $this->form_validation->set_rules('total_price', 'Sales Price', 'required');
         $this->form_validation->set_rules('price_per_unit', 'Price per Unit', 'required');
         $this->form_validation->set_rules('price_unit', 'Price unit', 'required');
         $this->form_validation->set_rules('rent_price', 'Rent Price', 'required');
         $this->form_validation->set_rules('rent_price_unit', 'Rent Price unit', 'required');
     }
     #price validation end
     if ($type == 'DBC_TYPE_APARTMENT') {
         $this->form_validation->set_rules('home_size', 'Home size', 'required');
         $this->form_validation->set_rules('home_size_unit', 'Home size unit', 'required');
         $this->form_validation->set_rules('bedroom', 'Bed rooms', 'required');
         $this->form_validation->set_rules('bath', 'Bathroom', 'required');
         $this->form_validation->set_rules('year_built', 'Year Built', 'required');
         $meta_search_text .= 'apartment' . ' ';
     } else {
         if ($type == 'DBC_TYPE_HOUSE') {
             $this->form_validation->set_rules('home_size', 'Home size', 'required');
             $this->form_validation->set_rules('home_size_unit', 'Home size unit', 'required');
             $this->form_validation->set_rules('lot_size', 'Lot size', 'required');
             $this->form_validation->set_rules('lot_size_unit', 'Lot size unit', 'required');
             $this->form_validation->set_rules('bedroom', 'Bed rooms', 'required');
             $this->form_validation->set_rules('bath', 'Bathroom', 'required');
             $this->form_validation->set_rules('year_built', 'Year Built', 'required');
             $meta_search_text .= 'house' . ' ';
         } else {
             if ($type == 'DBC_TYPE_LAND') {
                 $this->form_validation->set_rules('lot_size', 'Lot size', 'required');
                 $this->form_validation->set_rules('lot_size_unit', 'Lot size unit', 'required');
                 $meta_search_text .= 'land' . ' ';
             } else {
                 if ($type == 'DBC_TYPE_COMSPACE') {
                     $this->form_validation->set_rules('home_size', 'Home size', 'required');
                     $this->form_validation->set_rules('home_size_unit', 'Home size unit', 'required');
                     $this->form_validation->set_rules('year_built', 'Year Built', 'required');
                     $meta_search_text .= 'comercial space' . ' ';
                 } else {
                     if ($type == 'DBC_TYPE_CONDO') {
                         $this->form_validation->set_rules('home_size', 'Home size', 'required');
                         $this->form_validation->set_rules('home_size_unit', 'Home size unit', 'required');
                         $this->form_validation->set_rules('bedroom', 'Bed rooms', 'required');
                         $this->form_validation->set_rules('bath', 'Bathroom', 'required');
                         $this->form_validation->set_rules('year_built', 'Year Built', 'required');
                         $meta_search_text .= 'condo' . ' ';
                     } else {
                         if ($type == 'DBC_TYPE_VILLA') {
                             $this->form_validation->set_rules('home_size', 'Home size', 'required');
                             $this->form_validation->set_rules('home_size_unit', 'Home size unit', 'required');
                             $this->form_validation->set_rules('lot_size', 'Lot size', 'required');
                             $this->form_validation->set_rules('lot_size_unit', 'Lot size unit', 'required');
                             $this->form_validation->set_rules('bedroom', 'Bed rooms', 'required');
                             $this->form_validation->set_rules('bath', 'Bathroom', 'required');
                             $this->form_validation->set_rules('year_built', 'Year Built', 'required');
                             $meta_search_text .= 'villa' . ' ';
                         }
                     }
                 }
             }
         }
     }
     $this->form_validation->set_rules('condition', 'Condition', 'required');
     $this->form_validation->set_rules('address', 'Address', 'required');
     $this->form_validation->set_rules('country', 'Country', 'required');
     //$this->form_validation->set_rules('selected_state', 'State/province', 'required');
     $this->form_validation->set_rules('state', 'State/province', 'required');
     //$this->form_validation->set_rules('selected_city', 'City/Twon', 'required');
     $this->form_validation->set_rules('city', 'City/Twon', 'required');
     $this->form_validation->set_rules('zip_code', 'Zip code', 'required');
     $this->form_validation->set_rules('latitude', 'Latitude', 'required');
     $this->form_validation->set_rules('longitude', 'Longitude', 'required');
     $this->form_validation->set_rules('featured_img', 'Featured image', 'required');
     if ($this->form_validation->run() == FALSE) {
         $this->newestate('error');
     } else {
         if (constant("ENVIRONMENT") == 'demo') {
             $this->session->set_flashdata('msg', '<div class="alert alert-success">Data updated.[NOT AVAILABLE ON DEMO]</div>');
         } else {
             $data = array();
             $data['unique_id'] = uniqid();
             $data['type'] = $this->input->post('type');
             $data['purpose'] = $this->input->post('purpose');
             if ($purpose == 'DBC_PURPOSE_SALE') {
                 $data['total_price'] = $this->input->post('total_price');
                 $data['price_per_unit'] = $this->input->post('price_per_unit');
                 $data['price_unit'] = $this->input->post('price_unit');
             } elseif ($purpose == 'DBC_PURPOSE_RENT') {
                 $data['total_price'] = $this->input->post('rent_price');
                 $data['rent_price'] = $this->input->post('rent_price');
                 $data['rent_price_unit'] = $this->input->post('rent_price_unit');
             } else {
                 $data['total_price'] = $this->input->post('total_price');
                 $data['price_per_unit'] = $this->input->post('price_per_unit');
                 $data['price_unit'] = $this->input->post('price_unit');
                 $data['rent_price'] = $this->input->post('rent_price');
                 $data['rent_price_unit'] = $this->input->post('rent_price_unit');
             }
             #price validation end
             if ($type == 'DBC_TYPE_APARTMENT') {
                 $data['home_size'] = $this->input->post('home_size');
                 $data['home_size_unit'] = $this->input->post('home_size_unit');
                 $data['bedroom'] = $this->input->post('bedroom');
                 $data['bath'] = $this->input->post('bath');
                 $data['year_built'] = $this->input->post('year_built');
                 $meta_search_text .= ' bedroom bathroom' . $data['bedroom'] . ' ' . $data['bath'] . ' ' . $data['year_built'];
             } else {
                 if ($type == 'DBC_TYPE_HOUSE') {
                     $data['home_size'] = $this->input->post('home_size');
                     $data['home_size_unit'] = $this->input->post('home_size_unit');
                     $data['lot_size'] = $this->input->post('lot_size');
                     $data['lot_size_unit'] = $this->input->post('lot_size_unit');
                     $data['bedroom'] = $this->input->post('bedroom');
                     $data['bath'] = $this->input->post('bath');
                     $data['year_built'] = $this->input->post('year_built');
                     $meta_search_text .= ' bedroom bathroom' . $data['bedroom'] . ' ' . $data['bath'] . ' ' . $data['year_built'];
                 } else {
                     if ($type == 'DBC_TYPE_LAND') {
                         $data['lot_size'] = $this->input->post('lot_size');
                         $data['lot_size_unit'] = $this->input->post('lot_size_unit');
                     } else {
                         if ($type == 'DBC_TYPE_COMSPACE') {
                             $data['home_size'] = $this->input->post('home_size');
                             $data['home_size_unit'] = $this->input->post('home_size_unit');
                             $data['year_built'] = $this->input->post('year_built');
                             $meta_search_text .= ' ' . $data['year_built'];
                         } else {
                             if ($type == 'DBC_TYPE_CONDO') {
                                 $data['home_size'] = $this->input->post('home_size');
                                 $data['home_size_unit'] = $this->input->post('home_size_unit');
                                 $data['bedroom'] = $this->input->post('bedroom');
                                 $data['bath'] = $this->input->post('bath');
                                 $data['year_built'] = $this->input->post('year_built');
                                 $meta_search_text .= ' bedroom bathroom' . $data['bedroom'] . ' ' . $data['bath'] . ' ' . $data['year_built'];
                             } else {
                                 if ($type == 'DBC_TYPE_VILLA') {
                                     $data['home_size'] = $this->input->post('home_size');
                                     $data['home_size_unit'] = $this->input->post('home_size_unit');
                                     $data['lot_size'] = $this->input->post('lot_size');
                                     $data['lot_size_unit'] = $this->input->post('lot_size_unit');
                                     $data['bedroom'] = $this->input->post('bedroom');
                                     $data['bath'] = $this->input->post('bath');
                                     $data['year_built'] = $this->input->post('year_built');
                                     $meta_search_text .= ' bedroom bathroom' . $data['bedroom'] . ' ' . $data['bath'] . ' ' . $data['year_built'];
                                 }
                             }
                         }
                     }
                 }
             }
             $data['estate_condition'] = $this->input->post('condition');
             $meta_search_text .= ' ' . $data['estate_condition'];
             $data['address'] = $this->input->post('address');
             $meta_search_text .= ' ' . $data['address'];
             $data['country'] = $this->input->post('country');
             $meta_search_text .= ' ' . get_location_name_by_id($data['country']);
             $state_id = $this->realestate_model->get_location_id_by_name($this->input->post('state'), 'state', $data['country']);
             $data['state'] = $state_id;
             $meta_search_text .= ' ' . $this->input->post('state');
             $city_id = $this->realestate_model->get_location_id_by_name($this->input->post('city'), 'city', $state_id);
             $data['city'] = $city_id;
             $meta_search_text .= ' ' . $this->input->post('city');
             $data['zip_code'] = $this->input->post('zip_code');
             $data['latitude'] = $this->input->post('latitude');
             $data['longitude'] = $this->input->post('longitude');
             $data['facilities'] = json_encode($this->input->post('facilities'));
             $data['featured_img'] = $this->input->post('featured_img');
             $this->load->helper('date');
             $format = 'DATE_RFC822';
             $time = time();
             $data['create_time'] = standard_date($format, $time);
             $data['created_by'] = $this->input->post('created_by') != '' ? $this->input->post('created_by') : $this->session->userdata('user_id');
             $publish_directly = get_settings('memento_settings', 'publish_directly', 'Yes');
             $data['status'] = $publish_directly == 'Yes' ? 1 : 2;
             // 2 = pending
             $id = $this->realestate_model->insert_estate($data);
             $default_title = $this->input->post('title' . $dl);
             $meta_search_text .= ' ' . $default_title;
             $default_description = $this->input->post('description' . $dl);
             $meta_search_text .= ' ' . $default_description;
             $meta_search_text .= $this->input->post('tags');
             #collecting meta information for simple searching is complete
             #now update the post table with the information
             $data = array();
             $data['search_meta'] = $meta_search_text;
             $this->realestate_model->update_estate($data, $id);
             $this->load->model('admin/system_model');
             $query = $this->system_model->get_all_langs();
             $active_languages = $query->result();
             $data = array();
             $data['post_id'] = $id;
             $data['key'] = 'title';
             $data['status'] = 1;
             $value = array();
             foreach ($active_languages as $row) {
                 $title = $this->input->post('title' . $row->short_name);
                 $value[$row->short_name] = $title;
             }
             $data['value'] = json_encode($value);
             $this->realestate_model->insert_estate_meta($data);
             $data = array();
             $data['post_id'] = $id;
             $data['key'] = 'description';
             $data['status'] = 1;
             $value = array();
             foreach ($active_languages as $row) {
                 $description = $this->input->post('description' . $row->short_name);
                 $value[$row->short_name] = $description;
             }
             $data['value'] = json_encode($value);
             $this->realestate_model->insert_estate_meta($data);
             add_post_meta($id, 'tags', $this->input->post('tags'));
             if ($purpose == 'DBC_PURPOSE_RENT') {
                 add_post_meta($id, 'from_rent_date', $this->input->post('from_date'));
                 add_post_meta($id, 'to_rent_date', $this->input->post('to_date'));
             }
             add_post_meta($id, 'energy_efficiency', $this->input->post('energy_efficiency'));
             #increase users post count
             $user_id = $this->session->userdata('user_id');
             $post_count = get_user_meta($user_id, 'post_count', 0);
             $post_count++;
             add_user_meta($user_id, 'post_count', $post_count);
             #adding distance information
             $distance_ids = $this->input->post('distance_id');
             $distance_titles = $this->input->post('distance_title');
             $distance_icons = $this->input->post('distance_icon');
             $distance_values = $this->input->post('distance_value');
             $distance_units = $this->input->post('distance_unit');
             $i = 0;
             $vals = array();
             foreach ($distance_ids as $key => $value) {
                 $dis_info = array();
                 $dis_info['id'] = $distance_ids[$key];
                 $dis_info['title'] = $distance_titles[$key];
                 $dis_info['icon'] = $distance_icons[$key];
                 $dis_info['value'] = $distance_values[$key];
                 $dis_info['units'] = $distance_units[$key];
                 $vals[$i++] = json_encode($dis_info);
             }
             add_post_meta($id, 'distance_info', json_encode($vals));
             if ($enable_custom_fields == 'Yes') {
                 $fields = $this->config->item('custom_fields');
                 $data = array();
                 foreach ($fields as $field) {
                     $data[$field['name']] = $this->input->post($field['name']);
                 }
             }
             add_post_meta($id, 'custom_values', json_encode($data));
             $this->session->set_flashdata('msg', '<div class="alert alert-success">Property added</div>');
         }
         redirect(site_url('admin/realestate/editestate/0/' . $id));
     }
 }
                  <td data-title="<?php 
        echo lang_key('type');
        ?>
" class="numeric"><?php 
        echo $row->type;
        ?>
</td>

                  <td data-title="<?php 
        echo lang_key('parent');
        ?>
" class="numeric">

                    <?php 
        echo get_location_name_by_id($row->parent);
        ?>


                  </td>

                  <td data-title="<?php 
        echo lang_key('actions');
        ?>
" class="numeric">

                    <div class="btn-group">

                      <a class="btn btn-info dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-cog"></i> <?php 
        echo lang_key('action');
        ?>
Exemple #16
0
            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);
        $estate['estate_short_address'] = get_location_name_by_id($row->city) . ',' . get_location_name_by_id($row->state) . ',' . get_location_name_by_id($row->country);
        $estate['detail_link'] = site_url('property/' . $row->unique_id . '/' . dbc_url_title($title));
        array_push($estates, $estate);
    }
    $data['estates'] = $estates;
}
?>
<style>
    #pac-input-<?php 
echo $map_id;
?>
 {
        background-color: #fff;
        padding: 0 11px 0 13px;
        width: 400px;
        font-family: Roboto;
        <div class="clearfix"></div>
    </div>
</div>

<!-- Container -->
<div class="container">

    <div class="row">

        <div class="col-md-9 col-sm-12 col-xs-12">
            <div class="block-heading-two">
                <h3><span><i class="fa fa-map-marker"></i> <?php 
echo lang_key($location_type);
?>
 : <?php 
echo get_location_name_by_id($location_id);
?>
</span>
                    <div class="pull-right list-switcher">
                        <a target="recent-posts" href="<?php 
echo site_url('show/location_posts_ajax/' . $per_page . '/grid/' . $location_id . '/' . $location_type);
?>
"><i class="fa fa-th "></i></a>
                        <a target="recent-posts" href="<?php 
echo site_url('show/location_posts_ajax/' . $per_page . '/list/' . $location_id . '/' . $location_type);
?>
"><i class="fa fa-th-list "></i></a>
                    </div>
                </h3>
            </div>
            <span class="recent-posts">