Нема описа

print_three_year_plan.blade.php 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?php
  2. if(isset($submit)){
  3. ob_start();
  4. }
  5. echo '<html>';
  6. echo '<head>';
  7. echo '</head>';
  8. echo '<body id="theDocument">';
  9. //Inline styles (only for printing)
  10. echo '<style type="text/css">
  11. body
  12. {
  13. font-family: "Arial", sans-serif;
  14. width:90%;
  15. margin: 0 auto;
  16. }
  17. .header-text
  18. {
  19. text-align:center;
  20. font-weight: bold;
  21. margin:0;
  22. }
  23. h1.header-text
  24. {
  25. margin: 15px auto;
  26. width:75%;
  27. font-size: 25px;
  28. }
  29. table
  30. {
  31. border-collapse: collapse;
  32. border: 1px solid black;
  33. width: 100%;
  34. margin: 30px auto;
  35. font-size:1.5vw;
  36. }
  37. td, th
  38. {
  39. border: 1px solid black;
  40. padding: 5px;
  41. }
  42. .activity-name-row
  43. {
  44. background:black;
  45. color:white;
  46. }
  47. .activity-headers-row
  48. {
  49. background:lightgrey;
  50. font-weight:bold;
  51. }
  52. .report-info
  53. {
  54. margin:5px 0;
  55. font-size: 16px;
  56. }
  57. .criterion-field
  58. {
  59. text-align:left;
  60. }
  61. .score-field, .total, .percentage
  62. {
  63. text-align:center;
  64. }
  65. .header
  66. {
  67. margin: 30px 0;
  68. }
  69. .content
  70. {
  71. font-size: 12px;
  72. }
  73. .logo
  74. {
  75. position:absolute;
  76. right:0;
  77. top: 30px;
  78. width: 100px;
  79. }
  80. ol{
  81. list-style-type:none;
  82. }
  83. @media print{@page {size: landscape}}
  84. </style>';
  85. echo '<style type="text/css" media="print">
  86. @page { size: landscape; }
  87. </style>';
  88. ?>
  89. <img class="logo" src="{{ asset('images/logo_uprrp_bw.png') }}" alt="UPRRP Logo">
  90. <div class="header">
  91. <p class="header-text">University of Puerto Rico, Río Piedras Campus</p>
  92. <p class="header-text">Online Learning Assessment System</p>
  93. <h1 class="header-text">Three Year Plan for {{ $program->name }} from {{ $three_year_plan->year_start }} to
  94. {{ $three_year_plan->year_end }}</h1>
  95. </div>
  96. @foreach ($typ_semesters as $semester)
  97. <br>
  98. <br>
  99. <h2 class='header-text'>{{ $semester->name }}</h2>
  100. <br>
  101. @foreach ($typ_semester_outcome[$semester->semester_id] as $outcome)
  102. @if(count($outcome->objectives))
  103. <span>
  104. <h3>{{ $outcome->name }}</h3>
  105. </span>
  106. <table class="table table-striped table-condensed" style="table-layout: fixed">
  107. <thead>
  108. <tr>
  109. <th>Objectives</th>
  110. <th>Courses</th>
  111. </tr>
  112. </thead>
  113. <tbody>
  114. @foreach ($outcome->objectives as $index => $objective)
  115. <tr>
  116. <td>
  117. {{ $index + 1 }}. {{ $objective->text }}
  118. </td>
  119. <td>
  120. <ol>
  121. @foreach ($objective->courses as $course)
  122. <li>[{{ $course->code }}{{ $course->number }}] {{ $course->name }}</li>
  123. @endforeach
  124. </ol>
  125. </td>
  126. </tr>
  127. @endforeach
  128. </tbody>
  129. </table>
  130. <br>
  131. <br>
  132. @endif
  133. @endforeach
  134. @endforeach
  135. </body></html>
  136. <script>
  137. @if($view==0 && !isset($submit))
  138. window.print();
  139. @elseif(isset($submit))
  140. window.close();
  141. @endif
  142. </script>
  143. @if(isset($submit))
  144. <?php
  145. $path = app_path() . '/views/three_year_plan_htmls/' . date('d-m-Y') . '-for-' . $program->id . '-by-' . Auth::user()->id . '.blade.php';
  146. $ob = ob_get_contents();
  147. $ob = str_replace("window.close();", '', $ob);
  148. file_put_contents($path, $ob);
  149. ob_end_flush();
  150. //return Redirect::action('AnnualPlansController@showPlan', array($program->id));
  151. ?>
  152. @endif