<?php 
$INC_DIR = $_SERVER['DOCUMENT_ROOT']."/v1/app/";
include $INC_DIR."src/common.php";

$customer_details=get_customer_details($configs);
?>
<?php
	if( !empty($customer_details['firstName']) ) {
		$shipFirstName = $customer_details['firstName'];
	} else {
		$shipFirstName = "";
	}
	if( !empty($customer_details['lastName']) ) {
		$shipLastName = $customer_details['lastName'];
	} else {
		$shipLastName = "";
	}
	if( !empty($customer_details['email']) ) {
		$emailAddress = $customer_details['email'];
	} else {
		$emailAddress = "";
	}
	if( !empty($customer_details['phone']) ) {
		$phoneNumber = $customer_details['phone'];
	} else {
		$phoneNumber = "";
	}

	$product_price = 0.0;
	$package = 0;
	if(!empty($_REQUEST['pk'])) {
		if($_REQUEST['pk']==1){
			$package = 1;
		} else if($_REQUEST['pk']==3){
			$package = 3;
		} else if($_REQUEST['pk']==5){
			$package = 5;
		}
	}
	
	if(empty($package)) {
		$homeUrl = 'choose.php' . (!empty($_SERVER['QUERY_STRING']) ? ('?' . $_SERVER['QUERY_STRING']) : '');
		header('Location:' . $homeUrl);
		exit(0);
	}

?>
<!DOCTYPE html>

<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	
	<title><?php echo $configs->step_1_name; ?></title>
	<meta content="width=device-width,initial-scale=1" name="viewport">

	<link rel="icon" type="image/png" sizes="16x16" href="../images/favicon.png">

	<link href="../css/app.css" rel="stylesheet">
	<link href="../css/modal.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="../css/inner.css">
	<link href="../css/css2" rel="stylesheet">
	<link href="../css/jquery.autocomplete.css" rel="stylesheet">
	<style>
		.autocomplete-suggestions {
			overflow: auto;
			width: auto !important;
		}

		.autocomplete-suggestion {
			overflow: visible;
		}

		form {
			padding: 0;
		}
	</style>
	<style>
		.has-error {
			border: 1px solid #ff5e45 !important;
			background-image: url('../images/icon-validation-bad.png') !important;
			background-position: right center !important;
			background-repeat: no-repeat !important;
			background-size: 30px !important;
		}

    .no-error{
        background-image: url('../images/icon-validation-good.png') !important;
        background-position: right center !important;
        background-repeat: no-repeat !important;
        
        background-size: 30px !important;
    }
	</style>
	<script>
		history.pushState(null, null, window.location.href);
		history.back();
		history.forward();
		window.onpopstate = function() {
			history.go(1);
		};
	</script>
<style type="text/css">.lf-progress {
  -webkit-appearance: none;
  -moz-apperance: none;
  width: 100%;
  /* margin: 0 10px; */
  height: 4px;
  border-radius: 3px;
  cursor: pointer;
}
.lf-progress:focus {
  outline: none;
  border: none;
}
.lf-progress::-moz-range-track {
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
}
.lf-progress::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  height: 13px;
  width: 13px;
  border: 0;
  border-radius: 50%;
  background: #0fccce;
  cursor: pointer;
}
.lf-progress::-moz-range-thumb {
  -moz-appearance: none !important;
  height: 13px;
  width: 13px;
  border: 0;
  border-radius: 50%;
  background: #0fccce;
  cursor: pointer;
}
.lf-progress::-ms-track {
  width: 100%;
  height: 3px;
  cursor: pointer;
  background: transparent;
  border-color: transparent;
  color: transparent;
}
.lf-progress::-ms-fill-lower {
  background: #ccc;
  border-radius: 3px;
}
.lf-progress::-ms-fill-upper {
  background: #ccc;
  border-radius: 3px;
}
.lf-progress::-ms-thumb {
  border: 0;
  height: 15px;
  width: 15px;
  border-radius: 50%;
  background: #0fccce;
  cursor: pointer;
}
.lf-progress:focus::-ms-fill-lower {
  background: #ccc;
}
.lf-progress:focus::-ms-fill-upper {
  background: #ccc;
}
.lf-player-container :focus {
  outline: 0;
}
.lf-popover {
  position: relative;
}

