unlock.phtml 4.0 KB

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