$show_street_view = 0; $show_calendar = 0; if (array_key_exists('trav_accommodation_main_top', $acc_meta)) { $main_top_meta = $acc_meta['trav_accommodation_main_top']; $show_gallery = in_array('gallery', $main_top_meta) ? 1 : 0; $show_map = in_array('map', $main_top_meta) ? 1 : 0; $show_street_view = in_array('street', $main_top_meta) ? 1 : 0; $show_calendar = in_array('calendar', $main_top_meta) ? 1 : 0; } // init booking search variables $rooms = isset($_GET['rooms']) && is_numeric($_GET['rooms']) ? sanitize_text_field($_GET['rooms']) : 1; $adults = isset($_GET['adults']) && is_numeric($_GET['adults']) ? sanitize_text_field($_GET['adults']) : 1; $kids = isset($_GET['kids']) && is_numeric($_GET['kids']) ? sanitize_text_field($_GET['kids']) : 0; $child_ages = isset($_GET['child_ages']) ? $_GET['child_ages'] : ''; $date_from = isset($_GET['date_from']) ? trav_tophptime($_GET['date_from']) : ''; $date_to = isset($_GET['date_to']) ? trav_tophptime($_GET['date_to']) : ''; $except_booking_no = isset($_GET['edit_booking_no']) ? sanitize_text_field($_GET['edit_booking_no']) : 0; $pin_code = isset($_GET['pin_code']) ? sanitize_text_field($_GET['pin_code']) : 0; // add to user recent activity trav_update_user_recent_activity($acc_id); ?> <section id="content"> <div class="container"> <div class="row"> <div id="main" class="col-sm-8 col-md-9"> <div class="tab-container style1" id="hotel-main-content"> <ul class="tabs"> <?php if (!empty($gallery_imgs) && $show_gallery) {
function trav_tour_get_single_schedule_html($tour_id, $st_id, $schedule) { global $trav_options; // init variables $st_data = trav_tour_get_schedule_type_data($tour_id, $st_id); $st_title = !empty($st_data) && !empty($st_data['title']) ? $st_data['title'] : ''; $st_desc = !empty($st_data) && !empty($st_data['description']) ? $st_data['description'] : ''; $st_time = !empty($st_data) && !empty($st_data['time']) ? $st_data['time'] : ''; $repeated = get_post_meta($tour_id, 'trav_tour_repeated', true); $multi_book = get_post_meta($tour_id, 'trav_tour_multi_book', true); $tour_booking_page = ''; if (!empty($trav_options['tour_booking_page'])) { $tour_booking_page = trav_get_permalink_clang($trav_options['tour_booking_page']); } $location_arr = array(); $location_arr[] = trav_tour_get_city($tour_id); $location_arr[] = trav_tour_get_country($tour_id); $location = implode(', ', $location_arr); $discount = get_post_meta($tour_id, 'trav_tour_hot', true); $discount_rate = get_post_meta($tour_id, 'trav_tour_discount_rate', true); // init variables $def_date = key($schedule); $default_data = $schedule[$def_date]; foreach ($schedule as $key => $value) { if (!empty($value['available_seat'])) { $def_date = $key; $default_data = $value; break; } } $adults = 1; $kids = 0; ?> <div class="intro small-box table-wrapper full-width hidden-table-sms"> <div class="col-sm-4 table-cell features"> <table> <tr><td><label><?php _e('Location', 'trav'); ?> :</label></td><td><?php echo esc_html($location); ?> </td></tr> <?php if (empty($repeated)) { ?> <tr><td><label><?php _e('Tour Date', 'trav'); ?> :</label></td><td><?php echo date('l, F, j, Y', trav_strtotime($default_data['tour_date'])); ?> </td></tr> <?php } ?> <tr><td><label><?php _e('Duration', 'trav'); ?> :</label></td><td><?php echo esc_html($default_data['duration']); ?> </td></tr> <tr><td><label><?php _e('Available Seats', 'trav'); ?> :</label></td><td class="available-seats"><?php echo esc_html($default_data['available_seat']); ?> </td></tr> <?php if (!empty($multi_book)) { ?> <tr><td><label><?php _e('Price Per Adult', 'trav'); ?> :</label></td><td class="adult-price"><?php echo esc_html(trav_get_price_field($default_data['price'])); ?> </td></tr> <?php if (!empty($default_data['child_price']) && (double) $default_data['child_price'] != 0) { ?> <tr><td><label><?php _e('Price Per Child', 'trav'); ?> :</label></td><td class="child-price"><?php echo esc_html(trav_get_price_field($default_data['child_price'])); ?> </td></tr> <?php } ?> <?php } else { ?> <tr><td><label><?php _e('Price', 'trav'); ?> :</label></td><td class="adult-price"><?php echo esc_html(trav_get_price_field($default_data['price'])); ?> </td></tr> <?php } ?> <?php if (!empty($discount) && !empty($discount_rate)) { ?> <tr><td><label><?php _e('Discount', 'trav'); ?> :</label></td><td><?php echo sprintf(__('%d%% Off', 'trav'), $discount_rate); ?> </td></tr> <?php } ?> </table> </div> <div class="col-sm-8 table-cell"> <form method="get" action="<?php echo $tour_booking_page; ?> " class="tour-booking-form"> <input type="hidden" name="tour_id" value="<?php echo esc_attr($tour_id); ?> "> <input type="hidden" name="st_id" value="<?php echo esc_attr($st_id); ?> "> <?php wp_nonce_field('post-' . $tour_id, '_wpnonce', false); ?> <?php if (defined('ICL_LANGUAGE_CODE')) { ?> <input type="hidden" name="lang" value="<?php echo ICL_LANGUAGE_CODE; ?> "> <?php } ?> <?php if (empty($multi_book)) { ?> <input type="hidden" name="adults" value="1"> <?php } ?> <?php if (empty($repeated)) { ?> <input type="hidden" name="tour_date" value="<?php echo $default_data['tour_date']; ?> "> <?php } ?> <div class="detail-section-top row"> <div class="st-details col-md-9 col-sm-8"> <?php if (!empty($st_title)) { ?> <h4 class="box-title"><?php echo wp_kses_post($st_title); ?> </h4> <?php } ?> <?php if (!empty($st_desc)) { ?> <div class="st-description"><?php echo wp_kses_post($st_desc); ?> </div> <?php } ?> <?php if (!empty($st_time)) { ?> <div class="time"><i class="soap-icon-clock yellow-color"></i><span><?php echo wp_kses_post($st_time); ?> </span></div> <?php } ?> </div> <div class="price-details col-md-3 col-sm-4"> <h3 class="price"> <div class="adult-price"><?php echo trav_get_price_field($default_data['price']); ?> </div> <?php if (!empty($multi_book)) { ?> <small><?php _e('per adult', 'trav'); ?> </small> <?php } ?> </h3> <?php if (empty($multi_book) && empty($repeated)) { ?> <button title="book now" class="button btn-small full-width text-center btn-book-now <?php echo empty($default_data['available_seat']) ? 'no-display' : ''; ?> "><?php _e("BOOK NOW", "trav"); ?> </button> <h4 class="sold-out <?php echo empty($default_data['available_seat']) ? '' : 'no-display'; ?> "><?php echo __('Sold Out', 'trav'); ?> </h4> <h4 class="exceed-persons no-display"><?php echo __('Exceed Persons', 'trav'); ?> </h4> <?php } ?> </div> </div> <?php if (!empty($multi_book) || !empty($repeated)) { ?> <div class="detail-section-bottom"> <div class="row"> <?php if (!empty($repeated)) { ?> <div class="col-md-4 col-sm-6"> <label><?php _e('AVAILABLE ON', 'trav'); ?> </label> <div class="selector validation-field"> <select name="tour_date" class="full-width tour-date-select"> <?php foreach ($schedule as $key => $value) { $selected = $key == $def_date ? 'selected' : ''; echo '<option value="' . esc_attr($key) . '" ' . $selected . ' data-max-seat="' . esc_attr($value['available_seat']) . '" data-price="' . esc_attr($value['price']) . '" data-child-price="' . esc_attr($value['child_price']) . '" >' . esc_html(trav_tophptime($key)) . '</option>'; } ?> </select> </div> </div> <?php } else { ?> <div class="price-data no-display" data-max-seat="<?php echo esc_attr($default_data['available_seat']); ?> " data-price="<?php echo esc_attr($default_data['price']); ?> " data-child-price="<?php echo esc_attr($default_data['child_price']); ?> "></div> <?php } ?> <?php if (!empty($multi_book)) { ?> <div class="col-md-2 col-sm-3 col-xs-6"> <label><?php _e('ADULTS', 'trav'); ?> </label> <div class="selector validation-field"> <select name="adults" class="full-width"> <?php for ($i = 1; $i <= 10; $i++) { $selected = $i == $adults ? 'selected' : ''; echo '<option value="' . esc_attr($i) . '" ' . $selected . '>' . esc_html($i) . '</option>'; } ?> </select> </div> </div> <div class="col-md-2 col-sm-3 col-xs-6"> <label><?php _e('KIDS', 'trav'); ?> </label> <div class="selector validation-field"> <select name="kids" class="full-width"> <?php for ($i = 0; $i <= 10; $i++) { $selected = $i == $kids ? 'selected' : ''; echo '<option value="' . esc_attr($i) . '" ' . $selected . '>' . esc_html($i) . '</option>'; } ?> </select> </div> </div> <?php } ?> <div class="col-md-4 pull-right"> <label> <?php _e('Total', 'trav'); ?> : <span class="total-price"> <?php echo trav_get_price_field($default_data['price']); ?> </span> </label> <div class="row"> <div class="col-sm-12"> <button data-animation-duration="1" data-animation-type="bounce" class="btn-book-now full-width icon-check animated bounce <?php echo empty($default_data['available_seat']) ? 'no-display' : ''; ?> " type="submit"><?php _e("BOOK NOW", "trav"); ?> </button> <h4 class="sold-out <?php echo empty($default_data['available_seat']) ? '' : 'no-display'; ?> "><?php echo __('Sold Out', 'trav'); ?> </h4> <h4 class="exceed-persons no-display"><?php echo __('Exceed Persons', 'trav'); ?> </h4> </div> </div> </div> </div> </div> <?php } ?> </form> </div> </div> <?php }
*/ global $trav_options, $wpdb, $logo_url; global $booking_data, $tour_id, $st_id, $deposit_rate; if (!isset($_REQUEST['booking_no']) || !isset($_REQUEST['pin_code'])) { do_action('trav_tour_conf_wrong_data'); exit; } if (!($booking_data = trav_tour_get_booking_data($_REQUEST['booking_no'], $_REQUEST['pin_code']))) { do_action('trav_tour_conf_wrong_data'); exit; } $tour_id = trav_tour_clang_id($booking_data['tour_id']); $st_id = $booking_data['st_id']; $deposit_rate = get_post_meta($tour_id, 'trav_tour_security_deposit', true); $deposit_rate = empty($deposit_rate) ? 0 : $deposit_rate; $tour_date = trav_tophptime($booking_data['tour_date']); // if deposit is required and it is not paid process payment if (!empty($deposit_rate) && empty($booking_data['deposit_paid'])) { // init payment variables $ItemName = ''; if ($deposit_rate < 100) { $ItemName = sprintf(__('Deposit(%d%%) for ', 'trav'), $deposit_rate); } else { $ItemName = __('Deposit for ', 'trav'); } $ItemName .= get_the_title($tour_id) . ' ' . trav_tour_get_schedule_type_title($tour_id, $st_id); $payment_data = array(); $payment_data['item_name'] = $ItemName; $payment_data['item_number'] = $tour_id . '-' . $st_id; $payment_data['item_desc'] = __('Tour Date', 'trav') . ' ' . $tour_date . ' ' . get_the_title($tour_id) . ' ' . trav_tour_get_schedule_type_title($tour_id, $st_id); $payment_data['item_qty'] = 1;
<?php get_header(); if (have_posts()) { while (have_posts()) { the_post(); //init variables $tour_id = get_the_ID(); $city = trav_tour_get_city($tour_id); $country = trav_tour_get_country($tour_id); $date_from = isset($_GET['date_from']) ? trav_tophptime($_GET['date_from']) : date(trav_get_date_format('php')); $date_to = isset($_GET['date_to']) ? trav_tophptime($_GET['date_to']) : date(trav_get_date_format('php'), trav_strtotime($date_from) + 86400 * 30); $repeated = get_post_meta($tour_id, 'trav_tour_repeated', true); $multi_book = get_post_meta($tour_id, 'trav_tour_multi_book', true); $isv_setting = get_post_meta($tour_id, 'trav_post_media_type', true); $discount = get_post_meta($tour_id, 'trav_tour_hot', true); $discount_rate = get_post_meta($tour_id, 'trav_tour_discount_rate', true); $sc_list_pos = get_post_meta($tour_id, 'trav_tour_sl_first', true); $schedule_types = trav_tour_get_schedule_types($tour_id); // add to user recent activity trav_update_user_recent_activity($tour_id); ?> <section id="content"> <div class="container tour-detail-page"> <div class="row"> <div id="main" class="col-sm-8 col-md-9"> <div <?php post_class(); ?> >
global $wpdb; global $booking_data, $acc_id, $room_type_id, $deposit_rate, $date_from, $date_to; if (!isset($_REQUEST['booking_no']) || !isset($_REQUEST['pin_code'])) { do_action('trav_acc_conf_wrong_data'); exit; } if (!($booking_data = trav_acc_get_booking_data($_REQUEST['booking_no'], $_REQUEST['pin_code']))) { do_action('trav_acc_conf_wrong_data'); exit; } $acc_id = trav_acc_clang_id($booking_data['accommodation_id']); $room_type_id = trav_room_clang_id($booking_data['room_type_id']); $deposit_rate = get_post_meta($acc_id, 'trav_accommodation_security_deposit', true); $deposit_rate = empty($deposit_rate) ? 0 : $deposit_rate; $date_from = trav_tophptime($booking_data['date_from']); $date_to = trav_tophptime($booking_data['date_to']); if (!is_array($booking_data['child_ages'])) { $booking_data['child_ages'] = unserialize($booking_data['child_ages']); } $query_args = array('date_from' => $date_from, 'date_to' => $date_to, 'rooms' => $booking_data['rooms'], 'adults' => $booking_data['adults'], 'kids' => $booking_data['kids'], 'child_ages' => $booking_data['child_ages'], 'edit_booking_no' => $booking_data['booking_no'], 'pin_code' => $booking_data['pin_code']); // if deposit is required and it is not paid process payment if (!empty($deposit_rate) && empty($booking_data['deposit_paid'])) { // init payment variables $ItemName = ''; if ($deposit_rate < 100) { $ItemName = sprintf(__('Deposit(%d%%) for ', 'trav'), $deposit_rate); } else { $ItemName = __('Deposit for ', 'trav'); } $ItemName .= get_the_title($acc_id) . ' ' . get_the_title($room_type_id) . ' ' . $booking_data['rooms'] . __('rooms', 'trav'); $payment_data = array();