<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<?php
session_start();

if ($_SESSION["CURRENT_USER"] == "") {
    echo "Please Loging Again !!!";
    exit();
}
if ($_SESSION["company"] == "") {
    echo "Please Loging Again !!!";
    exit();
}
if ($_SESSION["dev"] == "") {
    echo "Invalid User Session";
    exit();
}
?>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <meta charset="utf-8">
    <!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
    <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">-->
    <!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>-->
    <!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>-->
    <title>Invoice Print</title>

    <style>
        .table {
            border-style: double;
        }

        .center {
            text-align: center;
        }

        .style2 {
            font-size: 17px;
        }

        .right {
            text-align: right;
        }

        .tb {
            width: 1050px;
            border: 1px solid black;


            border-collapse: collapse;
        }

        .tb td {

            border-top: 1px solid black;
            border-left: 1px solid black;


            border-collapse: collapse;
        }

        .tb th {

            border-top: 1px solid black;
            border-left: 1px solid black;


            border-collapse: collapse;
        }

        .tb1 {

            border: 1px solid #000000;
        }

        .customer-name {
            white-space: normal;
            word-wrap: break-word;
            width: 80%; /* Adjust as needed */
        }

        .customer-label {
            font-weight: bold;
            width: 20%; /* Adjust as needed */
            vertical-align: top;
        }

    </style>

</head>
<?php
session_start();
require_once("connection_sql.php");

$sql = "update s_salma set pirnt_serial=pirnt_serial+1 where REF_NO='" . $_GET["invno"] . "'";
$res_inv = $conn->query($sql);

$sql = "Select * from s_salma where REF_NO='" . $_GET["invno"] . "'";
$result = $conn->query($sql);
$row = $result->fetch();

$sql_out = "Select sum(GRAND_TOT-TOTPAY) AS OUTS from s_salma where C_CODE='" . $row["C_CODE"] . "' AND CANCELL='0'";
$result_out = $conn->query($sql_out);
$row_out = $result_out->fetch();

$sql1 = "Select * from vendor where CODE='" . $row["C_CODE"] . "'";
$result1 = $conn->query($sql1);
$row1 = $result1->fetch();

$sql2 = "Select * from s_salrep where REPCODE='" . $row["SAL_EX"] . "'";
$result2 = $conn->query($sql2);
$row2 = $result2->fetch();

$sql_la = "Select * from s_labour where CODE='" . $row["labour"] . "'";
$result_la = $conn->query($sql_la);
$row_la = $result_la->fetch();

$sql3 = "Select sum(PRICE*QTY)  as pricetot from s_invo where REF_NO='" . $_GET["invno"] . "'";
$result3 = $conn->query($sql3);
$row3 = $result3->fetch();

$sinvtot = $row3["pricetot"];

$sql_invpara = "SELECT * from invpara where flag='" . $_SESSION['company'] . "'";
$result_invpara = $conn->query($sql_invpara);
$row_invpara = $result_invpara->fetch();

$rtxtrep = $row2["DISPLAY_NAME"];
$rtxtSupCode = $row1["CODE"];
$rtxtSupName = $row1["NAME"];
$txtadd = $row1["ADD1"] . " " . $row1["ADD2"];
$rtxtdate = date("Y-m-d", strtotime($row["SDATE"]));
$grandtot = $row["GRAND_TOT"];
$totpay = $row["TOTPAY"];

$VAT_per = $row["VAT"];
$disamou = $row["DISCOU"];
$txtsubtot = $row["AMOUNT"];

if ($row["VAT"] == "1") {
    $txtcusvat = "VAT NO :  " . $row["vat_no"];
    $txtcomvat = "VAT Reg. " . $row_para["VAT"];
    $RTXTVAT = "VAT " . $row["GST"] . "%  ";
    $RTXVATAMU = $row["BTT"];
    $txttaxinv = "<b>TAX INVOICE</b>";
    $txtsubtot = $row["AMOUNT"];
    $txtsubtotdes = "Sub Total";
}

