function tour_schedule_admin_styles()
    {
        if (isset($_POST['start_date'])) {
            $start_date = wp_kses($_POST['start_date'], '');
        }
        echo '<style type="text/css">';
        echo '	.wp-list-table .column-Id { width: 100px; }';
        echo '	.wp-list-table .column-TourName { width: 150px; }';
        echo '	.wp-list-table .column-TourType { width: 150px; }';
        echo '	.wp-list-table .column-StartDate { width: 150px; }';
        echo '	.wp-list-table .column-EndDate { width: 150px; }';
        echo '	.wp-list-table .column-MaxPeople { width: 100px; }';
        echo '	.wp-list-table .column-DurationDays { width: 100px; }';
        echo '	.wp-list-table .column-Action { width: 100px; }';
        echo '  table.calendar { width:60%; }
				table.calendar th { text-align:center; }
				table.calendar td { border:none;text-align:center;height:30px;line-height:30px;vertical-align:middle; }
				table.calendar td.sel a { color:#fff;padding:10px;background:#b1b1b1; }
				table.calendar td.cur a { color:#fff;padding:10px;background:#ededed; }';
        echo "</style>";
        echo '<script>';
        echo 'window.adminAjaxUrl = "' . admin_url('admin-ajax.php') . '";';
        echo 'window.datepickerDateFormat = "' . BYT_Theme_Utils::dateformat_PHP_to_jQueryUI(get_option('date_format')) . '";';
        echo 'window.datepickerAltFormat = "' . BOOKYOURTRAVEL_ALT_DATE_FORMAT . '";';
        echo '</script>';
    }
Example #2
0
 function list_locations($location_id = 0, $paged = 0, $per_page = -1, $orderby = '', $order = '', $featured_only = false)
 {
     $location_ids = array();
     if ($location_id > 0) {
         $location_ids[] = $location_id;
         $location_descendants = BYT_Theme_Utils::get_post_descendants($location_id, 'location');
         foreach ($location_descendants as $location) {
             $location_ids[] = $location->ID;
         }
     }
     $args = array('post_type' => 'location', 'post_status' => array('publish'), 'posts_per_page' => $per_page, 'paged' => $paged, 'orderby' => $orderby, 'suppress_filters' => false, 'order' => $order, 'meta_query' => array('relation' => 'AND'));
     if (count($location_ids) > 0) {
         $args['meta_query'][] = array('key' => 'location_location_post_id', 'value' => $location_ids, 'compare' => 'IN');
     }
     if (isset($featured_only) && $featured_only) {
         $args['meta_query'][] = array('key' => 'location_is_featured', 'value' => 1, 'compare' => '=', 'type' => 'numeric');
     }
     $posts_query = new WP_Query($args);
     $locations = array();
     if ($posts_query->have_posts()) {
         while ($posts_query->have_posts()) {
             global $post;
             $posts_query->the_post();
             $locations[] = $post;
         }
     }
     $results = array('total' => $posts_query->found_posts, 'results' => $locations);
     wp_reset_postdata();
     return $results;
 }
 function __construct()
 {
     add_action('init', array($this, 'action_init'));
     $this->allowed_mime_types = function_exists('wp_get_mime_types') ? wp_get_mime_types() : get_allowed_mime_types();
     $this->has_correct_role = BYT_Theme_Utils::check_user_role(BOOKYOURTRAVEL_FRONTEND_SUBMIT_ROLE, $this->get_current_user_id());
     $this->_html_helper = new Html_Helper();
 }
Example #4
0
 public function get_type_day_of_week_day()
 {
     $day_of_week_index = $this->get_type_day_of_week_index();
     $days_of_week = BYT_Theme_Utils::get_days_of_week();
     if ($day_of_week_index > -1) {
         return $days_of_week[$day_of_week_index];
     }
     return '';
 }
 function bookings_admin_styles()
 {
     echo '<style type="text/css">';
     echo '.wp-list-table .column-Id { width: 100px; }';
     echo '.wp-list-table .column-TourName { width: 250px; }';
     echo '.wp-list-table .column-TourDate { width: 150px; }';
     echo '.wp-list-table .column-People { width: 100px; }';
     echo '.wp-list-table .column-UserId { width: 50px; }';
     echo '</style>';
     echo '<script>';
     echo 'window.adminAjaxUrl = "' . admin_url('admin-ajax.php') . '";';
     echo 'window.datepickerDateFormat = "' . BYT_Theme_Utils::dateformat_PHP_to_jQueryUI(get_option('date_format')) . '";';
     echo 'window.datepickerAltFormat = "' . BOOKYOURTRAVEL_ALT_DATE_FORMAT . '";';
     echo '</script>';
 }
Example #6
0
				<?php 
    BYT_Theme_Utils::render_field("min_age", "", __('Minimum driver age', 'bookyourtravel'), $car_rental_obj->get_custom_field('min_age'), '', false, true);
    ?>
				<?php 
    BYT_Theme_Utils::render_field("transmission", "", __('Transmission', 'bookyourtravel'), $car_rental_obj->get_custom_field('transmission_type') == 'manual' ? __('Manual', 'bookyourtravel') : __('Automatic', 'bookyourtravel'), '', false, true);
    ?>
				<?php 
    BYT_Theme_Utils::render_field("air_conditioned", "", __('Air-conditioned?', 'bookyourtravel'), $car_rental_obj->get_custom_field('is_air_conditioned') ? __('Yes', 'bookyourtravel') : __('No', 'bookyourtravel'), '', false, true);
    ?>
				<?php 
    BYT_Theme_Utils::render_field("unlimited_mileage", "", __('Unlimited mileage?', 'bookyourtravel'), $car_rental_obj->get_custom_field('is_unlimited_mileage') ? __('Yes', 'bookyourtravel') : __('No', 'bookyourtravel'), '', false, true);
    ?>
			</div>
			<?php 
    echo "<div class='actions'>";
    BYT_Theme_Utils::render_link_button($car_rental_obj->get_permalink(), "gradient-button", "", __('Book now', 'bookyourtravel'));
    echo "</div>";
    ?>
		</div>
	</div>
</article>
<!--//car rental item-->
<?php 
} else {
    ?>
	<li>
		<a href="<?php 
    echo esc_url($car_rental_obj->get_permalink());
    ?>
">
			<h3><?php 
		</article>
	</section>
	<!--//location-->
	<?php 
    }
    ?>
	<?php 
    if ($enable_reviews) {
        ?>
	<!--reviews-->
	<section id="reviews" class="tab-content <?php 
        echo $first_display_tab == 'review' ? 'initial' : '';
        ?>
">
		<?php 
        do_action('byt_show_single_accommodation_reviews_before');
        get_template_part('includes/parts/review', 'item');
        BYT_Theme_Utils::render_tab_extra_fields('accommodation_extra_fields', $accommodation_extra_fields, 'reviews', $accommodation_obj);
        do_action('byt_show_single_accommodation_reviews_after');
        ?>
	</section>
	<!--//reviews-->	
	<?php 
    }
    // if ($enable_reviews)
    ?>
	<?php 
    if ($accommodation_location != null) {
        ?>
	<!--things to do-->
	<section id="things-to-do" class="tab-content <?php 
Example #8
0
            $all_empty_fields = BYT_Theme_Utils::are_tab_fields_empty('tour_extra_fields', $tour_extra_fields, $tab['id'], $tour_obj);
            if (!$all_empty_fields) {
                ?>
			<section id="<?php 
                echo esc_attr($tab['id']);
                ?>
" class="tab-content <?php 
                echo $first_display_tab == $tab['id'] ? 'initial' : '';
                ?>
">
				<article>
					<?php 
                do_action('byt_show_single_tour_' . $tab['id'] . '_before');
                ?>
					<?php 
                BYT_Theme_Utils::render_tab_extra_fields('tour_extra_fields', $tour_extra_fields, $tab['id'], $tour_obj);
                ?>
					<?php 
                do_action('byt_show_single_tour_' . $tab['id'] . '_after');
                ?>
				</article>
			</section>
		<?php 
            }
        }
    }
    do_action('byt_show_single_tour_tab_content_after');
    ?>
