<?php

include('../_global.php');
include('../add-ons/Pixel.php');

	/* if(!empty($_REQUEST['pk'])) {
		if($_REQUEST['pk']==1){
			$package = 1;
			$productId = $configs->package_1_id;
		} else if($_REQUEST['pk']==3){
			$package = 3;
			$productId = $configs->package_3_id;
		} else if($_REQUEST['pk']==5){
			$package = 5;
			$productId = $configs->package_5_id;
		}
	}

	if(empty($package)) {
		$homeUrl = '/mobile/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->page_title;?></title>
	<meta content="" name="description">
	<meta content="width=device-width, initial-scale=1" name="viewport">

	<link href="<?php echo $configs->mobile_path . "assets/css/style.css"; ?>" rel="stylesheet">
	<link href="<?php echo $configs->mobile_path . "assets/css/style-m.css"; ?>" rel="stylesheet">
	<link href="<?php echo $configs->mobile_path . "assets/css/checkout.css"; ?>" rel="stylesheet">
	<link href="<?php echo $configs->mobile_path . "assets/css/custom.css"; ?>" rel="stylesheet">
	<link rel="shortcut icon" type="./assets/image/x-icon" href="<?php echo $configs->mobile_path . "assets/brand/favicon.png"; ?>">

	<link rel="preconnect" href="https://fonts.gstatic.com/">
	<link href="assets/css/css2.html" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="<?php echo $configs->mobile_path . "assets/css/inr-custom.css"; ?>">
	<link rel="stylesheet" type="text/css" href="<?php echo $configs->mobile_path . "assets/css/modal.css"; ?>">
	<link href="<?php echo $configs->mobile_path . "assets/css/loading.css"; ?>" rel="stylesheet">
	<link href="<?php echo $configs->mobile_path . "assets/css/common.css"; ?>" rel="stylesheet">

	<style>
		.header-in {
	background: white;
}

.header-in img {
	max-width: 200px;
}
		#upsellAccept {
			font-weight: 700;
			font-size: 24px;
			line-height: 70px;
			padding: 23px;
			line-height: 1;
			width: 100%;
			background: linear-gradient(to bottom, rgba(159, 234, 97, 1) 0%, rgba(120, 189, 59, 1) 51%, rgba(71, 142, 9, 1) 100%) !important;
			box-shadow: 0 2px 4px rgb(0 0 0/25%);
			border-radius: 12px;
			text-decoration: none;
			display: block;
			text-align: center;
			letter-spacing: .02em;
			font-family: Poppins, sans-serif;
			color: #fff;
			border: none;
		}

		#upsellDecline {
			font-size: 0.8rem;
			color: gray;
		}

		.modal-content {
			border: 15px solid white;
		}

		.modal-dialog {
			margin-top: 3.5rem;
		}

		/* #submitButton {
			background: linear-gradient(to bottom, rgba(159, 234, 97, 1) 0%, rgba(120, 189, 59, 1) 51%, rgba(71, 142, 9, 1) 100%) !important;
		} */
	</style>

	<style>
		.autocomplete-suggestions {
			border: 1px solid #999;
			background: #FFF;
			overflow: auto;
			font-size: 12px;
		}

		.autocomplete-suggestion {
			padding: 2px 5px;
			white-space: nowrap;
			overflow: hidden;
		}

		.autocomplete-selected {
			background: #F0F0F0;
		}

		.autocomplete-suggestions strong {
			font-weight: normal;
			color: #3399FF;
		}

		.autocomplete-group {
			padding: 2px 5px;
			color: #888;
		}

		.autocomplete-group::before {
			content: "Â» "
		}

		.autocomplete-group strong {
			display: block;
			border-bottom: 1px solid #000;
		}

		@media  only screen and (max-width: 768px) {
			.autocomplete-suggestion {
				line-height: 36px;
				font-size: 18px;
			}
		}

		.form-fields label {
			width: 100%;
			display: block;
			float: left;
		}

		#cvv,
		#expire_m,
		#expire_y {
			width: 48%;
			float: left
		}

		#expire_y {
			margin-left: 4%
		}

		.form-fields label {
			width: 100%;
			display: block;
			float: left;
		}

		select {
			-webkit-appearance: none;
			-moz-appearance: none;
			display: block;
			margin: 4px 5px 12px 0;
			padding-left: 5px;
			width: 100%;
			height: 40px;
			line-height: 40px;
			font-size: 17px;
			border: 1px solid #000;
			-webkit-border-radius: 5px;
			-moz-border-radius: 5px;
			border-radius: 5px;
			font-family: 'Roboto', sans-serif;

			background-color: #fff;
			background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iM3B4IiB2aWV3Qm94PSIwIDAgNiAzIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA2IDMiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwb2x5Z29uIHBvaW50cz0iNS45OTIsMCAyLjk5MiwzIC0wLjAwOCwwICIvPjwvc3ZnPg==);
			background-repeat: no-repeat;
			background-position: 94% center
		}

		.cvv-link {
			margin-top: 2px;
			float: left;
			width: 48%;
		}

		.cvv-link a {
			font-size: 12px;
			color: #323131;
			margin: 0 0 0 15px;
		}

		.secure-icon {
			text-align: center;
			margin-bottom: 19px;
			float: left;
			width: 100%;
			margin-top: 10px;
			font-size: 15px;
		}

		.secure-icon span {
			position: relative;
		}

		.secure-icon span:before {
			content: "";
			width: 10px;
			height: 12px;
			background: url(assets/images/lock-img.svg) no-repeat center;
			position: absolute;
			left: -16px;
			top: 3px;
		}
	
		.has-error {
			border: 2px solid #ff5e45 !important;
			background-image: url('assets/images/icon-validation-bad.html') !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.html') !important;
			background-position: right center !important;
			background-repeat: no-repeat !important;
			background-size: 30px !important;
		}

		.rebate-col {
			display: none;
		}

		.col-sm-4,
		.col-sm-3,
		.col-sm-2 {
			padding: 0 8px !important;
		}

		.savings .mark-1 {
			font-weight: 500;
		}

		.savings .mark {
			display: block;
			font-family: 'Montserrat', sans-serif;
			text-align: center;
			font-size: 52px;
			font-weight: 900;
			color: #FE2321;
		}

		@media  only screen and (max-width: 995px) {
			.savings {
				text-align: left;
				font-size: 40px;
			}
		}

		@media  only screen and (max-width: 400px) {

			.savings,
			.savings .mark {
				font-size: 25px;
			}
		}

		#app_common_modal,
		#error_handler_overlay {
			position: fixed;
			top: 0;
			left: 0;
			padding: 0;
			margin: 0;
			width: 100%;
			height: 100%;
			z-index: 2147483647;
			background: #333;
			background: rgba(255, 255, 255, .8);
			display: none;
			overflow-x: hidden;
			-webkit-overflow-scrolling: touch;
		}

		.app_modal_body {
			margin: 100px auto;
			min-width: inherit;
			width: 95%;
			min-height: 400px;
			padding: 2.5%;
			background-color: #fff;
			background-clip: padding-box;
			border: 1px solid #999;
			border: 1px solid rgba(0, 0, 0, .2);
			border-radius: 0;
			-webkit-box-shadow: 0 3px 9px rgb(0 0 0 / 50%);
			box-shadow: 0 3px 9px rgb(0 0 0 / 50%);
			font-size: 14px;
			line-height: 1.42857143;
			color: #333;
			position: relative;
			-webkit-box-sizing: border-box;
			-moz-box-sizing: border-box;
			-ms-box-sizing: border-box;
		}

		#app_common_modal .app_modal_body,
		#error_handler_overlay .error_handler_body {
			max-width: 600px;
			-webkit-background-clip: padding-box;
			font-family: Verdana, Geneva, sans-serif;
			box-sizing: border-box;
			outline: 0;
		}

		#app_common_modal .app_modal_body iframe {
			min-height: 400px;
			width: 100%;
			border: 1px solid #d5d6ef;
		}

		#app_common_modal_close,
		#error_handler_overlay_close {
			position: absolute;
			right: -10px;
			top: -10px;
			color: #FFF;
			background-color: #333;
			border: 2px solid #FFF;
			border-radius: 50%;
			width: 30px;
			height: 30px;
			text-align: center;
			cursor: pointer;
			text-decoration: none;
			font-weight: 700;
			line-height: 30px;
			padding: 0;
			margin: 0;
		}
	</style>
	<?php include_once('../sentry.php'); ?>