if ($row["SVAT"] != "0") {
    $txtcusvat = "VAT NO : " . $row["vat_no"];
    $txtcomvat = "VAT Reg. " . $row_invpara["VAT"];
    $RTXTVAT = "Suspended VAT " . $row["GST"] . "%  ";
    $RTXVATAMU = $row["BTT"];
    $txttaxinv = "<b>SUSPENDED TAX INVOICE</b>";
    $txtsubtot = $row["AMOUNT"];
    $txtsubtotdes = "Nett Total";

    $txtoursvat = "SVAT Reg. " . $row_invpara["svatno"];
    $txtcussavat = "SVAT " . $row["s_vat_no"];
}

if ($row["pirnt_serial"] == "0") {

    if ($row["CANCELL"] == "0") {
        $sql = "update s_salma set pirnt_serial='1' where REF_NO='" . $_GET["invno"] . "'";
        $result = $conn->query($sql);
    }

} else if ($row["pirnt_serial"] > 1) {

    if ($_SESSION['User_Type'] == "0") {

        if ($row["CANCELL"] == "0") {
            // 	exit("Cannot Print Twice !!!");
        }
    } else {
        if ($_SESSION['User_Type'] == "1") {

            if ($row["CANCELL"] == "0") {
                $copy = "CP";
            }

            $print_serial = $row["pirnt_serial"] + 1;
            $sql = "update s_salma set pirnt_serial='" . $print_serial . "' where REF_NO='" . $_GET["invno"] . "'";
            $result = $conn->query($sql);
        }
    }

}

?>
<body style="font-family:  " Times New Roman
", Times, serif; " onload="window.print();">

<table width="1050px;" cellspacing="0" border="0" style="margin-top:-10px !important;">
    <tr>
        <!--<td style='width: 100px;'>-->
        <!--        <?php if ($_SESSION['company'] == "PA"){ ?>-->
        <!--            <img style="width: 225px;margin-top:-20px;height:109px" src="img/logo1.png"/> -->
        <!--        <?php } ?>-->
        <!--        <?php if ($_SESSION['company'] == "PB"){ ?>-->
        <!--            <img style="width: 225px;margin-top:-20px;height:109px" src="img/logo1.png"/> -->
        <!--        <?php } ?>-->
        <!--        <?php if ($_SESSION['company'] == "SA"){ ?>-->
        <!--            <img style="width: 225px;margin-top:-20px;height:109px" src="img/logo2.png"/> -->
        <!--        <?php } ?>-->
        <!--        <?php if ($_SESSION['company'] == "SB"){ ?>-->
        <!--            <img style="width: 225px;margin-top:-20px;height:109px" src="img/logo2.png"/> -->
        <!--        <?php } ?>-->

        <!--</td>-->
        <td>
            <p style="margin: 0px !important;font-size: 28px;"><b><?php echo $row_invpara["COMPANY"]; ?></b></p>
            <p style="margin: 0px!important;font-size: 18px;">
                <b><?php echo $row_invpara["ADD1"] . ', ' . $row_invpara["ADD2"] . ', ' . $row_invpara["ADD3"]; ?>.</b>
            </p>
            <p style="margin: 0px!important;font-size: 18px;"><b><?php echo "Tel -" . $row_invpara["TELE"]; ?>
                    / <?php echo "E-mail -  " . $row_invpara["EMAIL"]; ?></b></p>
            <p style="margin: 0px!important;font-size: 18px;"><b><?php if ($row["VAT"] == "1") {
                        echo "VAT Registration No. - " . $row_invpara["VAT"];
                        if ($row["SVAT"] != "0") {
                            echo '&nbsp;&nbsp;' . $txtoursvat;
                        }
                    } ?></b></i></p>
            <br>
        </td>
        <td align="right">
            <?php

            if ($row['CANCELL'] == "1") {
                ?>
                <p style="margin: 0px;font-size:24px;color:red"></p>
            <?php } else {
                ?>
                <p style="margin: 0px;font-size:24px;"></p>
            <?php } ?>
            <p style="margin: 0px;font-size:24px;">
                <b><u>
                        <?php
                        if ($row["VAT"] == "1") {
                            // if($row['CANCELL'] =="1"){

                            //         echo "CANCELED TAX INVOICE  ";

                            // }else{
                            if ($row["SVAT"] != "0") {
                                echo "SUSPENDED TAX INVOICE  ";
                            } else {
                                echo "TAX INVOICE  ";
                            }


                            // }
                            // if ($row["TYPE"] == "CR") {
                            //     echo "CREDIT";
                            // }else{
                            //     echo "CASH";
                            // }

                        } else {
                            //  if($row['CANCELL'] =="1"){
                            //         echo "CANCELED INVOICE  ";

                            // }else{
                            echo "INVOICE  ";

                            // }

                            // if ($row["TYPE"] == "CR") {
                            //     echo "CREDIT";
                            // }else{
                            //     echo "CASH";
                            // }

                        }

                        ?>

                        <p style="margin: 0px;font-size:24px;">
                            <?php
                            if ($row["TYPE"] == "CR") {
                                echo "CREDIT";
                            } else {
                                echo "CASH";
                            }
                            ?>
                        </p>
                    </u></b></p>
        </td>
    </tr>
</table>

<!--<table width="1050px;" cellspacing="0" border="0" >-->
<!--<tr>-->
<!--    <td> -->
<!--<img style="  width: 245px;margin-top:-20px;" src="img/lassa.jpg"/> -->
<!--    </td>-->
<!--    <td align="right" style=" margin-top:-20px;">-->

<?php

//  if($row['CANCELL'] =="1"){
?>
<!--<center><p style="margin: 0px;font-size:24px;color:red" ></p></center>-->
<?php
//   }else{
?>
<!--<center><p style="margin: 0px;font-size:24px;" >-->
<?php
// }
?>

<!--<b><u>-->
<?php
// if($row["VAT"]=="1"){
//     if($row['CANCELL'] =="1"){
//         echo "CANCELED TAX INVOICE  ";
//     }else{
//          echo "TAX INVOICE  ";
//     }
//     // if ($row["TYPE"] == "CR") {
//     //     echo "CREDIT";
//     // }else{
//     //     echo "CASH";
//     // }


// }else{
//      if($row['CANCELL'] =="1"){
//         echo "CANCELED INVOICE  ";
//     }else{
//           echo "INVOICE  ";
//     }

//     // if ($row["TYPE"] == "CR") {
//     //     echo "CREDIT";
//     // }else{
//     //     echo "CASH";
//     // }


// }

// if($row['pirnt_serial'] =="0"){
//         echo " - COPY";
// }
?>
<!--</u></b></p></center>-->
<!--</td>-->
<!--<td align="right">-->
<!--<img style="  width: 245px;margin-top:-20px;" src="img/radar.png"/> -->
<!--</td>-->

<!--</tr>-->
<!--    <tr>-->
<!--       <td>&nbsp;</td>-->
<!--    </tr>  -->

<!--</table>-->

<!--new border box-->


