Пример #1
0
 function ct_hotel_generate_conf_mail($order, $type = 'new')
 {
     global $wpdb, $ct_options;
     $order_data = $order->get_order_info();
     if (!empty($order_data)) {
         // server variables
         $admin_email = get_option('admin_email');
         $home_url = esc_url(home_url('/'));
         $site_name = $_SERVER['SERVER_NAME'];
         $logo_url = esc_url(ct_logo_url());
         $order_data['hotel_id'] = ct_hotel_clang_id($order_data['post_id']);
         // hotel info
         $hotel_name = get_the_title($order_data['hotel_id']);
         $hotel_url = esc_url(ct_get_permalink_clang($order_data['hotel_id']));
         $hotel_thumbnail = get_the_post_thumbnail($order_data['hotel_id'], 'medium');
         $hotel_address = get_post_meta($order_data['hotel_id'], 'ct_hotel_address', true);
         $hotel_email = get_post_meta($order_data['hotel_id'], 'ct_hotel_email', true);
         $hotel_phone = get_post_meta($order_data['hotel_id'], 'ct_hotel_phone', true);
         // room info
         $booking_rooms = '<table><tbody><tr><th>' . esc_html__('Room Name', 'citytours') . '</th><th>' . esc_html__('Rooms', 'citytours') . '</th><th>' . esc_html__('Adults', 'citytours') . '</th><th>' . esc_html__('Kids', 'citytours') . '</th><th>' . esc_html__('Total Price', 'citytours') . '</th></tr>';
         $rooms_booking_data = $order->get_rooms();
         if (!empty($rooms_booking_data)) {
             foreach ($rooms_booking_data as $key => $room_data) {
                 $room_type_id = ct_room_clang_id($room_data['room_type_id']);
                 $room_type_title = esc_html(get_the_title($room_type_id));
                 $booking_rooms .= '<tr><td>' . $room_type_title . '</td><td>' . $room_data['rooms'] . '</td><td>' . $room_data['adults'] . '</td><td>' . $room_data['kids'] . '</td><td>' . $room_data['total_price'] . '</td></tr>';
             }
         }
         $booking_rooms .= '</tbody></table>';
         // services info
         $booking_services = '<table><tbody><tr><th>' . esc_html__('Service Name', 'citytours') . '</th><th>' . esc_html__('Total Price', 'citytours') . '</th></tr>';
         $services_booking_data = $order->get_services();
         if (!empty($services_booking_data)) {
             foreach ($services_booking_data as $key => $service_booking_data) {
                 $service_data = ct_get_add_service($service_booking_data['add_service_id']);
                 $service_total_price = $service_booking_data['total_price'];
                 $booking_services .= '<tr><td>' . $service_data->title . '</td><td>' . $service_total_price . '</td></tr>';
             }
         }
         $booking_services .= '</tbody></table>';
         // booking info
         $date_from = new DateTime($order_data['date_from']);
         $date_to = new DateTime($order_data['date_to']);
         $number1 = $date_from->format('U');
         $number2 = $date_to->format('U');
         $booking_nights = ($number2 - $number1) / (3600 * 24);
         $booking_from_date = date('j F Y', strtotime($order_data['date_from']));
         $booking_to_date = date('j F Y', strtotime($order_data['date_to']));
         $booking_adults = $order_data['total_adults'];
         $booking_kids = $order_data['total_kids'];
         $booking_total_price = esc_html(ct_price($order_data['total_price'] * $order_data['exchange_rate'], $order_data['currency_code'], 0));
         $booking_deposit_price = esc_html($order_data['deposit_price'] . $order_data['currency_code']);
         $booking_deposit_paid = esc_html(empty($order_data['deposit_paid']) ? 'No' : 'Yes');
         $booking_no = $order_data['booking_no'];
         $booking_pincode = $order_data['pin_code'];
         // customer info
         $customer_first_name = $order_data['first_name'];
         $customer_last_name = $order_data['last_name'];
         $customer_email = $order_data['email'];
         $customer_country_code = $order_data['country'];
         $customer_phone = $order_data['phone'];
         $customer_address1 = $order_data['address1'];
         $customer_address2 = $order_data['address2'];
         $customer_city = $order_data['city'];
         $customer_zip = $order_data['zip'];
         $customer_country = $order_data['country'];
         $customer_special_requirements = $order_data['special_requirements'];
         $variables = array('home_url', 'site_name', 'logo_url', 'hotel_name', 'hotel_url', 'hotel_thumbnail', 'hotel_address', 'hotel_email', 'hotel_phone', 'booking_rooms', 'booking_services', 'booking_no', 'booking_pincode', 'booking_from_date', 'booking_to_date', 'booking_nights', 'booking_adults', 'booking_kids', 'booking_total_price', 'booking_deposit_paid', 'booking_deposit_price', 'customer_first_name', 'customer_last_name', 'customer_email', 'customer_country_code', 'customer_phone', 'customer_address1', 'customer_address2', 'customer_city', 'customer_zip', 'customer_country', 'customer_special_requirements');
         if (empty($subject)) {
             $subject = empty($ct_options['hotel_confirm_email_subject']) ? 'Booking Confirmation Email Subject' : $ct_options['hotel_confirm_email_subject'];
         }
         if (empty($description)) {
             $description = empty($ct_options['hotel_confirm_email_description']) ? 'Booking Confirmation Email Description' : $ct_options['hotel_confirm_email_description'];
         }
         foreach ($variables as $variable) {
             $subject = str_replace("[" . $variable . "]", ${$variable}, $subject);
             $description = str_replace("[" . $variable . "]", ${$variable}, $description);
         }
         $mail_sent = ct_send_mail($site_name, $admin_email, $customer_email, $subject, $description);
         /* mailing function to admin */
         if (!empty($ct_options['hotel_booked_notify_admin'])) {
             $subject = empty($ct_options['hotel_admin_email_subject']) ? 'You received a booking' : $ct_options['hotel_admin_email_subject'];
             $description = empty($ct_options['hotel_admin_email_description']) ? 'Booking Details' : $ct_options['hotel_admin_email_description'];
             foreach ($variables as $variable) {
                 $subject = str_replace("[" . $variable . "]", ${$variable}, $subject);
                 $description = str_replace("[" . $variable . "]", ${$variable}, $description);
             }
             ct_send_mail($site_name, $admin_email, $admin_email, $subject, $description);
         }
         return true;
     }
     return false;
 }
Пример #2
0
		<!-- <p><?php 
echo esc_html__('Nihil inimicus ex nam, in ipsum dignissim duo. Tale principes interpretaris vim ei, has posidonium definitiones ut. Duis harum fuisset ut his, duo an dolor epicuri appareat.', 'citytours');
?>
</p> -->
		<?php 
if (!empty($ct_options['hotel_thankyou_text_2'])) {
    ?>
		<p><?php 
    echo esc_html__($ct_options['hotel_thankyou_text_2'], 'citytours');
    ?>
</p>
		<?php 
}
?>
		<hr>
		<?php 
if (!empty($ct_options['hotel_invoice_page'])) {
    ?>
			<a class="btn_full_outline" target="_blank" href="<?php 
    echo esc_url(add_query_arg(array('booking_no' => $order_data['booking_no'], 'pin_code' => $order_data['pin_code']), ct_get_permalink_clang($ct_options['hotel_invoice_page'])));
    ?>
" target="_blank"><?php 
    echo esc_html__('View your invoice', 'citytours');
    ?>
</a>
		<?php 
}
?>
	</div>
	</aside>
</div><!--End row -->
Пример #3
0
						</div>
					</div><!--End row -->
				</div><!--End step -->
					<div id="policy">

						<?php 
        global $ct_options;
        if (!empty($ct_options['hotel_terms_page'])) {
            ?>
							<h4><?php 
            echo esc_html__('Cancellation policy', 'citytours');
            ?>
</h4>
							<div class="form-group">
								<label><input name="agree" value="agree" type="checkbox" checked><?php 
            printf(__('By continuing, you agree to the <a href="%s" target="_blank"><span class="skin-color">Terms and Conditions</span></a>.', 'citytours'), ct_get_permalink_clang($ct_options['hotel_terms_page']));
            ?>
</label>
							</div>
						<?php 
        }
        ?>
						<button type="submit" class="btn_1 green medium book-now-btn book-now-btn1"><?php 
        echo esc_html__('Book now', 'citytours');
        ?>
</button>
					</div>
					<?php 
        do_action('hotel_checkout_main_after');
        ?>
				</div>
 function ct_authenticate($user, $username, $password)
 {
     global $ct_options;
     if (!empty($ct_options['login_page']) && (empty($username) || empty($password)) && empty($_GET['no_redirect'])) {
         wp_redirect(add_query_arg($_GET, ct_get_permalink_clang($ct_options['login_page'])));
         exit;
     }
 }
<?php

/*
Template Name: Login Page Template
*/
get_header();
global $ct_options;
$signup_url = add_query_arg('action', 'register', ct_get_permalink_clang($ct_options['login_page']));
$login_url = strtok($_SERVER["REQUEST_URI"], '?');
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>

	<section id="hero" class="login">
		<div class="container">
			<div class="row">
				<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3">
					<div id="login">
						<div class="text-center"><img src="<?php 
        echo esc_url(ct_logo_sticky_url());
        ?>
" alt="" data-retina="true" ></div>
						<hr>

						<?php 
        if (isset($_GET['action']) && $_GET['action'] == 'register') {
            ?>

							<form name="registerform" action="<?php 
            echo esc_url(wp_registration_url());