<?php 
$INC_DIR = $_SERVER['DOCUMENT_ROOT']."/v2/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 charset="utf-8">
<title><?php echo $configs->page_title; ?></title>
<meta content="width=device-width, initial-scale=1" name="viewport">
<link href="assets/brand/favicon.png" rel="icon" type="image/png">

<link href="assets/css/app.css" rel="stylesheet">
<link href="assets/css/inner.css" type="text/css" rel="stylesheet">
<!-- <link href="/assets/css/jquery.autocomplete.css" rel="stylesheet"> -->
<style>.autocomplete-suggestions { overflow: auto; width:auto !important;}
.autocomplete-suggestions { background-color: white !important; padding:20 0px;}
.autocomplete-suggestion { overflow: visible; }
form{padding:0;}
.has-error{
	border: 2px solid #ff5e45 !important;
	background-image: url('./assets/images/icon-validation-bad.png') !important;
	background-position: right center !important;
	background-repeat: no-repeat !important;
	background-size: 30px !important;
}
.no-error{
	border: 2px solid #6abd6a !important;
	background-image: url('./assets/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>
</head>

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

        <div id="top-1">
            <center><img src="assets/brand/logo2-strips.png" style="width:158px; margin: 6px 0 10px 0;"></center>
            <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 style="text-align:center;"><br>
                <b style="color:#f18704; font-size:18px;">Your package is reserved for the next: <span id="clockdiv"> 9:56</span> Minutes <br><br><span style="color:#000;"> Where do we send it?</span></b><br></p>

            <div class="form-partial" id="partialcontainer" style="max-width:95%; margin:0 auto;">
							
                <form  name="prospect_form1" class="partialform form form123" id="theForm" action="/v2/app/src/ajax.php" method="post" onSubmit="return validate_optin_form()" accept-charset="utf-8" enctype="application/x-www-form-urlencoded;charset=utf-8">
					<input type="hidden" name="device" value="mobile">
					<input type="hidden" name="package" value="<?=$package?>">
					  <?php
                        foreach($customer_details['affiliate_details'] as $key => $value) {
                            echo "<input type='hidden' name='".$key."' value='".$value."'>";
                        }
                    ?>
					<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?>" onKeyUp="javascript: this.value = this.value.replace(/[^a-zA-Z]/g, '');" autocomplete="given-name">
                        </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?>" onKeyUp="javascript: this.value = this.value.replace(/[^a-zA-Z]/g, '');" autocomplete="family-name">
                        </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="" onKeyUp="javascript: this.value = this.value.replace(/[^a-zA-Z0-9 .'\-#:;,]/g, '');" autocomplete="address-line1">
                        </div>

                        <div class=" form-holder">
                            <label>Zip 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, '');" autocomplete="postal-code">
                        </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="" autocomplete="address-level2">
                        </div>

                        <div class="form-holder" style="display: none">
                            <label>Country</label>
                            <select class="form-control" id="id_country" >
                            </select>
                        </div>

                        <div class=" form-holder">
                            <label>State:</label>
                            <select name="shippingState" id="fields_state" class="form-control required" data-selected="" data-error-message="State is required" autocomplete="address-level1">
                        			<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="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?>"  autocomplete="email">
                        </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="10"  autocomplete="tel-national">
                        </div>

                        <button id="partialsubmitbutton" name="partialsubmitbutton" style="font-size: 21px;" type="submit"> Proceed to Checkout »
                        </button>
                    </div>
                </form>
            </div>
        </div>
        <div class="linebreak" style="margin:15px 0;"></div>
        <div id="content-3">
            <div style="color:#7b0600; font-size:11px; text-align:center;">
                We care about your privacy.
            </div>
        </div>
        <div id="top-2">
            <img src="assets/images/godaddyimg.png">
        </div>
        <div class="linebreak" style="margin:15px 0;"></div>
        <div id="top-3">
            <img src="assets/images/safe.png">
        </div>
        <div class="linebreak" style="margin:15px 0;"></div>

    	<div id="footer">
            <br>
            <center>
                <ul class="terms-links">
                    <li> <a href="javascript:void(0);" onClick="openNewWindow('../disclosures/privacy.php','modal');">Privacy Policy |</a></li>
                    <li> <a href="javascript:void(0);" onClick="openNewWindow('../disclosures/terms.php','modal');">Terms and Conditions |</a></li>
		            <li><a href="javascript:void(0);" onClick="openNewWindow('../disclosures/wireless.php','modal');">Wireless Policy</a></li>
										
                </ul>
                <br>
                <div class="text-center">
                    <p><?php echo $configs->step_1_name; ?> is committed to maintaining the highest quality products and the utmost 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><br><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. These products are not intended to diagnose, treat, cure or prevent any disease. Individual results may vary.</p>
                </div>
                <br>
            </center>
    
            <center>
                <div class="text-center">
                    <p class="cop-text">&copy; <script> var date = new Date(); document.write(date.getFullYear()) </script> <span class="product-name"><?php echo $configs->step_1_name; ?></span>. All Rights Reserved.</p>
                    <br>
                </div>
            </center>
            <p></p>
    	</div>
	</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="assets/js/jquery-3.5.1.min.js"></script> 
<script type="text/javascript" src="assets/js/jquery.mask.min.js"></script>	
<script type="text/javascript">
$(document).ready(function () {
  var time_in_minutes = 10;
  var current_time = Date.parse(new Date());
  var deadline = new Date(current_time + time_in_minutes * 60 * 1000);

  function time_remaining(endtime) {
    var t = Date.parse(endtime) - Date.parse(new Date());
    var seconds = Math.floor((t / 1000) % 60);
    var minutes = Math.floor((t / 1000 / 60) % 60);
    var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
    var days = Math.floor(t / (1000 * 60 * 60 * 24));
    return {
      total: t,
      days: days,
      hours: hours,
      minutes: minutes,
      seconds: seconds,
    };
  }

  function run_clock(id, endtime) {
    var clock = document.getElementById(id);

    function update_clock() {
      var t = time_remaining(endtime);
      clock.innerHTML = " " + t.minutes + ":" + t.seconds;
      if (t.total <= 0) {
        clearInterval(timeinterval);
      }
    }

    update_clock();
    var timeinterval = setInterval(update_clock, 1000);
  }

  run_clock("clockdiv", deadline);
});

</script>

<script type="text/javascript" src="../assets/js/jquery.autocomplete.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.mask.min.js"></script>
<script type="text/javascript" src="assets/js/custom.js"></script>
</body>
</html>