<table width="1050px;" border="0">
    <tr>
        <td height="110" colspan="5" valign="top">
            <table border="1" bordercolor="#000000" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="428">
                        <table width="500" border="0">
                            <tr>
                                <td class="style2 customer-label"><b>CUSTOMER: </b></td>
                                <td class="style2 customer-name">
                                    <b><?php echo strtoupper($row["C_CODE"] . ' ' . $row['CUS_NAME']); ?></b></td>
                            </tr>
                            <tr>
                                <td class="style2 customer-label"></td>
                                <td class="style2 customer-name"><?php echo strtoupper($row['C_ADD1']) ?></td>
                            </tr>
                            <tr>
                                <td colspan="6" height="21" align="left"><span class="style2"><b>
                                    <?php
                                    echo $txtcusvat; ?> <?php if ($row["VAT"] == "1"){
                                            if ($row["SVAT"] != "0") { ?><b>
                           <?php echo $txtcussavat;
                           }
                           } ?></span></b></td>
                            </tr>
                            <tr>
                                <td colspan="6" height="21" align="left"><span
                                            class="style2"><b>TEL </b>- <?php echo $row['TEL'] ?></td>
                            </tr>
                            <tr>
                                <td colspan="1" class="style2"><b></b></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>

        <td height="110" colspan="5" valign="top">
            <table border="1" bordercolor="#000000" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="428">
                        <table width="500" border="0">
                            <tr>
                                <td colspan="1" class="style2" align="left"><b>PO
                                        NO:</b> <?php echo $row["ORD_NO"]; ?></span></td>
                                <td width="170" align="left"><span
                                            class="style2"><b>INVOICE NO&nbsp;&nbsp;&nbsp; : <?php echo $row['REF_NO'] ?></b>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="1" class="style2"><b>JOB NO:<?php echo $row["jobno"]; ?></b></td>
                                <td width="170" align="left" class="style2"><b>INVOICE DATE
                                        : <?php echo $row['SDATE']; ?></b></td>
                            </tr>
                            <tr>
                                <td width="180"><span
                                            class="style2"><b>MILEAGE: <?php echo $row["millage"] ?></b></span></td>
                                <td width="30" align="right"><b>VEHICLE NO: </b><?php echo $row["veheno"]; ?> </span>
                                </td>

                            </tr>
                            <tr>
                                <td width="180"><span class="style2"><b>SALES EX: </b><?php echo $rtxtrep; ?></span>
                                </td>
                                <td width="30" align="right" class="style2">
                                    <b>LABOUR: </b><?php echo $row_la['DESCRIPTION']; ?></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<!--new border box-->


