unlock.phtml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <div class="section">
  2. <div class="row">
  3. <div class="small-12 columns">
  4. <h2><i class="fa fa-unlock"></i> Time Unlock</h2>
  5. </div>
  6. </div>
  7. <div class="row">
  8. <div class="small-12 columns">
  9. <hr>
  10. <h3>Current Pay Period Entry Unlock</h3>
  11. <?php
  12. if(count($this->accounts->timesheets) > 0)
  13. {
  14. foreach($this->accounts->timesheets as $account=>$timesheet)
  15. {
  16. if(count($timesheet) > 0)
  17. {
  18. $validatedTotal = 0;
  19. foreach($timesheet as $entry)
  20. {
  21. if($entry['validated'] == 1)
  22. {
  23. $validatedTotal++;
  24. }
  25. }
  26. echo "<h4 class='timeTitle'>$account <i class='fa fa-chevron-down right'></i></h4>";
  27. echo "<div class='wrapper hide'>";
  28. if($validatedTotal > 0)
  29. {
  30. echo "
  31. <table width='100%'>
  32. <tr>
  33. <th>Date</th>
  34. <th>Start Time</th>
  35. <th>End Time</th>
  36. <th>Code</th>
  37. <th>Action</th>
  38. </tr>
  39. ";
  40. foreach($timesheet as $id=>$entry)
  41. {
  42. if($entry['validated'] == 1)
  43. {
  44. echo "
  45. <tr>
  46. <td>".$entry['date']."</td>
  47. <td>".date("g:i A",$entry['inTime'])."</td>
  48. <td>".date("g:i A",$entry['outTime'])."</td>
  49. <td>".$entry['code']."</td>
  50. <td><a href=\"".$this->link(array('reports','unlockid',$id))."\"><i class='fa fa-unlock-alt'></i> Unlock</td>
  51. </tr>
  52. ";
  53. }
  54. }
  55. }
  56. else
  57. {
  58. echo "<div class='text-center'>No validated time submitted for this pay period.</div>";
  59. }
  60. echo "</table></div> <!-- end wrapper -->";
  61. }
  62. }
  63. }
  64. ?>
  65. </div>
  66. </div>
  67. </div>
  68. <script>
  69. $(function() {
  70. $( "#date" ).datepicker({
  71. numberOfMonths: 2,
  72. showWeek: true,
  73. showButtonPanel: true
  74. });
  75. $(".timeTitle").click(function() {
  76. $(this).next(".wrapper").slideToggle("slow");
  77. $(this).find("i").toggleClass("fa-chevron-up fa-chevron-down")
  78. return false;
  79. });
  80. $("#hideAll").click(function() {
  81. $(".wrapper").slideUp();
  82. $(".timeTitle").find("i").removeClass("fa-chevron-up")
  83. $(".timeTitle").find("i").addClass("fa-chevron-down")
  84. return false;
  85. });
  86. $("#showAll").click(function() {
  87. $(".wrapper").slideDown();
  88. $(".timeTitle").find("i").removeClass("fa-chevron-down")
  89. $(".timeTitle").find("i").addClass("fa-chevron-up")
  90. return false;
  91. });
  92. });
  93. </script>