/**
  *
  *
  *
  *
  * @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_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;
 }
Example #3
0
 /**
  *
  *
  * @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 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;
 }
Example #5
0
 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;
 }
 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;
 }
Example #7
0
 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;
 }
Example #8
0
 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;
 }
 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;
 }
 */
$cars = new STCars();
$fields = $cars->get_search_fields_box();
?>
<h3><?php 
st_the_language('search_for_cars');
?>
</h3>
<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'];
        <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>

Example #12
0
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-holiday-address2"><?php 
echo esc_html($title);
?>
</label>
    <i class="fa fa-map-marker input-icon"></i>
    <input id="field-holiday-address2" <?php 
echo esc_attr($is_required);
?>
 name="address" value="<?php 
echo STInput::request('address');
?>
" class="typeahead_address form-control <?php 
echo esc_attr($is_required);
?>
" placeholder="<?php 
echo $placeholder ? $placeholder : st_get_language('city_name_or_zip_code');
?>
" type="text" />
</div>
Example #13
0
</label>
            <?php 
        if (is_array($terms)) {
            ?>
                <?php 
            foreach ($terms as $k => $v) {
                $key_id = $value_name = "";
                if (!empty($v->term_id)) {
                    $key_id = $v->term_id;
                    $value_name = $v->name;
                } else {
                    $tmp = explode("|", $v);
                    $key_id = $tmp[0];
                    $value_name = $tmp[1];
                }
                $is_taxonomy = STInput::request('taxonomy');
                $is_check = '';
                if (!empty($is_taxonomy[$taxonomy])) {
                    $data = explode(',', $is_taxonomy[$taxonomy]);
                    if (in_array($key_id, $data)) {
                        $is_check = 'checked';
                    }
                }
                ?>
                    <div class="checkbox">
                        <label>
                            <input class="i-check item_tanoxomy" <?php 
                echo esc_html($is_check);
                ?>
  type="checkbox" value="<?php 
                echo esc_attr($key_id);
Example #14
0
 /**
  * @since 1.1.0
  *
  */
 function check_anymous_user_email()
 {
     $current_email = STInput::request('email');
     if (!$current_email) {
         return false;
     }
     global $wpdb;
     $query = "SELECT count({$wpdb->comments}.comment_ID) from {$wpdb->comments} WHERE comment_author_email  = '{$current_email}'  ";
     $count = $wpdb->get_var($query);
     if ($count > 1) {
         return false;
     }
     return true;
 }
Example #15
0
                <label for="field-car-drive-name"><?php 
st_the_language('driver_name');
?>
 <span class="require">*</span></label>
                <input id="field-car-drive-name" name="driver_name" value="<?php 
echo STInput::request('driver_name');
?>
" type="text" placeholder="<?php 
st_the_language('driver_name');
?>
"  class="form-control">
            </div>
            <div class="form-group">
                <label for="field-car-drive-age"><?php 
st_the_language('driver_age');
?>
 <span class="require">*</span></label>
                <input id="field-car-drive-age" name="driver_age" value="<?php 
echo STInput::request('driver_age');
?>
" type="text" placeholder="<?php 
st_the_language('driver_age');
?>
"  class="form-control">
            </div>
        </div>

    </div>


</div>
Example #16
0
 static function get_avg_price_hotel($hotel_id)
 {
     global $wpdb;
     $rooms = self::_getAllRoomHotelID($hotel_id);
     $avg_price = 0;
     $check_in = STInput::request('start', '');
     $check_out = STInput::request('end', '');
     if (empty($check_in)) {
         $check_in = date('m/d/Y');
     } else {
         $check_in = TravelHelper::convertDateFormat($check_in);
     }
     if (empty($check_out)) {
         $check_out = date('m/d/Y', strtotime("+1 day"));
     } else {
         $check_out = TravelHelper::convertDateFormat($check_out);
     }
     $room_num_search = STInput::request('room_num_search', 1);
     if (intval($room_num_search) <= 0) {
         $room_num_search = 1;
     }
     $room_full_ordered = HotelHelper::_get_room_cant_book_by_id($hotel_id, date('Y-m-d', strtotime($check_in)), date('Y-m-d', strtotime($check_out)), $room_num_search);
     if (is_array($rooms) && count($rooms)) {
         $i = 0;
         foreach ($rooms as $room) {
             if (!in_array($room, $room_full_ordered)) {
                 $price = STPrice::getRoomPriceOnlyCustomPrice($room, strtotime($check_in), strtotime($check_out), $room_num_search);
                 if ($price > 0) {
                     $avg_price += $price;
                 }
             }
             $i++;
         }
         $avg_price /= $i;
     }
     return $avg_price;
 }
 */
$default = array('title' => '', 'is_required' => 'on', 'placeholder' => '');
if (isset($data)) {
    extract(wp_parse_args($data, $default));
} else {
    extract($default);
}
if (!isset($field_size)) {
    $field_size = 'lg';
}
$old_location = STInput::get('location_id');
if (empty($location_name)) {
    $location_name = 's';
    $value_search = get_search_query();
} else {
    $value_search = STInput::request($location_name);
}
if ($is_required == 'on') {
    $is_required = 'required';
}
?>
<div class="form-group form-group-<?php 
echo esc_attr($field_size);
?>
 form-group-icon-left">
    <i class="fa fa-map-marker input-icon"></i>
    <label><?php 
echo esc_html($title);
?>
</label>
    <input <?php 
Example #18
0
    }
}
$data_min_max = TravelerObject::get_min_max_price('st_hotel');
$max = $data_min_max['price_max'];
$min = $data_min_max['price_min'];
if (TravelHelper::get_default_currency('rate') != 0 and TravelHelper::get_default_currency('rate')) {
    $rate_change = TravelHelper::get_current_currency('rate') / TravelHelper::get_default_currency('rate');
    $max = round($rate_change * $max);
    $min = round($rate_change * $min);
}
/*$min = number_format($min , TravelHelper::get_current_currency('booking_currency_precision')) ;
  $max = number_format($max , TravelHelper::get_current_currency('booking_currency_precision')) ;*/
