コード例 #1
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;
    }
コード例 #2
0
        $i++;
        if (function_exists('icl_translate')) {
            $label = icl_translate('wpestate', 'wp_estate_property_custom_front_' . $label, $label);
        }
        print '<div class="col-md-4"><p><label for="' . $slug . '">' . $label . '</label>';
        if ($type == 'long text') {
            print '<textarea type="text" class="form-control"  id="' . $slug . '"  size="0" name="' . $slug . '" rows="3" cols="42">' . $custom_fields_array[$slug] . '</textarea>';
        } else {
            print '<input type="text" class="form-control"  id="' . $slug . '" size="40" name="' . $slug . '" value="' . $custom_fields_array[$slug] . '">';
        }
        print '</p>  </div>';
        if ($type == 'date') {
            print '<script type="text/javascript">
                    //<![CDATA[
                    jQuery(document).ready(function(){
                        ' . wpestate_date_picker_translation($slug) . '
                    });
                    //]]>
                    </script>';
        }
    }
}
?>
  
    
    <div class="col-md-12" style="display: inline-block;">  
        <input type="hidden" name="" id="listing_edit" value="<?php 
echo $edit_id;
?>
">
        <input type="submit" class="wpb_btn-info wpb_btn-small wpestate_vc_button  vc_button" id="edit_prop_details" value="<?php 
コード例 #3
0
    function wpestate_show_search_field($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" 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">
                            ' . $action_select_list . '
                        </ul>        
                    </div>';
            } else {
                if ($search_field == 'categories') {
                    $return_string = '
                    <div class="dropdown  form-control">
                        <div data-toggle="dropdown" id="adv_categ" 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">
                          ' . $categ_select_list . '
                        </ul>        
                    </div>';
                } else {
                    if ($search_field == 'cities') {
                        $return_string = '
                    <div class="dropdown  form-control">
                        <div data-toggle="dropdown" id="advanced_city" 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="adv-search-city" class="dropdown-menu filter_menu" role="menu" aria-labelledby="advanced_city">
                            ' . $select_city_list . '
                        </ul>        
                    </div> ';
                    } else {
                        if ($search_field == 'areas') {
                            $return_string = '
                    <div class="dropdown  form-control">
                        <div data-toggle="dropdown" id="advanced_area" 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="adv-search-area" class="dropdown-menu filter_menu" role="menu" aria-labelledby="advanced_area">
                            ' . $select_area_list . '
                        </ul>        
                    </div>';
                        } else {
                            //$slug       =   wpestate_limit45 ( sanitize_title ( $search_field ));
                            //$slug       =   sanitize_key($slug);
                            $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);
                            }
                            //   $return_string='<input type="text" id="'.$slug.'"  name="'.$slug.'" placeholder="'.$label.'" value=""  class="advanced_select  form-control" />';
                            if ($adv_search_what[$key] == 'property price') {
                                $show_slider_price = get_option('wp_estate_show_slider_price', '');
                                if ($show_slider_price === 'yes') {
                                    $min_price_slider = floatval(get_option('wp_estate_show_slider_min_price', ''));
                                    $max_price_slider = floatval(get_option('wp_estate_show_slider_max_price', ''));
                                    $where_currency = esc_html(get_option('wp_estate_where_currency_symbol', ''));
                                    $currency = esc_html(get_option('wp_estate_currency_symbol', ''));
                                    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_slider">
                                    <p>
                                        <label for="amount">' . esc_html__('Price range:', 'wpestate') . '</label>
                                        <span id="amount"  style="border:0; color:#f6931f; font-weight:bold;">' . $price_slider_label . '</span>
                                    </p>
                                    <div id="slider_price"></div>
                                    <input type="hidden" id="price_low"  name="price_low"  value="' . $min_price_slider . '"/>
                                    <input type="hidden" id="price_max"  name="price_max"  value="' . $max_price_slider . '"/>
                                </div>';
                                } else {
                                    $return_string = '<input type="text" id="' . $slug . '"  name="' . $slug . '" placeholder="' . $label . '" value=""  class="advanced_select  form-control" />';
                                }
                                // if is property price
                            } else {
                                $return_string = '<input type="text" id="' . $slug . '"  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(){
                                    ' . wpestate_date_picker_translation($slug) . '
                              });
                              //]]>
                              </script>';
                            }
                        }
                    }
                }
            }
        }
        print $return_string;
    }
