
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

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


    <title>DAG Print</title>


    <style>
        /*.center {*/
        /*    text-align: center;*/
        /*}*/

        .right {
            text-align: right;
        }
        
        .tb  {
           width: 750px;
           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;
       }

   </style>

</head>
<?php
require_once ("connection_sql.php");
session_start();
$sql = "Select * from dag where refno='" . $_GET["refno"] . "' and cancel='0'";
$result = $conn->query($sql);
$row = $result->fetch();

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


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



?>
<body>
        <table width="750px;" cellspacing="0" border="0" align="center"

        <tr>
            <th style="text-align: center;font-size:23px;"   colspan=1 ><?php echo $row_invpara['COMPANY'] ?></th>
        </tr>
        
         <tr>
            <th style="text-align: center;font-size:21px;"   colspan=1 ><?php echo $row_invpara['ADD1'] ?></th>
        </tr>
         
        <tr>
            <th style="text-align: center;"  colspan=5 >Tel :<?php echo $row_invpara['TELE'] ?> </th>
        </tr>
         <tr>
            <th style="text-align: center;"  colspan=5 >Email :<?php echo $row_invpara['EMAIL'] ?> </th>
        </tr>
        
        <tr>

           
            <td style="text-align: center;font-size:27px;"><b>DAG INVOICE</b></td>
            <td></td>
            
            <td></td>
            <td></td>
        </tr>
     </table>  
    <table width="750px;"   cellspacing="0" align="center" border="0">

  
        
        <tr> 
            <td>Customer : <?php echo $row['cusname'] ?></td>
            <td></td>
            <td class="right">Ref No :<?php echo $row['refno']; ?> </td>  
        </tr>
         <tr> 
            <td>&nbsp;</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr> 
             <td>Customer Code : <?php echo $row['cuscode'] ?></td>
            <td></td>
             <td class="right">Date : <?php echo $row['sdate'] ?></td>
        </tr>
        <tr> 
            <td>&nbsp;</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
         <tr> 
             <td> Address : <?php echo $row1['ADD1'] ?></td>
            <td></td>
            <td></td>
        </tr>
        
         
        
    </table>

    <table class="tb" align="center"   >
            <tr>
                <td>JOB NO</td>
                <td>SIZE</td>
                <td>MARKER</td>
                <td>SERIAL NO</td>
                <td>WARRENTY</td>
                <td>BELT</td>
                <td>REMARK</td>
                
            </tr>
        <?php
        $i=1;
        $part="";
        $sql1 = "Select * from dag_item where refno='" . $row['refno'] . "' order by refno desc";
        foreach ($conn->query($sql1) as $row1) {

            ?>
            <tr> 

                 <td class="left" ><?php echo $row1['jobno']; ?> </td> 
                <td class="left" ><?php echo $row1['size']; ?> </td>  
                <td class="left" ><?php echo $row1['marker']; ?> </td>
                <td class="left" ><?php echo $row1['serialno']; ?> </td> 
                 <td class="left" ><?php echo $row1['warrenty']; ?> </td> 
                <td class="left" ><?php echo $row1['belt']; ?> </td>
                <td class="left" ><?php echo $row1['remark']; ?> </td>
             
               
            </tr>
            <?php
            $i=$i+1; 
        }
        ?>

        <?php

        $t=36;
        while ($i <$t) {

         echo "<tr>

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

     ?>
         
 
</table>


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

</html>
