Пример #1
0
 function trav_ajax_acc_check_room_availability()
 {
     if (!isset($_POST['_wpnonce']) || !isset($_POST['booking_no']) || !wp_verify_nonce($_POST['_wpnonce'], 'booking-' . $_POST['booking_no'])) {
         $result_json['success'] = 0;
         $result_json['result'] = __('Sorry, your nonce did not verify.', 'trav');
         wp_send_json($result_json);
     }
     if (!isset($_POST['date_from']) || !isset($_POST['date_to']) || trav_strtotime($_POST['date_from']) >= trav_strtotime($_POST['date_to'])) {
         $result_json['success'] = 0;
         $result_json['result'] = __('Wrong Date Interval. Please check your dates.', 'trav');
         wp_send_json($result_json);
     }
     global $wpdb;
     $booking_no = sanitize_text_field($_POST['booking_no']);
     $pin_code = sanitize_text_field($_POST['pin_code']);
     if (!($booking_data = trav_acc_get_booking_data($booking_no, $pin_code))) {
         $result_json['success'] = 0;
         $result_json['result'] = __('Wrong booking number and pin code.', 'trav');
         wp_send_json($result_json);
     }
     $booking_data['date_from'] = trav_sanitize_date($_POST['date_from']);
     $booking_data['date_to'] = trav_sanitize_date($_POST['date_to']);
     $booking_data['rooms'] = sanitize_text_field($_POST['rooms']);
     $booking_data['adults'] = sanitize_text_field($_POST['adults']);
     $booking_data['kids'] = sanitize_text_field($_POST['kids']);
     $booking_data['child_ages'] = $_POST['child_ages'];
     $room_price_data = trav_acc_get_room_price_data($booking_data['accommodation_id'], $booking_data['room_type_id'], $booking_data['date_from'], $booking_data['date_to'], $booking_data['rooms'], $booking_data['adults'], $booking_data['kids'], $booking_data['child_ages'], $booking_no, $pin_code);
     if (!$room_price_data || !is_array($room_price_data)) {
         $result_json['success'] = 0;
         $result_json['result'] = __('The room is not available for the selected date, rooms and person. Please have another look at booking fields.', 'trav');
         wp_send_json($result_json);
     } else {
         $tax_rate = get_post_meta($booking_data['accommodation_id'], 'trav_accommodation_tax_rate', true);
         $tax = 0;
         if (!empty($tax_rate)) {
             $tax = $tax_rate * $room_price_data['total_price'] / 100;
         }
         $total_price = $room_price_data['total_price'] + $tax;
         $return_html = '<dl class="other-details">';
         $return_html .= '<dt class="feature">' . esc_html(trav_get_day_interval($booking_data['date_from'], $booking_data['date_to'])) . ' ' . __('night Stay', 'trav') . ':</dt><dd class="value">' . esc_html(trav_get_price_field($room_price_data['total_price'])) . '</dd>';
         if (!empty($tax_rate)) {
             $return_html .= '<dt class="feature">' . __('taxes and fees', 'trav') . ':</dt><dd class="value">' . esc_html(trav_get_price_field($tax)) . '</dd>';
         }
         $return_html .= '<dt class="feature">' . __('Total Price', 'trav') . '</dt><dd>' . esc_html(trav_get_price_field($total_price)) . '</dd>';
         $return_html .= '</dl>';
         $result_json['success'] = 1;
         $result_json['result'] = $return_html;
         wp_send_json($result_json);
     }
 }
Пример #2
0
 function trav_tour_send_confirmation_email($booking_no, $booking_pincode, $type = 'new', $subject = '', $description = '')
 {
     global $wpdb, $logo_url, $trav_options;
     $booking_data = trav_tour_get_booking_data($booking_no, $booking_pincode);
     if (!empty($booking_data)) {
         // server variables
         $admin_email = get_option('admin_email');
         $home_url = esc_url(home_url());
         $site_name = $_SERVER['SERVER_NAME'];
         $logo_url = esc_url($logo_url);
         $tour_book_conf_url = '';
         if (isset($trav_options['tour_booking_confirmation_page']) && !empty($trav_options['tour_booking_confirmation_page'])) {
             $tour_book_conf_url = trav_get_permalink_clang($trav_options['tour_booking_confirmation_page']);
         }
         $booking_data['tour_id'] = trav_tour_clang_id($booking_data['tour_id']);
         $st_data = trav_tour_get_schedule_type_data($booking_data['tour_id'], $booking_data['st_id']);
         $schedule_data = trav_tour_get_schedule_data($booking_data);
         // tour info
         $tour_name = get_the_title($booking_data['tour_id']);
         $tour_url = esc_url(trav_get_permalink_clang($booking_data['tour_id']));
         $tour_thumbnail = get_the_post_thumbnail($booking_data['tour_id'], 'list-thumb');
         $tour_address = get_post_meta($booking_data['tour_id'], 'trav_tour_address', true);
         $tour_city = trav_tour_get_city($booking_data['tour_id']);
         $tour_country = trav_tour_get_country($booking_data['tour_id']);
         $tour_phone = get_post_meta($booking_data['tour_id'], 'trav_tour_phone', true);
         $tour_email = get_post_meta($booking_data['tour_id'], 'trav_tour_email', true);
         $tour_duration = '';
         if (!empty($schedule_data) && $schedule_data['success'] == 1) {
             $tour_duration = $schedule_data['schedule_data']['duration'];
         }
         $tour_st_title = esc_html(trav_tour_get_schedule_type_title($booking_data['tour_id'], $booking_data['st_id']));
         $tour_st_description = esc_html($st_data['description']);
         $tour_st_time = esc_html($st_data['time']);
         if (empty($tour_address)) {
             $tour_address = $tour_city . ' ' . $tour_country;
         }
         $tour_date = date('l, F, j, Y', trav_strtotime($booking_data['tour_date']));
         // booking info
         $booking_no = $booking_data['booking_no'];
         $booking_pincode = $booking_data['pin_code'];
         $booking_adults = $booking_data['adults'];
         $booking_kids = $booking_data['kids'];
         $booking_total_price = esc_html(trav_get_price_field($booking_data['total_price'] * $booking_data['exchange_rate'], $booking_data['currency_code'], 0));
         $booking_deposit_price = esc_html($booking_data['deposit_price'] . $booking_data['currency_code']);
         $booking_deposit_paid = esc_html(empty($booking_data['deposit_paid']) ? 'No' : 'Yes');
         $booking_update_url = esc_url(add_query_arg(array('booking_no' => $booking_data['booking_no'], 'pin_code' => $booking_data['pin_code']), $tour_book_conf_url));
         // customer info
         $customer_first_name = $booking_data['first_name'];
         $customer_last_name = $booking_data['last_name'];
         $customer_email = $booking_data['email'];
         $customer_country_code = $booking_data['country_code'];
         $customer_phone = $booking_data['phone'];
         $customer_address = $booking_data['address'];
         $customer_city = $booking_data['city'];
         $customer_zip = $booking_data['zip'];
         $customer_country = $booking_data['country'];
         $customer_special_requirements = $booking_data['special_requirements'];
         $variables = array('home_url', 'site_name', 'logo_url', 'tour_name', 'tour_url', 'tour_thumbnail', 'tour_country', 'tour_city', 'tour_address', 'tour_phone', 'tour_email', 'tour_date', 'tour_duration', 'tour_st_title', 'tour_st_description', 'tour_st_time', 'booking_no', 'booking_pincode', 'booking_adults', 'booking_kids', 'booking_total_price', 'booking_deposit_price', 'booking_deposit_paid', 'booking_update_url', 'customer_first_name', 'customer_last_name', 'customer_email', 'customer_country_code', 'customer_phone', 'customer_address', 'customer_city', 'customer_zip', 'customer_country', 'customer_special_requirements');
         if (empty($subject)) {
             if ($type == 'new') {
                 $subject = empty($trav_options['tour_confirm_email_subject']) ? 'Booking Confirmation Email Subject' : $trav_options['tour_confirm_email_subject'];
             } elseif ($type == 'update') {
                 $subject = empty($trav_options['tour_update_email_subject']) ? 'Booking Updated Email Subject' : $trav_options['tour_update_email_subject'];
             } elseif ($type == 'cancel') {
                 $subject = empty($trav_options['tour_cancel_email_subject']) ? 'Booking Canceled Email Subject' : $trav_options['tour_cancel_email_subject'];
             }
         }
         if (empty($description)) {
             if ($type == 'new') {
                 $description = empty($trav_options['tour_confirm_email_description']) ? 'Booking Confirmation Email Description' : $trav_options['tour_confirm_email_description'];
             } elseif ($type == 'update') {
                 $description = empty($trav_options['tour_update_email_description']) ? 'Booking Confirmation Email Description' : $trav_options['tour_update_email_description'];
             } elseif ($type == 'cancel') {
                 $description = empty($trav_options['tour_cancel_email_description']) ? 'Booking Confirmation Email Description' : $trav_options['tour_cancel_email_description'];
             }
         }
         foreach ($variables as $variable) {
             $subject = str_replace("[" . $variable . "]", ${$variable}, $subject);
             $description = str_replace("[" . $variable . "]", ${$variable}, $description);
         }
         $mail_sent = trav_send_mail($site_name, $admin_email, $customer_email, $subject, $description);
         /* mailing function to business owner */
         $bowner_address = '';
         if (!empty($trav_options['tour_booked_notify_bowner'])) {
             if ($type == 'new') {
                 $subject = empty($trav_options['tour_bowner_email_subject']) ? 'You received a booking' : $trav_options['tour_bowner_email_subject'];
                 $description = empty($trav_options['tour_bowner_email_description']) ? 'Booking Details' : $trav_options['tour_bowner_email_description'];
             } elseif ($type == 'update') {
                 $subject = empty($trav_options['tour_update_bowner_email_subject']) ? 'A booking is updated' : $trav_options['tour_update_bowner_email_subject'];
                 $description = empty($trav_options['tour_update_bowner_email_description']) ? 'Booking Details' : $trav_options['tour_update_bowner_email_description'];
             } elseif ($type == 'cancel') {
                 $subject = empty($trav_options['tour_cancel_bowner_email_subject']) ? 'A booking is canceled' : $trav_options['tour_cancel_bowner_email_subject'];
                 $description = empty($trav_options['tour_cancel_bowner_email_description']) ? 'Booking Details' : $trav_options['tour_cancel_bowner_email_description'];
             }
             foreach ($variables as $variable) {
                 $subject = str_replace("[" . $variable . "]", ${$variable}, $subject);
                 $description = str_replace("[" . $variable . "]", ${$variable}, $description);
             }
             if (!empty($tour_email)) {
                 $bowner_address = $tour_email;
             } else {
                 $post_author_id = get_post_field('post_author', $booking_data['tour_id']);
                 $bowner = get_user_by('id', $post_author_id);
                 if (!empty($bowner)) {
                     $bowner_address = $bowner->user_email;
                 }
             }
             if (!empty($bowner_address)) {
                 trav_send_mail($site_name, $admin_email, $bowner_address, $subject, $description);
             }
         }
         /* mailing function to admin */
         if (!empty($trav_options['tour_booked_notify_admin'])) {
             if ($bowner_address != $admin_email) {
                 if ($type == 'new') {
                     $subject = empty($trav_options['tour_admin_email_subject']) ? 'You received a booking' : $trav_options['tour_admin_email_subject'];
                     $description = empty($trav_options['tour_admin_email_description']) ? 'Booking Details' : $trav_options['tour_admin_email_description'];
                 } elseif ($type == 'update') {
                     $subject = empty($trav_options['tour_update_admin_email_subject']) ? 'A booking is updated' : $trav_options['tour_update_admin_email_subject'];
                     $description = empty($trav_options['tour_update_admin_email_description']) ? 'Booking Details' : $trav_options['tour_update_admin_email_description'];
                 } elseif ($type == 'cancel') {
                     $subject = empty($trav_options['tour_cancel_admin_email_subject']) ? 'A booking is canceled' : $trav_options['tour_cancel_admin_email_subject'];
                     $description = empty($trav_options['tour_cancel_admin_email_description']) ? 'Booking Details' : $trav_options['tour_cancel_admin_email_description'];
                 }
                 foreach ($variables as $variable) {
                     $subject = str_replace("[" . $variable . "]", ${$variable}, $subject);
                     $description = str_replace("[" . $variable . "]", ${$variable}, $description);
                 }
                 trav_send_mail($site_name, $admin_email, $admin_email, $subject, $description);
             }
         }
         return true;
     }
     return false;
 }
Пример #3
0
									<small><i class="soap-icon-departure yellow-color"></i><span class="fourty-space"><?php 
        echo esc_html(empty($city) ? '' : $city . ', ');
        echo esc_html(empty($country) ? '' : $country);
        ?>
</span></small>
								</h2>
								<?php 
        if (isset($acc_meta['trav_accommodation_avg_price']) && is_numeric($acc_meta['trav_accommodation_avg_price'][0])) {
            ?>
									<span class="price clearfix">
										<small class="pull-left"><?php 
            _e('avg/night', 'trav');
            ?>
</small>
										<span class="pull-right"><?php 
            echo esc_html(trav_get_price_field($acc_meta['trav_accommodation_avg_price'][0]));
            ?>
</span>
									</span>
								<?php 
        }
        ?>
								<div class="feedback clearfix">
									<div title="<?php 
        echo esc_attr($acc_review . ' ' . __('stars', 'trav'));
        ?>
" class="five-stars-container" data-toggle="tooltip" data-placement="bottom"><span class="five-stars" style="width: <?php 
        echo esc_attr($acc_review / 5 * 100);
        ?>
%;"></span></div>
									<span class="review pull-right"><?php 
Пример #4
0
 function trav_acc_send_confirmation_email($booking_no, $booking_pincode, $type = 'new', $subject = '', $description = '')
 {
     global $wpdb, $logo_url, $trav_options;
     $booking_data = trav_acc_get_booking_data($booking_no, $booking_pincode);
     if (!empty($booking_data)) {
         // server variables
         $admin_email = get_option('admin_email');
         $home_url = esc_url(home_url());
         $site_name = $_SERVER['SERVER_NAME'];
         $logo_url = esc_url($logo_url);
         $acc_book_conf_url = trav_acc_get_book_conf_url();
         $booking_data['accommodation_id'] = trav_acc_clang_id($booking_data['accommodation_id']);
         $booking_data['room_type_id'] = trav_room_clang_id($booking_data['room_type_id']);
         // accommodation info
         $accommodation_name = get_the_title($booking_data['accommodation_id']);
         $accommodation_url = esc_url(trav_get_permalink_clang($booking_data['accommodation_id']));
         $accommodation_thumbnail = get_the_post_thumbnail($booking_data['accommodation_id'], 'list-thumb');
         $accommodation_address = get_post_meta($booking_data['accommodation_id'], 'trav_accommodation_address', true);
         $accommodation_city = trav_acc_get_city($booking_data['accommodation_id']);
         $accommodation_country = trav_acc_get_country($booking_data['accommodation_id']);
         $accommodation_phone = get_post_meta($booking_data['accommodation_id'], 'trav_accommodation_phone', true);
         $accommodation_email = get_post_meta($booking_data['accommodation_id'], 'trav_accommodation_email', true);
         $accommodation_room_name = esc_html(get_the_title($booking_data['room_type_id']));
         if (empty($accommodation_address)) {
             $accommodation_address = $accommodation_city . ' ' . $accommodation_country;
         }
         $check_in = get_post_meta($booking_data['accommodation_id'], 'trav_accommodation_check_in', true);
         $check_out = get_post_meta($booking_data['accommodation_id'], 'trav_accommodation_check_out', true);
         $check_in_time = empty($check_in) ? $booking_data['date_from'] : $booking_data['date_from'] . ' ' . $check_in;
         $check_out_time = empty($check_out) ? $booking_data['date_to'] : $booking_data['date_to'] . ' ' . $check_out;
         // booking info
         $booking_no = $booking_data['booking_no'];
         $booking_pincode = $booking_data['pin_code'];
         $date_from = new DateTime($booking_data['date_from']);
         $date_to = new DateTime($booking_data['date_to']);
         $number1 = $date_from->format('U');
         $number2 = $date_to->format('U');
         $booking_nights = ($number2 - $number1) / (3600 * 24);
         $booking_checkin_time = date('l, F, j, Y', trav_strtotime($booking_data['date_from']));
         $booking_checkout_time = date('l, F, j, Y', trav_strtotime($booking_data['date_to']));
         $booking_rooms = $booking_data['rooms'];
         $booking_adults = $booking_data['adults'];
         $booking_kids = $booking_data['kids'];
         $booking_room_price = esc_html(trav_get_price_field($booking_data['room_price'] * $booking_data['exchange_rate'], $booking_data['currency_code'], 0));
         $booking_tax = esc_html(trav_get_price_field($booking_data['tax'] * $booking_data['exchange_rate'], $booking_data['currency_code'], 0));
         $booking_total_price = esc_html(trav_get_price_field($booking_data['total_price'] * $booking_data['exchange_rate'], $booking_data['currency_code'], 0));
         $booking_deposit_price = esc_html($booking_data['deposit_price'] . $booking_data['currency_code']);
         $booking_deposit_paid = esc_html(empty($booking_data['deposit_paid']) ? 'No' : 'Yes');
         $booking_update_url = esc_url(add_query_arg(array('booking_no' => $booking_data['booking_no'], 'pin_code' => $booking_data['pin_code']), $acc_book_conf_url));
         // customer info
         $customer_first_name = $booking_data['first_name'];
         $customer_last_name = $booking_data['last_name'];
         $customer_email = $booking_data['email'];
         $customer_country_code = $booking_data['country_code'];
         $customer_phone = $booking_data['phone'];
         $customer_address = $booking_data['address'];
         $customer_city = $booking_data['city'];
         $customer_zip = $booking_data['zip'];
         $customer_country = $booking_data['country'];
         $customer_special_requirements = $booking_data['special_requirements'];
         $variables = array('home_url', 'site_name', 'logo_url', 'accommodation_name', 'accommodation_url', 'accommodation_thumbnail', 'accommodation_country', 'accommodation_city', 'accommodation_address', 'accommodation_phone', 'accommodation_email', 'accommodation_room_name', 'booking_no', 'booking_pincode', 'booking_nights', 'booking_checkin_time', 'booking_checkout_time', 'booking_rooms', 'booking_adults', 'booking_kids', 'booking_room_price', 'booking_tax', 'booking_total_price', 'booking_deposit_price', 'booking_deposit_paid', 'booking_update_url', 'customer_first_name', 'customer_last_name', 'customer_email', 'customer_country_code', 'customer_phone', 'customer_address', 'customer_city', 'customer_zip', 'customer_country', 'customer_special_requirements');
         if (empty($subject)) {
             if ($type == 'new') {
                 $subject = empty($trav_options['acc_confirm_email_subject']) ? 'Booking Confirmation Email Subject' : $trav_options['acc_confirm_email_subject'];
             } elseif ($type == 'update') {
                 $subject = empty($trav_options['acc_update_email_subject']) ? 'Booking Updated Email Subject' : $trav_options['acc_update_email_subject'];
             } elseif ($type == 'cancel') {
                 $subject = empty($trav_options['acc_cancel_email_subject']) ? 'Booking Canceled Email Subject' : $trav_options['acc_cancel_email_subject'];
             }
         }
         if (empty($description)) {
             if ($type == 'new') {
                 $description = empty($trav_options['acc_confirm_email_description']) ? 'Booking Confirmation Email Description' : $trav_options['acc_confirm_email_description'];
             } elseif ($type == 'update') {
                 $description = empty($trav_options['acc_update_email_description']) ? 'Booking Confirmation Email Description' : $trav_options['acc_update_email_description'];
             } elseif ($type == 'cancel') {
                 $description = empty($trav_options['acc_cancel_email_description']) ? 'Booking Confirmation Email Description' : $trav_options['acc_cancel_email_description'];
             }
         }
         foreach ($variables as $variable) {
             $subject = str_replace("[" . $variable . "]", ${$variable}, $subject);
             $description = str_replace("[" . $variable . "]", ${$variable}, $description);
         }
         if (!empty($trav_options['acc_confirm_email_ical']) && $type == 'new') {
             $mail_sent = trav_send_ical_event($site_name, $admin_email, $customer_first_name . ' ' . $customer_last_name, $customer_email, $check_in_time, $check_out_time, $subject, $description, $accommodation_address);
         } else {
             $mail_sent = trav_send_mail($site_name, $admin_email, $customer_email, $subject, $description);
         }
         /* mailing function to business owner */
         $bowner_address = '';
         if (!empty($trav_options['acc_booked_notify_bowner'])) {
             if ($type == 'new') {
                 $subject = empty($trav_options['acc_bowner_email_subject']) ? 'You received a booking' : $trav_options['acc_bowner_email_subject'];
                 $description = empty($trav_options['acc_bowner_email_description']) ? 'Booking Details' : $trav_options['acc_bowner_email_description'];
             } elseif ($type == 'update') {
                 $subject = empty($trav_options['acc_update_bowner_email_subject']) ? 'A booking is updated' : $trav_options['acc_update_bowner_email_subject'];
                 $description = empty($trav_options['acc_update_bowner_email_description']) ? 'Booking Details' : $trav_options['acc_update_bowner_email_description'];
             } elseif ($type == 'cancel') {
                 $subject = empty($trav_options['acc_cancel_bowner_email_subject']) ? 'A booking is canceled' : $trav_options['acc_cancel_bowner_email_subject'];
                 $description = empty($trav_options['acc_cancel_bowner_email_description']) ? 'Booking Details' : $trav_options['acc_cancel_bowner_email_description'];
             }
             foreach ($variables as $variable) {
                 $subject = str_replace("[" . $variable . "]", ${$variable}, $subject);
                 $description = str_replace("[" . $variable . "]", ${$variable}, $description);
             }
             if (!empty($accommodation_email)) {
                 $bowner_address = $accommodation_email;
             } else {
                 $post_author_id = get_post_field('post_author', $booking_data['accommodation_id']);
                 $bowner = get_user_by('id', $post_author_id);
                 if (!empty($bowner)) {
                     $bowner_address = $bowner->user_email;
                 }
             }
             if (!empty($bowner_address)) {
                 trav_send_mail($site_name, $admin_email, $bowner_address, $subject, $description);
             }
         }
         /* mailing function to admin */
         if (!empty($trav_options['acc_booked_notify_admin'])) {
             if ($bowner_address != $admin_email) {
                 if ($type == 'new') {
                     $subject = empty($trav_options['acc_admin_email_subject']) ? 'You received a booking' : $trav_options['acc_admin_email_subject'];
                     $description = empty($trav_options['acc_admin_email_description']) ? 'Booking Details' : $trav_options['acc_admin_email_description'];
                 } elseif ($type == 'update') {
                     $subject = empty($trav_options['acc_update_admin_email_subject']) ? 'A booking is updated' : $trav_options['acc_update_admin_email_subject'];
                     $description = empty($trav_options['acc_update_admin_email_description']) ? 'Booking Details' : $trav_options['acc_update_admin_email_description'];
                 } elseif ($type == 'cancel') {
                     $subject = empty($trav_options['acc_cancel_admin_email_subject']) ? 'A booking is canceled' : $trav_options['acc_cancel_admin_email_subject'];
                     $description = empty($trav_options['acc_cancel_admin_email_description']) ? 'Booking Details' : $trav_options['acc_cancel_admin_email_description'];
                 }
                 foreach ($variables as $variable) {
                     $subject = str_replace("[" . $variable . "]", ${$variable}, $subject);
                     $description = str_replace("[" . $variable . "]", ${$variable}, $description);
                 }
                 trav_send_mail($site_name, $admin_email, $admin_email, $subject, $description);
             }
         }
         return true;
     }
     return false;
 }
Пример #5
0
    function trav_tour_get_tour_list_sigle($tour_id, $list_style, $before_article = '', $after_article = '', $show_badge = false, $animation = '')
    {
        echo wp_kses_post($before_article);
        $tour_id = trav_tour_clang_id($tour_id);
        $min_price = get_post_meta($tour_id, 'trav_tour_min_price', true);
        $brief = get_post_meta($tour_id, 'trav_tour_brief', true);
        if (empty($brief)) {
            $brief = apply_filters('the_content', get_post_field('post_content', $tour_id));
            $brief = wp_trim_words($brief, 20, '');
        }
        $discount_rate = get_post_meta($tour_id, 'trav_tour_discount_rate', true);
        $url = get_permalink($tour_id);
        $duration = trav_tour_get_tour_duration($tour_id);
        if ($list_style == "style1") {
            ?>

			<article class="box">
				<figure <?php 
            echo wp_kses_post($animation);
            ?>
>
					<a title="<?php 
            _e('View Photo Gallery', 'trav');
            ?>
" class="hover-effect popup-gallery" data-post_id="<?php 
            echo esc_attr($tour_id);
            ?>
" href="#"><?php 
            echo get_the_post_thumbnail($tour_id, 'biggallery-thumb');
            ?>
</a>
					<?php 
            if (!empty($discount_rate)) {
                ?>
						<span class="discount"><span class="discount-text"><?php 
                echo esc_html($discount_rate . '%' . ' ' . __('Discount', 'trav'));
                ?>
</span></span>
					<?php 
            }
            ?>
				</figure>
				<div class="details">
					<?php 
            if (!empty($min_price) && is_numeric($min_price)) {
                ?>
						<span class="price"><?php 
                echo esc_html(trav_get_price_field($min_price));
                ?>
</span>
					<?php 
            }
            ?>
					<h4 class="box-title"><a href="<?php 
            echo esc_url($url);
            ?>
"><?php 
            echo esc_html(get_the_title($tour_id));
            ?>
</a></h4>
					<hr>
					<div class="description"><?php 
            echo wp_kses_post($brief);
            ?>
</div>
					<hr>
					<div class="text-center">
						<div class="time">
							<i class="soap-icon-clock yellow-color"></i>
							<span><?php 
            echo esc_html($duration);
            ?>
</span>
						</div>
					<div class="action">
						<a title="<?php 
            _e('View Detail', 'trav');
            ?>
" class="button btn-small full-width" href="<?php 
            echo esc_url($url);
            ?>
"><?php 
            _e('BOOK NOW', 'trav');
            ?>
</a>
					</div>
				</div>
			</article>
		<?php 
        } elseif ($list_style == "style2") {
            ?>
			<article class="box">
				<?php 
            if (!empty($discount_rate)) {
                ?>
					<span class="discount"><span class="discount-text"><?php 
                echo esc_html($discount_rate . '%' . ' ' . __('Discount', 'trav'));
                ?>
</span></span>
				<?php 
            }
            ?>
				<figure <?php 
            echo wp_kses_post($animation);
            ?>
>
					<a href="<?php 
            echo esc_url($url);
            ?>
"><?php 
            echo get_the_post_thumbnail($tour_id, 'biggallery-thumb');
            ?>
</a>
					<figcaption>
						<?php 
            if (!empty($min_price) && is_numeric($min_price)) {
                ?>
							<span class="price"><?php 
                echo esc_html(trav_get_price_field($min_price));
                ?>
</span>
						<?php 
            }
            ?>
						<h2 class="caption-title"><?php 
            echo esc_html(get_the_title($tour_id));
            ?>
</h2>
					</figcaption>
				</figure>
			</article>
		<?php 
        } elseif ($list_style == "style3") {
            ?>

			<article class="box">
				<figure class="col-sm-5 col-md-4">
					<a title="<?php 
            _e('View Photo Gallery', 'trav');
            ?>
" class="hover-effect popup-gallery" data-post_id="<?php 
            echo esc_attr($tour_id);
            ?>
" href="#"><?php 
            echo get_the_post_thumbnail($tour_id, 'biggallery-thumb');
            ?>
</a>
					<?php 
            if ($show_badge && !empty($discount_rate)) {
                ?>
						<span class="discount"><span class="discount-text"><?php 
                echo esc_html($discount_rate . '%' . ' ' . __('Discount', 'trav'));
                ?>
</span></span>
					<?php 
            }
            ?>
				</figure>
				<div class="details col-sm-7 col-md-8">
					<div>
						<div>
							<h4 class="box-title"><a href="<?php 
            echo esc_url($url);
            ?>
"><?php 
            echo esc_html(get_the_title($tour_id));
            ?>
</a><small><i class="soap-icon-clock yellow-color"></i> <?php 
            echo esc_html($duration);
            ?>
</small></h4>
						</div>
						<div>
							<span class="price"><small><?php 
            _e('per person', 'trav');
            ?>
</small><?php 
            echo esc_html(trav_get_price_field($min_price));
            ?>
</span>
						</div>
					</div>
					<div>
						<?php 
            echo wp_kses_post($brief);
            ?>
						<div>
							<a title="<?php 
            _e('View Detail', 'trav');
            ?>
" class="button btn-small full-width text-center" href="<?php 
            echo esc_url($url);
            ?>
"><?php 
            _e('BOOK NOW', 'trav');
            ?>
</a>
						</div>
					</div>
				</div>
			</article>
		<?php 
        }
        echo wp_kses_post($after_article);
    }
Пример #6
0
            $_city = get_post_meta($post_id, 'trav_tour_city', true);
            if (!empty($_city)) {
                if ($user_info['city_obj'] = get_term_by('id', $_city, 'location')) {
                    $_city = __($user_info['city_obj']->name, 'trav');
                }
            }
            ?>

								<li>
									<a href="<?php 
            echo esc_url(get_permalink($post_id));
            ?>
">
										<i class="icon soap-icon-beach circle yellow-color"></i>
										<span class="price"><?php 
            echo esc_html(trav_get_price_field(get_post_meta($post_id, 'trav_tour_min_price', true)));
            ?>
</span>
										<h4 class="box-title"><?php 
            echo esc_html(get_the_title($post_id));
            ?>
<small><?php 
            echo esc_html($_city . ' ' . $_country);
            ?>
</small></h4>
									</a>
								</li>

							<?php 
        } elseif ($post_type == 'post') {
            $post_author_id = get_post_field('post_author', $post_id);
Пример #7
0
    ?>
					<dt class="feature"><?php 
    _e('Security Deposit', 'trav');
    ?>
:</dt><dd class="value"><?php 
    echo esc_html(trav_get_price_field($booking_data['deposit_price'], $booking_data['currency_code'], 0));
    ?>
</dd>
				<?php 
}
?>
				<dt class="total-price"><?php 
_e('Total Price', 'trav');
?>
</dt><dd class="total-price-value"><?php 
echo esc_html(trav_get_price_field($booking_data['total_price']));
?>
</dd>
			</dl>
			<?php 
do_action('trav_tour_booking_sidebar_after', $booking_data);
?>

		</div>
		<?php 
generated_dynamic_sidebar();
?>
	</div>
</div>

<script>
Пример #8
0
 function shortcode_latest_tours($atts)
 {
     extract(shortcode_atts(array('count' => 3, 'class' => '', 'thumb_width' => 64, 'thumb_height' => 64), $atts));
     $tours = trav_tour_get_special_tours('latest', $count);
     $result = '';
     $result .= '<div class="image-box style14">';
     foreach ($tours as $tour) {
         $tour_id = $tour->ID;
         $min_price = get_post_meta($tour_id, 'trav_tour_min_price', true);
         $min_price = empty($min_price) ? 0 : $min_price;
         $result .= '<article class="box"><figure>';
         $result .= '<a href="' . esc_url(get_permalink($tour_id)) . '">' . get_the_post_thumbnail($tour_id, array($thumb_width, $thumb_height)) . '</a>';
         $result .= '</figure>';
         $result .= '<div class="details">';
         $result .= '<h5 class="title"><a href="' . esc_url(get_permalink($tour_id)) . '">' . esc_html(get_the_title($tour_id)) . '</a></h5>';
         $result .= '<label class="price-wrapper"><span class="price-per-unit">' . esc_html(trav_get_price_field($min_price)) . '</span> ' . __('per person', 'trav') . '</label>';
         $result .= '</div>';
         $result .= '</article>';
     }
     $result .= '</div>';
     return $result;
 }
Пример #9
0
">
							<?php 
$return_value = trav_acc_get_available_rooms($acc_id, $booking_data['date_from'], $booking_data['date_to'], $booking_data['rooms'], $booking_data['adults'], $booking_data['kids'], $booking_data['child_ages'], $booking_data['booking_no'], $booking_data['pin_code']);
if (!empty($return_value) && is_array($return_value)) {
    foreach ($return_value['bookable_room_type_ids'] as $room_id) {
        $room_price = 0;
        foreach ($return_value['check_dates'] as $check_date) {
            $room_price += (double) $return_value['prices'][$room_id][$check_date]['total'];
        }
        $room_price *= 1 + $tax_rate / 100;
        $selected = '';
        $room_id_lang = trav_room_clang_id($room_id);
        if ($room_id_lang == $room_type_id) {
            $selected = 'selected';
        }
        echo '<option value="' . esc_attr($room_id) . '" ' . esc_attr($selected) . '>' . esc_html(get_the_title($room_id_lang) . ' (' . trav_get_price_field($room_price, $booking_data['currency_code'], 0) . ')') . '</option>';
    }
}
?>
						</select>
					</div>
				</div>
				<div class="col-xs-12">
					<button id="update_booking_room" data-animation-duration="1" data-animation-type="bounce" class="full-width icon-check animated bounce" type="submit"><?php 
_e("CHANGE ROOM", "trav");
?>
</button>
				</div>
			</div>
		</div>
	</form>
Пример #10
0
        echo esc_url($url);
        ?>
"><?php 
        echo esc_html(get_the_title($tour_id));
        ?>
</a><small><i class="soap-icon-clock yellow-color"></i> <?php 
        echo esc_html($duration);
        ?>
</small></h4>
					</div>
					<div>
						<span class="price"><small><?php 
        _e('per person', 'trav');
        ?>
</small><?php 
        echo esc_html(trav_get_price_field($min_price));
        ?>
</span>
					</div>
				</div>
				<div>
					<?php 
        echo wp_kses_post($brief);
        ?>
					<div>
						<a title="<?php 
        _e('View Detail', 'trav');
        ?>
" class="button btn-small full-width text-center" href="<?php 
        echo esc_url($url);
        ?>
Пример #11
0
    printf(__('Security Deposit(%d%%)', 'trav'), $deposit_rate);
    ?>
:</dt><dd><?php 
    echo esc_html(trav_get_price_field($booking_data['deposit_price'], $booking_data['currency_code'], 0));
    ?>
</dd>
				</dl>
			<?php 
}
?>
			<dl class="term-description" style="font-size: 16px;" >
				<dt style="text-transform: none;"><?php 
echo __('Total Price', 'trav');
?>
</dt><dd><b style="color: #2d3e52;"><?php 
echo esc_html(trav_get_price_field($booking_data['total_price'] * $booking_data['exchange_rate'], $booking_data['currency_code'], 0));
?>
</b></dd>
			</dl>
			<hr />
			<?php 
trav_get_template('tour-detail.php', '/templates/tour/');
?>
			<?php 
do_action('trav_tour_conf_form_after', $booking_data);
?>
		</div>
	</div>
	<div class="sidebar col-sm-4 col-md-3">
		<?php 
if (empty($tour_meta["trav_tour_d_edit_booking"]) || empty($tour_meta["trav_tour_d_edit_booking"][0]) || empty($tour_meta["trav_tour_d_cancel_booking"]) || empty($tour_meta["trav_tour_d_cancel_booking"][0])) {
Пример #12
0
        if (!empty($room_price_data['prices'][$check_date]['ppp'])) {
            echo '<tr><td>';
            echo __('price per person', 'trav') . '</td><td>' . esc_html(trav_get_price_field($room_price_data['prices'][$check_date]['ppp']));
            echo '</td></tr>';
        }
        if (!empty($room_price_data['prices'][$check_date]['cp'])) {
            $i = 0;
            foreach ($room_price_data['prices'][$check_date]['cp'] as $child_price) {
                $i++;
                echo '<tr><td>';
                echo __('child', 'trav') . esc_html($i) . ' ' . __('price', 'trav') . '</td><td>' . esc_html(trav_get_price_field($child_price));
                echo '</td></tr>';
            }
        }
        echo '<tr><td>';
        echo __('total', 'trav') . '</td><td>' . esc_html(trav_get_price_field($room_price_data['prices'][$check_date]['total']));
        echo '</td></tr></table></dd>';
    }
}
?>
			</dl>

			<?php 
do_action('trav_acc_booking_sidebar_after', $booking_data);
?>

		</div>
		<?php 
generated_dynamic_sidebar();
?>
	</div>
Пример #13
0
    function trav_acc_get_acc_list_sigle($acc_id, $list_style, $before_article = '', $after_article = '', $show_badge = false, $animation = '')
    {
        echo wp_kses_post($before_article);
        // $acc_id = trav_acc_clang_id( $acc_id );
        $avg_price = get_post_meta($acc_id, 'trav_accommodation_avg_price', true);
        $review = get_post_meta($acc_id, 'review', true);
        $review = !empty($review) ? round($review, 1) : 0;
        $brief = get_post_meta($acc_id, 'trav_accommodation_brief', true);
        if (empty($brief)) {
            $brief = apply_filters('the_content', get_post_field('post_content', $acc_id));
            $brief = wp_trim_words($brief, 20, '');
        }
        $loc = get_post_meta($acc_id, 'trav_accommodation_loc', true);
        $discount_rate = get_post_meta($acc_id, 'trav_accommodation_discount_rate', true);
        if ($list_style == "style1" || $list_style == "style2") {
            ?>
			<article class="box">
				<figure <?php 
            echo wp_kses_post($animation);
            ?>
>
					<a href="#" data-post_id="<?php 
            echo esc_attr($acc_id);
            ?>
" class="hover-effect popup-gallery"><?php 
            echo get_the_post_thumbnail($acc_id, 'biggallery-thumb');
            ?>
</a>
					<?php 
            if ($show_badge && !empty($discount_rate)) {
                ?>
						<span class="discount"><span class="discount-text"><?php 
                echo esc_html($discount_rate . '%' . ' ' . __('Discount', 'trav'));
                ?>
</span></span>
					<?php 
            }
            ?>
				</figure>
				<div class="details">
					<?php 
            if ($list_style == "style1") {
                if (!empty($avg_price) && is_numeric($avg_price)) {
                    ?>
							<span class="price"><small><?php 
                    _e('avg/night', 'trav');
                    ?>
</small><?php 
                    echo esc_html(trav_get_price_field($avg_price));
                    ?>
</span>
						<?php 
                }
                ?>
						<h4 class="box-title">
							<a href="<?php 
                echo esc_url(get_permalink($acc_id));
                ?>
"><?php 
                echo esc_html(get_the_title($acc_id));
                ?>
</a>
							<small><?php 
                echo esc_html(trav_acc_get_city($acc_id) . ' ' . trav_acc_get_country($acc_id));
                ?>
</small>
						</h4>
						<div class="feedback">
							<div data-placement="bottom" data-toggle="tooltip" class="five-stars-container" title="<?php 
                echo esc_attr($review . ' ' . __('stars', 'trav'));
                ?>
"><span style="width: <?php 
                echo esc_attr($review / 5 * 100);
                ?>
%;" class="five-stars"></span></div>
							<span class="review"><?php 
                echo esc_html(trav_get_review_count($acc_id) . ' ' . __('reviews', 'trav'));
                ?>
</span>
						</div>
						<p class="description"><?php 
                echo wp_kses_post($brief);
                ?>
</p>
						<div class="action clearfix">
							<?php 
                if (!empty($loc)) {
                    ?>
								<a class="button btn-small" href="<?php 
                    echo esc_url(get_permalink($acc_id));
                    ?>
"><?php 
                    _e('SELECT', 'trav');
                    ?>
</a>
								<a class="button btn-small yellow popup-map" href="#" data-box="<?php 
                    echo esc_attr($loc);
                    ?>
"><?php 
                    _e('VIEW ON MAP', 'trav');
                    ?>
</a>
							<?php 
                } else {
                    ?>
								<a class="button btn-small full-width" href="<?php 
                    echo esc_url(get_permalink($acc_id));
                    ?>
"><?php 
                    _e('SELECT', 'trav');
                    ?>
</a>
							<?php 
                }
                ?>
						</div>
					<?php 
            } elseif ($list_style == "style2") {
                ?>
						<a title="View all" href="<?php 
                echo esc_url(get_permalink($acc_id));
                ?>
" class="pull-right button uppercase"><?php 
                _e('select', 'trav');
                ?>
</a>
						<h4 class="box-title"><a href="<?php 
                echo esc_url(get_permalink($acc_id));
                ?>
"><?php 
                echo esc_html(get_the_title($acc_id));
                ?>
</a></h4>
						<?php 
                if (!empty($avg_price) && is_numeric($avg_price)) {
                    ?>
							<label class="price-wrapper">
								<span class="price-per-unit"><?php 
                    echo esc_html(trav_get_price_field($avg_price));
                    ?>
</span><?php 
                    _e('avg/night', 'trav');
                    ?>
							</label>
						<?php 
                }
            }
            ?>
				</div>
			</article>

		<?php 
        } elseif ($list_style == "style3") {
            ?>
			<article class="box">
				<figure class="col-sm-5 col-md-4">
					<a href="#" data-post_id="<?php 
            echo esc_attr($acc_id);
            ?>
" class="hover-effect popup-gallery"><?php 
            echo get_the_post_thumbnail($acc_id, 'biggallery-thumb');
            ?>
</a>
					<?php 
            if ($show_badge && !empty($discount_rate)) {
                ?>
						<span class="discount"><span class="discount-text"><?php 
                echo esc_html($discount_rate . '%' . ' ' . __('Discount', 'trav'));
                ?>
</span></span>
					<?php 
            }
            ?>
				</figure>
				<div class="details col-xs-12 col-sm-7 col-md-8">
					<div>
						<div>
							<h4 class="box-title"><a href="<?php 
            echo esc_url(get_permalink($acc_id));
            ?>
"><?php 
            echo esc_html(get_the_title($acc_id));
            ?>
</a><small><i class="soap-icon-departure yellow-color"></i> <?php 
            echo esc_html(trav_acc_get_city($acc_id) . ' ' . trav_acc_get_country($acc_id));
            ?>
</small></h4>
						</div>
						<div>
							<div class="five-stars-container">
								<span class="five-stars" style="width: <?php 
            echo esc_attr($review / 5 * 100);
            ?>
%;"></span>
							</div>
							<span class="review"><?php 
            echo esc_html(trav_get_review_count($acc_id) . ' ' . __('reviews', 'trav'));
            ?>
</span>

						</div>
					</div>
					<div>
						<p><?php 
            echo wp_kses_post($brief);
            ?>
</p>
						<div>
							<span class="price"><small><?php 
            _e('avg/night', 'trav');
            ?>
</small><?php 
            echo esc_html(trav_get_price_field($avg_price));
            ?>
</span>
							<a class="button btn-small full-width text-center" title="<?php 
            _e('select', 'trav');
            ?>
" href="<?php 
            echo esc_url(get_permalink($acc_id));
            ?>
"><?php 
            _e('SELECT', 'trav');
            ?>
</a>
						</div>
					</div>
				</div>
			</article>

		<?php 
        } elseif ($list_style == "style4") {
            ?>
			<div class="row">
				<div class="col-xs-2">
					<a href="<?php 
            echo esc_url(get_permalink($acc_id));
            ?>
" class="badge-container">
						<?php 
            if ($show_badge && !empty($discount_rate)) {
                ?>
							<span class="badge-content"><?php 
                echo __('save', 'trav') . '<br />' . esc_html($discount_rate) . '%';
                ?>
</span>
						<?php 
            }
            ?>
						<?php 
            echo get_the_post_thumbnail($acc_id, 'widget-thumb');
            ?>
					</a>
				</div>
				<div class="col-xs-8">
					<h5 class="box-title"><a href="<?php 
            echo esc_url(get_permalink($acc_id));
            ?>
"><?php 
            echo esc_html(get_the_title($acc_id));
            ?>
</a><small><?php 
            echo esc_html(trav_acc_get_city($acc_id) . ' ' . trav_acc_get_country($acc_id));
            ?>
</small></h5>
					<p class="no-margin"><?php 
            echo wp_kses_post($brief);
            ?>
</p>
				</div>
				<div class="col-xs-2">
					<span class="price"><small><?php 
            _e('avg/night', 'trav');
            ?>
</small><?php 
            echo esc_html(trav_get_price_field($avg_price));
            ?>
</span>
					<br /><br />
					<a class="button green-bg pull-right" href="<?php 
            echo esc_url(get_permalink($acc_id));
            ?>
"><?php 
            _e('SELECT', 'trav');
            ?>
</a>
				</div>
			</div>
		<?php 
        }
        echo wp_kses_post($after_article);
    }
Пример #14
0
        echo esc_html(trav_get_review_count($acc_id) . ' ' . __('reviews', 'trav'));
        ?>
</span>
					</div>
				</div>
				<div>
					<p><?php 
        echo wp_kses_post($brief);
        ?>
</p>
					<div>
						<span class="price"><small><?php 
        _e('avg/night', 'trav');
        ?>
</small><?php 
        echo esc_html(trav_get_price_field($avg_price));
        ?>
</span>
						<a title="<?php 
        _e('View Detail', 'trav');
        ?>
" class="button btn-small full-width text-center" href="<?php 
        echo esc_url($url);
        ?>
"><?php 
        _e('SELECT', 'trav');
        ?>
</a>
					</div>
				</div>
			</div>