<?php 

	include("_global.php");
	//require("add-ons/Pixel.php");
	
	if (isset($_SESSION["orderId"])) {
		$conf = $konnektive->confirm_order(array(
			"orderId" => $_SESSION["orderId"]
		));

		
	}

	$orders=$konnektive->get_order($_SESSION["orderId"]);
	
?>
<pre><?php //print_r($orders); ?></pre>
<!DOCTYPE html>
<html lang="en">
    <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta charset="utf-8"/>
		<title><?php echo $configs->page_title;?></title>
		<meta name="description" content="<?php echo $configs->step1_name;?>" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
		<meta http-equiv="content-language" content="en-us" />
		<meta name="apple-mobile-web-app-capable" content="yes"/>
		<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
		<meta name="HandheldFriendly" content="true"/>
		<meta name="viewport" content="width=device-width,user-scalable=no"/>
		<link href="<?php echo $configs->root_path . "/assets/css/app.css"; ?>" rel="stylesheet">
		<link rel="shortcut icon" type="/assets/image/x-icon" href="<?php echo $configs->root_path . "/assets/brand/favicon.png"; ?>">
		<link rel="stylesheet" href="<?php echo $configs->root_path . "/assets/css/upsells/bootstrap.min.css"; ?>">
		<link rel="stylesheet" href="<?php echo $configs->root_path . "/assets/css/ty-style.css"; ?>">
		<style>
			.addNewD{
				text-align: center;
			}
			.pic_1{
				display: inline-block;
			}
			.lead {
				font-size: 1rem;
			}
			.table td, .table th {
				vertical-align: middle!important;
			}
			ul.small li {
				list-style-type: disc!important;
			}
		</style>
		<?php include_once('./sentry.php'); ?>
		<script>
			history.pushState(null, null, window.location.href);
			history.back();
			history.forward(); 
			window.onpopstate = function () { history.go(1); };
		</script>
	</head>
	<body>
        <div class="container">
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="header clearfix" style="border-bottom:1px solid #ccc;margin-bottom:15px;padding-bottom:5px;">
                        <nav>
                            <ul class="nav nav-pills pull-right">
                                <li role="presentation">
                                    <h3><a href="tel:-<?php echo $configs->customer_service_number; ?>">Customer Service Support: <span style="font-weight:bold;color:#000;" class="active phone-text d-md-inline d-block">US: <?php echo $configs->customer_service_number; ?> </span>
                                        </a>
                                    </h3>
                                </li>
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>
			<div class="row">
				<div class="col">
					<div id="success" class="alert alert-success" role="alert">
						<span class="lead text-center">
						<strong>Thank You! Your Hello Healthy Glucose Coffee is On Its Way</strong>
						<br />We’re excited to support your journey to better blood sugar, steady energy, and vibrant health.
						</span>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-12 col-md-6 text-center">
                	<img src="<?php echo $configs->root_path . "/assets/images/checkmark.gif"; ?>"  width="92" height="91" alt="" />
                		<br> 
					<?php if ($_SESSION["package"] == 5): ?>
						<img src="<?php echo $configs->root_path . "/assets/brand/product2-3.png"; ?>" width="245" height="205" class="img-responsive pic_1" alt="" />
					<?php elseif($_SESSION["package"] == 3): ?>
						<img src="<?php echo $configs->root_path . "/assets/brand/product2-2.png"; ?>" width="245" height="205" class="img-responsive pic_1" alt="" />
					<?php else: ?>
						<img src="<?php echo $configs->root_path . "/assets/brand/product.png"; ?>" width="245" height="205" class="img-responsive pic_1" alt="" />
					<?php endif; ?>
				</div>
				<div class="col-sm-12 col-md-6">
					<h1>What Happens Next:</h1>
					<p><strong>Processing Time:</strong> Your order will ship within <strong>3 business days</strong>.</p>
					<p><strong>Shipping Time:</strong> Expect delivery in <strong>3-5 business days</strong> after shipping.</p>
					<p><strong>Tracking Info:</strong> You’ll get an email with your tracking number as soon as your order ships — check your inbox (or spam folder) for updates.</p>
					<p><strong>Need Help?</strong> Call us at <strong><?php echo $configs->customer_service_number; ?></strong> or email <a href="mailto:support@shopjba.com">support@shopjba.com</a> for any questions about your order.</p>
					<p>If you don’t see that email, please check your spam or contact our support team.</p>
					<h4>Order Summary</h4>
					<table class="table">
						<tbody>
							<?php foreach ($orders->items as $key => $value) {?>
								
								<tr>
									<td rowspan="2" style="width:80px;"><img src="assets/brand/<?php echo strtolower(str_replace(' ', '-', $value->name)); ?>.png" class="img-thumbnail img-fluid" width="40" height="40" /></td>
									<td><?php echo $value->name;?></td>
									<td><?php echo "$".$value->price;?></td>
								</tr>
								<tr>
									<td>Shipping</td>
									<td><?php echo ($value->shipping>0)? "$".$value->shipping : "FREE";?></td>
								</tr>
							<?php }?>
							
							<tr>
								<td></td>
								<td><h4>Total Amount</h4></td>
								<td><h4><?php echo number_format(((float)$orders->totalAmount + (float)$orders->baseShipping), 2, '.', ''); ?></h4></td>
							</tr>
							
						</tbody>
					</table>
					<h4 class="text-center">What You Ordered:</h4>
					<p class="text-center"><strong>Your order includes clinically supported ingredients like:</strong> </p>
					<ul class="small">
						<li><strong>Reducose® White Mulberry</strong> – helps block sugar absorption
						</li>
						<li><strong>ABALife™ Fig Extract</strong> – supports insulin sensitivity
						</li>
						<li><strong>Trojan22® Blend</strong> – helps regulate glucose and carb metabolism
						</li>
						<li><strong>Cordyceps, Coffee Cherry & Caffeine</strong> – to keep you energized, focused, and balanced
						</li>
					</ul>
				</div>
		</div>
		
		<div class="row">
			<div class="col text-center">
                <img src="<?php echo $configs->root_path . "/assets/images/footer-logos-image.png"; ?>" width="960" height="87" class="center-block img-responsive" alt="">
                <br>
                <div class="col-lg-12 content centered" style="font-size:12px;">
                    <div id="disclaimers">
                        <p></p>
                        <center>
                              [ <a href="javascript:void(0);" onClick="openNewWindow('disclosures/terms.php','modal');">Terms & Conditions</a> ] 
                             [ <a href="javascript:void(0);" onClick="openNewWindow('disclosures/privacy.php','modal');">Privacy Policy</a> ]
                             | Toll Free<a href="tel:<?php echo $configs->customer_service_number; ?>"> <?php echo $configs->customer_service_number; ?></a>
                            <br>
                        </center>
                        <br>
                        <br>
                        <center>
                            <?php echo $configs->step1_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.
                        </center>
                        <p></p>
                        <p></p>
                        <p></p>
                        <center>
                            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.
                        </center>
                        <br>
                        <br>© <script type="text/javascript">var year = new Date();document.write(year.getFullYear());</script> <?php echo $configs->corporate_name;?>, All rights reserved
                        <br>
                        <p></p>
                    </div>
                </div>
			</div>
		</div>
		<script type="text/javascript" src="<?php echo $configs->root_path . "/assets/js/jquery.min.js"; ?>"></script> 
		<script type="text/javascript">
		    // Popup JS
		    function openNewWindow(page_url, type, button, 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><div id="p-frame"></div>';
		            if (button) {
		                html += '<div id="bottom"><p>Please scroll down to activate Accept button</p><button onclick="chkBox()" disabled="disabled">' + button + '</button></div>';
		            }

		            html += '</div></div>';

		            if (!$('#app_common_modal').length) {
		                $('body').append(html);
		            }
		            $('#app_common_modal').fadeIn();
		        }
		        // Hide Popup
		        $('#app_common_modal_close').click(function () {
		            $('#app_common_modal').remove();
		        });

		        $.ajax({
		            url: page_url,
		        }).done(function (data) {
		            $('#p-frame').html(data);
		            $('#p-frame').scroll(function () {
		                if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 50) {
		                    $('#bottom button').removeAttr('disabled');
		                }
		            })

		        });
		    }
		</script>
    </body>
</html>