$value_show = $min . ";" . $max;
// default if error
if ($rate_change) {
    if (STInput::request('price_range')) {
        $price_range = explode(';', STInput::request('price_range'));
        $value_show = $price_range[0] . ";" . $price_range[1];
    } else {
        $value_show = $min . ";" . $max;
    }
}
echo '<input name="price_range" type="text" value="' . $value_show . '" class="price-slider" data-symbol="' . TravelHelper::get_current_currency('symbol') . '" data-min="' . esc_attr($min) . '" data-max="' . esc_attr($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('filter');
?>
</button>
</form>

Example #19
0
echo esc_attr($field_name);
?>
[lng]"/>
                <div class="st_msg ">
                    <?php 
echo STUser_f::get_msg_html($validator->error('gmap[lng]'), 'danger');
?>
                </div>
            </label>
            <label for=""><span class="title"><?php 
_e('Zoom:', ST_TEXTDOMAIN);
?>
</span>
                <?php 
$value = '';
$tmp = STInput::request('gmap');
if (!empty($tmp)) {
    $value = $tmp['zoom'];
} elseif (!empty($field_value['zoom'])) {
    $value = $field_value['zoom'];
}
?>
                <input value="<?php 
echo esc_html($value);
?>
" type="text"
                       placeholder="<?php 
_e('Zoom Level', ST_TEXTDOMAIN);
?>
" id="bt_ot_gmap_input_zoom" class="number bt_ot_gmap_input_zoom form-control"
                       name="<?php 
        public static function activity_external_booking_submit()
        {
            /*
             * since 1.1.1 
             * filter hook activity_external_booking_submit
             */
            $post_id = get_the_ID();
            if (STInput::request('post_id')) {
                $post_id = STInput::request('post_id');
            }
            $activity_external_booking = get_post_meta($post_id, 'st_activity_external_booking', "off");
            $activity_external_booking_link = get_post_meta($post_id, 'st_activity_external_booking_link', true);
            if ($activity_external_booking == "on" and $activity_external_booking_link !== "") {
                if (get_post_meta($post_id, 'st_activity_external_booking_link', true)) {
                    ob_start();
                    ?>
                    <a class='btn btn-primary'
                       href='<?php 
                    echo get_post_meta($post_id, 'st_activity_external_booking_link', true);
                    ?>
'> <?php 
                    st_the_language('book_now');
                    ?>
</a>
                    <?php 
                    $return = ob_get_clean();
                }
            } else {
                $return = TravelerObject::get_book_btn();
            }
            return apply_filters('activity_external_booking_submit', $return);
        }
 static function getRentalInfo()
 {
     $rental_id = intval(STInput::request('rental_id', ''));
     $data = array('price' => '', 'extras' => 'None', 'adult_html' => '', 'child_html' => '');
     if ($rental_id <= 0 || get_post_type($rental_id) != 'st_rental') {
         echo json_encode($data);
     } else {
         $adult_number = intval(get_post_meta($rental_id, 'rental_max_adult', true));
         if ($adult_number <= 0) {
             $adult_number = 1;
         }
         $adult_html = '<select name="adult_number" class="form-control" style="width: 100px;">';
         for ($i = 1; $i <= $adult_number; $i++) {
             $adult_html .= '<option value="' . $i . '">' . $i . '</option>';
         }
         $adult_html .= '</select>';
         $child_number = intval(get_post_meta($rental_id, 'rental_max_children', true));
         if ($child_number <= 0) {
             $child_number = 0;
         }
         $child_html = '<select name="child_number" class="form-control" style="width: 100px;">';
         for ($i = 0; $i <= $child_number; $i++) {
             $child_html .= '<option value="' . $i . '">' . $i . '</option>';
         }
         $child_html .= '</select>';
         $html = '';
         $price = floatval(get_post_meta($rental_id, 'price', true));
         $extras = get_post_meta($rental_id, 'extra_price', true);
         if (is_array($extras) && count($extras)) {
             $html = '<table class="table">';
             foreach ($extras as $key => $val) {
                 $html .= '
             <tr>
                 <td width="80%">
                     <label for="' . $val['extra_name'] . '" class="ml20">' . $val['title'] . ' (' . TravelHelper::format_money($val['extra_price']) . ')' . '</label>
                     <input type="hidden" name="extra_price[price][' . $val['extra_name'] . ']" value="' . $val['extra_price'] . '">
                     <input type="hidden" name="extra_price[title][' . $val['extra_name'] . ']" value="' . $val['title'] . '">
                 </td>
                 <td width="20%">
                     <select style="width: 100px" class="form-control" name="extra_price[value][' . $val['extra_name'] . ']" id="">';
                 $max_item = intval($val['extra_max_number']);
                 if ($max_item <= 0) {
                     $max_item = 1;
                 }
                 for ($i = 0; $i <= $max_item; $i++) {
                     $html .= '<option value="' . $i . '">' . $i . '</option>';
                 }
                 $html .= '
                     </select>
                 </td>
             </tr>';
             }
             $html .= '</table>';
         }
         $data['price'] = TravelHelper::format_money_from_db($price, false);
         $data['extras'] = $html;
         $data['adult_html'] = $adult_html;
         $data['child_html'] = $child_html;
         echo json_encode($data);
     }
     die;
 }
            ?>
">
                                    <?php 
        }
        ?>
                                    <?php 
        if ($v['type_field'] == "textarea") {
            ?>
                                        <textarea id="<?php 
            echo esc_attr($key);
            ?>
" name="<?php 
            echo esc_attr($key);
            ?>
" class="form-control" ><?php 
            echo STInput::request($key);
            ?>
</textarea>
                                    <?php 
        }
        ?>

                                    <div class="st_msg console_msg_"></div>
                                </div>
                            </div>
                        <?php 
    }
    ?>
                    </div>
                <?php 
}
Example #23
0
<?php

/**
 * @package WordPress
 * @subpackage Traveler
 * @since 1.0
 *
 * User Update hotel
 *
 * Created by ShineTheme
 *    value="<?php echo get_post_meta( $post_id , '' , true); ?>"
 */
if (STUser_f::st_check_edit_partner(STInput::request('id')) == false) {
    return false;
}
$post_id = STInput::request('id');
$post = get_post($post_id);
$validator = STUser_f::$validator;
?>
<div class="st-create">
    <h2 class="pull-left"><?php 
_e("Edit Hotel", ST_TEXTDOMAIN);
?>
</h2>
    <a target="_blank" href="<?php 
echo get_the_permalink($post_id);
?>
" class="btn btn-default pull-right"><?php 
_e("Preview", ST_TEXTDOMAIN);
?>
</a>
Example #24
0
                        <?php 
$child_number = intval(STInput::request('child_number', 0));
for ($i = 0; $i <= 20; $i++) {
    echo "<option " . selected($child_number, $i) . " value='{$i}'>{$i}</option>";
}
?>
                    </select>
                </div>
                <div class="col-md-4">
                    <span><?php 
_e('Infant', ST_TEXTDOMAIN);
?>
: </span>
                    <select class="form-control st_tour_infant" name="infant_number" required>
                        <?php 
