index.phtml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php echo $this->insertTimeForm ?>
  2. <div class="section">
  3. <div class="row">
  4. <div class="small-12 medium-4 text-left columns">
  5. <h3><i class="fa fa-calendar"></i> <?php echo $this->timesheet->currentMonthText ?> <a href="#" data-reveal-id="yearForm"><?php echo $this->timesheet->currentYear ?></a></h3>
  6. </div>
  7. <div class="small-12 medium-8 text-right columns">
  8. <ul class="button-group radius even-5 stack-for-small">
  9. <li><a class="button small secondary" href="<?php echo $this->link(array('timesheet',$this->timesheet->currentYear,$this->timesheet->previousMonth)) ?>"><i class="fa fa-caret-left"></i> Prev.</a></li>
  10. <li><a class="button small secondary" href="<?php echo $this->link(array('timesheet',$this->timesheet->currentYear,$this->timesheet->nextMonth)) ?>">Next <i class="fa fa-caret-right"></i></a></li>
  11. <li><a class="button small toggleTotals" href="#"><i class="fa fa-calculator"></i> Totals</a></li>
  12. <li><a class="button small" href="#"><i class="fa fa-print"></i> Print</a></li>
  13. <?php
  14. if($this->needsValidation)
  15. {
  16. echo "<li><a class=\"button small success\" href=\"".$this->link(array('timesheet','validate',$this->timesheet->currentYear,$this->timesheet->currentMonth))."\"><i class=\"fa fa-check\"></i> Validate</a></li>";
  17. }
  18. ?>
  19. </ul>
  20. </div>
  21. </div>
  22. <?php
  23. if(count($this->timesheet->entries) > 0)
  24. {
  25. echo "
  26. <div class=\"row\">
  27. <div class=\"small-4 medium-2 columns\">
  28. <b>Date</b>
  29. </div>
  30. <div class=\"small-4 medium-2 columns\">
  31. <b>Time In</b> <small>(Adjusted)</small>
  32. </div>
  33. <div class=\"small-4 medium-2 columns\">
  34. <b>Time Out</b> <small>(Adjusted)</small>
  35. </div>
  36. <div class=\"small-4 medium-2 columns\">
  37. <b>Less Time</b>
  38. </div>
  39. <div class=\"small-4 medium-2 columns\">
  40. <b>Time Worked</b>
  41. </div>
  42. <div class=\"small-4 medium-2 columns\">
  43. <b>Time Code</b>
  44. </div>
  45. <hr>
  46. </div>
  47. ";
  48. foreach($this->timesheet->entries as $entry)
  49. {
  50. echo "
  51. <div class=\"row\">
  52. <div class=\"small-4 medium-2 columns\">";
  53. if($this->timesheet->getBatch() == $entry->batchId)
  54. {
  55. echo "<i class=\"fa fa-square-o\"></i> <a href=\"".$this->link(array('timesheet','edit',$entry->id))."\">".$entry->date."</a>";
  56. }
  57. else
  58. {
  59. echo "<i class=\"fa fa-check-square-o green\"></i> ".$entry->date." ";
  60. }
  61. echo "
  62. </div>
  63. <div class=\"small-4 medium-2 columns\">
  64. <span data-tooltip aria-haspopup=\"true\" class=\"has-tip\" title=\"Entered as: ".$entry->inTime."\">".$entry->roundedInTime."</span>
  65. </div>
  66. <div class=\"small-4 medium-2 columns\">
  67. <span data-tooltip aria-haspopup=\"true\" class=\"has-tip\" title=\"Entered as: ".$entry->outTime."\">".$entry->roundedOutTime."</span>
  68. </div>
  69. <div class=\"small-4 medium-2 columns\">
  70. ".$entry->lessTime." Min.
  71. </div>
  72. <div class=\"small-4 medium-2 columns\">
  73. <b>".$entry->timeWorked."</b> Hours
  74. </div>
  75. <div class=\"small-4 medium-2 columns\">
  76. ".$entry->codeName."
  77. </div>
  78. <hr>
  79. </div>
  80. ";
  81. }
  82. }
  83. else
  84. {
  85. echo "
  86. <div class=\"row\">
  87. <div class=\"small-12 columns text-center\">
  88. No time submitted.
  89. </div>
  90. </div>
  91. ";
  92. }
  93. ?>
  94. </div>
  95. <div id="yearForm" class="reveal-modal small text-center" data-reveal aria-labelledby="Change Year" aria-hidden="true" role="dialog">
  96. <h2 id="modalTitle">Select a Year</h2>
  97. <?php echo $this->changeYearForm ?>
  98. <a class="close-reveal-modal" aria-label="Close">&#215;</a>
  99. </div>
  100. <div id="totals" class="totalsPanel">
  101. <div class="row">
  102. <div class="small-10 columns">
  103. <h3 id="modalTitle"><i class="fa fa-calculator"></i> Totals for this month</h3>
  104. </div>
  105. <div class="small-2 columns text-right">
  106. <a class="button secondary small radius toggleTotals" href="#"><i class="fa fa-chevron-up"></i></a>
  107. </div>
  108. </div>
  109. <div class="row">
  110. <div class="small-6 medium-4 large-3 columns totals">
  111. <b>Total hours: </b> <?php echo $this->timesheet->normalWorked ?>
  112. </div>
  113. <div class="small-6 medium-4 large-3 columns totals">
  114. <b>Vacation used: </b> <?php echo $this->timesheet->vacationUsed ?>
  115. </div>
  116. <div class="small-6 medium-4 large-3 columns totals end">
  117. <b>Sick used: </b> <?php echo $this->timesheet->sickUsed ?>
  118. </div>
  119. </div>
  120. </div>
  121. <script>
  122. $(function() {
  123. $(".toggleTotals").click(function() {
  124. if($("#totals").is(":visible"))
  125. {
  126. $('#entryForm').slideDown();
  127. }
  128. else
  129. {
  130. $('#entryForm').slideUp();
  131. }
  132. $("#totals").slideToggle();
  133. });
  134. });
  135. </script>