GIF89a php
Current File : /home/hencockfreshchic/public_html/invoice.php
<?php
ob_start();
ini_set('error_reporting', E_STRICT);
include("connect.php");
include("libs.php");
mysqli_set_charset($conn,'utf8');
date_default_timezone_set('Asia/Kolkata');

if($_COOKIE["user_id"]=="")
{
  echo '<script>window.location.href="login.php";</script>';
}

if($_GET['prod_id']=="" || $_GET['sr']=="")
{
  echo '<script>window.location.href="order-complete.php";</script>';
}

$datee=orderDetail($conn,$_GET['sr'],"datee");
$order_id=orderDetail($conn,$_GET['sr'],"order_id");

?>
<style>
.top_rw{ background-color:#f4f4f4; }
.td_w{ }
button{ padding:5px 10px; font-size:14px;}
.invoice-box {
max-width: 890px;
margin: auto;
padding:10px;
border: 1px solid #eee;
box-shadow: 0 0 10px rgba(0, 0, 0, .15);
font-size: 14px;
line-height: 24px;
font-family: "Helvetica Neue","Helvetic", Helvetica, Arial, sans-serif;
color: #555;
}
.invoice-box table {
width: 100%;
line-height: inherit;
text-align: left;
border-bottom: solid 1px #ccc;
}
.invoice-box table td {
padding: 5px;
vertical-align:middle;
}
.invoice-box table tr td:nth-child(2) {
text-align: right;
}
.invoice-box table tr.top table td {
padding-bottom: 20px;
}
.invoice-box table tr.top table td.title {
font-size: 45px;
line-height: 45px;
color: #333;
}
.invoice-box table tr.information table td {
padding-bottom: 40px;
}
.invoice-box table tr.heading td {
background: #eee;
border-bottom: 1px solid #ddd;
font-weight: bold;
font-size:12px;
}
.invoice-box table tr.details td {
padding-bottom: 20px;
}
.invoice-box table tr.item td{
border-bottom: 1px solid #eee;
}
.invoice-box table tr.item.last td {
border-bottom: none;
}
.invoice-box table tr.total td:nth-child(2) {
border-top: 2px solid #eee;
font-weight: bold;
}
@media only screen and (max-width: 600px) {
.invoice-box table tr.top table td {
width: 100%;
display: block;
text-align: center;
}
.invoice-box table tr.information table td {
width: 100%;
display: block;
text-align: center;
}
}
/** RTL **/
.rtl {
direction: rtl;
font-family: Tahoma, "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
}
.rtl table {
text-align: right;
}
.rtl table tr td:nth-child(2) {
text-align: left;
}
.logo_section
{
margin-bottom: 20px;
}
</style>

<div class="invoice-box">
  
  <table cellpadding="0" cellspacing="0">
    <tr class="logo_section text-center">
      <img src="images/logo.png" style="height: 80px;">
    </tr>
    <tr class="top_rw mt-3">
      <td colspan="2">
        <h2 style="margin-bottom: 0px;"> Tax invoice</h2>
        <span style=""> Invoice No: <?php echo $order_id; ?> Date: <?php echo $datee; ?> </span>
      </td>
      <td  style="width:30%; margin-right: 10px;">
        Order Id: <?php echo $order_id; ?>
      </td>
    </tr>
    <tr class="top">
      <td colspan="3">
        <table>
          <tr>
            <td>
              <b> Sold By: Jungle Basket </b> <br>
              Sonipat village - Khori <br>Sonipat Village-Khori <br>Sonipat 1100662 <br>
              
              GSTIN: 07BYHPA0360H1ZV <br>
            </td>
            <td>
              <b> Support </b> <br>
              <b>Phone No :</b> 6397652448<br>
              <b>Email Id :</b> info@junglebasket.in<br>
              <b>Website :</b> https://junglebasket.in
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr class="information">
      <td colspan="3">
        <table>
          <tr>
            <td colspan="2">
              <b> Shipping Address: </b> <br>
         
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"uname","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"bill_adds","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"cityy","1"); ?><?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"state","1"); ?><br>
              Landmark: <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"bill_land","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"mobb","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"uemail","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"pincode","1"); ?><br>
            </td>
            <td> <b> Billing Address:</b><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"uname","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"bill_adds","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"cityy","1"); ?><?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"state","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"bill_land","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"mobb","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"uemail","1"); ?><br>
              <?php echo shpAddByOrderID($conn,$_COOKIE["user_id"],$order_id,"pincode","1"); ?><br>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <td colspan="3">
      <table cellspacing="0px" cellpadding="2px">
        <tr class="heading">
          <td style="width:25%;">
            ITEM
          </td>
          <td style="width:10%; text-align:center;">
            QTY.
          </td>
          <td style="width:10%; text-align:right;">
            PRICE (INR)
          </td>
          <td style="width:15%; text-align:right;">
            TAX RATE & TYPE
          </td>
          <td style="width:15%; text-align:right;">
            TAX AMOUNT (INR)
          </td>
          <td style="width:15%; text-align:right;">
            TOTAL AMOUNT (INR)
          </td>
        </tr>
        <?php
          $sqlO="SELECT * FROM `incoming_order` WHERE `sr`='".$_GET['sr']."'";
          $rsO=mysqli_query($conn,$sqlO);
          $rowO=mysqli_fetch_assoc($rsO);

          $sqlP="SELECT * FROM `products` WHERE `sr`='".$rowO["prod_id"]."'";
          $rsP=mysqli_query($conn,$sqlP);
          $rowP=mysqli_fetch_assoc($rsP);

          $amount=$rowO["prod_price"];
          $gst=($amount*18)/100;
          $shp=$rowP["ship_chrg"];
          $pure_amount=$amount-$gst-$shp;
        ?>

        <tr class="item">
          <td style="width:25%;">
            <?php echo $rowP["p_name"]; ?>
            HSN Code :'<?php echo $rowO["prod_code"]; ?>         
          </td>
          <td style="width:10%; text-align:center;">
            <?php echo $rowO["prod_qty"]; ?>
          </td>
          <td style="width:10%; text-align:right;">
            <?php echo $pure_amount; ?>
          </td>
          <td style="width:15%; text-align:right;">
            18% GST(Included)
          </td>
          <td style="width:15%; text-align:right;">
            <?php echo $gst; ?>(GST) +<?php echo $shp; ?>(Shipping Charge)".'
          </td>
          <td style="width:15%; text-align:right;">
            <?php echo $amount; ?>
          </td>
        </tr>
        <tr class="item">
          <td style="width:25%;"> <b> Grand Total </b> </td>
          <td style="width:10%; text-align:center;">
            <?php echo $rowO["prod_qty"]; ?>
          </td>
          <td style="width:10%; text-align:right;">
            <?php echo $pure_amount; ?>
          </td>
          <td style="width:15%; text-align:right;">
          </td>
          <td style="width:15%; text-align:right;">
            <?php echo $gst+$shp; ?>
          </td>
          <td style="width:15%; text-align:right;">
            <?php echo $amount; ?>
          </td>
        </tr>
      </td>
    </table>
    <tr class="total">
      <td colspan="3" align="right">  Total Amount :  <b> <?php echo $amount; ?>  </b> </td>
    </tr>
    <tr>
      <td colspan="3">
        <table cellspacing="0px" cellpadding="2px">
          <tr>
            
            <td colspan="2">
              * This is a computer generated invoice and does not
              require a physical signature
            </td>
          </tr>
          <tr>
            <td width="50%">
            </td>
            <td>
              <b> Authorized Signature </b>
              <br>
              <br>
              ...................................
              <br>
              <br>
              <br>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</div>
<?php

$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$dompdf->stream("Good Leather",array("Attachment"=>0));

?>