inactive.phtml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <div class="section">
  2. <div class="row">
  3. <div class="small-7 columns">
  4. <h1><i class="fa fa-file"></i>Time Sheets <small>Inactive</small></h1>
  5. </div>
  6. <div class="small-5 columns text-right">
  7. <h1 class="subheader"><?php echo $this->monthName ?> <?php echo $this->year?></h1>
  8. </div>
  9. </div>
  10. <div class="row">
  11. <div class="small-12 columns">
  12. <ul class="button-group radius even-5">
  13. <?php
  14. $year = $this->year;
  15. if($this->month == 12)
  16. {
  17. $year = $this->nextYear;
  18. }
  19. if($this->momth == 1)
  20. {
  21. $year = $this->previousYear;
  22. }
  23. ?>
  24. <li><a class="button small secondary" href="
  25. <?php
  26. switch ($this->month)
  27. {
  28. case 01:
  29. echo $this->link(array('reports','inactive',$this->previousYear, $this->previousMonth));
  30. break;
  31. default:
  32. echo $this->link(array('reports','inactive',$this->year, $this->previousMonth));
  33. }
  34. ?>
  35. "><i class="fa fa-caret-left"></i> Previous</a></li>
  36. <li><a class="button small secondary" href="
  37. <?php
  38. switch ($this->month)
  39. {
  40. case 12:
  41. echo $this->link(array('reports','inactive',$this->nextYear, $this->nextMonth));
  42. break;
  43. default:
  44. echo $this->link(array('reports','inactive',$this->year, $this->nextMonth));
  45. }
  46. ?>
  47. ">Next <i class="fa fa-caret-right"></i></a></li>
  48. <li><a id="showAll" class="button small secondary" href="#"><i class="fa fa-eye"></i> Show All</a></li>
  49. <li><a id="hideAll" class="button small secondary" href="#"><i class="fa fa-eye-slash"></i> Hide All</a></li>
  50. <li><a class="button small" data-reveal-id="print" href="#"><i class="fa fa-print"></i> Print</a></li>
  51. </ul>
  52. </div>
  53. </div>
  54. <div class="row">
  55. <div class="small-12 columns">
  56. <?php
  57. $i = 0;
  58. foreach($this->report as $user=>$timesheet)
  59. {
  60. echo "<h3 id='user'.$i.'' class='timeTitle'>$user <i class='fa fa-chevron-down right'></i></h3>";
  61. echo "
  62. <div class=\"wrapper hide\">";
  63. if(count($timesheet) > 0)
  64. {
  65. echo"
  66. <table width='100%'>
  67. <thead>
  68. <tr>
  69. <th>Date</th>
  70. <th>In</th>
  71. <th>Out</th>
  72. <th>Less Time</th>
  73. <th>Hours</th>
  74. <th>Code</th>
  75. <th>Date Stamp</th>
  76. <th>Validated</th>";
  77. if($this->accountLevel >= 900)
  78. {
  79. echo "<th>Action</th>";
  80. }
  81. echo"</tr>
  82. </thead>
  83. ";
  84. }
  85. $totalValidated = 0;
  86. $totalInvalid = 0;
  87. $totalVacation = 0;
  88. $totalSick = 0;
  89. foreach($timesheet as $key=>$entry)
  90. {
  91. echo "
  92. <tr>
  93. <td>".date("l, F jS Y",strtotime($entry['date']))."</td>
  94. <td>".date("g:i A",$entry['inTime'])."</td>
  95. <td>".date("g:i A",$entry['outTime'])."</td>
  96. <td>".$entry['lessTime']." <small>Hours</small></td>
  97. <td>".$entry['timeWorked']."</td>
  98. <td>".$entry['code']."</td>
  99. <td>".date("M. jS Y @ G:i A",strtotime($entry['timestamp']))."</td>
  100. <td><div class='text-center'>";
  101. if($entry['validated'] == 1)
  102. {
  103. echo "<i class=\"fa fa-check green\"></i>";
  104. }
  105. else
  106. {
  107. echo "<i class=\"fa fa-close red\"></i>";
  108. }
  109. echo "</td>";
  110. if($this->accountLevel >= 900)
  111. {
  112. echo "<td><a href=\"".$this->link(array('timesheet','remove',$key))."\"><i class=\"fa fa-trash\"></i> Remove</a></td>";
  113. }
  114. echo "</tr>";
  115. if(strlen($entry['note']) > 0)
  116. {
  117. echo "
  118. <tr>
  119. <td colspan='9'>
  120. <b>Note:</b> ".$entry['note']."
  121. </td>
  122. </tr>
  123. ";
  124. }
  125. if($entry['validated'] == 1)
  126. {
  127. $totalValidated += $entry['timeWorked'];
  128. }
  129. if($entry['validated'] == 0)
  130. {
  131. $totalInvalid += $entry['timeWorked'];
  132. }
  133. if($entry['code'] == "Vacation")
  134. {
  135. $totalVacation += $entry['timeWorked'];
  136. }
  137. if($entry['code'] == "Sick")
  138. {
  139. $totalSick += $entry['timeWorked'];
  140. }
  141. }
  142. if(count($timesheet) > 0)
  143. {
  144. echo "</table>";
  145. echo "<div class=\"row\">";
  146. echo "<div class='small-12'>
  147. FORM GOES HERE
  148. </div>";
  149. echo "</div>";
  150. echo "<div class=\"row\">";
  151. echo "<div class=\"small-6 medium-4 large-3 columns\">";
  152. echo "<div class=\"card successBg\">
  153. <div class=\"title\">Validated</div>
  154. <div class=\"value\">".$totalValidated." <small>Hours</small></div>
  155. </div>";
  156. echo "</div>";
  157. echo "<div class=\"small-6 medium-4 large-3 columns\">";
  158. echo "<div class=\"card warning\">
  159. <div class=\"title\">Not Validated</div>
  160. <div class=\"value\">".$totalInvalid." <small>Hours</small></div>
  161. </div>";
  162. echo "</div>";
  163. echo "<div class=\"small-6 medium-4 large-3 columns end\">";
  164. echo "<div class=\"card\">
  165. <div class=\"title\">Sick</div>
  166. <div class=\"value\">".$totalSick." <small>Hours</small></div>
  167. </div>";
  168. echo "</div>";
  169. echo "<div class=\"small-6 medium-4 large-3 columns end\">";
  170. echo "<div class=\"card\">
  171. <div class=\"title\">Vacation</div>
  172. <div class=\"value\">".$totalVacation." <small>Hours</small></div>
  173. </div>";
  174. echo "</div>";
  175. echo "</div>";
  176. }
  177. else
  178. {
  179. echo "<div class=\"text-center\">No time submitted</div>";
  180. }
  181. $i++;
  182. echo "</div><hr>";
  183. }
  184. ?>
  185. </div>
  186. </div>
  187. </div>
  188. <div id="yearForm" class="reveal-modal small" data-reveal aria-labelledby="Change Year" aria-hidden="true" role="dialog">
  189. <h2 id="modalTitle">Select a Year</h2>
  190. <?php echo $this->yearForm ?>
  191. <a class="close-reveal-modal" aria-label="Close">&#215;</a>
  192. </div>
  193. <div id="print" class="reveal-modal small" data-reveal aria-labelledby="Print Report" aria-hidden="true" role="dialog">
  194. <h2>Print Individual Time Sheet</h2>
  195. <?php echo $this->printTimeSheetForm ?>
  196. <a class="close-reveal-modal" aria-label="Close">&#215;</a>
  197. </div>
  198. <script>
  199. $(function() {
  200. $(".timeTitle").click(function() {
  201. $(this).next(".wrapper").slideToggle("slow");
  202. $(this).find("i").toggleClass("fa-chevron-up fa-chevron-down")
  203. return false;
  204. });
  205. $("#hideAll").click(function() {
  206. $(".wrapper").slideUp();
  207. $(".timeTitle").find("i").removeClass("fa-chevron-up")
  208. $(".timeTitle").find("i").addClass("fa-chevron-down")
  209. return false;
  210. });
  211. $("#showAll").click(function() {
  212. $(".wrapper").slideDown();
  213. $(".timeTitle").find("i").removeClass("fa-chevron-down")
  214. $(".timeTitle").find("i").addClass("fa-chevron-up")
  215. return false;
  216. });
  217. });
  218. </script>