<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
require("includes/zcompany.php");
include ('includes/function.php');

$vouch = $_GET['vouchno'];
$ztit = $_SESSION["tit"];
$zdb = $_SESSION["zdbyear_bmexp"];

mysqli_select_db($conn, $zdb);
$cond = '';
$lcond = '';

if (!empty($_POST['frmiv']) && !empty($_POST['toinv'])) {
    $frmiv = trim($_POST['frminv']);
    $toinv = trim($_POST['toinv']);

    $cond = "AND a.locker >= '$frmiv' AND a.locker <='$toinv'  ";
}




if (!empty($_POST['frmledger']) && !empty($_POST['toledger'])) {
    $frmledger = trim($_POST['frmledger']);
    $toledger = trim($_POST['toledger']);

    $lcond = "AND a.custcode >= '$frmiv' AND a.custcode <='$toinv'  ";
}




$qry = mysqli_query($conn, "SELECT *, DATE_FORMAT(`invdate`, '%d-%m-%Y')as mydt, DATE_FORMAT(`orddate`, '%d-%m-%Y')as ordt FROM `salemainexp`  WHERE vouchno='$vouch'") or die(mysqli_error($conn));
?>



<html>
    <head>
        <title>Custom Invoice</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" media="all" /> 
        <link rel="stylesheet" type="text/css" href="css/resume.css" media="all" />
        <!--detail Part-->
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="css/repdtl.css"/>
        <!--[if !IE]><!-->
        <style>
            @media 
            only screen and (max-width: 560px),
            (min-device-width: 768px) and (max-device-width: 1024px)  {
                /* Force table to not be like tables anymore */
                table, thead, tbody, th, td, tr { 
                    display: block; 
                }
                /* Hide table headers (but not display: none;, for accessibility) */
                thead tr { 
                    position: absolute;
                    top: -9999px;
                    left: -9999px;
                }
                tr { border: 1px solid #ccc; }
                td { 
                    /* Behave  like a "row" */
                    border: none;
                    border-bottom: 1px solid #eee; 
                    position: relative;
                    padding-left: 10%; 
                }
                td:before { 
                    /* Now like a table header */
                    position: absolute;
                    /* Top/left values mimic padding */
                    top: 6px;
                    left: 6px;
                    width: 45%; 
                    padding-right: 10px; 
                    white-space: nowrap;
                }

                /*
                Label the data
                */
                td:nth-of-type(1):before { content: "SR.NO."; }
                td:nth-of-type(2):before { content: "DESCRIPTION"; }
                td:nth-of-type(3):before { content: "UNIT"; }
                td:nth-of-type(4):before { content: "RATE"; }
            }
            /* Smartphones (portrait and landscape) ----------- */
            @media only screen
            and (min-device-width : 10px)
            and (max-device-width : 10px) {
                body { 
                    padding: 0; 
                    margin: 0; 
                    width: 320px; }
            }
            /* iPads (portrait and landscape) ----------- */
            @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
                body { 
                    width: 495px; 
                }
            }
        </style>
        <!--end Detail-->
    </head>
    <body>
        <?php
        /* $i = 0;
          while ($get = mysqli_fetch_object($qry)){
          $i++;
          if($i == 2){
          echo "<div style='page-break-after: always;'>";
          $i = 0;
          }else{
          echo "<div style='width: 100%;'>";
          }
          $openbal   = $get->openbal;
          $rent      = $get->rent;
          $stamt     = $get->stamt;
          $billamt   = $rent + $stamt;
          $totamt    = $openbal + $rent + $stamt;
         */
        $get = mysqli_fetch_assoc($qry);
        $date = $get['mydt'];
        $invdate = $get['invdate'];
        $bank = $get['bank'];

        $getparty = mysqli_query($conn, "SELECT * FROM `accmast` WHERE accode='$get[partyname]'")or die(mysqli_error($conn));
        $pdtl = mysqli_fetch_array($getparty);

        $getbank = mysqli_query($conn, "SELECT * FROM `bankmast` WHERE code='$bank'")or die(mysqli_error($conn));
        $bankdtl = mysqli_fetch_array($getbank);

        $bname = $bankdtl['name'];
        $bacno = $bankdtl['acno'];
        $biecode = $bankdtl['iecode'];
        $badcode = $bankdtl['adcode'];
        $baddress = $bankdtl['address'];
        $getcon = mysqli_query($conn, "SELECT `name` FROM `consignee` WHERE code='$get[consignee]'")or die(mysqli_error($conn));
        $con = mysqli_fetch_array($getcon);

        $getpol = mysqli_query($conn, "SELECT * FROM `port` WHERE code='$get[portofloading]'")or die(mysqli_error($conn));
        $pol = mysqli_fetch_array($getpol);
        $getpod = mysqli_query($conn, "SELECT * FROM `port` WHERE code='$get[portofdischarge]'")or die(mysqli_error($conn));
        $pod = mysqli_fetch_array($getpod);

        $getfin = mysqli_query($conn, "SELECT * FROM `place` WHERE code='$get[finaldestination]'")or die(mysqli_error($conn));
        $fin = mysqli_fetch_array($getfin);
        
        $coun = mysqli_query($conn, "SELECT * FROM `country` WHERE code='$get[country]'")or die(mysqli_error($conn));
        $co = mysqli_fetch_array($coun);
        ?>   

        <div id="doc2" class="yui-t7" style="margin-top: -80px;">
            <div id="inner">



                <div id="bd">



                    <div id="yui-main">



                        <div class="yui-b">







                            <div class="yui-gf">



                                <div class="yui-u first" style="width: 100%;">



                                    <?php
                                    require("includes/dbconnect.php");



                                    $comp = mysqli_query($conn, "SELECT * FROM `company`") or die(mysqli_errno());



                                    $zcomp = mysqli_fetch_assoc($comp);
                                    ?>



                                    <span style="float:left;margin-top:-11px;"><img src="images/bm.gif" style="width:100px;height:auto;"></span><font size="5px"><b><center>Custom Invoice</center></b></font>







                                </div>











                                <div class="yui-gf" style="width: 100%">



                                    <table border='1' width='100%'>



                                        <tr>



                                            <td valign='top' style="border: 2px solid black;">



                                                <font size='1px'> Exporter</font>



                                                <br/>



                                                <?php echo "<font size='3px'><b>" . $zcomp["compname"] . "<br/>"; ?>



                                                <?php echo $zcomp["add1"] . "<br/>" . $zcomp["add2"] . "<br/>" . $zcomp["add3"] . "</b></font>"; ?>



                                            </td>



                                            <td valign='top' style="border: 2px solid black;">



                                                <table align='left' width='100%'>



                                                    <tr>



                                                        <td style="border-bottom: 2px solid black;" valign='top'><font size='2px'>Invoice No. & Date<br/>



                                                            <b>  <?php echo $get["invoice"] . "/" . $get['mydt']; ?></b>



                                                        </td>



                                                        <td style="border-bottom: 2px solid black;" valign='top'><font size='2px'>Exporter's Ref.</td>



                                                    </tr>



                                                    <tr>



                                                        <td style="border-bottom: 2px solid black;"><font size='2px'>Buyer's Order No. & Date<br/>



                                                            <b> <?php
                                                                echo $get['orderno'];



                                                                if ($get['ordt'] != '00-00-0000') {



                                                                    echo "/" . $get['ordt'];
                                                                }
                                                                ?></b>



                                                        </td>



                                                        <td style="border-bottom: 2px solid black;"><font size='2px'></td>



                                                    </tr>



                                                    <tr>



                                                        <td style="border-bottom: 0px solid black;"><font size='2px'>Other Reference(s).</td>



                                                        <td style="border-bottom: 0px solid black;"></td>



                                                    </tr>



                                                </table>



                                            </td>



                                        </tr>







                                        <tr>



                                            <td style="border: 2px solid black;" valign='top'><font size='2px'>Consignee<br/>



                                                <b>



                                                    <?php #echo $con['name']."<br/>"; ?>







                                                    <?php echo nl2br($get['conadd']); ?>



                                                </b>







                                            </td> 



                                            <td style="border: 2px solid black;" valign='top'>



                                                <font size='2px'>Buyer(if other than consignee)<br/>

                                                <b>



                                                    <?php #echo $con['name']."<br/>"; ?>







                                                    <?php echo nl2br($get['buyconadd']); ?>



                                                </b>

                                            </td> 
                                        </tr>
                                        <tr>
                                            <td valign='top' style="border: 2px solid black;">
                                                <table>



                                                    <tr>



                                                        <td style="border-bottom: 2px solid black;"><font size='2px'></td>



                                                        <td style="border-bottom: 2px solid black;"><font size='2px'>Place of Receipt by Pre-carrier<br/>







                                                        </td>



                                                    </tr>



                                                    <tr>



                                                        <td style="border-bottom: 2px solid black;"><font size='2px'></td>



                                                        <td style="border-bottom: 2px solid black;"><font size='2px'>Port of Loading<br/>



                                                            <b>   <?php echo $get['portofloading']; ?></b>



                                                        </td>



                                                    </tr>



                                                    <tr>



                                                        <td style="border-bottom: 0px solid black;"><font size='2px'>Port of Discharge<br/>



                                                            <b> <?php echo $get['portofdischarge']; ?></b>



                                                        </td>



                                                        <td style="border-bottom: 0px solid black;"><font size='2px'>Final Destination<br/>



                                                            <b> <?php echo $get['finaldestination']; ?></b>



                                                        </td>



                                                    </tr>



                                                </table>



                                            </td>



                                            <td valign='top' style="border: 2px solid black;"><font size='2px'>



                                                <table>



                                                    <tr>



                                                        <td style="border-bottom:  2px solid black;border-right:  2px solid black;" valign="top"><font size='2px'>Country of Origin of Goods<br><b>INDIA</b></td>



                                                        <td style="border-bottom:  2px solid black;" valign="top"><font size='2px'>Country of Final Destination<br/>



                                                            <b> <?php echo $get['country']; ?></b>



                                                        </td>



                                                    </tr>



                                                    <tr>



                                                        <td style="border-bottom:  0px solid black;"><font size='0.8px'>Terms of Delivery and Payment</td>



                                                        <td style="border-bottom:  0px solid black;"><font size='2px'></td>



                                                    </tr>



                                                    <tr>



                                                        <td style="border-bottom:  0px solid black;"><b><span style="float:left;">C & F</span><span style="float:right;">D/P</span></b></td>



                                                    </tr>



                                                </table>



                                            </td>



                                        </tr>



                                        <tr>



                                            <td colspan='3' style="border: 2px solid black;"><font size='2px'>



                                                <table>



                                                    <tr>



                                                        <td style="border: 2px solid black;"><font size='2px'>Marks & Nos.</td>



                                                        <td style="border: 2px solid black;" ><font size='2px'>No. of Pkgs.</td>



                                                        <td style="border: 2px solid black;" width="350px"><font size='2px'>Description of Goods</td>



                                                        <td style="border: 2px solid black;" align="right"><font size='2px'>Qty.</td>



                                                        <td style="border: 2px solid black;" align="right" width="60px"><font size='2px'>Rate</td>



                                                        <td style="border: 2px solid black;" align="right" width="60px"><font size='2px'>Amount</td>



                                                    </tr>



                                                    <?php
                                                    $mrow = 0;



                                                    $fontsize = '1em;font-weight:bold;';



                                                    mysqli_select_db($conn, $zdb);



                                                    $getdtl = mysqli_query($conn, "SELECT * FROM `saletran` WHERE vouchno='$vouch' ORDER BY srno")or die(mysqli_error($conn));



                                                    while ($row = mysqli_fetch_array($getdtl)) {

                                                        $itemcode = $row['item'];
                                                        if ($itemcode != '') {
                                                            $getitem = mysqli_query($conn, "SELECT `name` FROM `item` WHERE code='$itemcode'")or die(mysqli_error($conn));
                                                            $item = mysqli_fetch_array($getitem);
                                                            $itemname = $item['name'];
                                                        } else {
                                                            $itemname = '';
                                                        }


                                                        if (!empty($row["item"]) || $row["marks"]) {



                                                            $mrow = $mrow + 1;

                                                            echo "<tr>";
                                                            echo "<td style='border: 2px solid black;'>";
                                                            echo "<font style='font-size:$fontsize'>" . $row['marks'] . "</font>";

                                                            echo "</td>";



                                                            echo "<td style='border: 2px solid black;'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td style='border: 2px solid black;'>";



                                                            echo "<font style='font-size:$fontsize'>" . $itemname . "</font>";



                                                            echo "</td>";



                                                            echo "<td align='right' style='border: 2px solid black;'>";



                                                            if ($row['qty'] > 0) {



                                                                echo "<font style='font-size:$fontsize'>" . $row['qty'] . "";
                                                            }



                                                            echo "</td>";



                                                            echo "<td align='right' style='border: 2px solid black;'>";



                                                            if ($row['rate'] > 0) {



                                                                echo "<font style='font-size:$fontsize'>" . $row['rate'] . "<font>";
                                                            }



                                                            echo "</td>";



                                                            if ($row['amt'] > 0) {



                                                                echo "<td style='border: 2px solid black;' align='right'>";



                                                                echo "<font style='font-size:$fontsize'>" . $row['amt'] . "<font>";
                                                            } else {



                                                                echo "<td style='border-left: 2px solid black;border-right:2px solid black;'>";
                                                            }



                                                            echo "</td>";







                                                            echo "</tr>";
                                                        } else {



                                                            echo "<tr>";



                                                            echo "<td>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td align='right'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td align='right' style='border: 2px solid black;'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td style='border-left: 2px solid black;border-right: 2px solid black;'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "</tr>";
                                                        }
                                                    }



                                                    if ($mrow < 13) {



                                                        for ($i = $mrow; $i <= 13; $i++) {



//                                                             browse($i);



                                                            $mrow = $mrow + 1;



                                                            echo "<tr>";



                                                            echo "<td style='height:33px;'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td style='height:33px;'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td style='height:33px;'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td align='right' style='height:33px;'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td align='right' style='height:33px;'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "<td style='border-left: 2px solid black;border-right: 2px solid black;height:33px;'>";



                                                            echo "";



                                                            echo "</td>";



                                                            echo "</tr>";
                                                        }
                                                    }
                                                    ?>



                                                    <?php
                                                    $mtot = $get["total"];

                                                    $mdis = $get["discount"];



                                                    $frgt = $get["freight"];



                                                    $tot = $get["billamt"];







                                                    $mtot = number_format($mtot, 2, '.', '');

                                                    $mdis = number_format($mdis, 2, '.', '');



                                                    $frgt = number_format($frgt, 2, '.', '');



                                                    $tot = number_format($tot, 2, '.', '');