$infant_number = intval(STInput::request('infant_number', 0));
for ($i = 0; $i <= 20; $i++) {
    echo "<option " . selected($infant_number, $i) . " value='{$i}'>{$i}</option>";
}
?>
                    </select>
                </div>
            </div>
            <br>
            <?php 
if ($st_is_booking_modal) {
    ?>
                <a href="#activity_booking_<?php 
    the_ID();
    ?>
" class="btn btn-primary popup-text btn_activity"
?>
'>
    <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>
Example #26
0
 function st_breadcrumbs()
 {
     global $post;
     $sep = ' > ';
     if (!is_home()) {
         echo '<li><a href="' . home_url() . '">' . st_get_language('home') . '</a></li>';
         if (is_category() || is_single()) {
             $cats = get_the_category($post->ID);
             foreach ($cats as $cat) {
                 echo '<li><a href="#">' . balanceTags($cat->cat_name) . '</a></li>';
             }
             do_action('st_single_breadcrumb', $sep);
             if (get_post_type($post->ID) == 'hotel_room') {
                 $hotel_parent = get_post_meta($post->ID, 'room_parent', true);
                 if (!empty($hotel_parent)) {
                     echo '<li><a href="' . get_permalink($hotel_parent) . '" title="' . get_the_title($hotel_parent) . '">' . get_the_title($hotel_parent) . '</a></li>';
                 }
             }
             if (is_single()) {
                 echo '<li class="active">' . get_the_title() . '</li>';
             }
         } elseif (is_page()) {
             if ($post->post_parent) {
                 $anc = get_post_ancestors($post->ID);
                 $anc_link = get_page_link($post->post_parent);
                 foreach ($anc as $ancestor) {
                     $output = '<li><a href="' . $anc_link . '">' . get_the_title($ancestor) . '</a></li>';
                 }
                 echo balanceTags($output);
                 echo '<li class="active">' . get_the_title() . '</li>';
             } else {
                 echo '<li class="active">' . get_the_title() . '</li>';
             }
         } elseif (is_search()) {
             //if( !empty($_REQUEST['location_id']) || !empty($_REQUEST['location_id_pick_up']) ){
             if (!empty($_REQUEST['location_id'])) {
                 if (!empty($_REQUEST['location_id'])) {
                     $location_id = $_REQUEST['location_id'];
                 }
                 if (!empty($_REQUEST['location_id_pick_up'])) {
                     $location_id = $_REQUEST['location_id_pick_up'];
                 }
                 $parent = array_reverse(get_post_ancestors($location_id));
                 foreach ($parent as $k => $v) {
                     // $url = TravelHelper::bui
                     $post_type = STInput::request('post_type');
                     if (!empty($post_type)) {
                         echo '<li><a href="' . home_url('?s=' . STInput::request('s') . '&post_type=' . $post_type . '&location_id=' . $v) . '">' . get_the_title($v) . '</a></li>';
                     } else {
                         echo '<li><a href="' . add_query_arg(array('location_id' => $v), get_the_permalink()) . '">' . get_the_title($v) . '</a></li>';
                     }
                 }
                 echo '<li class="active">' . get_the_title($location_id) . '</li>';
             } else {
                 if (STInput::request('s')) {
                     echo '<li class="active">' . st_get_language('search_results') . esc_html('"' . STInput::request('s') . '"') . '</li>';
                 } else {
                     if (STInput::request('location_name')) {
                         echo '<li class="active">' . esc_html(STInput::request('location_name')) . '</li>';
                     } else {
                         if (STInput::request('address')) {
                             echo '<li class="active">' . esc_html(STInput::request('address')) . '</li>';
                         } else {
                             if (!empty($_REQUEST['pick-up'])) {
                                 echo '<li class="active">' . st_get_language('search_results') . '</li>';
                                 echo esc_html('"' . $_REQUEST['pick-up'] . '"');
                                 if (!empty($_REQUEST['drop-off'])) {
                                     echo esc_html(' to "' . $_REQUEST['drop-off'] . '"');
                                 }
                             }
                         }
                     }
                 }
             }
         }
     } elseif (is_tag()) {
         single_tag_title();
     } elseif (is_day()) {
         echo __("Archive: ", ST_TEXTDOMAIN);
         the_time('F jS, Y');
         echo '</li>';
     } elseif (is_month()) {
         echo __("Archive: ", ST_TEXTDOMAIN);
         the_time('F, Y');
         echo '</li>';
     } elseif (is_year()) {
         echo __("Archive: ", ST_TEXTDOMAIN);
         the_time('Y');
         echo '</li>';
     } elseif (is_author()) {
         echo __("Author's archive: ", ST_TEXTDOMAIN);
         echo '</li>';
     } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
         echo __("Blog Archive: ", ST_TEXTDOMAIN);
         echo '';
     } elseif (is_search()) {
         echo '<li class="active">' . st_get_language('search_results') . '</li>';
     }
 }
