123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <div class="section">
- <div class="row">
- <div class="small-7 columns">
- <h1><i class="fa fa-file"></i>Time Sheets <small>Inactive</small></h1>
- </div>
- <div class="small-5 columns text-right">
- <h1 class="subheader"><?php echo $this->monthName ?> <?php echo $this->year?></h1>
- </div>
- </div>
- <div class="row">
- <div class="small-12 columns">
- <ul class="button-group radius even-5">
- <?php
- $year = $this->year;
- if($this->month == 12)
- {
- $year = $this->nextYear;
- }
- if($this->momth == 1)
- {
- $year = $this->previousYear;
- }
- ?>
- <li><a class="button small secondary" href="
- <?php
- switch ($this->month)
- {
- case 01:
- echo $this->link(array('reports','inactive',$this->previousYear, $this->previousMonth));
- break;
- default:
- echo $this->link(array('reports','inactive',$this->year, $this->previousMonth));
- }
- ?>
- "><i class="fa fa-caret-left"></i> Previous</a></li>
- <li><a class="button small secondary" href="
- <?php
- switch ($this->month)
- {
- case 12:
- echo $this->link(array('reports','inactive',$this->nextYear, $this->nextMonth));
- break;
- default:
- echo $this->link(array('reports','inactive',$this->year, $this->nextMonth));
- }
- ?>
- ">Next <i class="fa fa-caret-right"></i></a></li>
- <li><a id="showAll" class="button small secondary" href="#"><i class="fa fa-eye"></i> Show All</a></li>
- <li><a id="hideAll" class="button small secondary" href="#"><i class="fa fa-eye-slash"></i> Hide All</a></li>
- <li><a class="button small" data-reveal-id="print" href="#"><i class="fa fa-print"></i> Print</a></li>
- </ul>
- </div>
- </div>
- <div class="row">
- <div class="small-12 columns">
- <?php
- $i = 0;
- foreach($this->report as $user=>$timesheet)
- {
- echo "<h3 id='user'.$i.'' class='timeTitle'>$user <i class='fa fa-chevron-down right'></i></h3>";
- echo "
- <div class=\"wrapper hide\">";
- if(count($timesheet) > 0)
- {
- echo"
- <table width='100%'>
- <thead>
- <tr>
- <th>Date</th>
- <th>In</th>
- <th>Out</th>
- <th>Less Time</th>
- <th>Hours</th>
- <th>Code</th>
- <th>Date Stamp</th>
- <th>Validated</th>";
- if($this->accountLevel >= 900)
- {
- echo "<th>Action</th>";
- }
- echo"</tr>
- </thead>
- ";
- }
- $totalValidated = 0;
- $totalInvalid = 0;
- $totalVacation = 0;
- $totalSick = 0;
- foreach($timesheet as $key=>$entry)
- {
- echo "
- <tr>
- <td>".date("l, F jS Y",strtotime($entry['date']))."</td>
- <td>".date("g:i A",$entry['inTime'])."</td>
- <td>".date("g:i A",$entry['outTime'])."</td>
- <td>".$entry['lessTime']." <small>Hours</small></td>
- <td>".$entry['timeWorked']."</td>
- <td>".$entry['code']."</td>
- <td>".date("M. jS Y @ G:i A",strtotime($entry['timestamp']))."</td>
- <td><div class='text-center'>";
- if($entry['validated'] == 1)
- {
- echo "<i class=\"fa fa-check green\"></i>";
- }
- else
- {
- echo "<i class=\"fa fa-close red\"></i>";
- }
- echo "</td>";
- if($this->accountLevel >= 900)
- {
- echo "<td><a href=\"".$this->link(array('timesheet','remove',$key))."\"><i class=\"fa fa-trash\"></i> Remove</a></td>";
- }
- echo "</tr>";
- if(strlen($entry['note']) > 0)
- {
- echo "
- <tr>
- <td colspan='9'>
- <b>Note:</b> ".$entry['note']."
- </td>
- </tr>
- ";
- }
- if($entry['validated'] == 1)
- {
- $totalValidated += $entry['timeWorked'];
- }
- if($entry['validated'] == 0)
- {
- $totalInvalid += $entry['timeWorked'];
- }
- if($entry['code'] == "Vacation")
- {
- $totalVacation += $entry['timeWorked'];
- }
- if($entry['code'] == "Sick")
- {
- $totalSick += $entry['timeWorked'];
- }
- }
- if(count($timesheet) > 0)
- {
- echo "</table>";
- echo "<div class=\"row\">";
- echo "<div class='small-12'>
- FORM GOES HERE
- </div>";
- echo "</div>";
- echo "<div class=\"row\">";
- echo "<div class=\"small-6 medium-4 large-3 columns\">";
- echo "<div class=\"card successBg\">
- <div class=\"title\">Validated</div>
- <div class=\"value\">".$totalValidated." <small>Hours</small></div>
- </div>";
- echo "</div>";
- echo "<div class=\"small-6 medium-4 large-3 columns\">";
- echo "<div class=\"card warning\">
- <div class=\"title\">Not Validated</div>
- <div class=\"value\">".$totalInvalid." <small>Hours</small></div>
- </div>";
- echo "</div>";
- echo "<div class=\"small-6 medium-4 large-3 columns end\">";
- echo "<div class=\"card\">
- <div class=\"title\">Sick</div>
- <div class=\"value\">".$totalSick." <small>Hours</small></div>
- </div>";
- echo "</div>";
- echo "<div class=\"small-6 medium-4 large-3 columns end\">";
- echo "<div class=\"card\">
- <div class=\"title\">Vacation</div>
- <div class=\"value\">".$totalVacation." <small>Hours</small></div>
- </div>";
- echo "</div>";
- echo "</div>";
- }
- else
- {
- echo "<div class=\"text-center\">No time submitted</div>";
- }
- $i++;
- echo "</div><hr>";
- }
- ?>
- </div>
- </div>
- </div>
- <div id="yearForm" class="reveal-modal small" data-reveal aria-labelledby="Change Year" aria-hidden="true" role="dialog">
- <h2 id="modalTitle">Select a Year</h2>
- <?php echo $this->yearForm ?>
- <a class="close-reveal-modal" aria-label="Close">×</a>
- </div>
- <div id="print" class="reveal-modal small" data-reveal aria-labelledby="Print Report" aria-hidden="true" role="dialog">
- <h2>Print Individual Time Sheet</h2>
- <?php echo $this->printTimeSheetForm ?>
- <a class="close-reveal-modal" aria-label="Close">×</a>
- </div>
- <script>
- $(function() {
- $(".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>
|