<table width="1050px;">
    <tr style="font-size:15px;">
        <th width="20px;"></th>
        <td width="90"><b><u>ITEM NO</u></b></td>
        <td width="800"><b><u>ITEM DESCRIPTION</u></b></td>
        <td hidden width="150"><b><u>SERIAL NO</u></b></td>
        <td width="60" align="right"><b><u>QTY<u></b></td>
        <td width="135" align="right"><b><u>UNIT PRICE<u></b></td>
        <td width="90" align="right"><b><u>DIS 1(%)<u></b></td>
        <td width="90" align="right"><b><u>DIS 2(%)<u></b></td>
        <td width="140" align="right"><b><u>UNIT TOTAL<u></b></td>
    </tr>

    <?php

    $remark = "";
    $hasPetlas = false;
    $i = 1;
    $part = "";
    $qty = 0;
    $TOTPRICE = 0;
    $unittot = 0;
    $distot = 0;
    $disgtot = 0;
    $unitgtot = 0;
    $rr = 0;
    $rrtot = 0;
    $sql1 = "Select * from s_invo where REF_NO='" . $_GET["invno"] . "' order by PRICE DESC";

    foreach ($conn->query($sql1) as $row1) {

        $sql_smas = "SELECT * from s_mas where STK_NO='" . $row1['STK_NO'] . "'";
        $result_smas = $conn->query($sql_smas);
        $row_smas = $result_smas->fetch();

        $sql_dag = "SELECT * from dag_item where jobno='" . $row1['JOBNO'] . "'";
        $result_dag = $conn->query($sql_dag);
        $row_dag = $result_dag->fetch();

        if (($row["VAT"] == "1") or ($row["VAT"] == "2")) {
            $vatr = 100 + $row["GST"];
            $PRICE = $row1["PRICE"] / $vatr * 100;
            // $PRICE = $row1["PRICE"] ;

        } else {
            $PRICE = $row1["PRICE"];
        }

        if (isset($row_smas['BRAND_NAME']) && strtoupper(trim($row_smas['BRAND_NAME'])) === "PETLAS") {

            $hasPetlas = true;
            $remark = "<b>PETLAS</b> BRAND TYRES ARE WARRANTED AGAINST MANUFACTURING DEFECTS ON A PRO-RATA BASIS FOR <b>24 MONTHS FROM THE MANUFACTURING DATE.</b>";

        }

        $disFactor = (100 - $row1["Print_dis1"]) * (100 - $row1["Print_dis2"]) / 10000;
        $unittot = $PRICE * $row1["QTY"] * $disFactor;

        // $unittot=$PRICE*$row1['QTY']-($PRICE*$row1['QTY']*$row1["DIS_per"]/100);
        $distot = $PRICE * $row1['QTY'] * $row1["DIS_per"] / 100;
        $rr = $PRICE * $row1['QTY'];
        ?>
        <tr style="font-size:18px;">
            <td class="left"><b><?php echo $i . '.' ?></b></td>
            <td class="left"><b><?php echo $row1['STK_NO']; ?></b></td>
            <?php
            if ($row1['TYPE'] == "PRODUCT") {
                ?>
                <td class="left"><b> <?php echo $row1['DESCRIPT']; ?></b></td>
            <?php } else {
                ?>
                <td class="left"><b><?php echo $row1['JOBNO']; ?> - <?php echo $row1['SIZE']; ?>
                        - <?php echo $row1['MAKE']; ?> - <?php echo $row_dag['dagtype']; ?></b></td>


            <?php } ?>

            <td hidden class="left"><b><?php echo $row1['SERIALNO']; ?> </b></td>
            <td class="right"><b><?php echo number_format($row1['QTY'], 0, ".", ","); ?></b></td>
            <td class="right"><b><?php echo number_format($PRICE, 2, ".", ","); ?></b></td>
            <td class="right"><b><?php echo number_format($row1["Print_dis1"], 2, ".", ","); ?></b></td>
            <td class="right"><b><?php echo number_format($row1["Print_dis2"], 2, ".", ","); ?></b></td>
            <td class="right"><b><?php echo number_format($unittot, 2, ".", ","); ?></b></td>
        </tr>
        <?php
        $i = $i + 1;
        $TOTPRICE = $TOTPRICE + ($PRICE * $row1['QTY']);
        $unitgtot = $unitgtot + $unittot;
        $disgtot = $disgtot + $distot;
        $rrtot = +$rrtot + $rr;
    }
    ?>

    <?php
    if ($row["VAT"] == "1") {
        $t = 10;
    } else {
        $t = 12;
    }

    while ($i < $t) {

        echo "<tr>

         <td>&nbsp;</td>
         <td></td>
         <td></td>
         <td></td> 
         <td></td> 
         <td></td> 
         </tr>";
        $i = $i + 1;
    }

    ?>

    <!--<tr> -->

    <!--<td  class="right" colspan='4' style="font-size:19px;"><b>SUB TOTAL: </b></td> -->
    <!--<td class="right" style="font-size:19px;"><b>-->
    <?php
    //  if ($rrtot > 0) {
    // echo number_format($rrtot, 2, ".", ",");
    // }
    // if ($sinvtot > 0) {
    //     echo number_format($sinvtot, 2, ".", ",");
    // }
    ?>
    <!--    </b></td>-->
    <!--</tr>-->
    <tr hidden>

        <td class="right" colspan='7' style="font-size:16px;"><b>TOTAL DISCOUNT: </b></td>
        <td class="right" style="font-size:19px;"><b>
                <?php
                if ($disgtot > 0) {
                    echo number_format($disgtot, 2, ".", ",");
                }

                ?>
            </b></td>
    </tr>
    <?php
    if ($row["VAT"] == "1") {
        if ($row["SVAT"] != "0") { ?>
            <tr>

                <td class="right" colspan='7' style="font-size:19px;"><b>Total Without Vat :</b></td>
                <td class="right" style="font-size:19px;"><b><?php
                        // if ($RTXVATAMU > 0) {
                        echo number_format($grandtot - $RTXVATAMU, 2, ".", ",");
                        // }
                        ?></b>
                </td>
            </tr>
        <?php }
    } ?>
    <?php
    if ($row["VAT"] == "1") {
        ?>
        <tr>

            <td class="right" colspan='7' style="font-size:19px;"><b><?php echo $RTXTVAT ?> :</b></td>
            <td class="right" style="font-size:19px;"><b><?php
                    if ($RTXVATAMU > 0) {
                        echo number_format($RTXVATAMU, 2, ".", ",");
                    }
                    ?></b>
            </td>
        </tr>
    <?php } ?>

    <tr>
        <td class="left" colspan='3' style="font-size:24px;"><b><?php
                if ($row['pirnt_serial'] > "1") {
                    if ($row['CANCELL'] == "1") {
                        echo "CP - CANCELED INVOICE";
                    } else {
                        echo "CP";
                    }
                }

                ?>
            </b></td>
        <td class="right" colspan='4' style="font-size:24px;"><b>TOTAL: </b></td>
        <td class="right" style="font-size:25px;"><b><?php
                if ($grandtot > 0) {
                    echo number_format($grandtot, 2, ".", ",");
                }
                ?></b></td>
    </tr>
    <!--<tr>-->


    <!--<td  class="right" colspan='7' style="font-size:20px;"><b>PAID: </b></td>  -->
    <!--<td class="right" style="font-size:21px;"><b>-->
    <?php

    // echo number_format($totpay, 2, ".", ",");

    ?>
    <!--</b></td>-->
    <!--</tr>-->
    <!--<tr>-->


    <!--<td  class="right" colspan='7' style="font-size:20px;"><b>BALANCE: </b></td>  -->
    <!--<td class="right" style="font-size:21px;"><b>-->
    <?php
    // if ($grandtot > 0) {
    //     echo number_format($grandtot-$totpay, 2, ".", ",");
    // }
    ?>
    <!--</b></td>-->
    <!--</tr>-->
    <!--<tr>-->


    <!--<td  class="right" colspan='7' style="font-size:18px;"><b>OUTSTANDING: </b></td>  -->
    <!--<td class="right" style="font-size:19px;"><b>-->
    <?php
    // if ($row_out['OUTS'] > 0) {
    //     echo number_format($row_out['OUTS'], 2, ".", ",");
    // }
    ?>
    <!--</b></td>-->
    <!--</tr>-->

