function st_list_hotel_related($attr, $content = false) { $data_vc = STHotel::get_taxonomy_and_id_term_tour(); $param = array('title' => '', 'sort_taxonomy' => '', 'posts_per_page' => 3, 'orderby' => 'ID', 'order' => 'DESC', 'font_size' => '3', 'number_of_row' => 1); $param = array_merge($param, $data_vc['list_id_vc']); $data = shortcode_atts($param, $attr, 'st_list_hotel_related'); extract($data); $page = STInput::request('paged'); if (!$page) { $page = get_query_var('paged'); } $query = array('post_type' => 'st_hotel', 'posts_per_page' => $posts_per_page, 'post_status' => 'publish', 'paged' => $page, 'order' => $order, 'orderby' => $orderby, 'post__not_in' => array(get_the_ID())); if (!empty($sort_taxonomy)) { if (isset($attr["id_term_" . $sort_taxonomy])) { $terms_post = wp_get_post_terms(get_the_ID(), $sort_taxonomy, array('fields' => 'ids')); $id_term = $attr["id_term_" . $sort_taxonomy]; $id_term = explode(',', $id_term); $terms = array(); foreach ($id_term as $key => $value) { if (in_array($value, $terms_post)) { $terms[] = $value; } } if ($terms) { $query['tax_query'] = array(array('taxonomy' => $sort_taxonomy, 'field' => 'id', 'terms' => $terms)); } } } $r = "<div class='list_hotel_related'>" . st()->load_template('vc-elements/st-list-hotel/loop-hot', 'deals', array('query' => new Wp_Query($query))) . "</div>"; wp_reset_query(); if (!empty($title) and !empty($r)) { $r = '<h' . $font_size . '>' . $title . '</h' . $font_size . '>' . $r; } return $r; }
/** * * * * * @since 1.0.9 * */ function _top_ajax_search() { if (STInput::request('action') != 'st_top_ajax_search') { return; } //Small security check_ajax_referer('st_search_security', 'security'); $s = STInput::get('s'); $arg = array('post_type' => array('post', 'st_hotel', 'st_rental', 'location', 'st_tours', 'st_holidays', 'st_cars', 'st_activity'), 'posts_per_page' => 10, 's' => $s, 'suppress_filters' => false); $query = new WP_Query(); $query->is_admin = false; $query->query($arg); $r = array(); while ($query->have_posts()) { $query->the_post(); $post_type = get_post_type(get_the_ID()); $obj = get_post_type_object($post_type); $item = array('title' => get_the_title(), 'id' => get_the_ID(), 'type' => $obj->labels->singular_name, 'url' => get_permalink(), 'obj' => $obj); if ($post_type == 'location') { $item['url'] = home_url(esc_url_raw('?s=&post_type=st_hotel&location_id=' . get_the_ID())); } $r['data'][] = $item; } wp_reset_query(); echo json_encode($r); die; }
function st_post_select_func() { if (!current_user_can('upload_files')) { return; } $result = array('total_count' => 0, 'items' => array()); $q = STInput::get('q'); $post_type = STInput::get('post_type'); if ($q) { if (!$post_type) { $post_type = 'st_hotel'; } $arg = array('post_type' => $post_type, 'posts_per_page' => 20, 's' => $q, 'post_status' => 'publish'); $author = STInput::get('author'); if ($author) { $arg = array('post_type' => $post_type, 'posts_per_page' => 20, 's' => $q, 'author' => $author, 'post_status' => 'publish'); } $query = new WP_Query($arg); while ($query->have_posts()) { $query->the_post(); $result['items'][] = array('id' => get_the_ID(), 'name' => get_the_title(), 'description' => "ID: " . get_the_ID()); } global $wp_query; $result['total_count'] = $wp_query->found_posts; wp_reset_query(); } echo json_encode($result); die; }
/** * * * @since 1.0 * */ function _save_separated_field($post_id) { if (!empty($_POST['st_custom_price_nonce'])) { if (!wp_verify_nonce($_POST['st_custom_price_nonce'], plugin_basename(__FILE__))) { return $post_id; } if (!current_user_can('edit_post', $post_id)) { return $post_id; } $price_new = STInput::request('st_price'); $price_type = STInput::request('st_price_type'); $start_date = STInput::request('st_start_date'); $end_date = STInput::request('st_end_date'); $status = STInput::request('st_status'); $priority = STInput::request('st_priority'); STAdmin::st_delete_price($post_id); if ($price_new and $start_date and $end_date) { foreach ($price_new as $k => $v) { if (!empty($v)) { STAdmin::st_add_price($post_id, $price_type[$k], $v, $start_date[$k], $end_date[$k], $status[$k], $priority[$k]); } } } } }
function _shop_product_style() { $style = st()->get_option('shop_default_list_view', 'grid'); if (STInput::get('view_style')) { $style = STInput::get('view_style'); } return $style; }
function st_vc_list_activity($attr, $content = false) { $data_vc = STActivity::get_taxonomy_and_id_term_activity(); $param = array('st_ids' => "", 'st_number' => 4, 'st_order' => '', 'st_orderby' => '', 'st_of_row' => 4, 'only_featured_location' => 'no', 'st_location' => '', 'sort_taxonomy' => ''); $param = array_merge($param, $data_vc['list_id_vc']); $data = shortcode_atts($param, $attr, 'st_list_activity'); extract($data); $page = STInput::request('paged'); if (!$page) { $page = get_query_var('paged'); } $query = array('post_type' => 'st_activity', 'posts_per_page' => $st_number, 'paged' => $page, 'order' => $st_order, 'orderby' => $st_orderby); if (!empty($st_ids)) { $query['post__in'] = explode(',', $st_ids); $query['orderby'] = 'post__in'; } if ($st_orderby == 'sale') { $query['meta_key'] = 'price'; $query['orderby'] = 'meta_value'; } if ($st_orderby == 'rate') { $query['meta_key'] = 'rate_review'; $query['orderby'] = 'meta_value'; } if ($st_orderby == 'discount') { $query['meta_key'] = 'discount'; $query['orderby'] = 'meta_value'; } $_SESSION['el_only_featured_location'] = $only_featured_location; $_SESSION['el_st_location'] = $st_location; $_SESSION['el_featured'] = array(); if ($only_featured_location == 'yes') { $STLocation = new STLocation(); $featured = $STLocation->get_featured_ids(); $_SESSION['featured'] = $featured; } $st_list_activity = new st_list_activity(); if ($only_featured_location == 'yes' || !empty($st_location)) { add_filter('posts_where', array($st_list_activity, '_get_query_where')); add_filter('posts_join', array($st_list_activity, '_get_query_join')); } if (!empty($sort_taxonomy)) { if (isset($attr["id_term_" . $sort_taxonomy])) { $id_term = $attr["id_term_" . $sort_taxonomy]; $query['tax_query'] = array(array('taxonomy' => $sort_taxonomy, 'field' => 'id', 'terms' => explode(',', $id_term))); } } query_posts($query); remove_filter('posts_where', array($st_list_activity, '_get_query_where')); remove_filter('posts_join', array($st_list_activity, '_get_query_join')); unset($_SESSION['el_only_featured_location']); unset($_SESSION['el_st_location']); unset($_SESSION['el_featured']); $r = "<div class='list_tours'>" . st()->load_template('vc-elements/st-list-activity/loop', '', $data) . "</div>"; wp_reset_query(); return $r; }
/** * * * @since 1.1.3 * */ static function _format_money() { $data = STInput::post('money_data', array()); if (!empty($data)) { foreach ($data as $key => $value) { $data[$key] = TravelHelper::format_money($value); } } echo json_encode(array('status' => 1, 'money_data' => $data)); die; }
static function _get_image() { if (STInput::get('st_get_captcha')) { $key = STInput::get('key'); $captcha = new SimpleCaptcha(); if ($key) { $captcha->session_var = $key; } $captcha->CreateImage(); die; } }
function _alter_search_query($where) { if (is_admin()) { return $where; } global $wp_query, $wpdb; $post_type = ''; if (isset($wp_query->query_vars['post_type']) and is_string($wp_query->query_vars['post_type'])) { $post_type = $wp_query->query_vars['post_type']; } if ($post_type == 'hotel_room') { // Check Woocommerce Booking $st_is_woocommerce_checkout = apply_filters('st_is_woocommerce_checkout', false); if (STInput::request('start') and STInput::request('end')) { $check_in = strtotime(STInput::request('start')); $check_out = strtotime(STInput::request('end')); // $where_add=" AND {$wpdb->posts}.ID NOT IN (SELECT room_id FROM ( // SELECT count(st_meta6.meta_value) as total, // st_meta5.meta_value as total_room,st_meta6.meta_value as room_id ,st_meta2.meta_value as check_in,st_meta3.meta_value as check_out // FROM {$wpdb->posts} // JOIN {$wpdb->postmeta} as st_meta2 on st_meta2.post_id={$wpdb->posts}.ID and st_meta2.meta_key='check_in' // JOIN {$wpdb->postmeta} as st_meta3 on st_meta3.post_id={$wpdb->posts}.ID and st_meta3.meta_key='check_out' // JOIN {$wpdb->postmeta} as st_meta6 on st_meta6.post_id={$wpdb->posts}.ID and st_meta6.meta_key='room_id' // JOIN {$wpdb->postmeta} as st_meta5 on st_meta5.post_id=st_meta6.meta_value and st_meta5.meta_key='number_room' // WHERE {$wpdb->posts}.post_type='st_order' // GROUP BY st_meta6.meta_value HAVING total>=total_room AND ( // // ( CAST(st_meta2.meta_value AS DATE)<'{$check_in}' AND CAST(st_meta3.meta_value AS DATE)>'{$check_in}' ) // OR ( CAST(st_meta2.meta_value AS DATE)>='{$check_in}' AND CAST(st_meta2.meta_value AS DATE)<='{$check_out}' ) // // ) // ) as room_booked)"; $table_name = $wpdb->prefix . 'st_order_item_meta'; if ($st_is_woocommerce_checkout) { $where_type = " AND type='woocommerce'"; } else { $where_type = " AND type='normal_booking'"; } $where_add = " AND {$wpdb->posts}.ID NOT IN (SELECT room_id FROM (\r\n SELECT\r\n room_id,SUM(room_num_search) as total_booked_number,{$wpdb->postmeta}.meta_value\r\n FROM\r\n {$table_name}\r\n JOIN {$wpdb->postmeta} ON {$wpdb->postmeta}.post_id = {$table_name}.room_id and {$wpdb->postmeta}.meta_key='number_room'\r\n AND st_booking_post_type = 'st_hotel'\r\n WHERE (check_in_timestamp<{$check_in} AND check_out_timestamp>{$check_in}) OR\r\n (check_in_timestamp>={$check_in} AND check_in_timestamp<={$check_out})\r\n {$where_type}\r\n GROUP BY room_id\r\n HAVING total_booked_number>={$wpdb->postmeta}.meta_value\r\n\r\n ) as room_booked2 )"; // Woocommerce Booking if ($st_is_woocommerce_checkout) { // Woocommerce check Query $where_add = ""; } $where .= $where_add; } } return $where; }
protected function content($arg, $content = null) { $data = shortcode_atts(array('st_title_form' => '', 'st_post_type' => "st_hotel", 'st_button_search' => __("Search", ST_TEXTDOMAIN)), $arg, 'st_search_form'); extract($data); $content = st_remove_wpautop($content); $text = ' <h2>' . $st_title_form . '</h2> <form role="search" method="get" class="search" action="' . home_url('/') . '"> <input type="hidden" name="s" value=""> <input type="hidden" name="post_type" value="' . $st_post_type . '"> <input type="hidden" name="layout" value="' . STInput::get('layout') . '"> <div class="row">' . $content . '</div> <button class="btn btn-primary btn-lg" type="submit">' . $st_button_search . '</button> </form>'; return $text; }
static function _javascript_reload_parentwindow() { if (STInput::get('social_login_success') == 1) { ?> <script> window.opener.location.reload(); window.close(); </script> <?php die; } }
function list_item_post_type() { $post_type = STInput::request('post_type', 'location'); $query = array('post_type' => $post_type, 'posts_per_page' => -1); query_posts($query); $result = array(); while (have_posts()) { the_post(); $result[] = array('title' => get_the_title(), 'id' => get_the_ID()); } wp_reset_query(); wp_reset_postdata(); echo json_encode($result); die; }
/** * @since 1.1.8 */ static function _init() { self::$table_columns = apply_filters('st_order_meta_table_columns', self::$table_columns); add_action('after_setup_theme', array(__CLASS__, '_check_is_working')); add_action('st_traveler_do_upgrade_table', array(__CLASS__, '_upgrade_table')); add_action('st_save_order_item_meta', array(__CLASS__, '_save_data'), 10, 3); // Re update the Order Meta add_action('save_post', array(__CLASS__, '_reupdate_normal_booking'), 50); // Update Status add_action('st_booking_change_status', array(__CLASS__, '_st_booking_change_status'), 10, 3); add_action('woocommerce_order_status_changed', array(__CLASS__, '_woocommerce_order_status_changed'), 10, 3); if (STInput::get('_upgrade_table') and current_user_can('manage_options')) { self::_upgrade_table(); die; } }
static function _get_disable_date() { $disable = array(); if (!TravelHelper::checkTableDuplicate('st_holidays')) { echo json_encode($disable); die; } $holiday_id = STInput::request('holiday_id', ''); if (empty($holiday_id)) { echo json_encode($disable); die; } $year = STInput::request('year', date('Y')); global $wpdb; $sql = "SELECT\r\n\t\t\t\tst_booking_id AS holiday_id,\r\n\t\t\t\tcheck_in_timestamp AS check_in,\r\n\t\t\t\tcheck_out_timestamp AS check_out,\r\n\t\t\t\tadult_number,\r\n\t\t\t\tchild_number,\r\n\t\t\t\tinfant_number\r\n\t\t\tFROM\r\n\t\t\t\t{$wpdb->prefix}st_order_item_meta\r\n\t\t\tINNER JOIN {$wpdb->prefix}st_holidays AS mt ON mt.post_id = st_booking_id\r\n\t\t\tWHERE\r\n\t\t\t\tst_booking_post_type = 'st_holidays'\r\n\t\t\tAND mt.type_holiday = 'daily_holiday'\r\n\t\t\tAND st_booking_id = '{$holiday_id}'\r\n\t\t\tAND status NOT IN ('trash', 'canceled')\r\n\t\t\tAND YEAR (\r\n\t\t\t\tFROM_UNIXTIME(check_in_timestamp)\r\n\t\t\t) = {$year}\r\n\t\t\tAND YEAR (\r\n\t\t\t\tFROM_UNIXTIME(check_out_timestamp)\r\n\t\t\t) = {$year}"; $result = $wpdb->get_results($sql, ARRAY_A); if (is_array($result) && count($result)) { $list_date = array(); foreach ($result as $key => $val) { $list_date[] = array('check_in' => $val['check_in'], 'check_out' => $val['check_out'], 'adult_number' => $val['adult_number'], 'child_number' => $val['child_number'], 'infant_number' => $val['infant_number']); } } if (isset($list_date) && count($list_date)) { $min_max = self::_get_minmax($holiday_id, $year); if (is_array($min_max) && count($min_max)) { $max_people = intval(get_post_meta($holiday_id, 'max_people', true)); for ($i = intval($min_max['check_in']); $i <= intval($min_max['check_out']); $i = strtotime('+1 day', $i)) { $people = 0; foreach ($result as $key => $date) { if ($i == intval($date['check_in'])) { $people += intval($date['adult_number']) + intval($date['child_number']) + intval($date['infant_number']); } } if ($people >= $max_people) { $disable[] = date(TravelHelper::getDateFormat(), $i); } } } } if (count($disable)) { echo json_encode($disable); die; } echo json_encode($disable); die; }
function search_location() { //Small security check_ajax_referer('st_search_security', 'security'); $s = STInput::get('s'); $arg = array('post_type' => 'location', 'posts_per_page' => 10, 's' => $s); if ($s) { } global $wp_query; query_posts($arg); $r = array(); while (have_posts()) { the_post(); $r['data'][] = array('title' => get_the_title(), 'id' => get_the_ID(), 'type' => __('Location', ST_TEXTDOMAIN)); } wp_reset_query(); echo json_encode($r); die; }
function _alter_search_query($where) { if (is_admin()) { return $where; } global $wp_query, $wpdb; $post_type = ''; if (isset($wp_query->query_vars['post_type']) and is_string($wp_query->query_vars['post_type'])) { $post_type = $wp_query->query_vars['post_type']; } if ($post_type == 'hotel_room') { if (STInput::request('start') and STInput::request('end')) { $check_in = date('Y-m-d H:i:s', strtotime(STInput::request('start'))); $check_out = date('Y-m-d H:i:s', strtotime(STInput::request('end'))); $where_add = " AND {$wpdb->posts}.ID NOT IN (SELECT room_id FROM (\r\n SELECT count(st_meta6.meta_value) as total,\r\n st_meta5.meta_value as total_room,st_meta6.meta_value as room_id ,st_meta2.meta_value as check_in,st_meta3.meta_value as check_out\r\n FROM {$wpdb->posts}\r\n JOIN {$wpdb->postmeta} as st_meta2 on st_meta2.post_id={$wpdb->posts}.ID and st_meta2.meta_key='check_in'\r\n JOIN {$wpdb->postmeta} as st_meta3 on st_meta3.post_id={$wpdb->posts}.ID and st_meta3.meta_key='check_out'\r\n JOIN {$wpdb->postmeta} as st_meta6 on st_meta6.post_id={$wpdb->posts}.ID and st_meta6.meta_key='room_id'\r\n JOIN {$wpdb->postmeta} as st_meta5 on st_meta5.post_id=st_meta6.meta_value and st_meta5.meta_key='number_room'\r\n WHERE {$wpdb->posts}.post_type='st_order'\r\n GROUP BY st_meta6.meta_value HAVING total>=total_room AND (\r\n\r\n ( CAST(st_meta2.meta_value AS DATE)<'{$check_in}' AND CAST(st_meta3.meta_value AS DATE)>'{$check_in}' )\r\n OR ( CAST(st_meta2.meta_value AS DATE)>='{$check_in}' AND CAST(st_meta2.meta_value AS DATE)<='{$check_out}' )\r\n\r\n )\r\n ) as room_booked)"; $where .= $where_add; } } return $where; }
/** * Validate if order is available to show booking infomation * * @since 1.0.8 * * */ function success_page_validate() { $order_code = STInput::get('order_code'); $order_token_code = STInput::get('order_token_code'); if ($order_token_code) { $order_code = STOrder::get_order_id_by_token($order_token_code); } $status = get_post_meta($order_code, 'status', true); $result = true; if ($status == 'incomplete') { // try to check payment complete $paypal = new STPaypal(); $r = $paypal->check_completePurchase($order_code); if ($r) { if (isset($r['status'])) { if ($r['status']) { $result = true; update_post_meta($order_code, 'status', 'complete'); $status = 'complete'; //do_action('st_email_after_booking',$order_code); //do_action('st_booking_submit_form_success',$order_code); STCart::send_mail_after_booking($order_code, true); STCart::send_email_confirm($order_code); do_action('st_booking_change_status', 'complete', $order_code, 'normal_booking'); } elseif (isset($r['message']) and $r['message']) { $result = false; STTemplate::set_message($r['message'], 'danger'); } if (isset($r['redirect_url']) and $r['redirect_url']) { echo "<script>window.location.href='" . $r['redirect_url'] . "'</script>"; die; } } } } if ($status == 'incomplete') { $result = false; STTemplate::set_message(__("Sorry! Your payment is incomplete.", ST_TEXTDOMAIN)); } return $result; }
function st_post_select_ajax() { $result = array('total_count' => 0, 'items' => array()); $q = STInput::get('q'); $post_type = STInput::get('post_type'); $user_id = STInput::get('user_id', ''); if ($q) { if (!$post_type) { $post_type = 'st_hotel'; } query_posts(array('post_type' => $post_type, 'posts_per_page' => 20, 's' => $q, 'author' => $user_id, 'post_status' => array('publish', 'private'))); while (have_posts()) { the_post(); $result['items'][] = array('id' => get_the_ID(), 'name' => get_the_title(), 'description' => "ID: " . get_the_ID()); } global $wp_query; $result['total_count'] = $wp_query->found_posts; wp_reset_query(); } echo json_encode($result); die; }
function st_post_select_ajax() { //if(!current_user_can('upload_files')) return; $result = array('total_count' => 0, 'items' => array()); $q = STInput::get('q'); $post_type = STInput::get('post_type'); if ($q) { if (!$post_type) { $post_type = 'st_hotel'; } query_posts(array('post_type' => $post_type, 'posts_per_page' => 20, 's' => $q)); while (have_posts()) { the_post(); $result['items'][] = array('id' => get_the_ID(), 'name' => get_the_title(), 'description' => "ID: " . get_the_ID()); } global $wp_query; $result['total_count'] = $wp_query->found_posts; wp_reset_query(); } echo json_encode($result); die; }
public function partnerGetListRoom() { $result = array(''); $hotel_id = intval(STInput::request('hotel_id', '')); if ($hotel_id <= 0 || get_post_type($hotel_id) != 'st_hotel') { echo json_encode($result); die; } $user_id = STInput::request('user_id'); $query = array('post_type' => 'hotel_room', 'posts_per_page' => -1, 'post_status' => array('publish', 'private'), 'author' => $user_id, 'order_by' => 'title', 'order' => 'DESC', 'meta_query' => array(array('key' => 'room_parent', 'value' => $hotel_id, 'compare' => 'IN'))); query_posts($query); if (have_posts()) { $result = array(); $result[] = array('id' => '', 'text' => __('----Select a Room----', ST_TEXTDOMAIN)); while (have_posts()) { the_post(); $result[] = array('id' => get_the_ID(), 'text' => get_the_title()); } } wp_reset_query(); wp_reset_postdata(); echo json_encode($result); die; }
static function search_room($param = array()) { $default = array('cruise_id' => false, 'adult_num' => false, 'child_num' => false, 'cabin_type' => 0); $page = STInput::request('paged'); if (!$page) { $page = get_query_var('paged'); } extract(wp_parse_args($param, $default)); $arg = array('post_type' => 'cruise_cabin', 'posts_per_page' => '15', 'paged' => $page); if ($adult_num) { $arg['meta_query'][] = array('key' => 'adult_number', 'compare' => '=', 'value' => $adult_num); } if ($child_num === 0 or $child_num) { $arg['meta_query'][] = array('key' => 'children_number', 'compare' => '=', 'value' => $child_num); } if ($cabin_id) { $arg['meta_key'] = 'cruise_id'; $arg['meta_value'] = $room_parent; } if ($cabin_type) { $arg['tax_query'][] = array('taxonomy' => 'cabin_type', 'terms' => $cabin_type); } return $arg; }
<form method="get" action="<?php the_permalink(); ?> "> <div class="row"> <?php if (!get_option('permalink_structure')) { echo '<input type="hidden" name="page_id" value="' . STInput::request('page_id') . '">'; } ?> <input type="hidden" name="layout" value="<?php echo STInput::get('layout'); ?> "> <input type="hidden" name="style" value="<?php echo STInput::get('style'); ?> "> <?php if (!empty($fields)) { foreach ($fields as $key => $value) { $name = $value['title']; $size = $value['layout_col_box']; ?> <div class="col-md-<?php echo esc_attr($size); ?> "> <?php echo st()->load_template('cars/elements/search/field-' . $value['field_atrribute'], false, array('data' => $value)); ?>
} if (!isset($field_size)) { $field_size = 'lg'; } if ($is_required == 'on') { $is_required = 'required'; } ?> <div class="form-group form-group-<?php echo esc_attr($field_size); ?> form-group-icon-left"> <label for="field-st-name"><?php echo balanceTags($title); ?> </label> <i class="fa fa-sort-amount-asc input-icon"></i> <input id="field-st-name" name="item_name" <?php echo esc_attr($is_required); ?> value="<?php echo STInput::get('item_name'); ?> " class="form-control <?php echo esc_attr($is_required); ?> " placeholder="<?php echo $placeholder ? $placeholder : false; ?> " type="text" /> </div>
if ($is_required == 'on') { $is_required = 'required'; } if (!isset($field_size)) { $field_size = 'md'; } ?> <div class="form-group form-group-<?php echo esc_attr($field_size); ?> form-group-icon-left"> <label for="field-st-dropoff-address"><?php echo esc_html($title); ?> </label> <i class="fa fa-map-marker input-icon input-icon-highlight"></i> <input id="field-st-dropoff-address" name="drop-off" data-country="" <?php echo esc_attr($is_required); ?> value="<?php echo STInput::get('drop-off'); ?> " class="typeahead_drop_off_address form-control <?php echo esc_attr($is_required); ?> " placeholder="<?php echo $placeholder ? $placeholder : st_get_language('car_city_airport_or_us_zip_code'); ?> " type="text" /> </div>
} else { extract($default); } if (!isset($field_size)) { $field_size = 'lg'; } $old_location = STInput::get('location_id'); $list_location = TravelHelper::getListFullNameLocation(); if ($is_required == 'on') { $is_required = 'required'; } $location_id = STInput::get('location_id', ''); $location_name = STInput::request('location_name', ''); if (!$location_id) { $location_id = STInput::get('location_id_pick_up'); $location_name = STInput::get('pick-up'); } if (!empty($list_location) and is_array($list_location)) { ?> <div class="form-group form-group-<?php echo esc_attr($field_size); ?> form-group-icon-left"> <label for="field-hotel-location"><?php echo esc_html($title); ?> </label> <i class="fa fa-map-marker input-icon"></i> <select id="field-hotel-location" name="location_id" class="form-control" <?php echo esc_attr($is_required); ?>
if (!empty($get)) { foreach ($get as $key => $value) { if (is_array($value)) { if (!empty($value)) { if (!empty($value) and is_array($value)) { foreach ($value as $key2 => $value2) { if (!empty($value2) and is_array($value2)) { foreach ($value2 as $key3 => $value3) { echo "<input type='hidden' name='{$key}[{$key2}][{$key3}]' value='{$value3}' >"; } } } } } } else { if ($key != "price_range") { echo "<input type='hidden' name='{$key}' value='{$value}' >"; } } } } $data_min_max = TravelerObject::get_min_max_price('st_cars'); echo '<input type="text" name="price_range" value="' . STInput::get('price_range') . '" class="price-slider" data-symbol="' . TravelHelper::get_current_currency('symbol') . '" data-min="' . $data_min_max['price_min'] . '" data-max="' . $data_min_max['price_max'] . '" data-step="' . st()->get_option('search_price_range_step', 0) . '">'; ?> <button style="margin-top: 4px;" type="submit" class="btn btn-primary"><?php st_the_language('car_filter'); ?> </button> </form>
<div class="filter-items"> <div class="alignleft actions"> <input type="text" class="st_datepicker" format="mm/dd/yyyy" name="st_date_start" placeholder="<?php _e('Filter by Date from', ST_TEXTDOMAIN); ?> " value="<?php echo STInput::get('st_date_start'); ?> "/> <input type="text" class="st_datepicker" name="st_date_end" placeholder="<?php _e('Filter by Date to', ST_TEXTDOMAIN); ?> " value="<?php echo STInput::get('st_date_end'); ?> "/> <input type="submit" name="filter_action" id="post-query-submit" class="button" value="<?php _e('Filter', ST_TEXTDOMAIN); ?> "> </div> </div> </div> </form> <form id="posts-filter" action="<?php echo admin_url('edit.php?post_type=st_rental&page=st_rental_booking'); ?> " method="post">
} if ($is_required == 'on') { $is_required = 'required'; } ?> <div data-date-format="<?php echo TravelHelper::getDateFormatJs(); ?> " class="form-group input-daterange form-group-<?php echo esc_attr($field_size); ?> form-group-icon-left"> <label for="field-hotel-checkout"><?php echo esc_html($title); ?> </label> <i class="fa fa-calendar input-icon input-icon-highlight"></i> <input id="field-hotel-checkout" <?php echo esc_attr($is_required); ?> placeholder="<?php echo TravelHelper::getDateFormatJs(); ?> " class="form-control <?php echo esc_attr($is_required); ?> checkout_hotel" value="<?php echo STInput::get('end'); ?> " name="end" type="text" /> </div>
?> '> <input type="hidden" name="data_price_items" class="data_price_items" value=''> <input type="hidden" name="selected_equipments" value="" class="st_selected_equipments"> <?php echo st()->load_template('check_out/check_out'); ?> <?php if (!empty($field_list) and is_array($field_list)) { foreach ($field_list as $key => $value) { if (isset($field_type[$value['field_atrribute']])) { $field_name = isset($field_type[$value['field_atrribute']]['field_name']) ? $field_type[$value['field_atrribute']]['field_name'] : false; if ($field_name) { if (is_array($field_name) and !empty($field_name)) { foreach ($field_name as $k) { echo "<input name='{$k}' type='hidden' value='" . STInput::request($k) . "'>"; } } } if (is_string($field_name)) { echo "<input name='{$field_name}' type='hidden' value='" . STInput::request($field_name) . "'>"; } } } } ?> </div>
<option <?php if (STInput::request('drop-off-time') == '10:30 PM') { echo 'selected'; } ?> value="10:30 PM"><?php _e("10:30 PM", ST_TEXTDOMAIN); ?> </option> <option <?php if (STInput::request('drop-off-time') == '11:00 PM') { echo 'selected'; } ?> value="11:00 PM"><?php _e("11:00 PM", ST_TEXTDOMAIN); ?> </option> <option <?php if (STInput::request('drop-off-time') == '11:30 PM') { echo 'selected'; } ?> value="11:30 PM"><?php _e("11:30 PM", ST_TEXTDOMAIN); ?> </option> </select> </div>