payroll.phtml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <div class="section">
  2. <div class="row">
  3. <div class="small-6 columns">
  4. <h2><i class="fa fa-file"></i> Month 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','payroll',$this->previousYear, $this->previousMonth));
  14. break;
  15. default:
  16. echo $this->link(array('reports','payroll',$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','payroll',$this->nextYear, $this->nextMonth));
  26. break;
  27. default:
  28. echo $this->link(array('reports','payroll',$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','payrollprint',$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="">
  59. <table>
  60. <thead>
  61. <tr>
  62. <th style="width:150px;"></th>
  63. <?php
  64. foreach($this->codes as $codeKey=>$codeName)
  65. {
  66. echo "<th>$codeName</th>";
  67. }
  68. ?>
  69. <th>Total</th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. <?php
  74. //Gets the unpaid leave time code ID. These entries will not be reflected in the total.
  75. $code = new codeModel();
  76. $codeId = $code->getIdFor("Unpaid Leave");
  77. $grandTotal = 0;
  78. foreach($this->report as $account)
  79. {
  80. echo "<tr>";
  81. echo "<td style='border-bottom:1px solid #ccc;'><b>".$account['userInfo']['lastName'].", ".$account['userInfo']['firstName']."</b></td>";
  82. foreach($account['totals'] as $totals)
  83. {
  84. echo "<td class='text-center' style='border-bottom:1px solid #ccc;'>";
  85. if($totals == 0)
  86. {
  87. echo " - ";
  88. }
  89. else
  90. {
  91. echo $totals;
  92. }
  93. echo "</td>";
  94. }
  95. $accountTotal = 0;
  96. foreach($account['totals'] as $key => $value)
  97. {
  98. if($key != $codeId['id'])
  99. {
  100. $accountTotal = $accountTotal + $value;
  101. $grandTotal = $grandTotal + $value;
  102. }
  103. }
  104. echo "<td class='text-center'><b>$accountTotal</b></td>";
  105. echo "</tr>";
  106. }
  107. $codeCount = count($account['totals'])+2;
  108. echo "
  109. <tr>
  110. <td class='text-center' colspan=\"$codeCount\"><b>Total Pay Period Hours:</b> $grandTotal </td>
  111. </tr>
  112. ";
  113. ?>
  114. </tbody>
  115. </table>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <div id="yearForm" class="reveal-modal small" data-reveal aria-labelledby="Change Year" aria-hidden="true" role="dialog">
  121. <h2 id="modalTitle">Select a Year</h2>
  122. <?php echo $this->yearForm ?>
  123. <a class="close-reveal-modal" aria-label="Close">&#215;</a>
  124. </div>