?>
                </ul>        
            </div>
        </div>
     


        <div class="col-md-6">
            <div class="adv_search_slider">
                <p>
                    <label><?php 
esc_html_e('Price range:', 'wpestate');
?>
</label>
                    <span id="amount"  style="border:0; color:#f6931f; font-weight:bold;"><?php 
print wpestate_show_price_label_slider($min_price_slider, $max_price_slider, $currency, $where_currency);
?>
</span>
                </p>
                <div id="slider_price"></div>
                <input type="hidden" id="price_low"  name="price_low"  value="<?php 
echo wpestate_price_default_convert($min_price_slider);
?>
" />
                <input type="hidden" id="price_max"  name="price_max"  value="<?php 
echo wpestate_price_default_convert($max_price_slider);
?>
" />
            </div>
        </div>
        
Exemplo n.º 2
0
 function wpestate_show_search_field_mobile($search_field, $action_select_list, $categ_select_list, $select_city_list, $select_area_list, $key)
 {
     $adv_search_what = get_option('wp_estate_adv_search_what', '');
     $adv_search_label = get_option('wp_estate_adv_search_label', '');
     $adv_search_how = get_option('wp_estate_adv_search_how', '');
     $return_string = '';
     if ($search_field == 'none') {
         $return_string = '';
     } else {
         if ($search_field == 'types') {
             $return_string = '
               <div class="dropdown form-control">
               <div data-toggle="dropdown" id="adv_actions_mobile" class="filter_menu_trigger" data-value="all">' . esc_html__('All Sizes', 'wpestate') . '<span class="caret caret_filter"></span> </div>           
                  <input type="hidden" name="filter_search_action[]" value="">
                                                       
                 <ul class="dropdown-menu filter_menu" role="menu" aria-labelledby="adv_actions_mobile">
                   ' . $action_select_list . '
                 </ul>        
               </div>';
         } else {
             if ($search_field == 'categories') {
                 $return_string = '
               <div class="dropdown form-control">
               <div data-toggle="dropdown" id="adv_categ_mobile" class="filter_menu_trigger" data-value="all">' . esc_html__('All Types', 'wpestate') . ' <span class="caret caret_filter"></span> </div>           
                 <input type="hidden" name="filter_search_type[]" value="">
                                                           
                 <ul class="dropdown-menu filter_menu" role="menu" aria-labelledby="adv_categ_mobile">
                   ' . $categ_select_list . '
                 </ul>        
               </div>';
             } else {
                 if ($search_field == 'cities') {
                     $return_string = '
                 <div class="dropdown form-control">
                     <div data-toggle="dropdown" id="advanced_city_mobile" class="filter_menu_trigger" data-value="all">' . esc_html__('All Cities', 'wpestate') . ' <span class="caret caret_filter"></span> </div>           
                     <input type="hidden" name="advanced_city" value="">
                     <ul id="mobile-adv-city" class="dropdown-menu filter_menu" role="menu" aria-labelledby="advanced_city_mobile">
                         ' . $select_city_list . '
                     </ul>        
                 </div> ';
                 } else {
                     if ($search_field == 'areas') {
                         $return_string = '
                 <div class="dropdown form-control">
                     <div data-toggle="dropdown" id="advanced_area_mobile" class="filter_menu_trigger" data-value="all">' . esc_html__('All Areas', 'wpestate') . '<span class="caret caret_filter"></span> </div>           
                     <input type="hidden" name="advanced_area" value="">
                     <ul id="mobile-adv-area"  class="dropdown-menu filter_menu" role="menu" aria-labelledby="advanced_area_mobile">
                         ' . $select_area_list . '
                     </ul>        
                </div>  ';
                     } else {
                         // $slug=str_replace(' ','_',$search_field);
                         $string = wpestate_limit45(sanitize_title($adv_search_label[$key]));
                         $slug = sanitize_key($string);
                         $label = $adv_search_label[$key];
                         if (function_exists('icl_translate')) {
                             $label = icl_translate('wpestate', 'wp_estate_custom_search_' . $label, $label);
                         }
                         $random_id = rand(1, 999);
                         if ($adv_search_what[$key] == 'property price') {
                             $show_slider_price = get_option('wp_estate_show_slider_price', '');
                             if ($show_slider_price === 'yes') {
                                 $where_currency = esc_html(get_option('wp_estate_where_currency_symbol', ''));
                                 $currency = esc_html(get_option('wp_estate_currency_symbol', ''));
                                 $min_price_slider = floatval(get_option('wp_estate_show_slider_min_price', ''));
                                 $max_price_slider = floatval(get_option('wp_estate_show_slider_max_price', ''));
                                 $price_slider_label = wpestate_show_price_label_slider($min_price_slider, $max_price_slider, $currency, $where_currency);
                                 $return_string = '<div class="adv_search_slider slide_mobile">
                             <p>
                                 <label>' . esc_html__('Price range:', 'wpestate') . '</label>
                                 <span id="amount_mobile"  style="border:0; color:#f6931f; font-weight:bold;">' . $price_slider_label . '</span>
                             </p>
                             <div id="slider_price_mobile"></div>
                             <input type="hidden" id="price_low_mobile"  name="price_low"  value="' . $min_price_slider . '"/>
                             <input type="hidden" id="price_max_mobile"  name="price_max"  value="' . $max_price_slider . '"/>
                         </div>';
                             } else {
                                 $return_string = '<input type="text" id="' . $slug . $random_id . '" name="' . $slug . '" placeholder="' . $label . '" value=""  class="advanced_select form-control">';
                             }
                         } else {
                             $return_string = '<input type="text" id="' . $slug . $random_id . '" name="' . $slug . '" placeholder="' . $label . '" value=""  class="advanced_select form-control">';
                         }
                         if ($adv_search_how[$key] == 'date bigger' || $adv_search_how[$key] == 'date smaller') {
                             /*print '<script type="text/javascript">
                                   //<![CDATA[
                                   jQuery(document).ready(function(){
                                           jQuery("#'.$slug.$random_id.'").datepicker({
                                                   dateFormat : "yy-mm-dd"
                                           });
                                   });
                                   //]]>
                                   </script>';
                               */
                             wpestate_date_picker_translation($slug . $random_id);
                         }
                     }
                 }
             }
         }
     }
     print $return_string;
 }