</head>

<body style="max-width: 600px;">
	<div id="app">
		<div id="pagecontainer">
			<div id="top-1">
				<center class="header-in">
					<img src="<?php echo $configs->mobile_path . "assets/brand/logo.png"; ?>" style="width: 185px;">
				</center>
				<div class="delivery-b">
					<span><b>Fast, Free Shipping</b> 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: #7b0600; font-size: 18px;">Final Step: Payment Information</b>
					<div class="cards-list">
						<span>We Accept:</span>
						<img alt="" src="<?php echo $configs->mobile_path . "assets/images/visa.png"; ?>">
						<img alt="" src="<?php echo $configs->mobile_path . "assets/images/mastercard.png"; ?>">
					</div>
				</p>
				<style>
					#partialcontainer label {
						display: flex;
						margin: 4px 0 4px;
						font-family: Poppins, sans-serif;
					}
				</style>
				<div id="form-error-msg"></div>
				<div id="partialcontainer" class="form-partial" style="max-width: 95%; margin: 0 auto;">
					<div class="form-partial" id="partialcontainer" style="max-width:95%; margin:0 auto;">
						<form class="paymentform form"  method="post"  onSubmit="return submit_lead();" id="order_form" name="order_form">
							<input type='hidden' name='token' value='<?php echo $_SESSION["token"]; ?>'>
						    <input type="hidden" name="package" value="<?php echo (isset($_SESSION["package"])) ? $_SESSION["package"] : 5; ?>" id="package">
							<input type="hidden" name="fields_prospect_id" value="<?php echo $_GET["prospectId"]; ?>">
							<input type="hidden" name="fields_cc_type" value="">
							<input type="hidden" name="device" value="mobile">
							<input type="hidden" id="cc_type" name="cc_type" value="">
							
							<?php /*
							$amount = $configs->bottle_price_5;
							if (isset($_SESSION["package"]) && $_SESSION["package"] == 3) {
								$amount = $configs->bottle_price_3;
							}
				
							if (isset($_SESSION["package"]) && $_SESSION["package"] == 1) {
								$amount = $configs->bottle_price_1 + $configs->bottle_ship_price_1;
							}
							?>
							<input type="hidden" id="amount" value="<?php echo $amount; ?>"> */ ?>

							<?php
								foreach($_GET as $key => $value) {
									echo "<input type='hidden' name='".safeRequest($key)."' value='".safeRequest($_GET[$key])."'>";
								}
							?>
							
							<!-- 3DS -->
							<input type="hidden" name="cavv" id="cavv" value="">
							<input type="hidden" name="ds_trans_id" id="ds_trans_id" value="">
							<input type="hidden" name="eci" id="eci" value="">
							<input type="hidden" name="acs_trans_id" id="acs_trans_id" value="">
							<input type="hidden" name="3d_version" id="3d_version" value="">
				
							<!-- 3DS Rebill -->
							<input type="hidden" name="rebill_cavv" id="rebill_cavv" value="">
							<input type="hidden" name="rebill_ds_trans_id" id="rebill_ds_trans_id" value="">
							<input type="hidden" name="rebill_eci" id="rebill_eci" value="">
							<input type="hidden" name="rebill_acs_trans_id" id="rebill_acs_trans_id" value="">
							<input type="hidden" name="rebill_3d_version" id="rebill_3d_version" value="">

							<label for="payment_as_shipping" class="payment_as_shipping_label">
								<input type="checkbox" id="payment_as_shipping" name="billing_is_shipping" checked class="bill-inp" value="no">
								<span>Billing same as Shipping</span>
							</label>
							<div class="billing-info" style="display: none; margin-bottom: 15px">
								<div class="billing-form">
									<div class="billing-title">Billing Information</div>

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

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

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

									<div class=" form-holder">
										<label>Zip Code:</label>
										<input class="form-control required" data-placement="auto left" name="fields_billing_zip" id="postCode" placeholder="Zip Code*"  title="Zip Code" type="text" onKeyUp="javascript: this.value = this.value.replace(/[^0-9]/g, '');" >
									</div>

									<div class="form-holder">
										<label>City:</label>
										<input class="form-control required" data-placement="auto left" name="fields_billing_city" id="city" placeholder="City*" title="City" type="text">
									</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/Region:</label>
										<select  name="fields_billing_state" id="state" class="form-control required" />
											<option value="" onClick="" selected>Select Billing 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="billing-title">Payment Information</div>
								</div>
							</div>
							<div class="shipping-form-wrapper">
								<br>
								<div class="columns form-holder">
									<label>Card Number:</label>
									<input data-threeds="pan" type="tel" id="cardNumber" class="form-control required masked" placeholder="•••• •••• •••• ••••" name="fields_cc_number" maxlength="16" minlength="15">
								</div>

								<div class="form-fields">
									<label>Card Expiry Date:</label>
									<div class="form-holder" id="expire_m">
										<select data-threeds="month" class="required form-control" name="fields_expmonth" id="cardMonth">
											<option value="">Month</option>
											<option value='01'>1</option>
											<option value='02'>2</option>
											<option value='03'>3</option>
											<option value='04'>4</option>
											<option value='05'>5</option>
											<option value='06'>6</option>
											<option value='07'>7</option>
											<option value='08'>8</option>
											<option value='09'>9</option>
											<option value='10'>10</option>
											<option value='11'>11</option>
											<option value='12'>12</option>
										</select>
									</div>
									<div class="form-holder" id="expire_y">
										<select data-threeds="year" id="cardYear" class="form-control right required" name="fields_expyear">
											<option value="24">2024</option>
											<option value="25">2025</option>
											<option value="26">2026</option>
											<option value="27">2027</option>
											<option value="28">2028</option>
											<option value="29">2029</option>
											<option value="30">2030</option>
											<option value="31">2031</option>
											<option value="32">2032</option>
											<option value="33">2033</option>
											<option value="34">2034</option>
											<option value="35">2035</option>
											<option value="36">2036</option>
											<option value="37">2037</option>
											<option value="38">2038</option>
										</select>
									</div>
								</div>
								<div class="form-fields">
									<label>CVV:</label>
									<div class="form-holder" id="cvv">
										<input type="tel" id="cardSecurityCode" class="form-control required" maxlength="4" placeholder="•••" name="fields_cvv" />
									</div>
									<div class="cvv-link"><a href="javascript:void(0)" style="display: inline-block;">Where can I find my<br> Security Code?</a></div>
									<div class="clear"></div>
									<div class="cvv-image" style="display:none;"><img alt="" src="<?php echo $configs->mobile_path . "assets/images/cvv-image.png"; ?>" style="margin: 0px 0px 15px !important; width:190px; "></div>
								</div>
								<div class="row">
									<div class="secure-icon"><span>Secure 256-bit SSL Encryption</span></div>
								</div>
								<style>
									input[type="submit" i] {
										user-select: auto;
									}
								</style>
								<input id="submitButton" border="0" class="btn_pulse cformbtn-default button-form loading-btn btn_pulse" type="submit" value="RUSH MY ORDER!">
								<div class="frmCheckElemts" style="padding: 20px 10px 0;">
                                <label class="spl-checkbox" style="vertical-align:top;text-align: left;font-size: 14px !important;">
                                    <input type="checkbox" name="emag_subscription" id="emag_subscription" value="Y" checked="checked" class="chkbox no-error" style="margin:0 !important;width: auto;height: auto;display: inline;">
                                    <span style="margin-left:5px;">As a special gift you will gain access to the Health Digital Magazine Series today for the discounted rate of only $19.93 monthly. For questions on this separate enrollment, call any time.</span>
                                </label>
                            </div>
							</div>
						</form>
					</div>
				</div>
				<div class="bottom-icons">
					<div class="delivery-b">
						<span><b>Fast, Free Shipping</b> For A Limited Time</span>
					</div>
				</div>
				<div class="footer-in">
					<ul>
						<li>
							<img src="<?php echo $configs->mobile_path . "assets/images/gd1.svg"; ?>" alt="">
						</li>
						<li>
							<img src="<?php echo $configs->mobile_path . "assets/images/gd2.svg"; ?>" alt="">
						</li>
						<li>
							<img src="<?php echo $configs->mobile_path . "assets/images/gd3.svg"; ?>" alt="">
						</li>
					</ul>
				</div>
				<div class="secure-in">
					<span>
						Secure Server <br>
						<span class="secure-in__text">Protected by</span> <br>
						<span class="secure-in__text2">SSL</span>
					</span>
				</div>
				<div id="footer">
					<br>
					<center>
						<p>
							<a href="javascript:void(0);" onclick="openNewWindow('../disclosures/terms.php','modal');">Terms and Conditions |</a>
							<a href="javascript:void(0);" onclick="openNewWindow('../disclosures/privacy.php','modal');">Privacy Policy |</a>
							<a href="javascript:void(0);" onclick="openNewWindow('../disclosures/contact.php','modal');">Contact us</a>
						</p>
						<br>
						<div class="text-center">
							<p>
								*The statements made on our websites have not been evaluated by
								the FDA (U.S. Food &amp; Drug Administration). Our products are
								not intended to diagnose, cure or prevent any disease. The
								information provided by this website or this company is not a
								substitute for a face-to-face consultation with your physician,
								and should not be construed as individual medical advice. The
								testimonials on this website are individual cases and do not
								guarantee that you will get the same results. Due to the nature
								of this product and to protect the disclosures/privacy.php of the individuals,
								actual names and photographs of the individuals depicted in the
								testimonials have been changed. Individuals are remunerated.
							</p>
						</div>
					</center>
					<p></p>
					<p></p>
					<p>
						<br>
					</p>
					<center>
						<br>
						<div class="text-center">
							<p class="cop-text">
								©
								<script>
									const date = new Date();
									document.write(date.getFullYear());
								</script>
								<span class="product-name"><?php echo $configs->corporate_name;?></span>. All Rights Reserved.
							</p>
						</div>
					</center>
					<p></p>
				</div>
			</div>
		</div>
	</div>

	<div class="modal fade modal-lg" id="upsellModal" tabindex="-1" role="dialog" aria-labelledby="upsellModal" data-bs-backdrop="static" data-bs-keyboard="false" aria-modal="true" style="display: none;">
		<div class="modal-dialog modal-dialog-centered" role="document">
			<div class="modal-content">
				<div class="modal-body upsell-modal-body">
					<div class="container-fluid position-relative">
						<div class="row2">
							<div class="col-lg-5 col-12 text-center d-flex justify-content-center align-items-center">
								<div class="pt-3 pb-4 upsellModal-product-image m-auto">
									<img src="<?php echo $configs->mobile_path . "assets/brand/product2-5.png"; ?>" class="img-fluid" id="product5B" style="display: none">
									<img src="<?php echo $configs->mobile_path . "assets/brand/product2-3.png"; ?>" class="img-fluid" id="product3B" style="display: none">
									<img src="<?php echo $configs->mobile_path . "assets/brand/product2-2.png"; ?>" class="img-fluid" id="product2B" style="display: none">
								</div>
							</div>
							<div class="col-lg-7 col-12 text-center d-flex flex-column justify-content-end pb-3">
								<h2 class="mb-2">Exclusive offer</h2>
								<h1 class="mb-4">
									<b style="color: #ffd900">
										DOUBLE <br> YOUR VALUE!
									</b>
								</h1>
								<h5 class="mb-1">
									Upgrade from 500MG <br>(20 gummies/ bottle) <br>
								</h5>
								<h4 class="mb-5">
									<b>to 1000MG <br>(40 gummies/ bottle) </b><br>
								</h4>
								<h5 class="mb-0">
									<small class="unimportant">For Only <span class="small-price">$9.99</span> More Per Bottle</small>
								</h5>
							</div>
							<div class="col-12 text-center">
								<button class="send-btn mb-3 btn_pulse" id="upsellAccept" data-value="5B">
									COMPLETE CHECKOUT
								</button>
								<button class="send-btn-secondary" id="upsellDecline">
									NO, THANK YOU
								</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="modal fade modal-lg" id="upsellModal" tabindex="-1" role="dialog" aria-labelledby="upsellModal" data-bs-backdrop="static" data-bs-keyboard="false" aria-modal="true" style="display: none;">
		<div class="modal-dialog modal-dialog-centered" role="document">
			<div class="modal-content">
				<div class="modal-body upsell-modal-body">
					<div class="container-fluid position-relative">
						<div class="row2">
							<div class="col-lg-5 col-12 text-center d-flex justify-content-center align-items-center">
								<div class="pt-3 pb-4 upsellModal-product-image m-auto">
									<img src="<?php echo $configs->mobile_path . "assets/brand/product2-5.png"; ?>" class="img-fluid" id="product5B" style="display: none">
									<img src="<?php echo $configs->mobile_path . "assets/brand/product2-3.png"; ?>" class="img-fluid" id="product3B" style="display: none">
									<img src="<?php echo $configs->mobile_path . "assets/brand/product2-2.png"; ?>" class="img-fluid" id="product2B" style="display: none">
								</div>
							</div>
							<div class="col-lg-7 col-12 text-center d-flex flex-column justify-content-end pb-3">
								<h2 class="mb-2">Exclusive offer</h2>
								<h1 class="mb-4">
									<b style="color: #ffd900">
										DOUBLE <br> YOUR VALUE!
									</b>
								</h1>
								<h5 class="mb-1">
									Upgrade from 500MG <br>(20 gummies/ bottle) <br>
								</h5>
								<h4 class="mb-5">
									<b>to 1000MG <br>(40 gummies/ bottle) </b><br>
								</h4>
								<h5 class="mb-0">
									<small class="unimportant">For Only <span class="small-price">$9.99</span> More Per Bottle</small>
								</h5>
							</div>
							<div class="col-12 text-center">
								<button class="send-btn mb-3 btn_pulse" id="upsellAccept" data-value="5B">
									COMPLETE CHECKOUT
								</button>
								<button class="send-btn-secondary" id="upsellDecline">
									NO, THANK YOU
								</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<!--popup processing wrapper-->
	<section id="loading-indicator" class="popup-loading-wrapper" style="display: none">
		<div class="popup">
			<img src="<?php echo $configs->mobile_path . "assets/images/icon-lock.png"; ?>" alt="" class="lock-image" />
			<p>Please wait a moment</p>
			<h3>Your Product Is Being Reserved</h3>
			<img src="<?php echo $configs->mobile_path . "assets/images/icon-loading.png"; ?>" alt="" class="loading-image" />
		</div>
	</section>
	<!--end popup processing wrapper-->

	<input type="hidden" id="ccchecker" name="" value="">
	<div class="modal-backdrop fade show" style="display: none;"></div>
	<script src="<?php echo $configs->root_path . "/assets/js/jquery.min.js"; ?>"></script>
  <script src="<?php echo $configs->root_path . "/assets/js/jquery.mask.min.js"; ?>"></script>
  <script src="<?php echo $configs->root_path . "/assets/js/threeds.2.min.latest.js"; ?>"></script>
  <script type="text/javascript" src="<?php echo $configs->root_path . "/assets/js/jquery.cardtype.js"; ?>"></script>
<script>
    const formatedDate = new Date().toLocaleString('en-us', {
      month: 'long',
      year: 'numeric',
      day: 'numeric'
    });
    $('.currentDateFormat').text(formatedDate);

	$('#cardNumber').keyup(function() {
		var result = $('#cardNumber').validateCreditCard();
		var card = result.card_type?.name;
		if(card) {
			card = card.replace("mastercard", "master");
			$("input[name=fields_cc_type]").val(card);
		}
	});
		
	var total_price = 0;
	var three_s1 = 0;
	var three_ebook = 0;
	var three_s1_called_back = 0;
	var three_ebook_called_back = 0;
	var allowSubmit = false;
	var submitted = false;
	var submitTmr = 0;
	var s1Tmr = 0;
	var s2Tmr = 0;
	var s3Tmr = 0;

	$('.bill-inp').click(function(){
		if($(this).prop("checked") == true){
			$('.billing-info').slideUp();
			$("#billingSameAsShipping").val('YES');
			$('#hidden-fields').find('input,select').removeClass('required');
			$('#billingSameAsShipping').trigger('change');
		} else {
			$('.billing-info').slideDown();
			$("#billingSameAsShipping").val('NO');
			$('#hidden-fields').find('input,select').addClass('required');
			$('#billingSameAsShipping').trigger('change');
		}
	});


	$(document).ready(function(){
		$('#cardNumber').mask('0000 0000 0000 0000');
		$('#cform-submit-btn').show();

	});

	$('form#order_form').find('input, select, textarea').not('#payment_as_shipping').on('change keyup', function() {
		$('form#order_form').find('input, select').not('#submitButton').each(function() {
			if($(this).val()==''){
				$(this).addClass('has-error');
				$(this).removeClass('no-error');
			}else{
				$(this).removeClass('has-error');
				$(this).addClass('no-error');	
			}
		});
	});

	function submit_lead() {		
		ShowExitPopup = false;
		internal = 1;
		isExit=false;
		window.internalLink = true;

		$('form.paymentform').find('input, select').each(function() {
			if($(this).val()==''){
				$(this).addClass('has-error');
			}
		});

		var errors = new Array();

		phonefilter = /^([0-9\-\+\(\)]{8,22})+$/ ;

		if ($('#billingSameAsShipping').val()=='NO') {
			if ($('#firstName').length == 1 && ($('#firstName').val()=='' || $("#firstName").val().replace(/\s/g,"")=='')) {
				errors.push('Please enter Billing First Name.');
			}
			if ($('#lastName').length == 1 && ($('#lastName').val()=='' || $("#lastName").val().replace(/\s/g,"")=='')) {
				errors.push('Please enter Billing Last Name.');
			}
			if ($('#address1').val()=='' || $("#address1").val().replace(/\s/g,"")=='') {
				errors.push('Please enter Billing Address.');
			}
			if ($('#city').val()=='' || $("#city").val().replace(/\s/g,"")=='') {
				errors.push('Please enter Billing City.');
			}
			if ($('#state').val()=='' || $("#state").val().replace(/\s/g,"")=='') {
				errors.push('Please select Billing State.');
			}
			if ($('#postalCode').val()=='' || $("#postalCode").val().replace(/\s/g,"")=='') {
				errors.push('Please enter Billing Zip.');
			}
		}

		if ($.trim($("#cardNumber").val()) != '') {
			checkCardType($("#cardNumber").val());
		}else {
			$('#cc_type').val("");
		}

		if ($('#cardNumber').val()=='' || $("#cardNumber").val().replace(/\s/g,"")=='') {
			errors.push('Please enter Credit Card number.');
		} else {
			// Run Luhn algorithm to validate card number
			var validCard = LuhnAlgorithm( $("#cardNumber").unmask().val() );
			
			$("#cardNumber").mask('0000 0000 0000 0000');
			if (!validCard) {
				errors.push('Credit Card number is Invalid, please enter a valid credit card number.');
			}
		}
		
		if ($('#cardMonth').val()=='' || $("#cardMonth").val().replace(/\s/g,"")=='') {
			errors.push('Please select expiry Month.');
		}
		if ($('#cardYear').val()=='' || $("#cardYear").val().replace(/\s/g,"")=='') {
			errors.push('Please select expiry Year.');
		} 
		if ($('#cardSecurityCode').val()=='' || $("#cardSecurityCode").val().replace(/\s/g,"")=='') {
			errors.push('Please enter CVV code.');
		}

		if (errors.length == 0 ) {
			allowSubmit = true;
			$('#loading-indicator').css('display', 'block');
			doSubmitNow();
			return false;
		} else {
			var li = '';
			$.each(errors, function(key, value) {
				li += '<li>' + value + '</li>';
			});

			var html = '';
			html += '<div id="error_handler_overlay">';
			html += '<div class="error_handler_body"><a href="javascript:void(0);" id="error_handler_overlay_close">X</a><ul>' + li + '</ul></div>';
			html += '</div>';

			$('body').append(html);
			$('#error_handler_overlay').fadeIn(500);

			return false;
		}
	}

	function doSubmitNow() {
		if(allowSubmit == false) {
			return false;
		}
		if(submitted == true) {
			return false;
		}
		submitted = true;

		if((s1Tmr)) {
			clearTimeout(s1Tmr);
		}
		if((s2Tmr)) {
			clearTimeout(s2Tmr);
		}
		if((s3Tmr)) {
			clearTimeout(s3Tmr);
		}

		var page_ajax = 'create_order.php';
		$('#cardNumber').unmask();
		
		var frmData = $("#order_form :input[value!=''][value!='.']").serialize();
		
		$('#cardNumber').mask('0000 0000 0000 0000');
		
		$.ajax({type:'POST', url: '../app/src/'+page_ajax, data:frmData, success: function(response) {
			var res = response.split("|");

			if( res[0]=='decline' ) {
				// Decline Page Error
				alert('=>'+response);
				$('#loading-indicator').css('display', 'none');
				allowSubmit = false;
				submitted = false;
				$("#proc_popup").show();
			} else if( res[0]=='ok' || res[0]=='oksc' || res[0]=='okprepaid' ) {
				$('#loading-indicator').css('display', 'none');
				setTimeout(function(){window.location.href = res[1]; }, 100);
			}
			else {
				$('#loading-indicator').css('display', 'none');
				if(res.length > 0 && typeof(res[0]) !== 'undefined') {
					if(submitTmr) {
						clearTimeout(submitTmr);
					}
					alert(res[0]);
					allowSubmit = false;
					submitted = false;
				} else {
					if(submitTmr) {
						clearTimeout(submitTmr);
					}
					alert(response);
					allowSubmit = false;
					submitted = false;
				}
			}
		}});
	}
		
	$(window).keydown(function(e) {
		if (e.which === 27 && $('#error_handler_overlay').length) {
			$('#error_handler_overlay').remove();
		}
	});

	$(document).off('click', '#error_handler_overlay');
	$(document).on('click', '#error_handler_overlay', function() {
		$(this).remove();
	});

	$(document).off('click', '#error_handler_overlay_close');
	$(document).on('click', '#error_handler_overlay_close', function() {
		$('#error_handler_overlay').remove();
	});

	$(document).on('click', '#app_common_modal_close', function() {
		$('#app_common_modal').remove();
	});	

	function onlyNumbers(e,type) {
		var keynum;
		var keychar;
		var numcheck;
		if(window.event) // IE
		{
			keynum = e.keyCode;
		}
		else if(e.which) // Netscape/Firefox/Opera
		{
			keynum = e.which;
		}
		keychar = String.fromCharCode(keynum);
		numcheck = /\d/;
	
		switch (keynum){
			case 8:    //backspace
			case 9:    //tab
			case 35:   //end
			case 36:   //home
			case 37:   //left arrow
			case 38:   //right arrow
			case 39:   //insert
			case 45:   //delete
			case 46:   //0
			case 48:   //1
			case 49:   //2
			case 50:   //3
			case 51:   //4
			case 52:   //5
			case 54:   //6
			case 55:   //7
			case 56:   //8
			case 57:   //9
			case 96:   //0
			case 97:   //1
			case 98:   //2
			case 99:   //3
			case 100:  //4
			case 101:  //5
			case 102:  //6
			case 103:  //7
			case 104:  //8
			case 105:  //9
				result2 = true;
				break;
			case 109: // dash -
				if (type == 'phone'){
					result2 = true;
				} else {
					result2 = false;
				}
				break;
			default:
				result2 = numcheck.test(keychar);
				break;
		}
		return result2;
	}

	function openNewWindow(page_url, type, window_name, width, height, top, left, features) {
	    if (!type) {
	        type = 'popup';
	    }
	    if (!width) {
	        width = 480;
	    }
	    if (!height) {
	        height = 480;
	    }
	    if (!top) {
	        top = 50;
	    }
	    if (!left) {
	        left = 50;
	    }
	    if (!features) {
	        features = 'resizable,scrollbars';
	    }

	    if (type == 'popup') {
	        var settings = 'height=' + height + ',';
	        settings += 'width=' + width + ',';
	        settings += 'top=' + top + ',';
	        settings += 'left=' + left + ',';
	        settings += features;

	        win = window.open(page_url, window_name, settings);
	        win.window.focus();
	    } else if (type == 'modal') {
	        var html = '';
	        html += '<div id="app_common_modal">';
	        html += '<div class="app_modal_body"><a href="javascript:void(0);" id="app_common_modal_close">X</a><iframe src="' + page_url + '" frameborder="0"></iframe></div>';
	        html += '</div>';

	        if (!$('#app_common_modal').length) {

	            $('body').append(html);
	        }
	        $('#app_common_modal').fadeIn();
	    }

	}
	
	$('form#order_form').find('#cc_number').on('change keyup',function (){
		if ($.trim($("#cardNumber").val()) != '') {
			checkCardType($("#cardNumber").val());
		}else {
			$('#cc_type').val("");
		}
	});

	function checkCardType(e) {
		/*
	    if (!$("#cardNumber").val() && !$.isNumeric($("#cardNumber").val())) {
				
	    }else {
			cardNum = $("#cardNumber").val();
			var firstChar = cardNum.substr(0, 1);
			if (firstChar === "5") {
						$('#cc_type').val("master");
			} else if (firstChar === "4") {
				$('#cc_type').val("visa");
			} else if (firstChar === "6") {
				$('#cc_type').val("discover");
			} else if (firstChar === "0") {
				$('#cc_type').val("visa");
			}else {
				$('#cc_type').val("");
				if (typeof (e) !== 'undefined') {
								//   alert("Only Visa, Discover and Mastercards are supported!");
				}
				$("#cardNumber").val('');
			}
		} */
	}

	function LuhnAlgorithm(num){

		var inputNum = num.toString();
		var sum = 0;
		var doubleUp = false;

		/* from the right to left, double every other digit starting with the second to last digit.*/
		for (var i = inputNum.length - 1; i >= 0; i--)
		{
			var curDigit = parseInt(inputNum.charAt(i));

			/* double every other digit starting with the second to last digit */
			if(doubleUp)
			{
				/* doubled number is greater than 9 than subtracted 9 */
				if((curDigit*2) > 9)
				{
					sum +=( curDigit*2)-9;
				}
				else
				{
					sum += curDigit*2;
				}
			}
			else
			{
				sum += curDigit;
			}
			var doubleUp =!doubleUp
		}

		  /* sum and divide it by 10. If the remainder equals zero, the original credit card number is valid.  */
		  //return (sum % 10) == 0  ? true : false;
			return true;
	}
