<?php
/**
 * Template part for displaying single posts.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Purity_System
 */

?>
<div class="row purity-product-cols">
	<div class="col-md-8">
		<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
			<header class="entry-header">
				<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
			</header><!-- .entry-header -->

			<div class="entry-content">
				<?php the_content(); ?>

		</article><!-- #post-## -->
	</div>
	<div class="col-md-4 product-equipment-details">
		<div class="side-by-side-links">
			<a href="?print" target="_blank" class="print-product-btn">Print or Save</a>
			<div class="clearfix"></div>
		</div>
		<div class="equipment-table-wrapper">
			<h3>Equipment Details</h3>
			<table>
				<?php if(_purity_get_field('vehicle_length')):?>
					<tr>
						<th>Vehicle Length (Bumper to Bumper)</th>
						<td><?php echo _purity_get_field('vehicle_length');?></td>
					</tr>
				<?php endif;?>
				<?php if(_purity_get_field('vehicle_width')):?>
					<tr>
						<th>Vehicle Width (Side Mirror to Side Mirror)</th>
						<td><?php echo _purity_get_field('vehicle_width');?></td>
					</tr>
				<?php endif;?>
				<?php if(_purity_get_field('vehicle_height_1')):?>
					<tr>
						<th>Vehicle Height (Ground to Roof Rack)</th>
						<td><?php echo _purity_get_field('vehicle_height_1');?></td>
					</tr>
				<?php endif;?>
				<?php if(_purity_get_field('vehicle_height_2')):?>
					<tr>
						<th>Vehicle Height (Ground to Top of Crane)</th>
						<td><?php echo _purity_get_field('vehicle_height_2');?></td>
					</tr>
				<?php endif;?>
				<?php if(_purity_get_field('vehicle_height_3')):?>
					<tr>
						<th>Vehicle Height (Ground to Top of Crane w/ 26’ Ext.)</th>
						<td><?php echo _purity_get_field('vehicle_height_3');?></td>
					</tr>
				<?php endif;?>
				<?php if(_purity_get_field('front_wheel_width')):?>
					<tr>
						<th>Front Wheel Width</th>
						<td><?php echo _purity_get_field('front_wheel_width');?></td>
					</tr>
				<?php endif;?>
				<?php if(_purity_get_field('rear_wheel_width')):?>
					<tr>
						<th>Rear Wheel Width</th>
						<td><?php echo _purity_get_field('rear_wheel_width');?></td>
					</tr>
				<?php endif;?>
				<?php if(_purity_get_field('maximum_speed')):?>
					<tr>
						<th>Maximum Speed</th>
						<td><?php echo _purity_get_field('maximum_speed');?></td>
					</tr>
				<?php endif;?>
				<?php if(_purity_get_field('passenger_capacity')):?>
					<tr>
						<th>Passenger Capacity</th>
						<td><?php echo _purity_get_field('passenger_capacity');?></td>
					</tr>
				<?php endif;?>

				<?php if(_purity_get_field('other_equipments')):?>
					<?php $other_equipments = _purity_get_field('other_equipments'); ?>
					<?php foreach ($other_equipments as $equipment): ?>
						<tr>
							<th><?php echo $equipment['heading'];?></th>
							<td><?php echo $equipment['data'];?></td>
						</tr>
					<?php endforeach ?>
				<?php endif;?>
			</table>
		</div>
	</div>
</div>