.lf-popover-content {
  display: inline-block;
  position: absolute;
  opacity: 1;
  visibility: visible;
  transform: translate(0, -10px);
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
  transition: all 0.3s cubic-bezier(0.75, -0.02, 0.2, 0.97);
}

.lf-popover-content.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(0, 0px);
}

.lf-player-btn-container {
  display: flex;
  align-items: center;
}
.lf-player-btn {
  cursor: pointer;
  fill: #999;
  width: 14px;
}

.lf-player-btn.active {
  fill: #555;
}

.lf-popover {
  position: relative;
}

.lf-popover-content {
  display: inline-block;
  position: absolute;
  background-color: #ffffff;
  opacity: 1;

  transform: translate(0, -10px);
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
  transition: all 0.3s cubic-bezier(0.75, -0.02, 0.2, 0.97);
  padding: 10px;
}

.lf-popover-content.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(0, 0px);
}

.lf-arrow {
  position: absolute;
  z-index: -1;
  content: '';
  bottom: -9px;
  border-style: solid;
  border-width: 10px 10px 0px 10px;
}

.lf-left-align,
.lf-left-align .lfarrow {
  left: 0;
  right: unset;
}

.lf-right-align,
.lf-right-align .lf-arrow {
  right: 0;
  left: unset;
}

.lf-text-input {
  border: 1px #ccc solid;
  border-radius: 5px;
  padding: 3px;
  width: 60px;
  margin: 0;
}

.lf-color-picker {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  height: 90px;
}

