Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. <table cellspacing="0" cellpadding="0">
  2. <tr>
  3. <th colspan="12" class="tops"></th>
  4. </tr>
  5. <tr>
  6. <th colspan="12"><br><u>MONTHLY INVENTORY AND CONSUMPTION REPORTS<u><br><br></th>
  7. </tr>
  8. <tr>
  9. <th colspan="5" style="text-align: left;">Department/Section: ENGINEERING AND FACILITIES MANAGEMENT SECTION<br><br></th>
  10. <th colspan="2" style="text-align: right;">Period Covered:<br><br></th>
  11. <th colspan="4"><input type="text" name="from" id="from" class="tcal"> to <input type="text" name="to" id="to" class="tcal"><br><br></th>
  12. <th><input type="submit" class="button" value=""><br><br></th></th>
  13. </tr>
  14. <tr>
  15. <th rowspan="3" width="500px" class="all">ITEMS</th>
  16. <th colspan="3" width="280px" class="top right">BEGINNING BALANCE</th>
  17. <th colspan="3" width="350px" class="top right">ADD - RECEIVED FROM SUPPLY</th>
  18. <th rowspan="3" width="80px" class="top right bottom">TOTAL QUANTITY RECEIVED</th>
  19. <th colspan="3" width="280px" class="top right">DEDUCT CONSUMPTION</th>
  20. <th rowspan="3" width="80px" class="top right bottom">TOTAL ENDING BALANCE</th>
  21. </tr>
  22. <tr>
  23. <td colspan="3" style="text-align: center;" class="right bottom"><font size="2px">(Stock on Hand prior to the Request)</font></td>
  24. <td colspan="3" style="text-align: center;" class="right bottom"><font size="2px">(Stock received for the Month Consumption)</font></td>
  25. <td colspan="3" style="text-align: center;" class="right bottom"><font size="2px">(Total Issuance to End-user)</font></td>
  26. </tr>
  27. <tr>
  28. <th width="80px" class="right bottom">Qty</th>
  29. <th width="100px" class="right bottom">Unit Cost</th>
  30. <th width="100px" class="right bottom">Total Cost</th>
  31. <th width="80px" class="right bottom">Qty</th>
  32. <th width="100px" class="right bottom">Unit Cost</th>
  33. <th width="100px" class="right bottom">Total Cost</th>
  34. <th width="80px" class="right bottom">Qty</th>
  35. <th width="100px" class="right bottom">Unit Cost</th>
  36. <th width="100px" class="right bottom">Total Cost</th>
  37. </tr>
  38. <?php
  39. include('connect/connection.php');
  40. $con = mysqli_connect('localhost','root','','efms');
  41. if (!$con) {
  42. die('Could not connect: ' . mysqli_error($con));
  43. }
  44. $from=@$_POST['from'];
  45. $to=@$_POST['to'];
  46. $query = "SELECT *, SUM(rqty), SUM(iqty), COUNT(item), COUNT(description) FROM issuances WHERE trandate BETWEEN '$from' AND '$to' GROUP BY item, description ORDER BY item ASC, id DESC";
  47. $result = mysql_query($query) or die(mysql_error());
  48.  
  49. while($row = mysql_fetch_array($result)){
  50. $id=$row['id'];
  51. $item=$row['item'];
  52. $description=$row['description'];
  53. $stockno=$row['stockno'];
  54. $orderpoint=$row['orderpoint'];
  55. $rqty=$row['SUM(rqty)'];
  56. $iqty=$row['SUM(iqty)'];
  57. $bqty=$row['bqty'];
  58. $bbal=$bqty;
  59. $totqtyr=$bbal+$rqty;
  60. $totqtyb=$totqtyr-$iqty;
  61. echo "<tr>";
  62. echo "<th width='80px' class='left bottom right'>$item ( $description )</th>";
  63. echo "<th width='80px' class='right bottom'>$bbal</th>";
  64. echo "<th width='100px' class='right bottom'></th>";
  65. echo "<th width='100px' class='right bottom'></th>";
  66. echo "<th width='80px' class='right bottom'>$rqty</th>";
  67. echo "<th width='100px' class='right bottom'></th>";
  68. echo "<th width='100px' class='right bottom'></th>";
  69. echo "<th width='100px' class='right bottom'>$totqtyr</th>";
  70. echo "<th width='80px' class='right bottom'>$iqty</th>";
  71. echo "<th width='100px' class='right bottom'></th>";
  72. echo "<th width='100px' class='right bottom'></th>";
  73. echo "<th width='100px' class='right bottom'>$totqtyb</th>";
  74. echo "</tr>";
  75. }
  76. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement