unlock.phtml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <div class="section">
  2. <div class="row">
  3. <div class="small-12 columns">
  4. <h1><i class="fa fa-unlock"></i> Time Unlock</h1>
  5. </div>
  6. </div>
  7. <div class="row">
  8. <div class="small-12 columns">
  9. <ul class="tabs" data-tab>
  10. <li class="tab-title active"><a href="#panel1"><i class="fa fa-square"></i> Single Unlock</a></li>
  11. <li class="tab-title"><a href="#panel2"><i class="fa fa-th"></i> Range Unlock</a></li>
  12. </ul>
  13. <div class="tabs-content">
  14. <div class="content active" id="panel1">
  15. <div class="small-12 columns">
  16. <p>Unlocks a single validated time entry.</p>
  17. <p>This is useful in a situation when an employee has accidentally validated a time entry and it is inaccurate.</p>
  18. <hr>
  19. </div>
  20. <div class="small-12 columns">
  21. <?php
  22. if(count($this->accounts->timesheets) > 0)
  23. {
  24. foreach($this->accounts->timesheets as $account=>$timesheet)
  25. {
  26. if(count($timesheet) > 0)
  27. {
  28. $validatedTotal = 0;
  29. foreach($timesheet as $entry)
  30. {
  31. if($entry['validated'] == 1)
  32. {
  33. $validatedTotal++;
  34. }
  35. }
  36. echo "<h3 class='timeTitle'>$account <i class='fa fa-chevron-down right'></i></h3>";
  37. echo "<div class='wrapper hide'>";
  38. if($validatedTotal > 0)
  39. {
  40. echo "
  41. <table width='100%'>
  42. <tr>
  43. <th>Date</th>
  44. <th>Start Time</th>
  45. <th>End Time</th>
  46. <th>Code</th>
  47. <th>Action</th>
  48. </tr>
  49. ";
  50. foreach($timesheet as $id=>$entry)
  51. {
  52. if($entry['validated'] == 1)
  53. {
  54. echo "
  55. <tr>
  56. <td>".$entry['date']."</td>
  57. <td>".date("g:i A",$entry['inTime'])."</td>
  58. <td>".date("g:i A",$entry['outTime'])."</td>
  59. <td>".$entry['code']."</td>
  60. <td><a href=\"".$this->link(array('reports','unlockid',$id))."\"><i class='fa fa-unlock-alt'></i> Unlock</td>
  61. </tr>
  62. ";
  63. }
  64. }
  65. }
  66. else
  67. {
  68. echo "<div class='text-center'>No validated time submitted for this pay period.</div>";
  69. }
  70. echo "</table></div> <!-- end wrapper -->";
  71. }
  72. }
  73. }
  74. ?>
  75. </div>
  76. </div>
  77. <div class="content" id="panel2">
  78. <div class="small-12 medium-6 columns">
  79. <p>Unlocks a range of dates for a user to submit new time entries.</p>
  80. <p>This is useful in a situation when an employee needs to have previous pay period dates unlocked for submission.</p>
  81. <p>
  82. <b>Note:</b> This <b>will not</b> unlock validated time entries.
  83. </p>
  84. </div>
  85. <div class="small-12 medium-6 columns">
  86. <?php echo $this->rangeForm ?>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <script>
  94. $(function() {
  95. $( "#startDate" ).datepicker({
  96. numberOfMonths: 2,
  97. showWeek: true,
  98. showButtonPanel: true,
  99. onClose: function( selectedDate ) {
  100. $( "#endDate" ).datepicker( "option", "minDate", selectedDate );
  101. }
  102. });
  103. $( "#endDate" ).datepicker({
  104. numberOfMonths: 2,
  105. showWeek: true,
  106. showButtonPanel: true,
  107. onClose: function( selectedDate ) {
  108. $( "#startDate" ).datepicker( "option", "maxDate", selectedDate );
  109. }
  110. });
  111. $(".timeTitle").click(function() {
  112. $(this).next(".wrapper").slideToggle("slow");
  113. $(this).find("i").toggleClass("fa-chevron-up fa-chevron-down")
  114. return false;
  115. });
  116. $("#hideAll").click(function() {
  117. $(".wrapper").slideUp();
  118. $(".timeTitle").find("i").removeClass("fa-chevron-up")
  119. $(".timeTitle").find("i").addClass("fa-chevron-down")
  120. return false;
  121. });
  122. $("#showAll").click(function() {
  123. $(".wrapper").slideDown();
  124. $(".timeTitle").find("i").removeClass("fa-chevron-down")
  125. $(".timeTitle").find("i").addClass("fa-chevron-up")
  126. return false;
  127. });
  128. });
  129. </script>