</section>
<!--//tour content-->	
<?php 
 function repeat_review_field_option_type($option_name, $option, $values)
 {
     global $byt_theme_of_default_fields;
     $counter = 0;
     $default_values = $byt_theme_of_default_fields->get_default_review_fields_array($option['id']);
     if (!is_array($values) || count($values) == 0) {
         $values = $default_values;
     }
     $post_type = '';
     if ($option['id'] == 'accommodation_review_fields') {
         $post_type = 'accommodation';
     } elseif ($option['id'] == 'tour_review_fields') {
         $post_type = 'tour';
     } elseif ($option['id'] == 'cruise_review_fields') {
         $post_type = 'cruise';
     }
     $output = '<div class="of-repeat-loop">';
     $output .= '<ul class="sortable of-repeat-review-fields">';
     if (is_array($values)) {
         foreach ((array) $values as $key => $value) {
             if (isset($value['label']) && isset($value['post_type']) && isset($value['id'])) {
                 $output .= '<li class="ui-state-default of-repeat-group">';
                 $output .= '<input data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="input-field-id" name="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][id]') . '" type="hidden" value="' . esc_attr($value['id']) . '" />';
                 $output .= '<input data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][post_type]') . '" type="hidden" value="' . $post_type . '" />';
                 $output .= '<div class="of-input-wrap">';
                 $output .= '<label data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="of-label label-field-label" for="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][label]') . '">' . __('Field label', 'bookyourtravel') . '</label>';
                 $output .= '<input data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="of-input input-field-label" name="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][label]') . '" type="text" value="' . esc_attr($value['label']) . '" />';
                 $output .= '</div>';
                 $output .= '<label data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="of-label label-hide-field" for="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][hide]') . '">' . __('Is hidden?', 'bookyourtravel') . '</label>';
                 $output .= '<input data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="of-checkbox checkbox-hide-field" name="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][hide]') . '" type="checkbox" value="1" ' . (isset($value['hide']) && $value['hide'] == '1' ? 'checked' : '') . ' />';
                 if (isset($value['id']) && isset($value['label']) && count(BYT_Theme_Utils::custom_array_search($default_values, 'id', $value['id'])) == 0) {
                     $output .= '<span class="ui-icon ui-icon-close"></span>';
                 }
                 $output .= '</li><!--.of-repeat-group-->';
                 $counter++;
             }
         }
     }
     $output .= '<li class="to-copy ui-state-default of-repeat-group">';
     $output .= '<input class="input-post-type" data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="hidden" value="' . $post_type . '" />';
     $output .= '<div class="of-input-wrap">';
     $output .= '<label class="of-label label-field-label" for="' . esc_attr($option_name . '[' . $option['id'] . ']') . '">' . __('Field label', 'bookyourtravel') . '</label>';
     $output .= '<input class="of-input input-field-label" data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="text" value="' . esc_attr($option['std']) . '" />';
     $output .= '</div>';
     $output .= '<label class="of-label label-hide-field" for="' . esc_attr($option_name . '[' . $option['id'] . ']') . '">' . __('Is hidden?', 'bookyourtravel') . '</label>';
     $output .= '<input class="of-checkbox checkbox-hide-field" data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="checkbox" value="1" />';
     $output .= '<span class="ui-icon ui-icon-close"></span>';
     $output .= '</li><!--.of-repeat-group-->';
     $output .= '</ul><!--.sortable-->';
     $output .= '<a href="#" class="docopy_review_field button icon add">' . __('Add review field', 'bookyourtravel') . '</a>';
     $output .= '</div><!--.of-repeat-loop-->';
     return $output;
 }
				<p><?php 
_e('Total', 'bookyourtravel');
?>
</p>
				<p class="step_1_total_holder"></p>
			</div>
		</div>
	
		<h3><span>02 </span><?php 
_e('Submit booking', 'bookyourtravel');
?>
</h3>
		<div class="error" style="display:none;"><div><p></p></div></div>
		<div class="row twins">
			<div class="f-item">
				<label for="first_name"><?php 
_e('First name', 'bookyourtravel');
?>
</label>
				<input type="text" id="first_name" name="first_name" data-required />
			</div>
			<div class="f-item">
				<label for="last_name"><?php 
_e('Last name', 'bookyourtravel');
?>
</label>
				<input type="text" id="last_name" name="last_name" data-required />
			</div>
		</div>			
		<div class="row twins">
			<div class="f-item">
<?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>
Example #12
0
$reset_password_page_url = $byt_theme_globals->get_reset_password_page_url();
$terms_page_url = $byt_theme_globals->get_terms_page_url();
$redirect_to_after_login_url = $byt_theme_globals->get_redirect_to_after_login_page_url();
if (!$redirect_to_after_login_url) {
    $redirect_to_after_login_url = get_home_url();
}
$login = null;
if (isset($_POST['log']) && isset($_POST['bookyourtravel_login_form_nonce']) && wp_verify_nonce($_POST['bookyourtravel_login_form_nonce'], 'bookyourtravel_login_form')) {
    $login = wp_signon(array('user_login' => $_POST['log'], 'user_password' => $_POST['pwd'], 'remember' => isset($_POST['rememberme']) && $_POST['rememberme'] ? true : false), false);
    if (!is_wp_error($login)) {
        wp_redirect($redirect_to_after_login_url);
        exit;
    }
}
get_header();
BYT_Theme_Utils::breadcrumbs();
get_sidebar('under-header');
global $post;
$page_id = $post->ID;
$page_custom_fields = get_post_custom($page_id);
$page_sidebar_positioning = null;
if (isset($page_custom_fields['page_sidebar_positioning'])) {
    $page_sidebar_positioning = $page_custom_fields['page_sidebar_positioning'][0];
    $page_sidebar_positioning = empty($page_sidebar_positioning) ? '' : $page_sidebar_positioning;
}
$section_class = 'three-fourth';
if ($page_sidebar_positioning == 'both') {
    $section_class = 'one-half';
} else {
    if ($page_sidebar_positioning == 'left' || $page_sidebar_positioning == 'right') {
        $section_class = 'three-fourth';
Example #13
0
				<p><?php 
    _e('We apologize for any inconvenience, please hit back on your browser or if you are an admin, enter some content.', 'bookyourtravel');
    ?>
</p>
			</div>
		</article>
		<?php 
}
?>
		<!--bottom navigation-->
		<nav class="page-navigation bottom-nav">
			<a href="#" class="scroll-to-top" title="<?php 
esc_attr_e('Back up', 'bookyourtravel');
?>
"><?php 
_e('Back up', 'bookyourtravel');
?>
</a> 
			<div class="pager">
			<?php 
global $wp_query;
BYT_Theme_Utils::display_pager($wp_query->max_num_pages);
?>
			</div>
		</nav>
		<!--//bottom navigation-->
	</section>
	<!--//three-fourth content-->
<?php 
get_sidebar('right');
get_footer();
Example #14
0
		</div>
		<nav class="page-navigation bottom-nav">
			<!--back up button-->
			<a href="#" class="scroll-to-top" title="<?php 
    esc_attr_e('Back up', 'bookyourtravel');
    ?>
"><?php 
    _e('Back up', 'bookyourtravel');
    ?>
</a> 
			<!--//back up button-->
			<!--pager-->
			<div class="pager">
				<?php 
    $total_results = $accommodation_results['total'];
    BYT_Theme_Utils::display_pager(ceil($total_results / $posts_per_page));
    ?>
			</div>
		</nav>
	<?php 
}
// end if ( $query->have_posts() )
?>
	</div><!--//deals clearfix-->
</section>
<?php 
wp_reset_postdata();
wp_reset_query();
if ($page_sidebar_positioning == 'both' || $page_sidebar_positioning == 'right') {
    get_sidebar('right');
}
Example #15
0
<?php

global $post, $post_class, $display_mode, $byt_theme_globals, $byt_posts_post_type;
$post_id = $post->ID;
$post_obj = new byt_post($post);
$base_id = $post_obj->get_base_id();
$post_image = $post_obj->get_main_image();
if (empty($post_image)) {
    $post_image = BYT_Theme_Utils::get_file_uri('/images/uploads/img.jpg');
}
if (empty($display_mode) || $display_mode == 'card') {
    ?>
<!--post-->
<article class=" <?php 
    echo $post_class;
    ?>
">
	<div>
		<?php 
    if (!empty($post_image)) {
        ?>
		<figure>
			<a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
"><img src="<?php 
        echo esc_url($post_image);
        ?>
Example #16
0
        ?>
			<p>
				<?php 
        $price_string = '';
        if (!$show_currency_symbol_after) {
            $price_string = '<span class="curr">' . $default_currency_symbol . '</span>';
            $price_string .= '<span class="amount">' . number_format_i18n($tour_min_price, $price_decimal_places) . '</span>';
        } else {
            $price_string = '<span class="amount">' . number_format_i18n($tour_min_price, $price_decimal_places) . '</span>';
            $price_string .= '<span class="curr">' . $default_currency_symbol . '</span>';
        }
        if (!$is_price_per_group) {
            echo sprintf(__('From %s per person', 'bookyourtravel'), $price_string);
        } else {
            echo sprintf(__('From %s per group', 'bookyourtravel'), $price_string);
        }
        ?>
			</p>
			<?php 
    }
    ?>
			<?php 
    if ($score_out_of_10 > 0) {
        // display score out of 10
        BYT_Theme_Utils::render_field("", "rating", $score_out_of_10 . ' / 10', "", '', false, false);
    }
    ?>
		</a>
	</li>
<?php 
}
Example #17
0
 public static function get_post_descendants($parent_id, $post_type)
 {
     $children = array();
     $posts = get_posts(array('numberposts' => -1, 'post_status' => 'publish', 'post_type' => $post_type, 'post_parent' => $parent_id, 'suppress_filters' => false));
     foreach ($posts as $child) {
         $gchildren = BYT_Theme_Utils::get_post_descendants($child->ID, $post_type);
         if (!empty($gchildren)) {
             $children = array_merge($children, $gchildren);
         }
     }
     $children = array_merge($children, $posts);
     return $children;
 }
