<!doctype html>
<html class="no-js" lang="zxx">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Sudila Printers - Kurunegala Sri Lanka</title>
<meta name="description" content="Sudila Printers">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Favicons -->
<link rel="shortcut icon" href="images/favicon.ico">

<!-- Google font (font-family: 'Roboto', sans-serif; Poppins ; Satisfy) -->
<link type="text/css" href="css/font_opensans.css" rel="stylesheet">
<link type="text/css" href="css/font_poppins.css" rel="stylesheet">
<link type="text/css" href="css/font_roboto.css" rel="stylesheet">
<!-- Stylesheets -->
<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="css/plugins.css">
<link type="text/css" rel="stylesheet" href="css/style.css">
<!-- Cusom css -->
<link type="text/css" rel="stylesheet" href="css/custom.css">
<!-- Modernizer js -->
<script type="text/javascript" src="js/vendor/modernizr-3.5.0.min.js"></script>
<style type="text/css">
.wn__order__box h3.onder__title {
    text-transform: unset;
    font-size: 18px;
    font-weight: 500;
    padding: 15px;
	border-bottom: none;
}
.text-orange {
    color: #db6c00;
}
blockquote {
    margin: 15px 30px;
}
@media only screen and (max-width: 767px) {
	blockquote {
		margin: 15px 0px 0;
	}
}
</style>
</head>
<body>
<!-- Main wrapper -->
<div class="wrapper" id="wrapper">
  <div id="pre_loader"></div>
  <!-- Header -->
  <?php include 'common/header.php';
	if(isset($_GET['order_id']) && !empty($_GET['order_id'])) {
		$o_id = htmlspecialchars(strip_tags(trim($_GET['order_id'])), ENT_QUOTES, 'UTF-8');
		$sql_ordr = mysqli_fetch_assoc(mysqli_query($conn, "SELECT tel_no FROM order_details WHERE inv_no='$o_id'"));
		$tel_no = $sql_ordr['tel_no'];
		
		if (isset($_SESSION['temp_user_bb'])) {
			unset($_SESSION['temp_user_bb']);
			unset($_SESSION['guest_user_bb']);
		}

	} else {
		$redirectUrl = "index";
		echo "<script type=\"text/javascript\">";
		echo "window.location.href = '$redirectUrl'";
		echo "</script>";	
	}
  ?>
  <!-- //Header --> 
  <!-- Start Bradcaump area -->
  <div class="ht__bradcaump__area bg-image--4">
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
          <div class="bradcaump__inner text-center">
            <h2 class="bradcaump-title">Order Confirm</h2>
            <nav class="bradcaump-content"> <a class="breadcrumb_item" href="index">Home</a> <span class="brd-separetor">/</span> <span class="breadcrumb_item active">Order Confirm</span> </nav>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- End Bradcaump area --> 

        <section class="wn__checkout__area pt--30 pb--30 bg__white">
        	<div class="container">
        		<div class="row">
        			<div class="col-lg-12">
        				<div class="wn__order__box">
        					<h3 class="onder__title text-left">Thank for your purchase!</h3>
        				</div>
						<blockquote>Your order has been received. <span class="d-flex">Your order number is: &nbsp;<h6 class="text-orange"><?php echo $o_id; ?></h6></span>You will receive an order confirmation email with details of your order.<br/>
							<div class="mt--20 row">
								<div class="col-md-12 d-flex justify-content-between">
									<div class="submite__btn">
										<a href="bookstore-sudila-printers-sri-lanka">Continue Shopping</a>
									</div>
								</div>
							</div>
						</blockquote>
        			</div>
        		</div>
        	</div>
        </section>

<input type="hidden" value="<?php echo $o_id; ?>" id="inv_id">
<input type="hidden" value="<?php echo $tel_no; ?>" id="tel_no">

  <!-- Footer Area -->
  <?php include 'common/footer.php'; ?>
  <!-- //Footer Area --> 
</div>
<!-- //Main wrapper -->
<!-- JS Files --> 
<script type="text/javascript" src="js/vendor/jquery-3.2.1.min.js"></script> 
<script type="text/javascript" src="js/popper.min.js"></script> 
<script type="text/javascript" src="js/bootstrap.min.js"></script> 
<script type="text/javascript" src="js/plugins.js"></script> 
<script type="text/javascript" src="js/active.js"></script>
<script type="text/javascript" src="js/add-to-cart.js"></script>
<script type="text/javascript">
$(document).ready(function () {
	var inv_id = $("#inv_id").val();
	var mobile_no = $("#tel_no").val();
	send_sms_fun(mobile_no, inv_id);
	
	localStorage.removeItem('delvry_type_b');
	localStorage.removeItem('country_b');
});

function send_sms_fun(mobile_no, inv_id) {
	var msg = "Your order has been successfully placed. Thank you! Order ID is "+inv_id+" sudila.esrilanka.org"; 
	var res = mobile_no.substring(1);
	var tel = '94'+res;
	
	$.ajax({
		type: "POST",
		async: false,
		dataType: 'jsonp',
		url: "https://sms.textware.lk:5001/sms/send_sms.php",
		data: {'username': 'samudra_group',
		'password': 'smr56grp',
		'src': 'Samudra',
		'dst': tel,
		'msg': msg,
		'dr': '1',           
		},
		success: function (response) {
		//alert(response);
		}		
	});
}
</script>
</body>
</html>