</script>	
<?php if ($configs->threeds_enabled): ?>
<script src="https://cdn.3dsintegrator.com/threeds.2.min.latest.js"></script>
<script>		
	var tds = new ThreeDS(
		"order_form",
		"<?php echo $configs->threeds_key; ?>",
	null,
	{
		endpoint:"https://api.3dsintegrator.com/v2",
		autoSubmit:false,
		verbose:true,
			addResultToForm: false
	});

	var tds_rebill = new ThreeDS(
		"order_form",
		"<?php echo $configs->threeds_key; ?>",
	null,
	{
		endpoint:"https://api.3dsintegrator.com/v2",
		autoSubmit:false,
		verbose:true,
			addResultToForm: false
	});
	
	function get_3ds_tokens() {
		var amount = parseFloat($('#amount').val());
		tds.verify(function(response) {
			$("#cavv").val(response.authenticationValue);
			$("#ds_trans_id").val(response.dsTransId);
			$("#eci").val(response.eci);
			$("#acs_trans_id").val(response.acsTransId);
			$("#3d_version").val(response.protocolVersion);
		}, function(response) {
			console.log("3ds failure - initial");
		}, {
			amount: amount
		});
		
		tds_rebill.verify(function(response) {
			$("#rebill_cavv").val(response.authenticationValue);
			$("#rebill_ds_trans_id").val(response.dsTransId);
			$("#rebill_eci").val(response.eci);
			$("#rebill_acs_trans_id").val(response.acsTransId);
			$("#rebill_3d_version").val(response.protocolVersion);
		}, function(response) {
			console.log("3ds failure - rebill");
		},{
			amount: amount
		});
	}
	
	$("#cardNumber,#cardMonth,#cardYear").change(function() {
		var cc_number = $("#cardNumber").val();
		var cc_month = $("#cardMonth").val();
		var cc_year = $("#cardYear").val();
		
		if (cc_number != ""  && cc_month != "" && cc_year != "") {
			// submit immediately after user enters values
			get_3ds_tokens();
		}
	});
</script>
<?php endif; ?>
<?php Pixel::render('glucovita-v1', ['payment']);?>
</body>
</html>