Example #18
0
    if ($enable_accommodations) {
        if ($show_hotel_count_in_location_items) {
            BYT_Theme_Utils::render_field("", "count", $hotel_count . ' ' . __('Hotels', 'bookyourtravel'), '', '', false);
        }
        if ($show_self_catered_count_in_location_items) {
            BYT_Theme_Utils::render_field("", "count", $self_catered_count . ' ' . __('Self-catered', 'bookyourtravel'), '', '', false);
        }
    }
    if ($enable_tours && $show_tour_count_in_location_items) {
        BYT_Theme_Utils::render_field("", "count", $tour_count . ' ' . __('Tours', 'bookyourtravel'), '', '', false);
    }
    if ($enable_cruises && $show_cruise_count_in_location_items) {
        BYT_Theme_Utils::render_field("", "count", $cruise_count . ' ' . __('Cruises', 'bookyourtravel'), '', '', false);
    }
    if ($enable_car_rentals && $show_car_rental_count_in_location_items) {
        BYT_Theme_Utils::render_field("", "count", $car_rental_count . ' ' . __('Car rentals', 'bookyourtravel'), '', '', false);
    }
    if ($accommodation_min_price > 0 && ($hotel_count || $self_catered_count)) {
        ?>
				<div class="ribbon">
					<div class="half hotel">
						<a href="<?php 
        echo esc_url($location_obj->get_permalink());
        ?>
#hotels" title="<?php 
        esc_attr_e('View all', 'bookyourtravel');
        ?>
">
							<span class="small"><?php 
        _e('from', 'bookyourtravel');
        ?>
 /**
  * Enqueues scripts and styles for admin.
  *
  * @since Book Your Travel 1.0
  */
 function enqueue_admin_scripts_styles()
 {
     wp_enqueue_script('jquery');
     wp_enqueue_script('jquery-effects-core');
     wp_enqueue_script('jquery-ui-core');
     wp_enqueue_script('jquery-ui-slider');
     wp_enqueue_script('jquery-ui-datepicker');
     wp_enqueue_script('jquery-ui-droppable');
     wp_enqueue_script('jquery-ui-draggable');
     wp_enqueue_script('jquery-ui-sortable');
     wp_enqueue_script('jquery-ui-selectable');
     wp_enqueue_script('jquery-ui-autocomplete');
     wp_enqueue_script('jquery-ui-tabs');
     wp_enqueue_script('jquery-ui-dialog');
     wp_enqueue_script('jquery-ui-spinner');
     wp_register_script('byt-admin', BYT_Theme_Utils::get_file_uri('/includes/admin/admin.js'), false, '1.0.0');
     wp_enqueue_script('byt-admin');
     wp_enqueue_style('byt-admin-ui-css', BYT_Theme_Utils::get_file_uri('/css/jquery-ui.min.css'), false);
     wp_enqueue_style('byt-admin-css', BYT_Theme_Utils::get_file_uri('/css/admin-custom.css'), false);
 }
Example #20
0
</h3>
			<?php 
if (isset($_GET['action']) && $_GET['action'] == 'resetpasswordnotification') {
    ?>
			<p class="success">
				<?php 
    _e('Please confirm the request to reset your password by clicking the link sent to your email address.', 'bookyourtravel');
    ?>
			</p>
			<?php 
} else {
    if (isset($_GET['action']) && $_GET['action'] == 'resetpassword' && isset($_GET['user_id']) && isset($_GET['resetpassword_key'])) {
        $user_id = wp_kses($_GET['user_id'], '', '');
        $resetpassword_key = wp_kses($_GET['resetpassword_key'], '', '');
        $new_password = BYT_Theme_Utils::resetpassword($user_id, $resetpassword_key);
        if ($new_password && BYT_Theme_Utils::newpassword_notification($user_id, $new_password)) {
            ?>
					<p class="success">
						<?php 
            _e('Your password was successfully reset. We have sent the new password to your email address.', 'bookyourtravel');
            ?>
					</p>
				<?php 
        } else {
            ?>
					<p class="error">
						<?php 
            _e('We encountered an error when attempting to reset your password. Please try again later.', 'bookyourtravel');
            ?>
					</p>
				<?php 
 public function get_cart_page_url()
 {
     $cart_page_url = '';
     if (function_exists('wc_get_page_id') && BYT_Theme_Utils::is_woocommerce_active()) {
         $cart_page_id = wc_get_page_id('cart');
         $cart_page_id = BYT_Theme_Utils::get_current_language_page_id($cart_page_id);
         $cart_page_url = get_permalink($cart_page_id);
     }
     return $cart_page_url;
 }
Example #22
0
        }
        // (!empty($my_account_page_url) || !empty($cart_page_url))
        ?>
						<li><a class="fn" href="<?php 
        echo wp_logout_url(home_url());
        ?>
"><?php 
        _e('Logout', 'bookyourtravel');
        ?>
</a></li>
						<?php 
    }
    ?>
					</ul>
					<?php 
    if (!BYT_Theme_Utils::is_woocommerce_active()) {
        ?>
					<?php 
    }
    ?>
					<?php 
    get_sidebar('header');
    ?>
				</nav>
			</div>
			<!--//ribbon-->
			<?php 
}
// endif (!$hide_header_ribbon)
?>
			<!--search-->
				<div class="f-item">
					<label for="your_name"><?php 
_e('Your name', 'bookyourtravel');
?>
</label>
					<input type="text" name="your_name" id="your_name" />
				</div>
			</div>
			<div class="row">
				<div class="f-item">
					<label for="your_email"><?php 
_e('Your email', 'bookyourtravel');
?>
</label>
					<input type="email" name="your_email" id="your_email" />
				</div>
			</div>
			<div class="row">
				<div class="f-item">
					<label for="your_phone"><?php 
_e('Your phone', 'bookyourtravel');
?>
</label>
					<input type="text" name="your_phone" id="your_phone" />
				</div>
			</div>
			<h3><?php 
_e('What would you like to inquire about?', 'bookyourtravel');
?>
</h3>
			<div class="f-item">
Example #24
0
            ?>
		<p>
		<?php 
            if (!empty($contact_error)) {
                echo $contact_error;
            } else {
                _e('Thank you for contacting us. We will get back to you as soon as we can.', 'bookyourtravel');
            }
            ?>
		</p>
		<?php 
        }
        if (!$form_submitted || !empty($contact_error)) {
            ?>
		<form action="<?php 
            echo esc_url(BYT_Theme_Utils::get_current_page_url());
            ?>
" id="contact-form" method="post">
			<fieldset>
				<div class="f-item">
					<label for="contact_name"><?php 
            _e('Your name', 'bookyourtravel');
            ?>
</label>
					<input type="text" id="contact_name" name="contact_name" required="required" value="<?php 
            echo esc_attr($contact_name);
            ?>
" />
				</div>
				<div class="f-item">
					<label for="contact_email"><?php 
 /**
  * Get the base ID of the post (ID of post in default language)
  *
  * @access public
  * @return int
  */
 public function get_base_id()
 {
     return apply_filters('bookyourtravel_entity_base_id', $this->post ? BYT_Theme_Utils::get_default_language_post_id($this->post->ID, $this->entity_type) : null, $this);
 }
Example #26
0
 function get_car_rental_booking($booking_id)
 {
     global $wpdb, $byt_multi_language_count;
     $table_name = BOOKYOURTRAVEL_CAR_RENTAL_BOOKINGS_TABLE;
     $sql = "SELECT \tDISTINCT bookings.*, \r\n\t\t\t\t\t\tcar_rentals.post_title car_rental_name,\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tSELECT MIN(booking_date) FROM " . BOOKYOURTRAVEL_CAR_RENTAL_BOOKING_DAYS_TABLE . " v2 \r\n\t\t\t\t\t\t\tWHERE v2.car_rental_booking_id = bookings.Id \r\n\t\t\t\t\t\t) from_day,\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tSELECT MAX(booking_date) FROM " . BOOKYOURTRAVEL_CAR_RENTAL_BOOKING_DAYS_TABLE . " v3 \r\n\t\t\t\t\t\t\tWHERE v3.car_rental_booking_id = bookings.Id \r\n\t\t\t\t\t\t) to_day, \r\n\t\t\t\t\t\tlocations.ID pick_up_location_id, \r\n\t\t\t\t\t\tlocations_2.ID drop_off_location_id,\t\t\t\t\t\r\n\t\t\t\t\t\tlocations.post_title pick_up, \r\n\t\t\t\t\t\tlocations_2.post_title drop_off\r\n\t\t\t\tFROM " . $table_name . " bookings \r\n\t\t\t\tINNER JOIN {$wpdb->posts} car_rentals ON car_rentals.ID = bookings.car_rental_id ";
     if (defined('ICL_LANGUAGE_CODE') && (BYT_Theme_Utils::get_default_language() != ICL_LANGUAGE_CODE || $byt_multi_language_count > 1)) {
         $sql .= " INNER JOIN " . $wpdb->prefix . "icl_translations translations ON translations.element_type = 'post_car_rental' AND translations.language_code='" . ICL_LANGUAGE_CODE . "' AND translations.element_id = car_rentals.ID ";
         $sql .= " INNER JOIN " . $wpdb->prefix . "icl_translations translations_default ON translations_default.element_type = 'post_car_rental' AND translations_default.language_code='" . BYT_Theme_Utils::get_default_language() . "' AND translations_default.trid = translations.trid ";
     }
     $sql .= "LEFT JOIN {$wpdb->postmeta} car_rental_meta_location ON car_rentals.ID=car_rental_meta_location.post_id AND car_rental_meta_location.meta_key='car_rental_location_post_id'\r\n\t\t\t\tLEFT JOIN {$wpdb->posts} locations ON locations.ID = car_rental_meta_location.meta_value+0\r\n\t\t\t\tLEFT JOIN {$wpdb->posts} locations_2 ON locations_2.ID = bookings.drop_off\r\n\t\t\t\tWHERE car_rentals.post_status = 'publish' AND locations.post_status = 'publish' AND locations_2.post_status = 'publish' AND bookings.Id = {$booking_id} ";
     return $wpdb->get_row($sql);
 }
Example #27
0
 function sync_cruise_min_price($cruise_id, $min_price, $force = false)
 {
     $last_update_time = get_post_meta($cruise_id, '_cruise_min_price_last_update', true);
     $last_update_time = isset($last_update_time) && !empty($last_update_time) ? $last_update_time : time();
     $time_today = time();
     $diff_hours = ($time_today - $last_update_time) / (60 * 60);
     if ($diff_hours > 24 || $force) {
         $cruise_id = BYT_Theme_Utils::get_default_language_post_id($cruise_id, 'cruise');
         $languages = BYT_Theme_Utils::get_active_languages();
         foreach ($languages as $language) {
             $language_cruise_id = BYT_Theme_Utils::get_language_post_id($cruise_id, 'cruise', $language);
             update_post_meta($language_cruise_id, '_cruise_min_price', $min_price);
             update_post_meta($language_cruise_id, '_cruise_min_price_last_update', time());
         }
     }
 }
<?php

require_once BYT_Theme_Utils::get_file_path('/includes/post_types/reviews.php');
require_once BYT_Theme_Utils::get_file_path('/includes/post_types/locations.php');
require_once BYT_Theme_Utils::get_file_path('/includes/post_types/facilities.php');
require_once BYT_Theme_Utils::get_file_path('/includes/post_types/room_types.php');
require_once BYT_Theme_Utils::get_file_path('/includes/post_types/accommodations.php');
require_once BYT_Theme_Utils::get_file_path('/includes/post_types/tours.php');
require_once BYT_Theme_Utils::get_file_path('/includes/post_types/cabin_types.php');
require_once BYT_Theme_Utils::get_file_path('/includes/post_types/cruises.php');
require_once BYT_Theme_Utils::get_file_path('/includes/post_types/car_rentals.php');
require_once BYT_Theme_Utils::get_file_path('/includes/post_types/posts.php');
class BYT_Theme_Post_Types extends BYT_BaseSingleton
{
    private $user_account_custom_meta_fields;
    private $user_account_meta_box;
    private $user_content_list_custom_meta_fields;
    private $user_content_list_meta_box;
    private $enable_accommodations;
    protected function __construct()
    {
        global $byt_theme_globals;
        $this->enable_accommodations = $byt_theme_globals->enable_accommodations();
        if ($this->enable_accommodations) {
            $this->user_account_custom_meta_fields = array(array('label' => __('Is partner page?', 'bookyourtravel'), 'desc' => __('If checked, will display partner (front end submit) pages and menus', 'bookyourtravel'), 'id' => 'user_account_is_partner_page', 'type' => 'checkbox'));
            $user_content_types = array();
            $user_content_types[] = array('value' => 'accommodation', 'label' => __('Accommodation', 'bookyourtravel'));
            $user_content_types[] = array('value' => 'vacancy', 'label' => __('Accommodation vacancy', 'bookyourtravel'));
            $user_content_types[] = array('value' => 'room_type', 'label' => __('Room type', 'bookyourtravel'));
            $this->user_content_list_custom_meta_fields = array(array('label' => __('User content type', 'bookyourtravel'), 'id' => 'user_content_type', 'type' => 'select', 'options' => $user_content_types));
        }
Example #29
0
?>
				<?php 
$tags = $car_rental_obj->get_tags();
if (count($tags) > 0) {
    ?>
				<div class="tags">
					<ul>
						<?php 
    foreach ($tags as $tag) {
        echo '<li>' . $tag->name . '</li>';
    }
    ?>
						
					</ul>
				</div>
				<?php 
}
?>
				<?php 
if ($car_rental_obj->get_custom_field('contact_email')) {
    BYT_Theme_Utils::render_link_button("#", "gradient-button right contact-car_rental", "", __('Send inquiry', 'bookyourtravel'));
}
?>
			</article>				
		</li>			
	<?php 
wp_reset_postdata();
dynamic_sidebar('right-car_rental');
?>
	</ul>
</aside><!-- #secondary -->
 function render_entry_form()
 {
     global $byt_cruises_post_type;
     $cruise_id = 0;
     $cabin_type_id = 0;
     $schedule_object = null;
     $cruise_obj = null;
     $cabin_type_obj = null;
     $is_price_per_person = 0;
     $cruise_type_is_repeated = 0;
     // on-off cruise by default
     $edit = isset($_GET['edit']) ? absint($_GET['edit']) : "";
     if (!empty($edit)) {
         $schedule_object = $byt_cruises_post_type->get_cruise_schedule($edit);
     }
     if (isset($_POST['cruises_select'])) {
         $cruise_id = wp_kses($_POST['cruises_select'], '');
     } else {
         if ($schedule_object != null) {
             $cruise_id = $schedule_object->cruise_id;
         }
     }
     if ($cruise_id) {
         $cruise_obj = new byt_cruise(intval($cruise_id));
         $cruise_id = $cruise_obj->get_base_id();
         $cruise_type_is_repeated = $cruise_obj->get_type_is_repeated();
         $is_price_per_person = $cruise_obj->get_is_price_per_person();
     }
     if (isset($_POST['cabin_types_select'])) {
         $cabin_type_id = wp_kses($_POST['cabin_types_select'], '');
     } else {
         if ($schedule_object) {
             $cabin_type_id = $schedule_object->cabin_type_id;
         }
     }
     if (!empty($cabin_type_id)) {
         $cabin_type_id = BYT_Theme_Utils::get_default_language_post_id($cabin_type_id, 'cabin_type');
     }
     $cruises_select = '<select id="cruises_select" name="cruises_select">';
     $cruises_select .= '<option value="">' . __('Select cruise', 'bookyourtravel') . '</option>';
     $author_id = null;
     if (!is_super_admin()) {
         $author_id = get_current_user_id();
     }
     $cruise_results = $byt_cruises_post_type->list_cruises(0, -1, 'title', 'ASC', 0, array(), array(), array(), false, $author_id);
     if (count($cruise_results) > 0 && $cruise_results['total'] > 0) {
         foreach ($cruise_results['results'] as $cruise_result) {
             global $post;
             $post = $cruise_result;
             setup_postdata($post);
             $cruises_select .= '<option value="' . $post->ID . '" ' . ($post->ID == $cruise_id ? 'selected' : '') . '>' . $post->post_title . '</option>';
         }
     }
     $cruises_select .= '</select>';
     $cabin_types_select = '<select class="normal" id="cabin_types_select" name="cabin_types_select">';
     $cabin_types_select .= '<option value="">' . __('Select cabin type', 'bookyourtravel') . '</option>';
     if ($cruise_obj) {
         $cabin_type_ids = $cruise_obj->get_cabin_types();
         if ($cabin_type_ids && count($cabin_type_ids) > 0) {
             for ($i = 0; $i < count($cabin_type_ids); $i++) {
                 $temp_id = $cabin_type_ids[$i];
                 $cabin_type_obj = new byt_cabin_type(intval($temp_id));
                 $cabin_types_select .= '<option value="' . $temp_id . '" ' . ($temp_id == $cabin_type_id ? 'selected' : '') . '>' . $cabin_type_obj->get_title() . '</option>';
             }
         }
     }
     $cabin_types_select .= '</select>';
     $start_date = null;
     if (isset($_POST['start_date'])) {
         $start_date = wp_kses($_POST['start_date'], '');
     } else {
         if ($schedule_object != null) {
             $start_date = $schedule_object->start_date;
         }
     }
     if (isset($start_date)) {
         $start_date = date($this->date_format, strtotime($start_date));
     }
     $duration_days = 0;
     if (isset($_POST['duration_days'])) {
         $duration_days = intval(wp_kses($_POST['duration_days'], '0'));
     } else {
         if ($schedule_object != null) {
             $duration_days = $schedule_object->duration_days;
         }
     }
     $cabin_count = 1;
     if (isset($_POST['cabin_count'])) {
         $cabin_count = intval(wp_kses($_POST['cabin_count'], '1'));
     } else {
         if ($schedule_object && isset($schedule_object->cabin_count)) {
             $cabin_count = $schedule_object->cabin_count;
         }
     }
     if ($cabin_count == 0) {
         $cabin_count = 1;
     }
     $price = 0;
     if (isset($_POST['price'])) {
         $price = floatval(wp_kses($_POST['price'], '2'));
     } else {
         if ($schedule_object != null) {
             $price = $schedule_object->price;
         }
     }
     $price_child = 0;
     if ($is_price_per_person) {
         if (isset($_POST['price_child'])) {
             $price_child = floatval(wp_kses($_POST['price_child'], '2'));
         } else {
             if ($schedule_object != null) {
                 $price_child = $schedule_object->price_child;
             }
         }
     }
     $end_date = null;
     if (isset($_POST['end_date'])) {
         $end_date = wp_kses($_POST['end_date'], '');
     } else {
         if ($schedule_object != null) {
             $end_date = $schedule_object->end_date;
         }
     }
     if (isset($end_date)) {
         $end_date = date($this->date_format, strtotime($end_date));
     }
     if ($schedule_object) {
         echo '<h3>' . __('Update Cruise Schedule Entry', 'bookyourtravel') . '</h3>';
     } else {
         echo '<h3>' . __('Add Cruise Schedule Entry', 'bookyourtravel') . '</h3>';
     }
     echo '<form id="cruise_schedule_entry_form" method="post" action="' . esc_url($_SERVER['REQUEST_URI']) . '" style="clear: both;">';
     echo wp_nonce_field('cruise_schedule_entry_form');
     echo '<table cellpadding="3" class="form-table"><tbody>';
     echo '<tr>';
     echo '	<th scope="row" valign="top">' . __('Select cruise', 'bookyourtravel') . '</th>';
     echo '	<td>' . $cruises_select . '</td>';
     echo '</tr>';
     echo '<tr>';
     echo '	<th scope="row" valign="top">' . __('Select cabin type', 'bookyourtravel') . '</th>';
     echo '	<td>' . $cabin_types_select . '</td>';
     echo '</tr>';
     echo '<tr id="cabin_count">';
     echo '	<th scope="row" valign="top">' . __('Number of cabins available', 'bookyourtravel') . '</th>';
     echo '	<td><input type="text" name="cabin_count" id="cabin_count" value="' . $cabin_count . '" /></td>';
     echo '</tr>';
     echo '<tr>';
     echo '	<th scope="row" valign="top">' . __('Duration (days)', 'bookyourtravel') . '</th>';
     echo '	<td><input type="text" name="duration_days" id="duration_days" value="' . $duration_days . '" /></td>';
     echo '</tr>';
     echo '<tr>';
     echo '	<th scope="row" valign="top">' . __('Start date', 'bookyourtravel') . '</th>';
     echo '	<td>';
     echo '		<script>';
     echo '			window.datepickerStartDateValue = "' . $start_date . '";';
     echo '  	</script>';
     echo '  	<input class="datepicker" type="text" name="datepicker_start_date" id="datepicker_start_date" />';
     echo '		<input type="hidden" name="start_date" id="start_date" />';
     echo '	</td>';
     echo '</tr>';
     echo '<tr class="is_repeated" ' . ($cruise_type_is_repeated ? '' : 'style="display:none"') . '>';
     echo '	<th scope="row" valign="top">' . __('End date', 'bookyourtravel') . '</th>';
     echo '	<td>';
     echo '		<script>';
     echo '			window.datepickerEndDateValue = "' . $end_date . '";';
     echo '  	</script>';
     echo '  	<input class="datepicker" type="text" name="datepicker_end_date" id="datepicker_end_date" />';
     echo '		<input type="hidden" name="end_date" id="end_date" />';
     echo '	</td>';
     echo '</tr>';
     echo '<tr>';
     echo '	<th scope="row" valign="top">' . __('Price', 'bookyourtravel') . ' <span class="per_person" ' . ($is_price_per_person ? '' : 'style="display:none"') . '>' . __('per adult', 'bookyourtravel') . '</span> <span class="per_person" ' . (!$is_price_per_person ? '' : 'style="display:none"') . '>' . __('per cabin', 'bookyourtravel') . '</span></th>';
     echo '	<td><input type="text" name="price" id="price" value="' . $price . '" /></td>';
     echo '</tr>';
     echo '<tr class="per_person" ' . ($is_price_per_person ? '' : 'style="display:none"') . '>';
     echo '	<th scope="row" valign="top">' . __('Price per child', 'bookyourtravel') . '</th>';
     echo '	<td><input type="text" name="price_child" id="price_child" value="' . $price_child . '" /></td>';
     echo '</tr>';
     echo '</table>';
     echo '<p>';
     echo '<a href="edit.php?post_type=cruise&page=theme_cruise_schedule_admin.php" class="button-secondary">' . __('Cancel', 'bookyourtravel') . '</a>&nbsp;';
     if ($schedule_object) {
         echo '<input id="schedule_id" name="schedule_id" value="' . $edit . '" type="hidden" />';
         echo '<input class="button-primary" type="submit" name="update" value="' . __('Update Cruise Schedule Entry', 'bookyourtravel') . '"/>';
     } else {
         echo '<input class="button-primary" type="submit" name="insert" value="' . __('Add Cruise Schedule Entry', 'bookyourtravel') . '"/>';
     }
     echo '</p>';
     echo '</form>';
 }