payperiod.phtml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <div class="section">
  2. <div class="row">
  3. <div class="small-12 columns">
  4. <h2><i class="fa fa-file"></i> Pay Period Report</h2>
  5. </div>
  6. </div>
  7. <?php echo $this->spanDays ?>
  8. <div class="row full">
  9. <div class="small-12 columns full">
  10. <style>
  11. table {
  12. border:1px solid #ccc;
  13. }
  14. th {
  15. border:1px solid #ccc;
  16. padding:0px;
  17. margin:0px;
  18. background-color: #eaeaea;
  19. }
  20. td {
  21. border:1px solid #ccc;
  22. padding:0px;
  23. margin:0px;
  24. }
  25. </style>
  26. <table>
  27. <thead>
  28. <tr>
  29. <th style="width:150px;"></th>
  30. <?php
  31. $date3 = new DateTime();
  32. $date3->setDate($this->year,$this->previousMonth,26);
  33. for($i=1;$i<=$this->span;$i++)
  34. {
  35. if($date3->format('d') >= 26)
  36. {
  37. echo "<th style='background-color:#fff;border-bottom:1px solid #ccc; '>".$date3->format('D')."<br>".$date3->format('n')."/".$date3->format('j')."</th>";
  38. }
  39. else
  40. {
  41. echo "<th style='border-bottom:1px solid #ccc;'>".$date3->format('D')."<br>".$date3->format('n')."/".$date3->format('j')."</th>";
  42. }
  43. $date3->modify('+1 day');
  44. }
  45. ?>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. <?php
  50. foreach($this->report as $user=>$dates)
  51. {
  52. echo "<tr>";
  53. echo "<td style='border-bottom:1px solid #ccc;'><b>$user</b></td>";
  54. $date = new DateTime();
  55. $date->setDate($this->year,$this->previousMonth,26);
  56. for($j=1;$j<=$this->span;$j++)
  57. {
  58. foreach ($dates as $entryDate => $total)
  59. {
  60. $newDate = explode("-", $entryDate);
  61. $dayOfMonth = $newDate[2];
  62. if($dayOfMonth == $date->format('d'))
  63. {
  64. echo "<td class='text-center' style='border-bottom:1px solid #ccc;'>$total</td>";
  65. $j++;
  66. }
  67. }
  68. echo "<td class='text-center'> - </td>";
  69. $date->modify('+1 day');
  70. }
  71. echo "</tr>";
  72. }
  73. ?>
  74. </tbody>
  75. </table>
  76. </div>
  77. </div>
  78. </div>
  79. <pre>
  80. <?php
  81. print_r($this->report);
  82. ?>
  83. </pre>