Exemplo n.º 3
0
    function wpestate_advanced_search_function($attributes, $content = null)
    {
        $return_string = '';
        $random_id = '';
        $custom_advanced_search = get_option('wp_estate_custom_advanced_search', '');
        $actions_select = '';
        $categ_select = '';
        $title = '';
        if (isset($attributes['title'])) {
            $title = $attributes['title'];
        }
        $args = wpestate_get_select_arguments();
        $action_select_list = wpestate_get_action_select_list($args);
        $categ_select_list = wpestate_get_category_select_list($args);
        $select_city_list = wpestate_get_city_select_list($args);
        $select_area_list = wpestate_get_area_select_list($args);
        $adv_submit = wpestate_get_adv_search_link();
        if ($title != '') {
        }
        $return_string .= '<h1 class="shortcode_title_adv">' . $title . '</h1>';
        $return_string .= '<div class="advanced_search_shortcode" id="advanced_search_shortcode">
        <form role="search" method="get"   action="' . $adv_submit . '" >';
        if ($custom_advanced_search == 'yes') {
            $adv_search_what = get_option('wp_estate_adv_search_what', '');
            $adv_search_label = get_option('wp_estate_adv_search_label', '');
            $adv_search_how = get_option('wp_estate_adv_search_how', '');
            $count = 0;
            foreach ($adv_search_what as $key => $search_field) {
                $count++;
                $margin_style = '';
                if ($count % 4 == 0) {
                    $margin_style = ' adv_seach_code_right ';
                }
                if ($search_field == 'none') {
                    $return_string .= '';
                } else {
                    if ($search_field == 'types') {
                        $return_string .= '           
                                <div class="dropdown listing_filter_select form-control" >
                                <div data-toggle="dropdown" id="adv_actions_shortcode" class="filter_menu_trigger" data-value="all">' . esc_html__('All Sizes', 'wpestate') . '<span class="caret caret_filter"></span> </div>           
                                    <input type="hidden" name="filter_search_action[]" value="">
                                    <ul class="dropdown-menu filter_menu" role="menu" aria-labelledby="adv_actions_shortcode">
                                        ' . $action_select_list . '
                                    </ul>        
                                </div>';
                    } else {
                        if ($search_field == 'categories') {
                            $return_string .= '
                             <div class="dropdown listing_filter_select form-control" >
                                <div data-toggle="dropdown" id="adv_categ_shortcode" class="filter_menu_trigger" data-value="all">' . esc_html__('All Types', 'wpestate') . ' <span class="caret caret_filter"></span> </div>           
                                  <input type="hidden" name="filter_search_type[]" value="">

                                  <ul class="dropdown-menu filter_menu" role="menu" aria-labelledby="adv_categ_shortcode">
                                    ' . $categ_select_list . '
                                  </ul>        
                            </div>';
                        } else {
                            if ($search_field == 'cities') {
                                $return_string .= '
                            <div class="dropdown listing_filter_select form-control" >
                                <div data-toggle="dropdown" id="advanced_city_shortcode" class="filter_menu_trigger" data-value="all">' . esc_html__('All Cities', 'wpestate') . ' <span class="caret caret_filter"></span> </div>           
                                <input type="hidden" name="advanced_city" value="">
                                <ul class="dropdown-menu filter_menu" role="menu" id="adv_short_select_city" aria-labelledby="advanced_city_shortcode">
                                    ' . $select_city_list . '
                                </ul>        
                            </div>';
                            } else {
                                if ($search_field == 'areas') {
                                    $return_string .= '
                            <div class="dropdown listing_filter_select  form-control" >
                               <div data-toggle="dropdown" id="advanced_area_shortcode" class="filter_menu_trigger" data-value="all">' . esc_html__('All Areas', 'wpestate') . '<span class="caret caret_filter"></span> </div>           
                               <input type="hidden" name="advanced_area" value="">
                               <ul class="dropdown-menu filter_menu" role="menu" id="adv_short_select_area" aria-labelledby="advanced_area_shortcode">
                                   ' . $select_area_list . '
                               </ul>        
                            </div>';
                                } else {
                                    $slug = str_replace(' ', '_', $search_field);
                                    $random_id = rand(1, 999);
                                    $string = wpestate_limit45(sanitize_title($adv_search_label[$key]));
                                    $slug = sanitize_key($string);
                                    $label = $adv_search_label[$key];
                                    if (function_exists('icl_translate')) {
                                        $label = icl_translate('wpestate', 'wp_estate_custom_search_' . $label, $label);
                                    }
                                    if ($adv_search_what[$key] == 'property price') {
                                        $show_slider_price = get_option('wp_estate_show_slider_price', '');
                                        if ($show_slider_price == 'yes') {
                                            $where_currency = esc_html(get_option('wp_estate_where_currency_symbol', ''));
                                            $currency = esc_html(get_option('wp_estate_currency_symbol', ''));
                                            $min_price_slider = floatval(get_option('wp_estate_show_slider_min_price', ''));
                                            $max_price_slider = floatval(get_option('wp_estate_show_slider_max_price', ''));
                                            if ($where_currency == 'before') {
                                                $price_slider_label = $currency . number_format($min_price_slider) . ' ' . esc_html__('to', 'wpestate') . ' ' . $currency . number_format($max_price_slider);
                                            } else {
                                                $price_slider_label = number_format($min_price_slider) . $currency . ' ' . esc_html__('to', 'wpestate') . ' ' . number_format($max_price_slider) . $currency;
                                            }
                                            $return_string .= '
                                        <div class="adv_search_sh">
                                            <p>
                                                <label>' . esc_html__('Price range:', 'wpestate') . '</label>
                                                <span id="amount_sh"  style="border:0; font-weight:bold;">' . wpestate_show_price_label_slider($min_price_slider, $max_price_slider, $currency, $where_currency) . '</span>
                                            </p>
                                            <div id="slider_price_sh"></div>
                                            <input type="hidden" id="price_low_sh"  name="price_low"  value="' . $min_price_slider . '" />
                                            <input type="hidden" id="price_max_sh"  name="price_max"  value="' . $max_price_slider . '" />
                                        </div>';
                                        } else {
                                            $return_string .= '
                                    <div class="adv_shortcode_input ' . $margin_style . '" >
                                       <input type="text" id="' . $slug . $random_id . '"  name="' . $slug . '" placeholder="' . $label . '" value=""  class="advanced_select form-control">
                                    </div>';
                                        }
                                        // if is property price
                                    } else {
                                        $return_string .= '
                                <div class="adv_shortcode_input ' . $margin_style . '" >
                                   <input type="text" id="' . $slug . $random_id . '"  name="' . $slug . '" placeholder="' . $label . '" value=""  class="advanced_select form-control">
                                </div>';
                                    }
                                    if ($adv_search_how[$key] == 'date bigger' || $adv_search_how[$key] == 'date smaller') {
                                        $return_string .= '<script type="text/javascript">
                                          //<![CDATA[
                                          jQuery(document).ready(function(){
                                                ' . wpestate_date_picker_translation($slug . $random_id) . '
                                          });
                                          //]]>
                                          </script>';
                                    }
                                }
                            }
                        }
                    }
                }
                //end else
            }
            // end foreach
        } else {
            $return_string .= '
                 
                <div class="col-md-3 map_icon "> <!-- map_icon -->
                    <input type="text" id="search_location_filter_shortcode" class="form-control search_location_city" name="search_location" placeholder="' . esc_html__('Type location', 'wpestate') . '" value="" autocomplete="off">
                    <input type="hidden" id="advanced_city_shortcode"   class="form-control" name="advanced_city" data-value=""   value="" >              
                    <input type="hidden" id="advanced_area_shortcode"   class="form-control" name="advanced_area"   data-value="" value="" >              
                    <input type="hidden" id="advanced_country_shortcode"   class="form-control" name="advanced_country"   data-value="" value="" >              
        
                </div>
                
                <div class="col-md-3 has_calendar calendar_icon ">  <!-- calendar_icon -->
                    <input type="text" id="checkinshortcode" class="form-control " name="check_in" placeholder="' . esc_html__('Check in', 'wpestate') . '">       
                </div>
                
                <div class="col-md-3 has_calendar calendar_icon checkout_sh ">  <!-- calendar_icon -->
                    <input type="text" id="checkoutshortcode" disabled class="form-control " name="check_out" placeholder="' . esc_html__('Check Out', 'wpestate') . '">
                </div>

                <div class="col-md-3 dropdown guest_form_sh_wr">
                <div class=" form-control guest_form">
                    <div data-toggle="dropdown" id="guest_no_shortcode" class="filter_menu_trigger" data-value="all"> ' . esc_html__('Guests', 'wpestate') . ' <span class="caret caret_filter"></span> </div>           
                    <input type="hidden" name="guest_no" id="guest_no_input_sh" value="">
                    <ul class="dropdown-menu filter_menu" role="menu" aria-labelledby="guest_no_input_sh">' . wpestate_get_guest_dropdown() . '
                    </ul>
                </div>    
                </div>';
            $show_slider_price = get_option('wp_estate_show_slider_price', '');
            $where_currency = esc_html(get_option('wp_estate_where_currency_symbol', ''));
            $currency = esc_html(get_option('wp_estate_currency_symbol', ''));
            $min_price_slider = floatval(get_option('wp_estate_show_slider_min_price', ''));
            $max_price_slider = floatval(get_option('wp_estate_show_slider_max_price', ''));
            if ($where_currency == 'before') {
                $price_slider_label = $currency . number_format($min_price_slider) . ' ' . esc_html__('to', 'wpestate') . ' ' . $currency . number_format($max_price_slider);
            } else {
                $price_slider_label = number_format($min_price_slider) . $currency . ' ' . esc_html__('to', 'wpestate') . ' ' . number_format($max_price_slider) . $currency;
            }
            $return_string .= '
                    <div class="col-md-9 adv_search_sh">
                        <p>
                            <label>' . esc_html__('Price range:', 'wpestate') . '</label>
                            <span id="amount_sh"  style="border:0; font-weight:bold;">' . wpestate_show_price_label_slider($min_price_slider, $max_price_slider, $currency, $where_currency) . '</span>
                        </p>
                        <div id="slider_price_sh"></div>
                        <input type="hidden" id="price_low_sh"  name="price_low"  value="' . $min_price_slider . '" />
                        <input type="hidden" id="price_max_sh"  name="price_max"  value="' . $max_price_slider . '" />
                    </div>';
        }
        $extended_search = get_option('wp_estate_show_adv_search_extended', '');
        if ($extended_search == 'yes') {
            ob_start();
            wpestate_show_extended_search('short');
            $templates = ob_get_contents();
            ob_end_clean();
            $return_string = $return_string . $templates;
        }
        $return_string .= '<div class="col-md-3"></div><div class="col-md-3 adv_sh_but"><button class="wpb_btn-info wpb_btn-small wpestate_vc_button  vc_button" id="advanced_submit_shorcode">' . esc_html__('Search', 'wpestate') . '</button> </div>             

    </form>   
</div>';
        return $return_string;
    }
