Nav apraksta

print_annual_report.blade.php 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. <?php
  2. echo '<html>';
  3. echo '<head>';
  4. echo '<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.debug.js"></script>';
  5. echo '</head>';
  6. echo '<body>';
  7. //Inline styles (only for printing)
  8. echo '<style type="text/css">
  9. body
  10. {
  11. font-family: "Arial", sans-serif;
  12. width:90%;
  13. margin: 0 auto;
  14. }
  15. .header-text
  16. {
  17. text-align:center;
  18. font-weight: bold;
  19. margin:0;
  20. }
  21. .outcome-text
  22. {
  23. text-align:left;
  24. font-weight: bold;
  25. margin:0;
  26. }
  27. h1.header-text
  28. {
  29. margin: 15px auto;
  30. width:75%;
  31. font-size: 25px;
  32. }
  33. table
  34. {
  35. border-collapse: collapse;
  36. border: 1px solid black;
  37. width: 100%;
  38. margin: 30px auto;
  39. font-size:1.5vw;
  40. }
  41. td, th
  42. {
  43. border: 1px solid black;
  44. padding: 5px;
  45. }
  46. .activity-name-row
  47. {
  48. background:black;
  49. color:white;
  50. }
  51. .activity-headers-row
  52. {
  53. background:lightgrey;
  54. font-weight:bold;
  55. }
  56. .report-info
  57. {
  58. margin:5px 0;
  59. font-size: 16px;
  60. }
  61. .criterion-field
  62. {
  63. text-align:left;
  64. }
  65. .score-field, .total, .percentage
  66. {
  67. text-align:center;
  68. }
  69. .header
  70. {
  71. margin: 30px 0;
  72. }
  73. .content
  74. {
  75. font-size: 12px;
  76. }
  77. .logo
  78. {
  79. position:absolute;
  80. right:0;
  81. top: 30px;
  82. width: 100px;
  83. }
  84. ul{
  85. list-style-type:none;
  86. }
  87. @media print{@page {size: landscape}}
  88. .outcome-header{
  89. text-align:left
  90. }
  91. hr{
  92. border-block-color: black
  93. }
  94. .course-title {
  95. text-align:center;
  96. font-weight:bold;
  97. }
  98. </style>';
  99. echo '<style type="text/css" media="print">
  100. @page { size: landscape; }
  101. </style>';
  102. ?>
  103. <div id="theEntireDoc">
  104. <img class="logo" src="{{ asset('images/logo_uprrp_bw.png') }}" alt="UPRRP Logo">
  105. <div class="header">
  106. <p class="header-text">University of Puerto Rico, Río Piedras Campus</p>
  107. <p class="header-text">Online Learning Assessment System</p>
  108. <p class="header-text">{{ $annualPlan->program->name }} Program Report</p>
  109. <h1 class="header-text">Academic Year {{ $annualPlan->annual_cycle->academic_year }} </h1>
  110. </div>
  111. @foreach ($annualPlan->outcomes as $outcome)
  112. @if ($outcome->student_performance != 'N/A')
  113. <h1 class="outcome-header">{{ $outcome->name }} <sub>(Semester
  114. {{ Semester::find($outcome->semester_id)->code }})</sub></h1>
  115. <hr>
  116. <p class="outcome-text">Target to achieve the learning outcome: {{ $outcome->expected_outcome }} or more
  117. of
  118. the
  119. attempts</p>
  120. <p class="outcome-text">Expected percent of students achieving the target by learning outcome:
  121. {{ $outcome->expected_target }}%
  122. <p class="outcome-text">Results for {{ $outcome->name }}
  123. @if ($outcome->student_performance >= $outcome->expected_target)
  124. <em style="color: green">{{ $outcome->student_performance }}% </em>
  125. @else
  126. <em style="color: red">{{ $outcome->student_performance }}% </em>
  127. @endif
  128. </p>
  129. <hr>
  130. <ol type="I">
  131. <li>
  132. <h2>Courses Assessment</h2>
  133. <hr style="border-block-color: black">
  134. <ol type="A">
  135. @foreach ($outcome->annual_objectives as $objective)
  136. <li>
  137. <h2>{{ $objective->text }}: </h2>
  138. @foreach ($objective->grouped_annual_course as $course_code)
  139. <h2 class="course-title">
  140. {{ $course_code->code }}-{{ $course_code->number }}
  141. </h2>
  142. <h2 class="outcome-text">Performance of Students by Learning Outcome Criteria</h2>
  143. <table class="table table-striped table-condensed">
  144. <thead>
  145. <tr>
  146. <th></th>
  147. <th>Criteria</th>
  148. <th>Number of Students Assessed</th>
  149. <th>Number of Students that Achieved the Target</th>
  150. <th>Percentage</th>
  151. </tr>
  152. </thead>
  153. <tbody>
  154. @foreach ($course_code->assessed_paired_criteria as $index => $criterion)
  155. <tr>
  156. <td>{{ $index + 1 }}.</td>
  157. <td>
  158. {{ $criterion->name }}
  159. @if ($criterion->subcriteria)
  160. <ul class="list-unstyled">
  161. @foreach (json_decode($criterion->subcriteria) as $subcriterion)
  162. <li>{{ $subcriterion }}</li>
  163. @endforeach
  164. </ul>
  165. @endif
  166. </td>
  167. <td>
  168. {{ $criterion->criteria_attempted }}
  169. </td>
  170. <td>
  171. {{ $criterion->criteria_achieved }}
  172. </td>
  173. <td>
  174. {{ round(($criterion->criteria_achieved / $criterion->criteria_attempted) * 100, 2) }}%
  175. </td>
  176. </tr>
  177. @endforeach
  178. </tbody>
  179. </table>
  180. @if (count($course_code->proposed_transformative_actions) > 0)
  181. <h2 class="outcome-text">Follow up on Course's Proposed Transformative Actions
  182. </h2>
  183. <table class="table table-striped table-condensed">
  184. <thead>
  185. <tr>
  186. <th></th>
  187. <th>Transformative Actions</th>
  188. <th>Was it Implemented on Semester
  189. {{ Semester::find($outcome->semester_id)->code }} ?</th>
  190. <th>Was this transformative action helpful to achieve the learning
  191. expectation?</th>
  192. <th>Explain briefly about the implementation of this transformative
  193. action
  194. or why was it not implemented</th>
  195. </tr>
  196. </thead>
  197. <tbody>
  198. <?php Log::info(json_encode($course_code->proposed_transformative_actions)); ?>
  199. @foreach ($course_code->proposed_transformative_actions as $index => $ta)
  200. <tr>
  201. <td>{{ $index + 1 }}.</td>
  202. <td>
  203. <strong>{{ $ta->at_text }}: </strong>
  204. {{ $ta->description }}
  205. </td>
  206. @if (!isset($ta->status))
  207. <td>
  208. Has not been followed up yet (Please follow up)
  209. </td>
  210. <td>
  211. Has not been followed up yet (Please follow up)
  212. </td>
  213. <td>
  214. Has not been followed up yet (Please follow up)
  215. </td>
  216. @else
  217. <td>
  218. @if ($ta->status->accomplished == 1)
  219. Yes
  220. @else
  221. No
  222. @endif
  223. </td>
  224. <td>
  225. @if ($ta->status->accomplished == 1)
  226. @if ($ta->status->it_was_useful == 1)
  227. Yes
  228. @else
  229. No
  230. @endif
  231. @else
  232. N/A
  233. @endif
  234. </td>
  235. <td>
  236. {{ $ta->status->comments }}
  237. </td>
  238. @endif
  239. </tr>
  240. @endforeach
  241. </tbody>
  242. </table>
  243. @endif
  244. @if (count($course_code->future_transformative_actions) > 0)
  245. <h2 class="outcome-text">Future Transformative Actions for Course
  246. </h2>
  247. <table class="table table-striped table-condensed">
  248. <thead>
  249. <tr>
  250. <th></th>
  251. <th>Transformative Actions to be Implemented</th>
  252. <th>Semesters where the Transformative Action will be Implemented
  253. </th>
  254. </tr>
  255. </thead>
  256. <tbody>
  257. @foreach ($course_code->future_transformative_actions as $index => $ta)
  258. <tr>
  259. <td>{{ $index + 1 }}.</td>
  260. <td>
  261. <strong>{{ $ta->at_text }}: </strong>
  262. {{ $ta->description }}
  263. </td>
  264. <td>
  265. @foreach ($ta->future_semesters as $semester)
  266. <p style="display:inline">{{ $semester->code }}, </p>
  267. @endforeach
  268. </td>
  269. </tr>
  270. @endforeach
  271. </tbody>
  272. </table>
  273. @endif
  274. <hr>
  275. @endforeach
  276. </li>
  277. @endforeach
  278. </ol>
  279. </li>
  280. @if (count($outcome->program_transformative_actions) > 0)
  281. <li>
  282. <h2>Program Transformative Actions</h2>
  283. <hr>
  284. <table class="table table-striped table-condensed">
  285. <thead>
  286. <tr>
  287. <th></th>
  288. <th>Transformative Action</th>
  289. <th>Category</th>
  290. <th>Results</th>
  291. <th>Was this helpful to achieve the learning expectation?</th>
  292. <th>Explain briefly details about the implementation</th>
  293. </tr>
  294. </thead>
  295. <tbody>
  296. @foreach ($outcome->program_transformative_actions as $index => $ta)
  297. <tr>
  298. <td>{{ $index + 1 }}.</td>
  299. <td>
  300. <strong>{{ $ta->at_text }}: </strong>{{ $ta->description }}
  301. </td>
  302. <td>
  303. {{ $ta->type_of_TA }}
  304. </td>
  305. @if (!isset($ta->status))
  306. <td>Has Not yet submitted</td>
  307. <td>Has Not Yet Submitted</td>
  308. <td>Has Not Yet Submitted</td>
  309. @else
  310. <td>
  311. {{ $ta->status->results }}
  312. </td>
  313. <td>
  314. @if ($ta->status->it_was_useful == 1)
  315. Yes
  316. @else
  317. No
  318. @endif
  319. </td>
  320. <td>
  321. {{ $ta->status->comments }}
  322. </td>
  323. @endif
  324. </tr>
  325. @endforeach
  326. </tbody>
  327. </table>
  328. <hr>
  329. </li>
  330. @endif
  331. @if (count($outcome->comments) > 0)
  332. <li>
  333. <h2>Comments</h2>
  334. <hr>
  335. <table class='table table-striped table-condensed'>
  336. <tbody>
  337. @foreach ($outcome->comments as $index => $comment)
  338. <tr>
  339. <td>
  340. {{ $index + 1 }}.
  341. </td>
  342. <td>
  343. {{ $comment->comments }}
  344. </td>
  345. </tr>
  346. @endforeach
  347. </tbody>
  348. </table>
  349. </li>
  350. @endif
  351. </ol>
  352. @else
  353. <h1 class="outcome-header">{{ $outcome->name }} <sub>(Semester
  354. {{ Semester::find($outcome->semester_id)->code }})</sub></h1>
  355. <hr>
  356. <p class="outcome-text">Target to achieve the learning outcome: {{ $outcome->expected_outcome }} or
  357. more of
  358. the
  359. attempts</p>
  360. <p class="outcome-text">Expected percent of students achieving the target by learning outcome:
  361. {{ $outcome->expected_target }}%
  362. <p class="outcome-text">Results for {{ $outcome->name }}
  363. <em style="color: red">{{ $outcome->student_performance }} </em>
  364. </p>
  365. <p class="outcome-text" style="color: red">No student has been assessed in this outcome</p>
  366. <hr>
  367. @endif
  368. @endforeach
  369. </div>
  370. {{-- @foreach ($outcome->program_transformative_actions as $trans)
  371. <li>
  372. <h2><strong>{{ $trans->at_text }}: {{ $trans->description }}</strong></h2>
  373. @if (isset($trans->status))
  374. <p><strong>Results: </strong>{{ $trans->status->results }}</p>
  375. <p><strong>Was this helpful to achieve the learning expectation? </strong>
  376. @if ($trans->status->it_was_useful == 1)
  377. Yes
  378. @else
  379. No
  380. @endif
  381. </p>
  382. <p><strong>Explain briefly details about the implementation: </strong>
  383. {{ $trans->status->comments }}
  384. </p>
  385. @else
  386. <p><strong>Please submit the results </strong>
  387. @endif
  388. </li>
  389. @endforeach
  390. </ol> --}}
  391. <?php
  392. echo '</body>';
  393. echo '</html>';
  394. ?>
  395. <script type="text/javascript">
  396. @if(!isset($submit))
  397. window.print();
  398. </script>
  399. @else
  400. window.close();
  401. </script>
  402. <?php
  403. $path = app_path() . '/views/annual_htmls/report-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . Auth::user()->id . '.blade.php';
  404. $ob = ob_get_contents();
  405. $ob = str_replace("window.close();", '', $ob);
  406. file_put_contents($path, $ob);
  407. ob_end_flush();
  408. ?>
  409. @endif