Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FaultyStatisticExport.php 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace App\Exports;
  3. use App\Compound;
  4. use Maatwebsite\Excel\Concerns\Exportable;
  5. use Maatwebsite\Excel\Concerns\WithMultipleSheets;
  6. class FaultyStatisticExport implements WithMultipleSheets
  7. {
  8. use Exportable;
  9. private $jan,$feb,$mac,$apr,$mei,$jun,$july,$ogos,$sept,$okt,$nov,$dis,$all,$start_date,$end_date;
  10. public function __construct($jan,$feb,$mac,$apr,$mei,$jun,$july,$ogos,$sept,$okt,$nov,$dis,$all,$start_date,$end_date)
  11. {
  12. $this->jan = $jan;
  13. $this->feb = $feb;
  14. $this->mac = $mac;
  15. $this->apr = $apr;
  16. $this->mei = $mei;
  17. $this->jun = $jun;
  18. $this->july = $july;
  19. $this->ogos = $ogos;
  20. $this->sept = $sept;
  21. $this->okt = $okt;
  22. $this->nov = $nov;
  23. $this->dis = $dis;
  24. $this->all = $all;
  25. $this->start_date = $start_date;
  26. $this->end_date = $end_date;
  27. }
  28. /**
  29. * @return array
  30. */
  31. public function sheets(): array
  32. {
  33. $sheets = [];
  34. $sheets[] = new FaultyStatisticSheet($this->jan, '01', $this->start_date, $this->end_date);
  35. $sheets[] = new FaultyStatisticSheet($this->feb, '02', $this->start_date, $this->end_date);
  36. $sheets[] = new FaultyStatisticSheet($this->mac, '03', $this->start_date, $this->end_date);
  37. $sheets[] = new FaultyStatisticSheet($this->apr, '04', $this->start_date, $this->end_date);
  38. $sheets[] = new FaultyStatisticSheet($this->mei, '05', $this->start_date, $this->end_date);
  39. $sheets[] = new FaultyStatisticSheet($this->jun, '06', $this->start_date, $this->end_date);
  40. $sheets[] = new FaultyStatisticSheet($this->july,'07', $this->start_date, $this->end_date);
  41. $sheets[] = new FaultyStatisticSheet($this->ogos,'08', $this->start_date, $this->end_date);
  42. $sheets[] = new FaultyStatisticSheet($this->sept,'09', $this->start_date, $this->end_date);
  43. $sheets[] = new FaultyStatisticSheet($this->okt, '10', $this->start_date, $this->end_date);
  44. $sheets[] = new FaultyStatisticSheet($this->nov, '11', $this->start_date, $this->end_date);
  45. $sheets[] = new FaultyStatisticSheet($this->dis, '12', $this->start_date, $this->end_date);
  46. $sheets[] = new FaultyStatisticSheet($this->all, 'All', $this->start_date, $this->end_date);
  47. return $sheets;
  48. }
  49. }