<?php
session_start();
include("includes/database.php");
include("functions/functions.php");
include("count.php");
hit_count();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Shopping Cart | Babykish</title>
<meta name="keywords" content="online shopping Dubai, online shopping" />
<meta name="description" content="" />
<?php include("includes/shop-head.php"); ?>
</head>
<body>
<div class="page-wrapper">
<?php include("includes/header.php"); ?>
<main class="main cart">
<div class="page-content pt-5 pb-5">
<div class="container-fluid mt-7 mb-2">
<div class="row">
<div class="col-lg-8 col-md-12 pr-lg-4">
<table class="shop-table cart-table">
<thead>
<tr>
<th><span>Product</span></th>
<th></th>
<th><span>Price</span></th>
<th><span>quantity</span></th>
<th>Subtotal</th>
</tr>
</thead>
<tbody class="myCartPage_products">
</tbody>
</table>
<div class="cart-actions mb-6 pt-4">
<a href="online-shopping" class="btn btn-dark btn-md btn-rounded btn-icon-left mr-4 mb-4">
<i class="d-icon-arrow-left"></i>Continue Shopping
</a>
</div>
</div>
<?php
include("includes/database.php");
$retr_custDbEma = "";
$retr_custDbFn = "";
$retr_custDbPhn = "";
$retr_custDbFlAd = "";
if(isset($_SESSION["customer_email"])){
$retri_cstEmail = $_SESSION["customer_email"];
$runRet_cstEmail = mysqli_query($con, "select * from customers where customer_email = '$retri_cstEmail' LIMIT 1");
$rowRet_cstEmail = mysqli_fetch_array($runRet_cstEmail);
$retr_custDbEma = $rowRet_cstEmail["customer_email"];
$retr_custDbFn = $rowRet_cstEmail["customer_name"];
$retr_custDbPhn = $rowRet_cstEmail["customer_phone"];
$retr_custDbFlAd = $rowRet_cstEmail["customer_address"];
}else{
$retr_custDbEma = "";
$retr_custDbFn = "";
$retr_custDbPhn = "";
$retr_custDbFlAd = "";
}
?>
<aside class="col-lg-4 sticky-sidebar-wrapper">
<div class="sticky-sidebar" data-sticky-options="{'bottom': 20}">
<div class="summary mb-4">
<h3 class="summary-title text-left">Order Now</h3>
<div class="row mb-2">
<div class="col-md-12 mb-2">
<input type="email" class="form-control" placeholder="Email Address *" value="<?php echo $retr_custDbEma; ?>" id="form_custEmailAd" />
</div>
<div class="col-md-12 mb-2">
<input type="text" class="form-control" placeholder="Full Name *" value="<?php echo $retr_custDbFn; ?>" id="form_custName" />
</div>
<div class="col-md-12 mb-2">
<input type="text" class="form-control" placeholder="Phone Number *" value="<?php echo $retr_custDbPhn; ?>" id="form_custPhoNum" />
<input type="hidden" id="w3lhidden" />
</div>
<div class="col-md-12 mb-2">
<select class="form-control" id="form_custCity">
<option value="null">Select Emirate</option>
<option value="Dubai">Dubai</option>
<option value="Abu Dhabi">Abu Dhabi</option>
<option value="Al Ain">Al Ain</option>
<option value="Sharjah">Sharjah</option>
<option value="Fujairah">Fujairah</option>
<option value="Ras Al Khaimah">Ras Al Khaimah</option>
<option value="Umm Al Quwain">Umm Al Quwain</option>
<option value="Ajman">Ajman</option>
</select>
</div>
<div class="col-md-12 mb-2">
<input type="text" class="form-control" placeholder="Full Address *" value="<?php echo $retr_custDbFlAd; ?>" id="form_custFullAdr" />
<small>Include Building Name / Flat No. / Villa No. / Area Name</small>
</div>
<div class="col-md-12 mb-2">
<textarea class="form-control" rows="5" placeholder="Additional Comment" id="form_custAddCom"></textarea>
</div>
</div>
<table class="shipping">
<tr class="summary-subtotal">
<td>
<h4 class="summary-subtitle">Subtotal</h4>
</td>
<td>
<p class="summary-subtotal-price total_price"><?php echo $wiscoy_currency; ?>0.00</p>
</td>
</tr>
<tr class="summary-subtotal">
<td>
<h4 class="summary-subtitle">Delivery fee:</h4>
</td>
<td>
<p class="summary-subtotal-price"><?php echo $wiscoy_currency; ?>0.00</p>
</td>
</tr>
</table>
<table class="total">
<tr class="summary-subtotal">
<td>
<h4 class="summary-subtitle">Total</h4>
</td>
<td>
<p class="summary-total-price ls-s total_price"><?php echo $wiscoy_currency; ?>0.00</p>
</td>
</tr>
</table>
<a href="#" class="btn btn-dark btn-rounded btn-checkout">Checkout</a>
<h3 class="text-center btn-wait mt-5" style="display:none;">Please Wait</h3>
</div>
</div>
</aside>
</div>
</div>
</div>
</main>
<script>
$("body").delegate(".btn-checkout","click",function(event){
event.preventDefault();
$(".btn-checkout").hide();
$(".btn-wait").show();
var form_custEmailAd = $("#form_custEmailAd").val();
var form_custName = $("#form_custName").val();
var form_custPhoNum = $("#form_custPhoNum").val();
var form_custCity = $("#form_custCity").val();
var form_custFullAdr = $("#form_custFullAdr").val();
var form_custAddCom = $("#form_custAddCom").val();
var hiddenInput = $("#w3lhidden").val();
if(form_custEmailAd == "" || form_custName == "" || form_custPhoNum == "" || form_custCity == "null" || form_custFullAdr == ""){
swal({
title: "Please Provide All The Needed Details, Thanks!",
text: "Thanks for Shopping With Us!",
icon: "warning",
button: "Click to Continue!",
});
$(".btn-checkout").show();
$(".btn-wait").hide();
}else if(hiddenInput != ""){
}else if(IsEmail(form_custEmailAd)==false){
$(".btn-checkout").show();
$(".btn-wait").hide();
swal({
title: "Please Provide A Valid Email Address!",
text: "Thanks for Shopping With Us!",
icon: "warning",
button: "Click to Continue!",
});
return false;
}else{
$.ajax({
type: "POST",
url: "guestAccountCreateData.php",
data: { send_guestEmail:form_custEmailAd, send_guestName:form_custName, send_guestMobile:form_custPhoNum, send_guestCity:form_custCity, send_guestAddress:form_custFullAdr, send_form_custAddCom:form_custAddCom },
success:function(new_entry){
if(new_entry == "success"){
swal({
title: "Your Order Has Been Received!",
text: "Thanks for Shopping With Us!",
icon: "success",
button: "Click to Continue!",
});
setTimeout(function(){
//window.location.href = "https://www.childrendc.com/confirm-order";
window.location.href = "confirm-order";
}, 1500);
}else{
swal({
title: "There Seem To Be A Problem, Please Try Again!",
text: "Thanks for Shopping With Us!",
icon: "warning",
button: "Click to Continue!",
});
$(".btn-checkout").show();
$(".btn-wait").hide();
}
}
});
}
});
function IsEmail(email){
var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(!regex.test(email)) {
return false;
}else{
return true;
}
}
</script>
<?php include("includes/footer.php"); ?>
</body>
</html>