%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64 User : ndkhermy ( 1200) PHP Version : 8.5.12 Disable Function : NONE Directory : /home1/ndkhermy/www/website_6031bb72/admin/manage_order/ |
Upload File : |
<?php include '../function.php';
$grand_total = 0;
$currencyType = '';
if (isset($_GET['order_id'])) {
$Order = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `order_tbl` WHERE order_id ='" . $_GET['order_id'] . "'"));
$$currencyType = $Order['currencyType'];
if ($Order['type'] == 'User') {
$UserTbl = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `new_user_tbl` WHERE user_id ='" . $Order['user_id'] . "'"));
}
$OrderDtl = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `order_detail_tbl` WHERE order_id ='" . $Order['order_id'] . "'"));
}
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="<?= $base_url ?>images/Upload/logo/<?= $rows_website['favicon'] ?>" type="image/x-icon" />
<link href="<?= $base_url ?>css/font-awesome.min.css" rel="stylesheet">
<link href="<?= $base_url ?>vendors/linearicons/style.css" rel="stylesheet">
<link href="<?= $base_url ?>vendors/flat-icon/flaticon.css" rel="stylesheet">
<title>Invoice - <?= $Order['order_id'] ?></title>
</head>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
background-color: #f4f4f4;
}
.invoice-container {
background-color: #fff;
padding: 30px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 900px;
margin: 20px auto;
}
.invoice-container img{
width: auto;
height: max-content;
}
.header {
align-items: center;
margin-bottom: 30px;
}
.invoice-meta {
display: flex;
justify-content: space-between;
font-size: 0.9em;
}
.details-section {
display: flex;
justify-content: space-between;
margin-bottom: 30px;
border-bottom: 1px solid #eee;
padding-bottom: 20px;
}
.from-details,
.deliver-to-details {
width: 48%;
}
.details-section h3 {
margin-top: 0;
color: #333;
}
.details-section p {
margin: 5px 0;
font-size: 0.9em;
}
.product-section table {
width: 100%;
border-collapse: collapse;
margin-bottom: 30px;
}
.product-section th,
.product-section td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
font-size: 0.9em;
}
.product-section th {
background-color: #f2f2f2;
}
.product-section img {
max-width: 60px;
height: auto;
display: block;
margin: 0 auto;
}
.summary-section {
float:right;
width:33%;
margin-bottom: 20px;
font-size: 0.9em;
}
.summary-section p {
margin: 5px 0;
}
.payment-status {
float:right;
width:33%;
font-weight: bold;
font-size: 1.1em;
}
.payment-status .pending0 {
color: orange;
background-color: #ffe0b2;
padding: 5px 10px;
border-radius: 5px;
}
.payment-status .pending2 {
color: Red;
background-color: #ffb2b2ff;
padding: 5px 10px;
border-radius: 5px;
}
.payment-status .pending1 {
color: green;
background-color: #b5ffb2ff;
padding: 5px 10px;
border-radius: 5px;
}
.print-btn {
display: block;
margin: 20px auto;
padding: 10px 20px;
background: #333;
color: #fff;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 1em;
}
.invoice-container .pro-logo{
width: auto;
height: 120px;
margin-bottom: 10px;
}
.invoice-container .pro-img{
width: auto;
height: 60px;
}
@media print {
.print-btn {
display: none;
}
/* When printAddress() is triggered */
body.print-address .product-section,
body.print-address .summary-section,
body.print-address .payment-status {
display: none !important;
}
}
</style>
<body>
<!-- Print Buttons -->
<div style="display: flex;">
<!-- <button class="print-btn" onclick="printAddress()">Print Address</button>
<button class="print-btn" onclick="window.print()">Print Invoice</button> -->
</div>
<div class="invoice-container">
<center><img src="<?=$base_url.'images/Upload/logo/'.$rows_website['logo'] ?>" alt="<?= $rows_website['website_name'] ?>" class="pro-logo"></center>
<div class="header">
<div class="invoice-meta">
<span><strong>Date: </strong><?= $Order['recieve_date'] ?></span>
<span><strong>Order ID: </strong><?= $Order['order_id'] ?></span>
<span><strong>User Type: </strong><?= $Order['type'] ?></span>
</div>
</div>
<div class="details-section">
<div class="from-details">
<h3><i class="fa fa-location-arrow" style="margin-right:8px;"></i>From</h3>
<p><strong>Website Name: </strong> <?= $rows_website['website_name'] ?></p>
<p><strong>Website Email: </strong> <?= $rows_website['website_email_id'] ?></p>
<p><strong>Mobile No: </strong> +<?= $rows_website['mobile_number1'] ?></p>
<p><strong>Website Address: </strong> <?= $rows_website['website_address'] ?></p>
</div>
<div class="deliver-to-details">
<h3><i class="fa fa-truck" style="margin-right:8px;"></i>Deliver to</h3>
<!-- <p><strong>Name: </strong> <?= $OrderDtl['name'] ?></p>
<p><strong>Email: </strong> <?= $OrderDtl['email'] ?></p>
<p><strong>Phone: </strong> <?= $OrderDtl['phone'] ?></p>
<p><strong>City: </strong> <?= $OrderDtl['city'] ?></p>
<p><strong>ZIP: </strong> <?= $OrderDtl['zip'] ?></p> -->
<!-- <p><strong>Address : </strong> </?= $OrderDtl['address'] ?></p> -->
<?php $val = explode(' - ', $Order['address'] ?? '');
$country_name = $val[0] ?? '';
$city = $val[1] ?? '';
$address_code = $val[2] ?? '';
$name = $val[3] ?? '';
$phone = $val[4] ?? '';
?>
<p><strong>Country : </strong> <?= htmlspecialchars($country_name) ?><br>
<strong>City : </strong> <?= htmlspecialchars($city) ?><br>
<strong>Address Code : </strong> <?= htmlspecialchars($address_code) ?><br>
<strong>Name : </strong> <?= htmlspecialchars($name) ?><br>
<strong>Phone : </strong> +<?= htmlspecialchars($phone) ?><br></p>
<!-- <p><strong>Delivery Method: </strong> Home Delivery</p> -->
<!-- <p><strong>Payment Method: </strong> <?= ($Order['payment_method'] == "cod") ? 'Case On Delivery' : 'Card Payment' ?></p> -->
</div>
</div>
<p><strong>Transaction ID: </strong> <?= $Order['transaction_id'] ?></p>
<div class="product-section">
<table>
<thead>
<tr>
<th>SR.NO</th>
<th>IMAGE</th>
<th>PRODUCT DETAILS</th>
<th>PRICE</th>
<th>QUANTITY</th>
<th>TOTAL</th>
</tr>
</thead>
<tbody>
<?php
$subtotal = 0;
$n=1;
$sql = mysqli_query($conn, "SELECT * FROM order_detail_tbl WHERE order_id='" . $Order['order_id'] . "'");
while ($fetch_row = mysqli_fetch_assoc($sql)) {
$product_row = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `product_tbl` WHERE id ='" . $fetch_row['product_id'] . "'"));
$brand_row = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `category_tbl` WHERE id='" . $product_row['cat_id'] . "'"));
$model_row = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `sub_category_tbl` WHERE id='" . $product_row['sub_cat_id'] . "'"));
$eachProductTotal = $fetch_row['amount'];
$grand_total += $eachProductTotal;
?>
<tr>
<td><?=$n;$n++?></td>
<td><img src="<?= $base_url ?>images/Upload/product/<?= $product_row['image1'] ?>" alt="Product Image" class="pro-img"></td>
<td>
<p> <strong>Product ID: </strong> <?=$product_row['product_id']?><br>
<strong>Name: </strong> <?= $product_row['title'] ?><br>
<strong>Brand :</strong> <?php if (isset($_COOKIE['ar'])){ echo $brand_row['title_ar']; }else{ echo $brand_row['title']; } ?><br>
<strong>Model :</strong> <?php if (isset($_COOKIE['ar'])){ echo $model_row['title_ar']; }else{ echo $model_row['title']; } ?><br>
</p>
</td>
<td><?=$currencyType.' '.number_format($fetch_row['price'],2)?></td>
<td><?=$fetch_row['quantity']?></td>
<td> <?=$currencyType.' '.number_format($eachProductTotal,2)?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="summary-section">
<p><strong>Subtotal:</strong> <?=$currencyType.' '. number_format($grand_total,2) ?></p>
<p><strong>Coupon:</strong> <?= $Order['coupon'] ?></p>
<p><strong>Coupon Discount:</strong><?=$currencyType.' '. number_format($Order['discount'],2) ?></p>
<p><strong>Shipping cost:</strong> <?=$currencyType.' '. number_format($Order['shipping'],2) ?></p>
<!-- <p><strong>VAT:</strong> </?= $Order['vat'] ?>%</p> -->
<p><strong>Grand total:</strong> <?=$currencyType.' '. number_format($Order['total_amount'],2) ?></p>
</div>
<div style="clear:both"></div>
<div class="payment-status">
<p><strong>Payment Status:</strong> <span class="pending<?=$Order['status']?>"><?php if($Order['status']==0){ echo 'Pending'; }elseif($Order['status']==2){ echo 'Failed'; }else{ echo 'Successfully'; } ?></span></p>
</div>
<div style="clear:both"></div>
</div>
</body>
</html>