<html>
<head>
<title>Inventory Diary</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
body {
    font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 14px;
}
h1 {
font-size: 20px;
vertical-align: top;
}

table{
      border-collapse: collapse;
}
table.pagehead {
  width: 100%;

}

table.pagehead td.bborder, th.bborder{

  border-bottom: 1px solid black;
   vertical-align: baseline;
}

table.pagehead th.bborder{
  border-bottom: 1px solid black;
  border-right: 1px solid black;
  border-left: 1px solid black;
  vertical-align: baseline;

  }

table.pagehead td.rborder{
  border-right: 1px solid black;
  border-left: 1px solid black;
  vertical-align: middle;
  width:100%;
  }


</style>

</head>
<body>

<table class="pagehead">
<tbody>
<tr>
    <td width="70%"  class="bborder">
                <img src="http://localhost/app2/images/shared/printlogo.jpg" alt="Posics Technologies" width="75" height="50" /><br>
                <h3><?php echo $companyinfo[0]->COMPANYNAME; ?></h3>
                <?php echo $companyinfo[0]->ADDRESS1.', '.$companyinfo[0]->ADDRESS2.', '.$companyinfo[0]->CITY.', '.$companyinfo[0]->REGION ; ?>
                    <br>
                    Phone: <?php echo $companyinfo[0]->PHONE1.', '.$companyinfo[0]->PHONE2.', Fax: '.$companyinfo[0]->FAX ?>
                    <br>
                    Email: <?php echo $companyinfo[0]->EMAIL.', Web: '.$companyinfo[0]->WEBSITE?>


            </td>
    <td width="30%" align="right" class="bborder">
        <h1>Inventory Diary</h1><br>
               Date: <?php echo date('d-m-Y', time()); ?><br>
               <br>
        </td>

</tr>
</tbody>
</table>

<?php
echo "<table class='pagehead'>";
echo "<tbody>";
echo "<thead><tr>
    <th width='25%' align='left' class='bborder'>Reference</th><th width='25%' align='center' class='bborder'>Name</th><th width='15%' align='center' class='bborder'>In </th><th width='35%' align='center' class='bborder'>Out</th><th width='20%' align='center' class='bborder'>Difference</th></thead>";
$totallines=0;
foreach ($inventory as $value) {
$totallines=$totallines+1;
echo "
<tr>
<td class='rborder' align='left'>".$value->REFERENCE."</td>
<td class='rborder' align='center'>".$value->PRODUCT."</td>
<td class='rborder' align='center'>".$value->IN."</td>
<td class='rborder' align='center'>".$value->OUT."</td>
 <td class='rborder' align='center'>".$value->DIFFERENCE."</td>
 </tr>";
}
while($totallines<30)
{
       $totallines=$totallines+1;
    echo "<tr>
    <td class='rborder'>&nbsp;</td>
    <td class='rborder'>&nbsp;</td>
    <td class='rborder'>&nbsp;</td>
    <td class='rborder'>&nbsp;</td>
    <td class='rborder'>&nbsp;</td>
           </tr>";
}
echo "<tr>
    <td class='bborder'></td>
    <td class='bborder'></td>
    <td class='bborder'></td>
    <td class='bborder'></td>
    <td class='bborder'></td>
           </tr>";

echo "</tbody>";
echo "</table>";
?>
    <br><br>
    <table class="pagehead" width="100%">
    <tr>
    <td width="50%">&nbsp;</td>
    <td width="40%">&nbsp;</td>
    <td width="10%">&nbsp;</td>
    </tr>
    <tr>
        <td></td>
    <td class="bborder"></td><td class="bborder">&nbsp;</td>
    </tr>
    <tr>
        <td></td>
    <td>Authorised By</td><td>Date</td>
    </tr>
    </table>
</body>
</html>