//                                                                 if($get["ci"] == 1){
//                                                                      $mtot = $get["billamt"] - $get["freight"];
//                                                                       $tot = number_format($mtot, 2, '.', '');
//                                                                 }else{
//                                                                     $tot =$get['billamt'];
//                                                                 }
                                                    ?>



                                                    <tr>



                                                        <td style="border: 0px solid black;" width="143"><font size='2px'></td>



                                                        <td style="border: 0px solid black;" colspan="2"><font size='2px'></td>



                                                        <td style="border: 0px solid black;"><font size='2px'></td>



                                                        <td style="border: 0px solid black;" align="right"><font size='2px'>Total USD$ </font></b></font></td>



                                                        <td style="border: 2px solid black; text-align: right"><font size='2px'>



                                                            <?php
                                                            echo "<font style='font-size:$fontsize'>" . $mtot . "</font>";
                                                            ?></td>



                                                    </tr>



                                                    <tr>



                                                        <td style="border: 0px solid black;" width="143"><font size='2px'></td>



                                                        <td style="border: 0px solid black;" colspan="2"><font size='2px'></td>



                                                        <td style="border: 0px solid black;"><font size='2px'></td>



                                                        <?php
                                                        if ($mdis > 0) {
                                                            ?>

                                                            <td style="border: 0px solid black;" align="right"><font size='2px'>Discount USD$</font></b></font></td>

                                                            <td style="border: 2px solid black; text-align: right"><font size='2px'>

                                                                <?php
                                                                echo "<font style='font-size:$fontsize'>" . $mdis . "</font>";
                                                            }
                                                            ?></td>



                                                    </tr>



                                                    <tr>



                                                        <td style="border: 0px solid black;" width="143"><font size='2px'></td>



                                                        <td style="border: 0px solid black;" colspan="2"><font size='2px'></td>



                                                        <td style="border: 0px solid black;"><font size='2px'></td>



                                                        <td style="border: 0px solid black;" align="right"><font size='2px'>Freight USD$</font></b></font></td>



                                                        <td style="border: 2px solid black; text-align: right"><font size='2px'>



                                                            <?php
                                                            echo "<font style='font-size:$fontsize'>" . $frgt . "</font>";
                                                            ?></td>



                                                    </tr>



                                                    <tr>



                                                        <td style="border: 0px solid black;" width="143"><font size='2px'>Amount Chargeable (In Words)</td>



                                                        <td style="border: 0px solid black;" colspan="2"><font size='2px'><?php echo "USD " . convert_number_to_words($tot); ?></td>



                                                        <td style="border: 0px solid black;"><font size='2px'></td>



                                                        <td style="border: 0px solid black;" align="right"><font size='2px'>Bill Amount USD$ </font></b></font></td>



                                                        <td style="border: 2px solid black;"><font size='2px'>



                                                            <?php
                                                            echo "<font style='font-size:$fontsize'>" . $tot . "</font>";
                                                            ?></td>



                                                    </tr>



                                                </table>







                                            </td>



                                        </tr>



                                        <tr>



                                            <td style="border: 2px solid black;" valign='top' colspan="2"><font size="1px">Shipment Terms :</font><br/>


                                                <?php
                                                if ($bank != 0) {
                                                    ?>
                                                    <table border = "0" style = 'width: 100%'>
                                                        <tr>
                                                            <td style = "border-bottom: 0px solid #ccc;width:20%"><font size = "2px"><b>Bank Name </td>
                                                            <td style = "border-bottom: 0px solid #ccc;width:40%">:<font size = "2px"><b> <?php echo $bname;
                                                    ?></td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%"><font size="3px">"SUPPLY MEANT FOR EXPORT UNDER</td>
                                                        </tr>
                                                        <tr>
                                                            <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>Address </td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b><?php echo $baddress; ?></td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%"><font size="3px"> LETTER OF UNDERTAKING WITHOUT</td>
                                                        </tr>
                                                        <tr>
                                                            <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>A/c No </td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $bacno; ?></td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%"><font size="3px">PAYMENT OF INTEGRATED TAX"</td>

                                                        </tr>
                                                        <tr>
                                                            <td style="border-bottom: 0px solid #ccc;width:20%" width="80"><font size="2px"><b>I.E. Code No </td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $biecode; ?></td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%"><font size="2px"></td>
                                                        </tr>
                                                        <tr>
                                                            <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>A.D Code </td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $badcode; ?></td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%"></td>
                                                        </tr>
                                                        <tr>
                                                            <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>GST No.</td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $zcomp["servtaxno"]; ?></td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%"></td>
                                                        </tr>
                                                        <tr>
                                                            <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>PAN No.</td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $zcomp["panno"]; ?></td>
                                                            <td style="border-bottom: 0px solid #ccc;width:40%"></td>
                                                        </tr>
                                                    </table>
                                                    <?php
                                                } else {
                                                    if ($invdate > '2017-09-18') {
                                                        ?>
                                                        <table border="0" style='width: 100%'>
                                                            <tr>
                                                                <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>Bank Name </td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $zcomp["bank"]; ?></td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%"><font size="3px">"SUPPLY MEANT FOR EXPORT UNDER</td>
                                                            </tr>
                                                            <tr>
                                                                <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>Address </td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"> <b><?php echo nl2br($zcomp["bankadd"]); ?></td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%"><font size="3px"> LETTER OF UNDERTAKING WITHOUT</td>
                                                            </tr>
                                                            <tr>
                                                                <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>A/c No </td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $zcomp["acno"]; ?></td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%"><font size="3px">PAYMENT OF INTEGRATED TAX"</td>

                                                            </tr>
                                                            <tr>
                                                                <td style="border-bottom: 0px solid #ccc;width:20%" width="80"><font size="2px"><b>I.E. Code No </td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $zcomp["iecode"]; ?></td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%"><font size="2px"></td>
                                                            </tr>
                                                            <tr>
                                                                <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>A.D Code </td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $zcomp["adcode"]; ?></td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%"></td>
                                                            </tr>
                                                            <tr>
                                                                <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>GST No.</td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $zcomp["servtaxno"]; ?></td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%"></td>
                                                            </tr>
                                                            <tr>
                                                                <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>PAN No.</td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo $zcomp["panno"]; ?></td>
                                                                <td style="border-bottom: 0px solid #ccc;width:40%"></td>
                                                            </tr>
                                                        </table>

                                                        <?php
                                                    } else {
                                                        if ($invdate > '2017-08-31') {
                                                            ?>
                                                            <table border="0" style='width: 100%'>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>Bank Name </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo 'CORPORATION BANK' ?></td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%"><font size="3px">"SUPPLY MEANT FOR EXPORT UNDER</td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>Address </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"> <b><?php echo 'MANGIREESH BUILDING, L.J CROSS ROAD, MAHIM MUMBAI 16' ?></td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%"><font size="3px"> LETTER OF UNDERTAKING WITHOUT</td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>A/c No </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo '053701601000295' ?></td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%"><font size="3px">PAYMENT OF INTEGRATED TAX"</td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>I.E. Code No </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo '0394028457' ?></td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>A.D Code </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo '0350122/6000009' ?></td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>GST No.</td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo '27AAAFD1545K1ZM' ?></td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>PAN No.</td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo 'AAAFB1545K' ?></td>
                                                                </tr>
                                                            </table>
                                                            <?
                                                        } else {
                                                            ?>
                                                            <table border="0">
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>Bank Name </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo 'CORPORATION BANK' ?></td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>Address </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"> <b><?php echo 'MANGIREESH BUILDING, L.J CROSS ROAD, MAHIM MUMBAI 16' ?></td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>A/c No </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo '053701601000295' ?></td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>I.E. Code No </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo '0394028457' ?></td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>A.D Code </td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo '0350122/6000009' ?></td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>GST No.</td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo '27AAAFD1545K1ZM' ?></td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="border-bottom: 0px solid #ccc;width:20%"><font size="2px"><b>PAN No.</td>
                                                                    <td style="border-bottom: 0px solid #ccc;width:40%">:<font size="2px"><b> <?php echo 'AAAFB1545K' ?></td>
                                                                </tr>
                                                            </table>
                                                            <?
                                                        }
                                                    }
                                                }
                                                ?>

                                                <font size='1px'>Declaration:<br/>We declare that this invoice shows the actual price of goods<br/>described and that all particulars are true and correct.</font>
                                                <div style="border:2px solid black;float:right;margin-top: -24px;height: 50px;margin-right: -8px;margin-bottom: -8px;z-index: 999;width:280px;text-align: center;padding: 5px 5px;">
                                                    <font size='2px'>Signature & Date.</font>
                                                </div>
                                        </tr> 
                                    </table>
                                </div>
                                <!--// doc -->
                            </div>
                        </div>
                        </body>
                        </html>
                        <?php
                        /*
                          echo "<br/>";
                          echo "<br/>";
                          echo "</div>";
                          }
                         */
                        ?>