$default = array('title' => '', 'is_required' => 'off');
if (isset($data)) {
    extract(wp_parse_args($data, $default));
} 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>
Example #28
0
unset($status_login);
?>
    <div class="form-group <?php 
echo esc_attr($class_form);
?>
 form-group-icon-left">
        <label for="field-login_name"><?php 
_e("User Name", ST_TEXTDOMAIN);
?>
</label>
        <i class="fa fa-user input-icon input-icon-show"></i>
        <input id="field-login_name" name="login_name" class="form-control" placeholder="<?php 
_e('e.g. johndoe', ST_TEXTDOMAIN);
?>
" type="text" value="<?php 
echo STInput::request('login_name');
?>
" />
    </div>
    <div class="form-group <?php 
echo esc_attr($class_form);
?>
 form-group-icon-left">
        <label for="field-login_password"><?php 
st_the_language('password');
?>
</label>
        <i class="fa fa-lock input-icon input-icon-show"></i>
        <input id="field-login_password" name="login_password" class="form-control" type="password"  placeholder="<?php 
st_the_language('my_secret_password');
?>
Example #29
0
 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;
 }
Example #30
0
}
if (STInput::get('style')) {
    $style = STInput::get('style');
}
$object = new STRental();
$allOrderby = $object->getOrderby();
?>
<div class="nav-drop booking-sort">
</div>

<div class="sort_top">
    <div class="row">
        <div class="col-md-10 col-sm-9">
            <ul class="nav nav-pills">
                <?php 
$active = STInput::request('orderby');
if (!empty($allOrderby) and is_array($allOrderby)) {
    $i = 0;
    foreach ($allOrderby as $key => $value) {
        $i++;
        $class = '';
        if ($key == $active) {
            $class = 'active';
        } elseif ($i == 1 and !$active) {
            $class = 'active';
        }
        echo '<li class="' . $class . '"><a href="' . TravelHelper::build_url('orderby', $key) . '">' . $value['name'] . '</a>';
    }
}
?>
            </ul>