</table>


</table>
<table width="1050px;">
    <tr>
        <td colspan="12" class="style2"><?php echo $remark; ?></td>
    </tr>
    <tr>
        <td colspan="12" class="style2"><b>REMARK:</b> <?php echo $row['note']; ?></td>
    </tr>

    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>

</table>
<!--<div style='height:34px;'></div>-->
<!--<table width="1050px;">-->
<!--    <tr> -->
<!--        <td colspan="8"  style="font-size:16px;"><b><u>CUSTOMER AGREED TO THE FOLLOWING TERMS & CONDITIONS</u></b></td> -->
<!--    </tr> -->

<!--    <tr> -->
<!--        <td colspan="8" style="font-size:16px;"><p># If no written complaint recieved within three days from the date hereon, invoiced goods shall be presumed to have delivered correctly.</p></b></td> -->
<!--    </tr>-->
<!--    <tr> -->
<!--        <td colspan="8" style="font-size:16px;"><p># All cheques made payable to <b><?php echo $row_invpara["COMPANY"]; ?></b> and crossed <b>AC PAYEE Only</b>.</p></td>-->
<!--    </tr>-->
<!-- <tr> -->
<!--    <td colspan="8" style="font-size:17px;"><p># Maximum credit period of<b> 30 days</b>.</p></td>-->
<!--</tr>-->

