Server : LiteSpeed System : Linux us-phx-web1202.main-hosting.eu 4.18.0-553.84.1.lve.el8.x86_64 #1 SMP Tue Nov 25 18:33:03 UTC 2025 x86_64 User : u615232177 ( 615232177) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/u615232177/domains/bond-lounge.com/public_html/ |
<?php session_start();
$page_name = basename($_SERVER['PHP_SELF']);
include("headerstrict.php"); ?>
<?php
if (isset($_GET['order_id'])){
$order_id = mysqli_real_escape_string($con,$_GET['order_id']);
$stmt = $con -> prepare('SELECT * FROM my_orders WHERE order_id=?');
$stmt -> bind_param('s',$order_id);
$stmt -> execute();
$stmt -> store_result();
$stmt -> bind_result($id,$user_id_db,$order_id,$total,$nice_date,$horrible_date,$status,$email_succesful,$email_delivered,$delivery_zone_complete,$payment_method);
$numrows = $stmt -> num_rows();
//status coloring
if($numrows > 0){
while ($stmt -> fetch()) {
//we use it for location
$location_api = $horrible_date;
$divided = explode('-',$delivery_zone_complete,2);
$delivery_zone_id = $divided[0];
$delivery_zone_fee = $divided[1];
//get the zone locations
$stmt_de = $con -> prepare('SELECT * FROM delivery_zones WHERE id = ?');
$stmt_de -> bind_param('s',$delivery_zone_id);
$stmt_de -> execute();
$stmt_de -> store_result();
$stmt_de -> bind_result($id_dz,$fee,$zone,$locations,$dis);
$numrows_de = $stmt_de -> num_rows();
if($numrows_de > 0){
while ($stmt_de -> fetch()) {}
}
if($status=="Pending"){$status_color="red";}
if($status=="Completed"){$status_color="forestgreen";}
}
}
else{echo "<meta http-equiv=\"refresh\" content=\"0; url=$link\">";exit();}
//only owner can view
if($user_id == $user_id_db){
}
else{echo "<meta http-equiv=\"refresh\" content=\"0; url=$link\">";exit();}
}
else{echo "<meta http-equiv=\"refresh\" content=\"0; url=$link\">";exit();}
?>
<title><?php echo $company_name; ?> - Order no <?php echo $order_id; ?></title>
<?php
$page_title = "Order $order_id";
$page_header = "shop_header.jpg";
include("page_header.php");
?>
<div class="checkout">
<div class="container">
<div class="row">
<div class="col-lg-6">
<div class="billing"><br/><br/>
<div class="checkout_title">Order Details</div><br/>
<div class='row'>
<?php
$stmt1 = $con -> prepare('SELECT * FROM cart_details WHERE order_id=?');
$stmt1 -> bind_param('s',$order_id);
$stmt1 -> execute();
$stmt1 -> store_result();
$stmt1 -> bind_result($id,$order_id,$product_id,$product_title,$product_price,$product_image,$qty);
$numrows1 = $stmt1 -> num_rows();
if($numrows1 > 0){
while ($stmt1 -> fetch()) {
//grab tags
$stmt_t = $con -> prepare('SELECT tags FROM products WHERE product_id=?');
$stmt_t -> bind_param('s',$product_id);
$stmt_t -> execute();
$stmt_t -> store_result();
$stmt_t -> bind_result($tags);
$numrows_t = $stmt_t -> num_rows();
if($numrows_t > 0){
while ($stmt_t -> fetch()) { }
}
echo"
<div class='col-6 col-sm-6 col-md-6 col-lg-6'>
<div style='border:1px solid lightgrey;padding:12px;border-radius:5px;'>
<a href='product_details?u=$product_id'>
<img src='site_img/products/$product_image' alt='' style='width:100px;height:100px;border-radius:5px;'><br/>
<b>$product_title"; if($tags !== ""){echo"($tags Inches)";} echo"</b></a><br/>";
echo $currency;
echo number_format((float)$product_price, 2, '.', ',');
echo
"
<br/>Qty - $qty<hr/>
</div> <br><br>
</div>";
$total = $qty * $product_price;
$total_array[] = $total;
}
echo"</div><!--end of row -->";
echo"<b>Status</b> <span class='number_box_order' style='color:$status_color;'>$status</span><br/>";
$grand_total = array_sum($total_array); ?>
<?php
//grand total
$gt = $grand_total + $delivery_zone_fee;
//no coverage
$amount_payable = $gt;
$amount_in_kobo = to_kobo($amount_payable);
echo"
<div class='lineo'></div>
<b>Subtotal</b><span class='number_box_order'>";echo $currency;echo number_format((float)$grand_total, 2, '.', ',');echo"</span><br/>
<b>Shipping Fee</b><span class='number_box_order'>";echo $currency;echo number_format((float)$delivery_zone_fee, 2, '.', ',');echo"</span><br>Zone $zone <span style='font-size:;'>$locations <br></span>";
echo"<div class='lineo'></div>";
echo"<b>Total</b> <span class='number_box_order the_color'>"; echo $currency; echo number_format((float)$gt, 2, '.', ',');echo"
</span><br>";
echo"<div class='lineo'></div>";
// amount payable
echo"
<div id='amount_payable_div'>
<b>Amount Payable</b>
<span id='amount_payable' class='number_box_order the_color'>"; echo $currency; echo number_format((float)$amount_payable, 2, '.', ',');echo"</span><br><br>
</div> ";
echo"<br/><br/>";
}
else{//echo "<meta http-equiv=\"refresh\" content=\"0; url=$link\">";exit();
}
?>
</div>
</div>
<div class="col-lg-6">
<div class="billing"><br/><br/>
<div class="checkout_title">Pay Online</div><br/>
<form method="POST" action="" class="php-email-form1">
<script src="https://js.paystack.co/v1/inline.js"></script>
<div style="text-align: center;">
<img src="site_img/paystack.png" style='width:100%;'/>
</div>
<br/><br/>
<br>
<div class="text-center">
<input type="hidden" name='order_id' value='<?php echo $order_id; ?>'>
<button type="button" id='btn_no_coverage' class="btn btn-primary hvr-hover" onclick="payWithPaystack()"> Pay <?php echo $currency; ?><?php echo number_format((float)$amount_payable, 2, '.', ','); ?> Securely
</button>
</div> <br><br>
</form>
<?php
$paystack_currency = "NGN";
?>
<script>
function payWithPaystack(){
var handler = PaystackPop.setup({
key: '<?php echo $ps_live; ?>',
email: '<?php echo $email; ?>',
amount: <?php echo $amount_in_kobo; ?>,
currency:'<?php echo $paystack_currency; ?>',
callback: function(response){
//alert('success. transaction ref is ' + response.reference);
window.location = "payment_result?<?php echo "order_id=$order_id&action=Paystack Payment&amount_paid=$amount_payable¤cy=$paystack_currency&"; ?>reference=" + response.reference;
},
onClose: function(){
//alert('window closed');
}
});
handler.openIframe();
}
</script>
</div>
</div>
</div>
</div>
</div>
<?php include("footer.php"); ?>