コード例 #4
0
ファイル: property.php プロジェクト: riddya85/rentail_upwrk
 function map_estate_box($post)
 {
     wp_nonce_field(plugin_basename(__FILE__), 'estate_property_noncename');
     global $post;
     $mypost = $post->ID;
     $gmap_lat = floatval(get_post_meta($mypost, 'property_latitude', true));
     $gmap_long = floatval(get_post_meta($mypost, 'property_longitude', true));
     $google_camera_angle = intval(esc_html(get_post_meta($mypost, 'google_camera_angle', true)));
     $cache_array = array('yes', 'no');
     $keep_min_symbol = '';
     $keep_min_status = esc_html(get_post_meta($post->ID, 'keep_min', true));
     foreach ($cache_array as $value) {
         $keep_min_symbol .= '<option value="' . $value . '"';
         if ($keep_min_status == $value) {
             $keep_min_symbol .= ' selected="selected" ';
         }
         $keep_min_symbol .= '>' . $value . '</option>';
     }
     print '<script type="text/javascript">
 //<![CDATA[
 jQuery(document).ready(function(){
     ' . wpestate_date_picker_translation("property_date") . '
 });
 //]]>
 </script>
 <p class="meta-options"> 
 <div id="googleMap" style="width:100%;height:380px;margin-bottom:30px;"></div>    
 <p class="meta-options"> 
     <a class="button" href="#" id="admin_place_pin">' . esc_html__('Place Pin with Property Address', 'wpestate') . '</a>
 </p>
 ' . esc_html__('Latitude:', 'wpestate') . '  <input type="text" id="property_latitude" style="margin-right:20px;" size="40" name="property_latitude" value="' . $gmap_lat . '">
 ' . esc_html__('Longitude:', 'wpestate') . ' <input type="text" id="property_longitude" style="margin-right:20px;" size="40" name="property_longitude" value="' . $gmap_long . '">
 <p>
 <p class="meta-options"> 
 <label for="google_camera_angle" >' . esc_html__('Google View Camera Angle', 'wpestate') . '</label>
 <input type="text" id="google_camera_angle" style="margin-right:0px;" size="5" name="google_camera_angle" value="' . $google_camera_angle . '">
 
 </p>';
     $page_custom_zoom = get_post_meta($mypost, 'page_custom_zoom', true);
     if ($page_custom_zoom == '') {
         $page_custom_zoom = 16;
     }
     print '
  <p class="meta-options">
    <label for="page_custom_zoom">' . esc_html__('Zoom Level for map (1-20)', 'wpestate') . '</label><br />
    <select name="page_custom_zoom" id="page_custom_zoom">';
     for ($i = 1; $i < 21; $i++) {
         print '<option value="' . $i . '"';
         if ($page_custom_zoom == $i) {
             print ' selected="selected" ';
         }
         print '>' . $i . '</option>';
     }
     print '
    </select>
 ';
 }
コード例 #5
0
ファイル: booking.php プロジェクト: riddya85/rentail_upwrk
    function wpestate_booking_meta_function($post)
    {
        wp_nonce_field(plugin_basename(__FILE__), 'estate_booking_noncename');
        global $post;
        $option_status = '';
        $status_values = array('confirmed', 'pending');
        $status_type = get_post_meta($post->ID, 'booking_status', true);
        foreach ($status_values as $value) {
            $option_status .= '<option value="' . $value . '"';
            if ($value == $status_type) {
                $option_status .= 'selected="selected"';
            }
            $option_status .= '>' . $value . '</option>';
        }
        // print   ' owner id '.get_post_meta($post->ID, 'owner_id', true);
        $property_id = esc_html(get_post_meta($post->ID, 'booking_id', true));
        print '
    <p class="meta-options">
        <label for="booking_listing_name">' . esc_html__('Booking Status:', 'wpestate') . ' </label>
        ' . get_post_meta($post->ID, 'booking_status', true) . '
    </p>
    
    <p class="meta-options">
        <label for="booking_listing_name">' . esc_html__('Booking Invoice:', 'wpestate') . ' </label>
        ' . get_post_meta($post->ID, 'booking_invoice_no', true) . '
    </p>
    
    <p class="meta-options">
        <label for="booking_from_date">' . esc_html__('Check In:', 'wpestate') . ' </label><br />
        <input type="text" id="booking_from_date" size="58" name="booking_from_date" value="' . esc_html(get_post_meta($post->ID, 'booking_from_date', true)) . '">
    </p>
    
    <p class="meta-options">
        <label for="booking_to_date">' . esc_html__('Check Out:', 'wpestate') . ' </label><br />
        <input type="text" id="booking_to_date" size="58" name="booking_to_date" value="' . esc_html(get_post_meta($post->ID, 'booking_to_date', true)) . '">
    </p>

    <p class="meta-options">
        <label for="booking_id">' . esc_html__('Property ID:', 'wpestate') . ' </label><br />
        <input type="text" id="booking_id" size="58" name="booking_id" value="' . $property_id . '">
    </p>
   
    <p class="meta-options">
        <label for="booking_guests">' . esc_html__('Guests No:', 'wpestate') . ' </label><br />
        <input type="text" id="booking_guests" size="58" name="booking_guests" value="' . esc_html(get_post_meta($post->ID, 'booking_guests', true)) . '">
    </p>
    
    <p class="meta-options">
        <label for="booking_status">' . esc_html__('Property Name:', 'wpestate') . ' </label><br /> 
        <select id="booking_listing_name" name="booking_listing_name">
            ' . wpestate_get_property_list($property_id) . '
        </select>   
    </p>
    
    <p class="meta-options">
        <label for="booking_listing_name">' . esc_html__('Booking Status:', 'wpestate') . ' </label><br />
        <select id="booking_status" name="booking_status">
            ' . $option_status . ' 
        </select>   
    </p>
     
  
    
    ';
        print '<script type="text/javascript">
                    //<![CDATA[
                    jQuery(document).ready(function(){
                        ' . wpestate_date_picker_translation("#booking_from_date") . '
                    });
                    //]]>
                    </script>';
        print '<script type="text/javascript">
                  //<![CDATA[
                  jQuery(document).ready(function(){
                        ' . wpestate_date_picker_translation("#booking_to_date") . '
                  });
                  //]]>
                  </script>';
    }