weekly.phtml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <div class="section">
  2. <div class="row">
  3. <div class="small-12 columns">
  4. <h2><i class="fa fa-file"></i> Week Report</h2>
  5. </div>
  6. </div>
  7. <div class="row">
  8. <div class="small-6 push-3 columns">
  9. <?php echo $this->form; ?>
  10. </div>
  11. <div class="small-12 columns">
  12. <?php
  13. if(count($this->report) > 0)
  14. {
  15. echo "
  16. <div class='row'>
  17. <div class='small-12 columns text-right hide-for-print'>
  18. <a class='button secondary radius' href='".$this->link(array('reports','weekly'))."'>Back</a>
  19. </div>
  20. </div>
  21. <table width=\"100%\">
  22. <thead>
  23. <tr>
  24. <th colspan='2' class='text-center'>
  25. <h3>".$this->account['firstName']." ".$this->account['lastName']." (";
  26. if($this->account['type'] == "part")
  27. {
  28. echo "Part Time";
  29. }
  30. else
  31. {
  32. echo "Full Time";
  33. }
  34. echo")</h3>
  35. </th>
  36. </tr>
  37. <tr>
  38. <th width='50%'>Week</th>
  39. <th width='50%'>Hours Worked</th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. ";
  44. $i = 0;
  45. foreach($this->report as $entry)
  46. {
  47. if($entry['hoursWorked'] !== null)
  48. {
  49. echo "
  50. <tr>
  51. <td>
  52. <b>Week:</b> ".$entry['week']." <br>
  53. <b>Start:</b> ".$entry['start']['dayName'].", ".$entry['start']['month']." ".$entry['start']['day']." ".$entry['start']['year']." <br>
  54. <b>End:</b> ".$entry['end']['dayName'].", ".$entry['end']['month']." ".$entry['end']['day']." ".$entry['end']['year']."
  55. </td>
  56. <td>";
  57. if($this->account['type'] == "part")
  58. {
  59. if($entry['hoursWorked'] >= 18 AND $entry['hoursWorked'] < 20)
  60. {
  61. echo "<span class='orange'><i class='fa fa-flag'></i> Approaching weekly limit of 20 hours.</span><br>".$entry['hoursWorked'];
  62. }
  63. elseif($entry['hoursWorked'] == 20)
  64. {
  65. echo "<span class='green'><i class='fa fa-flag'></i> At weekly limit of 20 hours.</span><br>".$entry['hoursWorked'];
  66. }
  67. elseif($entry['hoursWorked'] >= 21)
  68. {
  69. echo "<span class='red'><i class='fa fa-warning'></i> Exceeded weekly limit of 20 hours.</span><br>".$entry['hoursWorked'];
  70. }
  71. else
  72. {
  73. echo $entry['hoursWorked'];
  74. }
  75. }
  76. else
  77. {
  78. echo $entry['hoursWorked'];
  79. }
  80. echo "</td>
  81. </tr>
  82. ";
  83. $i++;
  84. }
  85. }
  86. if($i == 0)
  87. {
  88. echo "
  89. <tr>
  90. <td colspan='2'>
  91. <div class='text-center'>User hasn't submitted any time entries for ".$this->year.".</div>
  92. </td>
  93. </tr>
  94. ";
  95. }
  96. echo "
  97. </tbody>
  98. </table>
  99. ";
  100. }
  101. ?>
  102. </div>
  103. </div>
  104. </div>