123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <div class="section">
- <div class="row">
- <div class="small-12 columns">
- <h1><i class="fa fa-unlock"></i> Time Unlock</h1>
- </div>
- </div>
- <div class="row">
- <div class="small-12 columns">
- <ul class="tabs" data-tab>
- <li class="tab-title active"><a href="#panel1"><i class="fa fa-square"></i> Single Unlock</a></li>
- <li class="tab-title"><a href="#panel2"><i class="fa fa-th"></i> Range Unlock</a></li>
- </ul>
- <div class="tabs-content">
- <div class="content active" id="panel1">
- <div class="small-12 columns">
- <p>Unlocks a single validated time entry.</p>
- <p>This is useful in a situation when an employee has accidentally validated a time entry and it is inaccurate.</p>
- <hr>
- </div>
- <div class="small-12 columns">
- <?php
- if(count($this->accounts->timesheets) > 0)
- {
- foreach($this->accounts->timesheets as $account=>$timesheet)
- {
- if(count($timesheet) > 0)
- {
- $validatedTotal = 0;
- foreach($timesheet as $entry)
- {
- if($entry['validated'] == 1)
- {
- $validatedTotal++;
- }
- }
- echo "<h3 class='timeTitle'>$account <i class='fa fa-chevron-down right'></i></h3>";
- echo "<div class='wrapper hide'>";
- if($validatedTotal > 0)
- {
- echo "
- <table width='100%'>
- <tr>
- <th>Date</th>
- <th>Start Time</th>
- <th>End Time</th>
- <th>Code</th>
- <th>Action</th>
- </tr>
- ";
- foreach($timesheet as $id=>$entry)
- {
- if($entry['validated'] == 1)
- {
- echo "
- <tr>
- <td>".$entry['date']."</td>
- <td>".date("g:i A",$entry['inTime'])."</td>
- <td>".date("g:i A",$entry['outTime'])."</td>
- <td>".$entry['code']."</td>
- <td><a href=\"".$this->link(array('reports','unlockid',$id))."\"><i class='fa fa-unlock-alt'></i> Unlock</td>
- </tr>
- ";
- }
- }
- }
- else
- {
- echo "<div class='text-center'>No validated time submitted for this pay period.</div>";
- }
- echo "</table></div> <!-- end wrapper -->";
- }
- }
- }
- ?>
- </div>
- </div>
- <div class="content" id="panel2">
- <div class="small-12 medium-6 columns">
- <p>Unlocks a range of dates for a user to submit new time entries.</p>
- <p>This is useful in a situation when an employee needs to have previous pay period dates unlocked for submission.</p>
- <p>
- <b>Note:</b> This <b>will not</b> unlock validated time entries.
- </p>
- </div>
- <div class="small-12 medium-6 columns">
- <?php echo $this->rangeForm ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function() {
- $( "#startDate" ).datepicker({
- numberOfMonths: 2,
- showWeek: true,
- showButtonPanel: true,
- onClose: function( selectedDate ) {
- $( "#endDate" ).datepicker( "option", "minDate", selectedDate );
- }
- });
- $( "#endDate" ).datepicker({
- numberOfMonths: 2,
- showWeek: true,
- showButtonPanel: true,
- onClose: function( selectedDate ) {
- $( "#startDate" ).datepicker( "option", "maxDate", selectedDate );
- }
- });
- $(".timeTitle").click(function() {
- $(this).next(".wrapper").slideToggle("slow");
- $(this).find("i").toggleClass("fa-chevron-up fa-chevron-down")
- return false;
- });
- $("#hideAll").click(function() {
- $(".wrapper").slideUp();
- $(".timeTitle").find("i").removeClass("fa-chevron-up")
- $(".timeTitle").find("i").addClass("fa-chevron-down")
- return false;
- });
- $("#showAll").click(function() {
- $(".wrapper").slideDown();
- $(".timeTitle").find("i").removeClass("fa-chevron-down")
- $(".timeTitle").find("i").addClass("fa-chevron-up")
- return false;
- });
- });
- </script>
|