<?php

// Template Name: Home Page Template

get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<section id="banner">
	<div class="banner-inner" style="background-image: url('<?php the_field('banner_image'); ?>');">
		<div class="container">
			<div class="imr">
				<div class="im-12">
					<div class="banner-contents">
						<?php the_field('banner_contents'); ?>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>

<section id="about">
	<div class="container">
		<div class="imr">
			<div class="im-12">
				<div class="about-contents">
					<?php the_field('about_contents'); ?>
				</div>
				<div class="about-expendeture">
					<div class="about-box">
						<div class="about-box-left">
					        <?php the_field('about_box_left'); ?>
						</div>
						<div class="about-box-right">
					        <?php the_field('about_box_right'); ?>
						</div>
					</div>
					<div class="scott">
						<div class="scott-image">
							<img src="<?php the_field('scott_image'); ?>" alt="">
						</div>
						<div class="scott-contents">
					        <?php the_field('scott_contents'); ?>
						</div>
					</div>
				</div>
				<div class="expendeture-controller">
					<button id="expendeture"><i>Read More +</i><strong>Read Less-</strong></button>
					<button id="contact-btn" class="contact-poper">Contact us</button>
				</div>
			</div>
		</div>
	</div>
</section>

<section id="accordion">
<div class="single-accordion">
<div class="accordion-controller">Solutions</div>
<section id="solutions">
	<div class="solution-inner">
		<div class="container">
			<div class="imr">
				<div class="im-12">
					<div class="solution-top">
						<div class="solution-left">
							<?php the_field('solution_left'); ?>
						</div>
						<div class="solution-right">
							<?php the_field('solution_right'); ?>
						</div>
					</div>
					<div class="solution-boxs">
	                 <?php if( have_rows('solution_boxs') ): ?>
	                    <?php while ( have_rows('solution_boxs') ) : the_row(); ?>
						<div class="single-solution-box">
							<?php the_sub_field('solution_box_contents'); ?>
						</div>
						<?php endwhile; else : endif; ?>
					</div>
					<div class="solution-bottom">
						<?php the_field('solution_bottom_contents'); ?>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
</div>

<div class="single-accordion">
<div class="accordion-controller">Markets</div>
<section id="markets">
	<div class="market-top">
		<div class="container">
			<div class="imr">
				<div class="im-12">
					<div class="market-top-contents">
						<?php the_field('market_top_contents'); ?>
					</div>
					<div class="market-items">
	                 <?php if( have_rows('market_items') ): ?>
	                    <?php while ( have_rows('market_items') ) : the_row(); ?>
						<div class="single-market-items">
							<?php the_sub_field('market_single_item'); ?>
						</div>
						<?php endwhile; else : endif; ?>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="market-bottom">
		<div class="container">
			<div class="imr">
				<div class="im-12">
					<div class="market-bottom-contents">
						<?php the_field('market_bottom_contents'); ?>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
</div>

<div class="single-accordion">
<div class="accordion-controller">Dealership Report</div>
<section id="dealership">
	<div class="container">
		<div class="imr">
			<div class="im-12">
				<div class="dealership-inner">
					<div class="dealership-tag"><?php the_field('dealership_tag'); ?></div>
					<div class="dealership-hooks">
						<div class="dealership-controller">
							<div class="tab">
								<div class="tab-filter"><strong>Filter:</strong></div>
								<div class="tab-expend-inner">
			                 <?php if( have_rows('filter') ): ?>
			                    <?php while ( have_rows('filter') ) : the_row(); ?>
							  <button class="tablinks" onclick="openReport(event, '<?php if( get_sub_field('report_item_controller') == 'Report_one' ): ?>Report_one<?php endif; ?><?php if( get_sub_field('report_item_controller') == 'Report_two' ): ?>Report_two<?php endif; ?><?php if( get_sub_field('report_item_controller') == 'Report_three' ): ?>Report_three<?php endif; ?><?php if( get_sub_field('report_item_controller') == 'Report_four' ): ?>Report_four<?php endif; ?><?php if( get_sub_field('report_item_controller') == 'Report_five' ): ?>Report_five<?php endif; ?><?php if( get_sub_field('report_item_controller') == 'Report_six' ): ?>Report_six<?php endif; ?><?php if( get_sub_field('report_item_controller') == 'Report_seven' ): ?>Report_seven<?php endif; ?><?php if( get_sub_field('report_item_controller') == 'Report_eight' ): ?>Report_eight<?php endif; ?><?php if( get_sub_field('report_item_controller') == 'Report_nine' ): ?>Report_nine<?php endif; ?><?php if( get_sub_field('report_item_controller') == 'Report_ten' ): ?>Report_ten<?php endif; ?>')"><?php the_sub_field('tab_filter_name_text'); ?></button>
								<?php endwhile; else : endif; ?>
								</div>
								<div class="tab-expend"></div>
							</div>
						</div>

						<div class="dealership-reports-item">

			                 <?php if( have_rows('dealership_reports') ): ?>
			                    <?php while ( have_rows('dealership_reports') ) : the_row(); ?>

							<div id="<?php if( get_sub_field('report_item_tag') == 'Report_one' ): ?>Report_one<?php endif; ?><?php if( get_sub_field('report_item_tag') == 'Report_two' ): ?>Report_two<?php endif; ?><?php if( get_sub_field('report_item_tag') == 'Report_three' ): ?>Report_three<?php endif; ?><?php if( get_sub_field('report_item_tag') == 'Report_four' ): ?>Report_four<?php endif; ?><?php if( get_sub_field('report_item_tag') == 'Report_five' ): ?>Report_five<?php endif; ?><?php if( get_sub_field('report_item_tag') == 'Report_six' ): ?>Report_six<?php endif; ?><?php if( get_sub_field('report_item_tag') == 'Report_seven' ): ?>Report_seven<?php endif; ?><?php if( get_sub_field('report_item_tag') == 'Report_eight' ): ?>Report_eight<?php endif; ?><?php if( get_sub_field('report_item_tag') == 'Report_nine' ): ?>Report_nine<?php endif; ?><?php if( get_sub_field('report_item_tag') == 'Report_ten' ): ?>Report_ten<?php endif; ?>" class="tabcontent">
								<div class="report-top">
									<ul>
										<li>Number Of Vehicles: <strong> <?php the_sub_field('report_vehicles'); ?></strong></li>
										<li>Market Size: <strong> <?php the_sub_field('report_market_size'); ?> </strong></li>
									</ul>
								</div>
								<div class="report-main">
					                 <?php if( have_rows('report_row') ): ?>
					                    <?php while ( have_rows('report_row') ) : the_row(); ?>
									<div class="report-row">
					                 <?php if( have_rows('report_columns') ): ?>
					                    <?php while ( have_rows('report_columns') ) : the_row(); ?>
										<div class="report-column">
											<?php the_sub_field('report_column'); ?>
										</div>
									<?php endwhile; else : endif; ?>
									</div>
									<?php endwhile; else : endif; ?>
								</div>
							</div>
							<?php endwhile; else : endif; ?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
</div>
</section>
<?php endwhile; ?>
<?php get_footer(); ?>