.lf-color-selectors {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lf-color-component {
  display: flex;
  flex-direction: row;
  font-size: 12px;
  align-items: center;
  justify-content: center;
}

.lf-color-component strong {
  width: 40px;
}

.lf-color-component input[type='range'] {
  margin: 0 0 0 10px;
}

.lf-color-component input[type='number'] {
  width: 50px;
  margin: 0 0 0 10px;
}

.lf-color-preview {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-left: 5px;
}

.lf-preview {
  height: 60px;
  width: 60px;
}

.lf-popover-snapshot {
  width: 150px;
}
.lf-popover-snapshot h5 {
  margin: 5px 0 10px 0;
  font-size: 0.75rem;
}
.lf-popover-snapshot a {
  display: block;
  text-decoration: none;
}
.lf-popover-snapshot a:before {
  content: '⥼';
  margin-right: 5px;
}
.lf-popover-snapshot .lf-note {
  display: block;
  margin-top: 10px;
  color: #999;
}
.lf-player-controls > div {
  margin-right: 5px;
  margin-left: 5px;
}
.lf-player-controls > div:first-child {
  margin-left: 0px;
}
.lf-player-controls > div:last-child {
  margin-right: 0px;
}
</style></head>

<body style="max-width:600px;margin:0 auto">
	<div id="app">

		<div id="pagecontainer">
			<div id="top-1">

				<header class="header">
					<div class="header__warning"> </div>
					<div class="container row"> <img src="../images/logo.png" alt="" class="header__logo"> </div>
				</header>

				<div class="shipping-container"> <span><strong>Fast, Free Shipping</strong> For A Limited Time</span></div>

				<div class="breadcrumbs">
					<ul class="breadcrumbs__list">
						<li class="breadcrumbs__item"> <span>Qualify Now</span> </li>
						<li class="breadcrumbs__item breadcrumbs__item_2"> <span>Select Package</span> </li>
						<li class="breadcrumbs__item breadcrumbs__item_3 breadcrumbs__item_active"> <span>Confirm Order</span> </li>
					</ul>
				</div>

				<p class="text-1">Your package is reserved for the next:<br>
					<span id="stopwatch">09:24</span> Minutes
				</p>

				<p class="text-2">Where do we send it?</p>

				<div id="partialcontainer" class="form-partial">
					<!-- <form name="prospect_form1" class="partialform form form123" id="theForm" action="" method="post" onsubmit="return validate_optin_form()" accept-charset="utf-8" enctype="application/x-www-form-urlencoded;charset=utf-8"> -->
                    <form id='payment-form' class='prospect-form form partialform' action="/v1/app/src/ajax.php" method="post" onSubmit="return validate_optin_form()">
					<input type="hidden" name="device" value="mobile">
					<input type="hidden" name="package" value="<?=$package?>">
					<input type="hidden" name="AFFID" value="<?=isset($customer_details['AFFID'])?$customer_details['AFFID']:$_GET['AFFID']?>">
					<input type="hidden" name="shippingCountry" id="shippingCountry" value="US">
					<input type="hidden" name="pgtag" value="mshipping">

						
					<div class="shipping-form-wrapper">

							<div class="columns form-holder">
								<label>First Name:</label>
								<input class="form-control required" data-placement="auto left" name="firstName" id="fields_fname" placeholder="First Name*" title="First Name" type="text" value="<?=$shipFirstName?>"  >
							</div>

							<div class="columns form-holder">
								<label>Last Name:</label>
								<input class="form-control required" data-placement="auto left" name="lastName" id="fields_lname" placeholder="Last Name*" title="Last Name" type="text" value="<?=$shipLastName?>"   >
							</div>

							<div class="form-holder">
								<label>Zip/Postal Code:</label>
								<input class="form-control required" data-placement="auto left" name="shippingZip" id="fields_zip" placeholder="Zip Code*" minlength="5" maxlength="5" title="Zip Code" type="tel" value="" onkeyup="javascript: this.value = this.value.replace(/[^0-9]/g, &#39;&#39;);">
							</div>

							<div class="form-holder">
								<label>Address:</label>
								<input class="form-control required" data-placement="auto left" name="shippingAddress1" id="fields_address1" placeholder="Address*" title="Address" type="text" value="" >
							</div>

							<div class="form-holder">
								<label>City:</label>
								<input class="form-control required" data-placement="auto left" name="shippingCity" id="fields_city" placeholder="City*" title="City" type="text" value=""  >
							</div>

							<div class="form-holder">
								<label>State/Province:</label>
								<select name="shippingState" id="fields_state" class="form-control required" data-selected="" data-error-message="State is required">
									<option value="" onclick="">Select State</option>
									<option value="AL">Alabama (AL)</option>
									<option value="AK">Alaska (AK)</option>
									<option value="AS">American Samoa (AS)</option>
									<option value="AZ">Arizona (AZ)</option>
									<option value="AR">Arkansas (AR)</option>
									<option value="AE">Armed Forces (AE)</option>
									<option value="AA">Armed Forces Americas (AA)</option>
									<option value="AP">Armed Forces Pacific (AP)</option>
									<option value="CA">California (CA)</option>
									<option value="CO">Colorado (CO)</option>
									<option value="CT">Connecticut (CT)</option>
									<option value="DE">Delaware (DE)</option>
									<option value="DC">District of Columbia (DC)</option>
									<option value="FM">Federated States of Micronesia (FM)</option>
									<option value="FL">Florida (FL)</option>
									<option value="GA">Georgia (GA)</option>
									<option value="GU">Guam (GU)</option>
									<option value="HI">Hawaii (HI)</option>
									<option value="ID">Idaho (ID)</option>
									<option value="IL">Illinois (IL)</option>
									<option value="IN">Indiana (IN)</option>
									<option value="IA">Iowa (IA)</option>
									<option value="KS">Kansas (KS)</option>
									<option value="KY">Kentucky (KY)</option>
									<option value="LA">Louisiana (LA)</option>
									<option value="ME">Maine (ME)</option>
									<option value="MD">Maryland (MD)</option>
									<option value="MA">Massachusetts (MA)</option>
									<option value="MI">Michigan (MI)</option>
									<option value="MN">Minnesota (MN)</option>
									<option value="MS">Mississippi (MS)</option>
									<option value="MO">Missouri (MO)</option>
									<option value="MT">Montana (MT)</option>
									<option value="NE">Nebraska (NE)</option>
									<option value="NV">Nevada (NV)</option>
									<option value="NH">New Hampshire (NH)</option>
									<option value="NJ">New Jersey (NJ)</option>
									<option value="NM">New Mexico (NM)</option>
									<option value="NY">New York (NY)</option>
									<option value="NC">North Carolina (NC)</option>
									<option value="ND">North Dakota (ND)</option>
									<option value="MP">Northern Mariana Islands (MP)</option>
									<option value="OH">Ohio (OH)</option>
									<option value="OK">Oklahoma (OK)</option>
									<option value="OR">Oregon (OR)</option>
									<option value="PA">Pennsylvania (PA)</option>
									<option value="PR">Puerto Rico (PR)</option>
									<option value="MH">Republic of Marshall Islands (MH)</option>
									<option value="RI">Rhode Island (RI)</option>
									<option value="SC">South Carolina (SC)</option>
									<option value="SD">South Dakota (SD)</option>
									<option value="TN">Tennessee (TN)</option>
									<option value="TX">Texas (TX)</option>
									<option value="UT">Utah (UT)</option>
									<option value="VT">Vermont (VT)</option>
									<option value="VI">Virgin Islands of the U.S. (VI)</option>
									<option value="VA">Virginia (VA)</option>
									<option value="WA">Washington (WA)</option>
									<option value="WV">West Virginia (WV)</option>
									<option value="WI">Wisconsin (WI)</option>
									<option value="WY">Wyoming (WY)</option>
								</select>
							</div>

							<div class="columns">
								<label>Email:</label>
								<input class="form-control required" data-placement="auto left" name="email" id="fields_email" placeholder="Email*" title="Email" type="email" value="<?=$emailAddress?>" >
							</div>

							<div class="columns">
								<label>Phone Number:</label>
								<input class="form-control required" data-placement="auto left" name="phone" id="fields_phone" placeholder="Phone Number*" title="Phone Number" type="tel" value="<?=$phoneNumber?>"  maxlength="12">
							</div>

							<button id="partialsubmitbutton" name="partialsubmitbutton" type="submit">Proceed to Checkout &gt;&gt;</button>
						</div>
					</form>
				</div>
			</div>
		</div>

		<div class="linebreak" style="margin:15px 0"></div>
		<div class="footer-in">
			<div class="shipping-container"> <span><strong>Fast, Free Shipping</strong> For A Limited Time</span></div>
			<ul>
				<li> <img src="../images/m-secure1.svg" alt=""></li>
				<li> <img src="../images/m-secure2.svg" alt=""></li>
				<li> <img src="../images/m-secure3.svg" alt=""></li>
			</ul>
		</div>

		<div class="linebreak" style="margin:15px 0"></div>

		<div class="secure-in"><span>Secure Server<br>Protected by<br>SSL</span></div>

		<div class="linebreak" style="margin:15px 0"></div>

		<div id="footer">
			<center>
				<p class="link">
                <a href="javascript:void(0);" onclick="openNewWindow('../disclosures/privacy.php','modal');">Privacy</a> &nbsp;|&nbsp;
		<a href="javascript:void(0);" onclick="openNewWindow('../disclosures/wireless.php','modal');">Wireless Policy</a> &nbsp;|&nbsp;
		<a href="javascript:void(0);" onclick="openNewWindow('../disclosures/terms.php','modal');">Terms</a>
				</p>
				<div class="text-center">
					<p><?php echo $configs->step_1_name; ?> integrity in business practices. All products sold on this website are certified by Good Manufacturing Practices (GMP), which is the highest standard of testing in the supplement industry.</p>
					<p>Notice: The products and information found on this site are not intended to replace professional medical advice or treatment. These statements have not been evaluated by the Food and Drug Administration. Products and statements have not been evaluated by the European Medicines Agency or Food and Drug Administration. These products are not intended to diagnose, treat, cure or prevent any disease. Individual results may vary.</p>
				</div>
			</center>
			<center>
				<div class="text-center">
					<p class="cop-text">© <script>
							const date = new Date;
							document.write(date.getFullYear())
						</script> <?php echo $configs->step_1_name; ?>. All Rights Reserved. </p>
				</div>
			</center>
			<p></p>
		</div>
	</div>

	<p id="loading-indicator" style="display:none;">Processing...</p>
	<p id="crm-response-container" style="display:none;">Limelight messages will appear here...</p>

	<script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
	<script type="text/javascript" src="../js/jquery.mask.min.js"></script>

    <script>    
    function vmodal()
	{
        $( "a[href='#vmodal']" ).click( function ( e ) {
            e.preventDefault();
            var self = this;
            
            $( "#vmodal" ).load( $( self ).data( "modal-url" ), function () {
                softModal.open( "#vmodal" );
                
                if (typeof popup_callback === 'function') {
                    popup_callback( $( self ).data( "modal-url" ));
                }
            } );
        } );
	}
	
	
    $('.show-after-load').hide();
    
    setTimeout(function() {
        $('.show-after-load').fadeIn('fast');    
    }, 500);
    
    var submitting = false;
    
    $(function() {
		vmodal();            
        
        // $.validate( {
        //     modules: "html5",
        //     scrollToTopOnError: false,
        //     validateOnBlur: true,
        //     errorMessagePosition: "top"
        // } );
        
        $('.toTop').click( function () {
            var body = $( "html, body" );
            body.stop().animate( {
                scrollTop: 0
            }, 500, 'swing', function () {} );
        });   
        
        $(".toForm").click(function() {
            $([document.documentElement, document.body]).animate({
                scrollTop: $("form").offset().top
            }, 500);
        });
                
        if ($('#countdown').length) {
            var timer = 299;
            
            if (typeof localStorage != 'undefined') {
                timer = parseInt(localStorage.getItem('reservation_countdown'));
            }
            
            if (isNaN(timer)) timer = 299;
            
            if (timer < 0 ) timer = 0;
            
            $('#countdown').html(get_time_string(timer));
            
            startTimer(timer, $('#countdown').get('0'));   
        }
        
        animate_dots();

            });
    
    
    if ($('#vmodal-error').length) {
        softModal.open('#vmodal-error');
    }
    
    function animate_dots()
    {
        $('.dots').each(function() {
            let dots = $(this).html();
            
            if (dots.length < 8) {
                dots += '.';
            } else {
                dots = '.';    
            }
            
            $(this).html(dots);
        });
        
        setTimeout(animate_dots, 750);
    }
    
    function startTimer(duration, display) 
    {
        var timer = duration;
        
        setInterval(function () {
            display.textContent = get_time_string(timer);
            
            if (timer) {
                timer--;
            }
            
            if (typeof localStorage != 'undefined') {
                localStorage.setItem('reservation_countdown', timer);
            }
        }, 999);
    }    
    
    function get_time_string(timer)
    {
        var minutes, seconds;
        minutes = parseInt(timer / 60, 10);
        seconds = parseInt(timer % 60, 10);

        minutes = minutes < 10 ? "0" + minutes : minutes;
        seconds = seconds < 10 ? "0" + seconds : seconds;

        return minutes + ":" + seconds + "!";
    }
    
    function vmodal_msg(msg)
    {
        $('.soft-modal-content .vmodal-custom-content .submitting-text').html(msg);
    }
</script>




                </div>
            </div>
        </div>
        
        <script type="text/javascript">
        	document.querySelectorAll('a[href^="#"]').forEach(anchor => {
    anchor.addEventListener('click', function (e) {
        e.preventDefault();

        document.querySelector(this.getAttribute('href')).scrollIntoView({
            behavior: 'smooth'
        });
    });
});
        </script>
	<script type="text/javascript">
		var spd = 100;
		var spdVal = 10;
		var cntDown = 10 * 60 * spdVal;
		setInterval(function() {
			var mn, sc, ms;
			cntDown--;
			if (cntDown < 0) {
				return false;
			}
			mn = Math.floor((cntDown / spdVal) / 60);
			mn = (mn < 10 ? '0' + mn : mn);
			sc = Math.floor((cntDown / spdVal) % 60);
			sc = (sc < 10 ? '0' + sc : sc);
			ms = Math.floor(cntDown % spdVal);
			ms = (ms < 10 ? '0' + ms : ms);
			var result = mn + ':' + sc;
			document.getElementById('stopwatch').innerHTML = result;
		}, spd);

		$(document).ready(function() {
			$('#fields_phone').mask('000-000-0000');
		});
	</script>
	<script type="text/javascript" src="../js/jquery.autocomplete.min.js"></script>
	<script type="text/javascript" src="../js/custom.js"></script>
	


</body></html>