shiftPumpReport1.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. require "connectionDb.php";
  3. $date = $_GET['selectDateToFind'];
  4. $date = str_replace('-', '_', $date);
  5. $shiftnum = 1;
  6. $shiftPumpReport1 = $db->query("SELECT * FROM shift_pump_vw WHERE date='$date'");
  7. print_r("<thead><tr>
  8. <th>Pump Number</th>
  9. <th>Fuel Grade</th>
  10. <th>Pump Opening Volume</th>
  11. <th>Pump Closing Volume</th>
  12. <th>Sale Volume
  13. (Closing Volume - Opening Volume)</th>
  14. <th>Unit Price</th>
  15. <th>Money
  16. (Sale Volume x Unit Price)</th>
  17. </tr></thead>");
  18. while ($row = $shiftPumpReport1->fetchArray()) {
  19. //print_r($row);
  20. if ($row['number']==$shiftnum) {
  21. $openVolume = $row['open_volume'];
  22. $closeVolume = $row['close_volume'];
  23. $saleTotal =$closeVolume-$openVolume;
  24. $price= $row['price'];
  25. $moneyTotal = $saleTotal*$price;
  26. print_r(
  27. "<tr>"
  28. ."<td>".$row['fp_id']."</td>"
  29. ."<td>".$row['grade_name']."</td>"
  30. ."<td>".decimalAndNumberFormat1($row['open_volume'])."</td>"
  31. ."<td>".decimalAndNumberFormat1($row['close_volume'])."</td>"
  32. ."<td>".decimalAndNumberFormat1($saleTotal)."</td>"
  33. ."<td>".decimalAndNumberFormat1($row['price'])."</td>"
  34. ."<td>".decimalAndNumberFormat1($moneyTotal)."</td>"
  35. ."</tr>"
  36. );
  37. }
  38. }
  39. ?>