unlock.phtml 3.9 KB

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