<?php
/**
 * Template Name: Contact
*/

get_header(); get_template_part( 'template-parts/banner' );

$img_bg = get_theme_mod('vw_book_store_pro_contact_page_image_bg');
if( get_theme_mod('vw_book_store_pro_contact_page_bg_color','') ) {
  $about_backg = 'background-color:'.esc_attr(get_theme_mod('vw_book_store_pro_contact_page_bg_color','')).';';
}elseif( get_theme_mod('vw_book_store_pro_contact_page_bg_image','') ){
  $about_backg = 'background-image:url(\''.esc_url(get_theme_mod('vw_book_store_pro_contact_page_bg_image')).'\')';
}else{
  $about_backg = '';
}
?>
<?php do_action('vw_book_store_pro_before_contact_title'); ?>
<div class="contact-box">
	<div class="container">
		<div class="contact-color-bg <?php echo esc_attr($img_bg); ?>" style="<?php echo esc_attr($about_backg); ?>">
			<div class="contact-info text-center row m-0">
				<?php if ( get_theme_mod('vw_book_store_pro_address_title',true) != "" ) { ?>
				<div class="contact-address col-lg-3 col-md-6">
					<div class="inner-cont">
						<div class="c_icon">
							<i class="fas fa-location-arrow"></i>
						</div>
						<div class="c_content media-small mt-3 mb-3">
							<span class="font-weight-bold text-uppercase"><?php echo (get_theme_mod('vw_book_store_pro_address_title')); ?></span>
							<p class="m-0"><a href="http://maps.google.com/?q=1200<?php echo (get_theme_mod('vw_book_store_pro_address')); ?>"target="_blank"><?php echo (get_theme_mod('vw_book_store_pro_address')); ?></a></p>
						</div>
					</div>
				</div>
				<?php }?>
				<?php if ( get_theme_mod('vw_book_store_pro_contactpage_email_title',true) != "" ) { ?>
				<div class="contact-email col-lg-3 col-md-6">
					<div class="inner-cont">
						<div class="c_icon">
							<i class="far fa-envelope-open"></i>
						</div>
						<div class="c_content media-small mt-3 mb-3">
							<span class="w-100 font-weight-bold text-uppercase"><?php echo esc_html(get_theme_mod('vw_book_store_pro_contactpage_email_title')); ?></span>
							<p class="m-0">
								 <a href="mailto:<?php echo esc_html( get_theme_mod('vw_book_store_pro_header_email_address') ); ?>" target="_blank"><?php echo esc_html( get_theme_mod('vw_book_store_pro_contactpage_email') ); ?></a>
							</p>
						</div>
					</div>
				</div>
				<?php }?>
								
				<?php if ( get_theme_mod('vw_book_store_pro_contactpage_phone_title',true) != "" ) { ?>
				<div class="contact-phone col-lg-3 col-md-6">
					<div class="inner-cont text-center">
						<div class="c_icon">
							<i class="fas fa-phone-volume"></i>
						</div>
						<div class="c_content media-small mt-3 mb-3">
			 				<span class="font-weight-bold text-uppercase"><?php echo esc_html(get_theme_mod('vw_book_store_pro_contactpage_phone_title')); ?></span>
			 				<p class="m-0">
			 					<a href="tel:<?php echo esc_html( get_theme_mod('vw_book_store_pro_contactpage_phone') ); ?>"><?php echo esc_html( get_theme_mod('vw_book_store_pro_contactpage_phone') ); ?></a>
			 				</p>
			 			</div>
			 		</div>
	 			</div>
	 			<?php }?>
	 			<?php if ( get_theme_mod('vw_book_store_pro_contactpage_working_hours_title',true) != "" ) { ?>
				<div class="contact-phone col-lg-3 col-md-6">
					<div class="inner-cont">
						<div class="c_icon">
							<i class="fas fa-calendar-alt"></i>
						</div>
						<div class="c_content media-small mt-3 mb-3">
			 				<span class="font-weight-bold text-uppercase"><?php echo esc_html(get_theme_mod('vw_book_store_pro_contactpage_working_hours_title')); ?></span>
			 				<p class="m-0"><?php echo esc_html(get_theme_mod('vw_book_store_pro_contactpage_working_hours')); ?></p>
			 			</div>
			 		</div>
	 			</div>
	 			<?php }?>
			</div>
		</div>
		<div class="row">
			<div class="col-md-8 offset-2">
		<div class="contac_form">
			<div class="text-center">
				<?php if(get_theme_mod('vw_book_store_pro_contactpage_form_title') != ''){?>
			      <h3><?php echo esc_html(get_theme_mod('vw_book_store_pro_contactpage_form_title')); ?></h3>
			    <?php }
			    if(get_theme_mod('vw_book_store_pro_contactpage_form_subtitle') != ''){ ?>
			      <p class="subtitle"><?php echo esc_html(get_theme_mod('vw_book_store_pro_contactpage_form_subtitle')); ?></p>
			    <?php } ?>
			    
			</div>
			<?php echo do_shortcode(get_theme_mod('vw_book_store_pro_contactpage_shortcode','[contact-form-7 id="154" title="contact page"]','vw-book-store-pro')); ?> 
			<?php while ( have_posts() ) : the_post(); ?>
	        	<?php the_content(); ?>
	    	<?php endwhile; // end of the loop. ?>
		</div>
	</div>
	</div>
	</div>	
	<?php do_action('vw_book_store_pro_before_map'); ?>
		<section class="google-map text-center p-0" id="map">
			<?php if ( get_theme_mod('vw_book_store_pro_address_latitude',true) != "" && get_theme_mod('vw_book_store_pro_address_longitude',true) != "" ) {?>
			  <embed width="100%" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=<?php echo esc_attr(get_theme_mod('vw_book_store_pro_address_latitude')); ?>,<?php echo esc_attr(get_theme_mod('vw_book_store_pro_address_longitude')); ?>&hl=es;z=14&amp;output=embed"></embed>
			<?php }?>
		</section>
	<?php do_action('vw_book_store_pro_after_map'); ?>
</div>
<?php do_action('vw_book_store_pro_before_footer'); ?>

<?php get_footer(); ?>