<?php 
get_header();
if($_GET['utm_source']){
    $source = $_GET['utm_source'];
	$_SESSION['utm_source'] = $source;
}
if($_GET['utm_medium']){
    $medium = $_GET['utm_medium'];
	$_SESSION['utm_medium'] = $medium;
}

if($_GET['utm_campaign']){
     $campaign = $_GET['utm_campaign'];
	$_SESSION['utm_campaign'] = $campaign;
}
?>
<section class="walkthrough-section">
    <link rel="stylesheet" href='<?= get_template_directory_uri(); ?>/css/walkthrough.css?v=<?= time(); ?>'>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/css/select2.min.css?v=<?= time(); ?>" />
    <style>
        .walkthrough-section h2 {
            color: #CC6D06;
            font-weight: 400;
            margin-bottom: 1em;
        }
        .walk-more-info p {
            color: inherit;
        }
        .walk-more-info{
            margin-top: 11em;
        }
        .walk-more-info-home{
            margin-top: 20px;
        }
        .walk-more-info-home p{
            background: none;
        }
        .walkthrough-vehicles img{ margin:0 auto}
    </style>
	<div class="form-primary-section">
	<div class="form-info home-form">
    <!--<form method="post" id="first-form" action="<?php //admin_url('admin-ajax.php'); ?><?=get_site_url();?>/car-loan-application/">-->
        <ul class="walkthrough wrapped">
            <li class="walkthrough-step">
                <h1>Let's customize your auto financing strategy.</h1>
                <h2>What vehicle do you want?</h2>
                <ul class="walkthrough-vehicles">
                    <li>
                        <label>
                            <span class="control-checkbox"><input type="checkbox" name="vehicles[]" value="Suv" <?php if (isset($_GET['vehicle']) && $_GET['vehicle'] == 'suv') echo ' checked'; ?>><i></i></span>
                            <div class="vehicle">
                                <img src="<?= get_template_directory_uri(); ?>/img/vehicle-suv.jpg" alt="Suv">
                                <strong>SUVs</strong>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <span class="control-checkbox"><input type="checkbox" name="vehicles[]" value="Van" <?php if (isset($_GET['vehicle']) && $_GET['vehicle'] == 'van') echo ' checked'; ?>><i></i></span>
                            <div class="vehicle">
                                <img src="<?= get_template_directory_uri(); ?>/img/vehicle-van.jpg" alt="Van">
                                <strong>Vans</strong>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <span class="control-checkbox"><input type="checkbox" name="vehicles[]" value="Car" <?php if (isset($_GET['vehicle']) && $_GET['vehicle'] == 'car') echo ' checked'; ?>><i></i></span>
                            <div class="vehicle">
                                <img src="<?= get_template_directory_uri(); ?>/img/vehicle-car.jpg" alt="Car">
                                <strong>Cars</strong>
                            </div>
                        </label>
                    </li>
                    <li>
                        <label>
                            <span class="control-checkbox"><input type="checkbox" name="vehicles[]" value="Truck" <?php if (isset($_GET['vehicle']) && $_GET['vehicle'] == 'truck') echo ' checked'; ?>><i></i></span>
                            <div class="vehicle">
                                <img src="<?= get_template_directory_uri(); ?>/img/vehicle-truck.jpg" alt="Truck">
                                <strong>Trucks</strong>
                            </div>
                        </label>
                    </li>
                </ul>
                <input type="hidden" name="utm_source" value="<?php echo ($source) ? $source : '' ?>">
                <input type="hidden" name="utm_medium" value="<?php echo ($medium) ? $medium : '' ?>">
                <input type="hidden" name="utm_campaign" value="<?php echo ($campaign) ? $campaign : '' ?>">
                <input type="hidden" name="action11" value="custom_action">
                <div class="walkthrough-navi">
                    <div class="error-holder"></div>
                    <button class="button-alt js-walkthrough-next" disabled onClick="return redirectIt();">Continue</button>
                </div>

                <p class="walkthrough-info"><small>(Don't worry, you can change your mind about the kind of vehicle you want later.)</small></p>
            </li>
        </ul>
    
    <script>
	function redirectIt(){
		
		const checkboxes = document.querySelectorAll('input[name="vehicles[]"]:checked');
    
		// Initialize an array to store the values
		let values = [];
		
		// Loop through the checked checkboxes and add their values to the array
		checkboxes.forEach((checkbox) => {
			values.push(checkbox.value);
		});
		
		// Create a query string from the values array
		let queryString = values.map(value => 'vehicles[]=' + encodeURIComponent(value)).join('&');
		
		// Construct the new URL
		//let newUrl = window.location.href.split('?')[0] + '?' + queryString;
		//document.location.href='<?=get_site_url();?>/car-loan-application/';
		document.location.href='<?=get_site_url();?>/car-loan-application/#1' + '?' + queryString;
		//alert(1);
		return false;
	}
	</script>
	</div>
	<!--div id="quick-feedback-reviews-widget-container" class="form-fields review-widget">
		<div id="quick-feedback-reviews-widget" style="height: 100%;"></div><script type="text/javascript" id="quick-feedback-reviews-widget-script">(function() { function async_load(){ var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.async = true; script.src = 'https://quick-feedback.co/reviews-widget/widget.js?merchant_id=5c5473f78b516c005afc0e4a'; var embedder = document.getElementById( 'quick-feedback-reviews-widget-script' ); embedder.parentNode.insertBefore( script, embedder ); } if( window.attachEvent ) { window.attachEvent( 'onload', async_load ); } else { window.addEventListener( 'load', async_load, false ); } })();</script>
	</div>
	</div-->
	
    <div class="walk-more-info walk-more-info-home">
        <p>
            We love the Maritimes and we're driven to help Maritimers explore its roads. We've helped 1000's of Maritimers get approved since 2017 with the best application technology for online Car Loans and a huge network of thousands of vehicles for you to choose from. No matter what you're credit or financial standing is, you can get on the road within just a few hours of shopping <a href="<?=get_site_url();?>/used-cars-for-sale">our vehicle inventory</a>, or applying online. If you're employed and make at least $1700/mo, then you're already pre-approved for a car loan with us! Don't be fooled into buying a new vehicle with a high interest rate! We have a bankruptcy program for car loans with a flat low interest rate for everyone including those who've just entered bankruptcy. Even if you'd declared bankruptcy yesterday, we can get you into a vehicle today with a low interest rate. Other lenders will insist you need to 30-40% or more interest to get approved. We don't... we'll make sure you start off again on the right foot. Start car shopping the right way today. We often offer one or more of the following with: No Payments for 3 Months, Cash Back Options Available, Free Tires with Purchase, Free Delivery Anywhere. We have a record of thousands of vehicle car loan transactions and keep current on up-to-date used vehicle values. Do you want to know what your trade-in is valued at on a standard trade-in purchase at MVP? We'll give you an exact value your vehicle will carry towards a trade-in with MVP. No fee. No purchase necessary. To find out what your trade-in value is, just fill out our <a href="<?=get_site_url();?>/trade-in-calculator">trade-in calculator form</a>. Just entered a Bankruptcy? Forget paying 30% interest! We have a flat interest rate of 13.9% for those who are dealing with bankruptcy. We helped thousands of applicants throughout the Maritimes to get an approved with this last year! It's your turn! <a href="<?=get_site_url();?>/">Apply Now</a>. 
        </p>
</section>
<?php get_footer(); ?>