File manager - Edit - /home/autoph/public_html/projects/Rating-AutoHub/resources/views/layouts/reports/counts.blade.php
Back
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Autohub Rating</title> <style type="text/css"> @page { margin: 2cm; } *{ font-family: 'Arial', sans-serif; } table{ margin: 10px 0 20px 0; width: 100%; } .data{ background-color: #222831; color: #ffffff; } th{ padding: 4px; } td{ padding: 2px; } tbody tr:nth-child(even){ background-color: #EEEEEE; } .center-aligned{ text-align: center; } em { display: inline-block; } /* .header { position: fixed; left: 0px; top: -180px; right: 0px; height: 150px; background-color: orange; text-align: center; } */ .footer { position: fixed; left: -20px; bottom: -180px; height: 160px; font-size: 10px; } .footer .page:after { content: counter(page, upper-roman); } </style> </head> <body> {{-- <div class="header"> </div> --}} <div class="footer"> <em><small>Prepared By: {{Auth::user()->f_name . " " . Auth::user()->l_name}}</small></em><p class="page"><?php $PAGE_NUM ?> </p> </div> <div style="margin-top: -45px"> <div class="row" style="width:100%; margin-bottom: -25px"> <table> <thead> <th colspan="1" style="width: 30%;"> <img src="{{ public_path('files/img/AGC_TRANSPARENT.png') }}" alt="autohub" style="height: 40px"> </th> <th colspan="4" style="width: 40%;"> <div> <label for="" style="font-size: 1rem"><strong>{{ $report_title }}</strong></label> </div> </th> <th style="width:30%;"> <p style="text-align: right; font-size: 10px;">Blk. 15, Ford Global Building., 32nd St., Cor. Rizal Drive, Crescent Park West, BGC, Taguig City<br>{{\Carbon\Carbon::now()->format('M. d, Y')}}</p> </th> </thead> </table> </div> <hr/> <div> @foreach($data as $row) <div style="margin-bottom: -15px"> <em><small>System Name: {{ $system_name }}</small></em><br> <em><small>Template Name: {{ $template_name }}</small></em><br> <em><small>Total Respondents: {{$row->total}}</small></em><br> <em><small style="font-size: 8px">Scale: (Average = 5 : 'Excellent', Average = 4 : 'Very Satisfactory', Average = 3 : 'Satisfactory', Average = 2 : 'Dissatisfactory', Average = 1 : 'Very Dissatisfactory')</small></em> </div> @if(!empty($row->total)) <?php $grouped_data = []; $totals = [0, 0, 0, 0, 0]; // initialize array for total count for each category usort($row->list, function($a, $b) { return $b['rating'] - $a['rating']; // sort by average value in descending order }); for($i = 0; $i < $row->total; $i++) { $average = $row->list[$i]['rating']; $category = ''; // initialize variable for category if ($average == 5) { $category = 'Excellent'; } elseif ($average == 4) { $category = 'Very Satisfactory'; } elseif ($average == 3) { $category = 'Satisfactory'; } elseif ($average == 2) { $category = 'Dissatisfied'; } elseif ($average == 1) { $category = 'Very Dissatisfied'; } if(!isset($grouped_data[$category])) { $grouped_data[$category] = []; } $grouped_data[$category][] = $row->list[$i]; $totals[$average - 1]++; // increment count for category } ?> @if(count($grouped_data) > 0) @foreach ($grouped_data as $category => $group) <h5> {{$category}}: {{ $totals[array_search($category, ['Very Dissatisfied', 'Dissatisfied', 'Satisfactory', 'Very Satisfactory', 'Excellent'])] }}</h6> <table> <thead class="data"> @foreach ($table_headers as $header) <th> {{ $header }} </th> @endforeach </thead> <tbody> @foreach($group as $item) <tr> <td style="width:15px;">{{$loop->iteration}}</td> @foreach($table_body as $data) <td style="text-align:center">{{ $item[$data] }}</td> @endforeach </tr> @endforeach </tbody> </table> @endforeach @else <p class="center-aligned"><em class="center-aligned"> No data to show. </em></p> @endif @else <p class="center-aligned"><em class="center-aligned"> No data to show. </em></p> @endif @endforeach </div> </div> {{-- <script type="text/php"> --}} @php if (isset($pdf)) { //Shows number center-bottom of A4 page with $x,$y values $x = 250; //X-axis i.e. vertical position $y = 820; //Y-axis horizontal position $text = "Page {PAGE_NUM} of {PAGE_COUNT}"; //format of display message $font = $fontMetrics->get_font("helvetica"); $size = 10; $color = array(0, 0, 0); $word_space = 0.0; // default $char_space = 0.0; // default $angle = 0.0; // default $pdf->page_text(250,10,'HEADER: GGG',$font,$size,$color,$word_space,$char_space,$angle); // footer $pdf->page_text($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle); } @endphp {{-- </script> --}} </body> </html>
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings