weekly.phtml 4.9 KB

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