payperiod.phtml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <div class="section">
  2. <div class="row">
  3. <div class="small-6 columns">
  4. <h2><i class="fa fa-file"></i> Daily Totals <small><?php echo $this->date ?></small></h2>
  5. </div>
  6. <div class="small-6 columns text-right">
  7. <ul class="button-group round">
  8. <li><a class="button small secondary" href="
  9. <?php
  10. switch ($this->month)
  11. {
  12. case 01:
  13. echo $this->link(array('reports','payperiod',$this->previousYear, $this->previousMonth));
  14. break;
  15. default:
  16. echo $this->link(array('reports','payperiod',$this->year, $this->previousMonth));
  17. }
  18. ?>
  19. "><i class="fa fa-caret-left"></i> Previous</a></li>
  20. <li><a class="button small secondary" href="
  21. <?php
  22. switch ($this->month)
  23. {
  24. case 12:
  25. echo $this->link(array('reports','payperiod',$this->nextYear, $this->nextMonth));
  26. break;
  27. default:
  28. echo $this->link(array('reports','payperiod',$this->year, $this->nextMonth));
  29. }
  30. ?>
  31. ">Next <i class="fa fa-caret-right"></i></a></li>
  32. <li><a class="button small" target="_blank" href="<?php echo $this->link(array('reports','payperiodprint',$this->year,$this->month)) ?>"><i class='fa fa-print'></i> Print</a></li>
  33. </ul>
  34. </div>
  35. </div>
  36. <div class="row">
  37. <div class="small-12 columns">
  38. <style>
  39. table {
  40. border:1px solid #ccc;
  41. }
  42. th {
  43. border:1px solid #ccc;
  44. padding:0px;
  45. margin:0px;
  46. background-color: #eaeaea;
  47. }
  48. td {
  49. border:1px solid #ccc;
  50. padding:0px;
  51. margin:0px;
  52. }
  53. .scroll {
  54. overflow-x:scroll;
  55. overflow-y:visible;
  56. }
  57. </style>
  58. <div class="scroll">
  59. <table>
  60. <thead>
  61. <tr>
  62. <th style="width:150px;"></th>
  63. <?php
  64. $date = new DateTime();
  65. $date->setDate($this->year,$this->previousMonth,26);
  66. for($i=1;$i<=$this->span;$i++)
  67. {
  68. if($date->format('d') >= 26)
  69. {
  70. echo "<th style='background-color:#fff;border-bottom:1px solid #ccc; '>".$date->format('D')."<br>".$date->format('n')."/".$date->format('j')."</th>";
  71. }
  72. else
  73. {
  74. echo "<th style='border-bottom:1px solid #ccc;'>".$date->format('D')."<br>".$date->format('n')."/".$date->format('j')."</th>";
  75. }
  76. $date->modify('+1 day');
  77. }
  78. ?>
  79. </tr>
  80. </thead>
  81. <tbody>
  82. <?php
  83. foreach($this->report as $user=>$dates)
  84. {
  85. $totalTime = array_sum($dates);
  86. echo "<tr>";
  87. echo "<td style='border-bottom:1px solid #ccc;'><b>$user</b><br>Total: $totalTime</td>";
  88. $date = new DateTime();
  89. $date->setDate($this->year,$this->previousMonth,26);
  90. for($j=1;$j<=$this->span;$j++)
  91. {
  92. echo "<td class='text-center' style='border-bottom:1px solid #ccc;'>";
  93. $value = "-";
  94. foreach ($dates as $entryDate => $total)
  95. {
  96. $newDate = explode("-", $entryDate);
  97. $dayOfMonth = $newDate[2];
  98. if($dayOfMonth == $date->format('d'))
  99. {
  100. $value = $total;
  101. }
  102. }
  103. echo $value;
  104. echo "</td>";
  105. $date->modify('+1 day');
  106. }
  107. echo "</tr>";
  108. }
  109. ?>
  110. </tbody>
  111. </table>
  112. </div>
  113. </div>
  114. </div>
  115. </div>