<?php

global $accommodation_obj, $byt_theme_globals;
$price_decimal_places = $byt_theme_globals->get_price_decimal_places();
$default_currency_symbol = $byt_theme_globals->get_default_currency_symbol();
$show_currency_symbol_after = $byt_theme_globals->show_currency_symbol_after();
$enc_key = $byt_theme_globals->get_enc_key();
$add_captcha_to_forms = $byt_theme_globals->add_captcha_to_forms();
$c_val_1_acc = mt_rand(1, 20);
$c_val_2_acc = mt_rand(1, 20);
$c_val_1_acc_str = BYT_Theme_Utils::encrypt($c_val_1_acc, $enc_key);
$c_val_2_acc_str = BYT_Theme_Utils::encrypt($c_val_2_acc, $enc_key);
$accommodation_check_in_time = $accommodation_obj->get_custom_field('check_in_time');
$accommodation_check_out_time = $accommodation_obj->get_custom_field('check_out_time');
?>
<script>
	window.currencySymbol = <?php 
echo json_encode($default_currency_symbol);
?>
;
	window.currencySymbolShowAfter = <?php 
echo json_encode($show_currency_symbol_after);
?>
;
	window.invalidCaptchaMessage = <?php 
echo json_encode(__('Invalid captcha, please try again!', 'bookyourtravel'));
?>
;
	window.bookingDateFrom = null;
	window.bookingDateTo = null;
	window.bookingFormFirstNameError = <?php 
<?php

global $byt_theme_globals;
$terms_page_url = $byt_theme_globals->get_terms_page_url();
$add_captcha_to_forms = $byt_theme_globals->add_captcha_to_forms();
$enc_key = $byt_theme_globals->get_enc_key();
$register_page_url = $byt_theme_globals->get_register_page_url();
$c_val_1_reg = mt_rand(1, 20);
$c_val_2_reg = mt_rand(1, 20);
$c_val_1_reg_str = BYT_Theme_Utils::encrypt($c_val_1_reg, $enc_key);
$c_val_2_reg_str = BYT_Theme_Utils::encrypt($c_val_2_reg, $enc_key);
?>
<div class="lightbox" style="display:none;" id="register_lightbox">
	<div class="lb-wrap">
		<a onclick="toggleLightbox('register_lightbox');" href="javascript:void(0);" class="close">x</a>
		<div class="lb-content">
			<form action="<?php 
echo esc_url($register_page_url);
?>
" method="post">
				<h1><?php 
_e('Register', 'bookyourtravel');
?>
</h1>
				<div class="f-item">
					<label for="user_login"><?php 
_e('Username', 'bookyourtravel');
?>
</label>
					<input tabindex="27" type="text" id="user_login" name="user_login" />
				</div>
<?php

global $entity_obj, $byt_theme_globals;
$enc_key = $byt_theme_globals->get_enc_key();
$add_captcha_to_forms = $byt_theme_globals->add_captcha_to_forms();
$c_val_1_inq = mt_rand(1, 20);
$c_val_2_inq = mt_rand(1, 20);
$c_val_1_inq_str = BYT_Theme_Utils::encrypt($c_val_1_inq, $enc_key);
$c_val_2_inq_str = BYT_Theme_Utils::encrypt($c_val_2_inq, $enc_key);
$post_type = $entity_obj->get_entity_type();
$post_id = $entity_obj->get_base_id();
$contact_form_heading = '';
if ($post_type == 'accommodation') {
    $contact_form_heading = __('Use the form below to contact accommodation %s directly.', 'bookyourtravel');
} elseif ($post_type == 'tour') {
    $contact_form_heading = __('Use the form below to contact tour %s directly.', 'bookyourtravel');
} elseif ($post_type == 'car_rental') {
    $contact_form_heading = __('Use the form below to contact car rental %s directly.', 'bookyourtravel');
} elseif ($post_type == 'cruise') {
    $contact_form_heading = __('Use the form below to contact cruise %s directly.', 'bookyourtravel');
}
?>
<script>
	window.InvalidCaptchaMessage = <?php 
echo json_encode(__('Invalid captcha, please try again!', 'bookyourtravel'));
?>
;
	window.postId = '<?php 
echo $post_id;
?>
';
<?php

global $car_rental_obj, $byt_theme_globals;
$enc_key = $byt_theme_globals->get_enc_key();
$add_captcha_to_forms = $byt_theme_globals->add_captcha_to_forms();
$price_decimal_places = $byt_theme_globals->get_price_decimal_places();
$default_currency_symbol = $byt_theme_globals->get_default_currency_symbol();
$show_currency_symbol_after = $byt_theme_globals->show_currency_symbol_after();
$c_val_1_cr = mt_rand(1, 20);
$c_val_2_cr = mt_rand(1, 20);
$c_val_1_cr_str = BYT_Theme_Utils::encrypt($c_val_1_cr, $enc_key);
$c_val_2_cr_str = BYT_Theme_Utils::encrypt($c_val_2_cr, $enc_key);
$locations_select_options = "<option value=''>" . __('Select drop-off location', 'bookyourtravel') . "</option>";
$args = array('orderby' => 'title', 'order' => 'ASC', 'post_type' => 'location', 'post_status' => 'publish', 'posts_per_page' => -1);
$query = new WP_Query($args);
if ($query->have_posts()) {
    while ($query->have_posts()) {
        global $post;
        $query->the_post();
        $locations_select_options .= sprintf("<option value='%d'>%s</option>", $post->ID, get_the_title($post->ID));
    }
}
wp_reset_postdata();
?>
	<script>
		window.currencySymbol = <?php 
echo json_encode($default_currency_symbol);
?>
;
		window.currencySymbolShowAfter = <?php 
echo json_encode($show_currency_symbol_after);