Exemplo n.º 4
0
 function normal_fields_widget($action_select_list, $cate_select_list, $select_city_list, $select_area_list)
 {
     if (!empty($action_select_list)) {
         print '
                           <div class="dropdown form-control" >
                             <div data-toggle="dropdown" id="sidebar_filter_action" class="sidebar_filter_menu"> ' . esc_html__('All Sizes', 'wpestate') . ' <span class="caret caret_sidebar"></span> </div>           
                             <input type="hidden" name="filter_search_action[]" value="">
                             <ul id="list_sidebar_filter_action" class="dropdown-menu filter_menu" role="menu" aria-labelledby="sidebar_filter_action">
                                 ' . $action_select_list . '
                             </ul>        
                           </div>';
     }
     if (!empty($cate_select_list)) {
         print '                                            
                             <div class="dropdown form-control" >
                                 <div data-toggle="dropdown" id="a_sidebar_filter_categ" class="sidebar_filter_menu"> ' . esc_html__('All Types', 'wpestate') . ' <span class="caret caret_sidebar"></span> </div>           
                                     <input type="hidden" name="filter_search_type[]" value="">
                                     <ul id="sidebar_filter_categ" class="dropdown-menu filter_menu" role="menu" aria-labelledby="a_sidebar_filter_categ">
                                     ' . $cate_select_list . '
                                 </ul>        
                               </div>';
     }
     if (!empty($select_city_list)) {
         print '
                          <div class=" dropdown form-control" >
                             <div data-toggle="dropdown" id="sidebar_filter_cities" class="sidebar_filter_menu"> ' . esc_html__('All Cities', 'wpestate') . ' <span class="caret caret_sidebar"></span> </div>           
                             <input type="hidden" name="advanced_city" value="">
                             <ul id="sidebar_filter_city" class="dropdown-menu filter_menu" role="menu" aria-labelledby="sidebar_filter_cities">
                                 ' . $select_city_list . '
                             </ul>        
                           </div>  ';
     }
     if (!empty($select_area_list)) {
         print '
                         <div class="dropdown form-control" >
                             <div data-toggle="dropdown" id="sidebar_filter_areas" class="sidebar_filter_menu">' . esc_html__('Nearest Schools', 'wpestate') . '<span class="caret caret_sidebar"></span> </div>           
                             <input type="hidden" name="advanced_area" value="">
                             <ul id="sidebar_filter_area" class="dropdown-menu filter_menu" role="menu" aria-labelledby="sidebar_filter_areas">
                                 ' . $select_area_list . '
                             </ul>        
                           </div>';
     }
     print '    
                 <input type="text" id="adv_rooms_widget" name="advanced_rooms" placeholder="' . esc_html__('Type Bedrooms No.', 'wpestate') . '"      class="advanced_select form-control">
                 <input type="text" id="adv_bath_widget"  name="advanced_bath"  placeholder="' . esc_html__('Type Bathrooms No.', 'wpestate') . '"  class="advanced_select form-control">';
     $show_slider_price = get_option('wp_estate_show_slider_price', '');
     if ($show_slider_price == 'yes') {
         $where_currency = esc_html(get_option('wp_estate_where_currency_symbol', ''));
         $currency = esc_html(get_option('wp_estate_currency_symbol', ''));
         $min_price_slider = floatval(get_option('wp_estate_show_slider_min_price', ''));
         $max_price_slider = floatval(get_option('wp_estate_show_slider_max_price', ''));
         $price_slider_label = wpestate_show_price_label_slider($min_price_slider, $max_price_slider, $currency, $where_currency);
         print '
                         <div class="adv_search_widget">
                             <p>
                                 <label>' . esc_html__('Price range:', 'wpestate') . '</label>
                                 <span id="amount_wd"  style="border:0; ">' . $price_slider_label . '</span>
                             </p>
                             <div id="slider_price_widget"></div>
                             <input type="hidden" id="price_low_widget"  name="price_low"  value="' . wpestate_price_default_convert($min_price_slider) . '"/>
                             <input type="hidden" id="price_max_widget"  name="price_max"  value="' . wpestate_price_default_convert($max_price_slider) . '"/>
                         </div>';
     } else {
         print '
                 <input type="text" id="price_low_widget" name="price_low"  class="advanced_select form-control" placeholder="' . esc_html__('Type Min. Price', 'wpestate') . '"/>
                 <input type="text" id="price_max_widget" name="price_max"  class="advanced_select form-control" placeholder="' . esc_html__('Type Max. Price', 'wpestate') . '"/>';
     }
 }