<!--</table>-->
<table width="1050px;">

    <!--<tr>-->
    <!--    <td><b>RECEIVED THE ABOVE ITEMS IN GOOD CONDITION</b></td>-->
    <!--    <td>&nbsp;&nbsp;&nbsp;</td>-->
    <!--    <td>&nbsp;&nbsp;&nbsp;</td>-->
    <!--    <td>&nbsp;&nbsp;&nbsp;</td>-->
    <!--    <td>&nbsp;&nbsp;&nbsp;</td>-->
    <!--    <td>&nbsp;&nbsp;&nbsp;</td>-->
    <!--</tr>-->
</table>
<table cellpadding="0" cellspacing="0" border="0" width="1050px;">
    <tr>
        <td>
            <table border="0" bordercolor="#000000" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <table border="0">
                            <tr>
                                <td height="25" width="480" valign="top" align="center"><span
                                            style="font-size:16px;"><b></b></span></td>

                            </tr>
                            <tr>
                                <td><span><b>&nbsp;</b></span></td>
                                <td align="center"><span><b>...............................................................</b></span>
                                </td>
                                <td><span><b>&nbsp;</b></span></td>
                                <td align="center"><span><b>...............................................................</b></span>
                                </td>
                                <td><span><b>&nbsp;</b></span></td>
                                <td align="center"><span><b>...............................................................</b></span>
                                </td>
                                <td><span><b>&nbsp;</b></span></td>

                                <td align="center"><span><b>...............................................................</b></span>
                                </td>
                                <td><span><b>&nbsp;</b></span></td>
                            </tr>
                            <tr>
                                <td><span><b>&nbsp;</b></span></td>
                                <td align="center"><span style="font-size:16px;"><b>CUSTOMER SIGNATURE</b></span></td>
                                <td><span><b>&nbsp;</b></span></td>
                                <td align="center"><span style="font-size:16px;"><b>ISSUED BY</b></span></td>
                                <td><span><b>&nbsp;</b></span></td>
                                <td align="center"><span style="font-size:16px;"><b>DELIVERED BY</b></span></td>
                                <td><span><b>&nbsp;</b></span></td>
                                <td align="center"><span
                                            style="font-size:16px;"><b>INVOICED BY</b> - <?php echo $row["use_name"]; ?>
                                </span></td>
                                <td><span><b>&nbsp;</b></span></td>

                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
        <!--<td>-->
        <!--    <table border="0" bordercolor="#000000" cellpadding="0" cellspacing="0">-->
        <!--        <tr>-->
        <!--            <td>-->
        <!--                <table border="0" >-->
        <!--                    <tr>-->
        <!--                         <td><span><b>&nbsp;</b></span></td> -->
        <!--                    </tr> -->

        <!--                </table>-->
        <!--            </td>-->
        <!--        </tr>-->
        <!--     </table>-->
        <!--</td> -->


        <!--<td>-->
        <!--    <table border="0" bordercolor="#000000" cellpadding="0" cellspacing="0">-->
        <!--        <tr>-->
        <!--            <td>-->
        <!--                <table border="0" >-->
        <!--                    <tr > -->
        <!--                        <td height="35" width="480" valign="top" align="center"><span style="font-size:16px;"><b></b></span></td> -->

        <!--                    </tr> -->
        <!--                    <tr>-->
        <!--                        <td align="center"><span><b>..........................................................</b></span></td>   -->
        <!--                    </tr>-->
        <!--                    <tr>-->
        <!--                        <td align="center"><span style="font-size:16px;"><b>CUSTOMER SIGNATURE</b></span></td>   -->

        <!--                    </tr>-->
        <!--                </table>-->
        <!--            </td>-->
        <!--        </tr>-->
        <!--     </table>-->
        <!--</td> -->

    </tr>
</table>
<!-- ************************************************************************** -->
</body>

</html>
