/
home
/
maktab
/
server
/
storage
/
framework
/
views
/
File Upload :
llllll
Current File: /home/maktab/server/storage/framework/views/5d933fa53339f09a6fb2f1bba865822f13c9a47c.php
<?php $studentsGrouped = []; $totalPresenceCount = []; // تشخیص نوع گروهبندی $groupKey = $send['mode'] === 'teacher' ? 'teacher_name' : 'maktab_name'; foreach ($send['students'] as $student) { $presentCount = 0; foreach ($student['dates'] as $date) { $studentsGrouped[$student[$groupKey]][$date['date']][] = [ 'student_id' => $student['student_id'], 'student_name' => $student['student_name'], 'time' => $date['time'], 'present' => $date['present'], 'total_sessions' => $student['total_sessions'] // اضافه کردن تعداد جلسات دانشآموز ]; if ($date['present'] === 'حاضر') { $presentCount++; } } $totalPresenceCount[$student['student_id']] = $presentCount; } ?> <!DOCTYPE html> <html dir="rtl" lang="fa"> <head> <meta charset="UTF-8"> <style> body { font-family: 'fa' !important; font-size: 12px; direction: rtl; line-height: 1.6; } h1, h2, h3 { text-align: center; color: #333; margin-bottom: 5px; } .summary { font-size: 20px; margin-top: 10px; text-align: center; background: #f5f5f5; border: 1px solid #ccc; border-radius: 6px; padding: 8px; display: inline-block; } .maktab-header { background: #f0f0f0; padding: 8px; border-radius: 6px; margin: 20px 0 10px 0; font-size: 17px; text-align: right; } .maktab-span { font-weight: bold !important; font-size: 20px; } .page-break { page-break-before: always; } table { width: 100%; border-collapse: collapse; margin-top: 10px; margin-bottom: 20px; } td { border: 1px solid #444; padding: 8px; text-align: center; font-size: 13px; background: #f9f9f9; border-radius: 4px; width: 16.66%; } </style> </head> <body> <h1 style="font-size: 40px"> گزارش حضور و غیاب بر اساس <?php echo e($send['mode'] === 'teacher' ? 'مربی' : 'مکتب'); ?> </h1> <div style="text-align: center; margin-bottom: 20px;"> <p class="summary"> از تاریخ: <strong><?php echo e($send['from_date']); ?></strong> تا تاریخ: <strong><?php echo e($send['to_date']); ?></strong> </p> </div> <?php $index = 0; ?> <?php $__currentLoopData = $studentsGrouped; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $groupName => $dates): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $groupId = null; if ($send['mode'] === 'teacher') { $groupId = collect($send['students'])->firstWhere('teacher_name', $groupName)['teacher_id'] ?? null; } else { $groupId = collect($send['students'])->firstWhere('maktab_name', $groupName)['maktab_id'] ?? null; } $statsKey = $send['mode'] === 'teacher' ? 'teacher_stats' : 'maktab_stats'; $averageKey = $send['mode'] === 'teacher' ? 'average_presence_by_teacher' : 'average_presence_by_maktab'; ?> <div class="maktab-header <?php echo e($index > 0 ? 'page-break' : ''); ?>"> <strong>نام <?php echo e($send['mode'] === 'teacher' ? 'مربی' : 'مکتب'); ?>:</strong> <span class="maktab-span"><?php echo e($groupName ?: 'نامشخص'); ?></span> <br> <strong>تعداد دانشآموزان:</strong> <span class="maktab-span"><?php echo e($send[$statsKey][$groupName] ?? 0); ?></span> <br> <strong>تعداد جلسات مدیر مکتب :</strong> <span class="maktab-span"><?php echo e($send['total_type3_teacher_presence'][$groupId] ?? 0); ?></span> <br> <strong>میانگین حضور کل دانشآموزان:</strong> <span class="maktab-span"> <?php echo e(($send[$averageKey][$groupName] ?? 0) . ' از ' . ($send[$statsKey][$groupName] ?? 0) . ' دانشآموز'); ?> </span> </div> <?php $__currentLoopData = $dates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $date => $records): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $studentShown = []; $uniqueStudents = []; foreach ($records as $record) { if (!in_array($record['student_id'], $studentShown)) { $studentShown[] = $record['student_id']; $uniqueStudents[] = $record; } } $chunks = array_chunk($uniqueStudents, 6); ?> <table> <?php $__currentLoopData = $chunks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $chunk): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <?php $__currentLoopData = $chunk; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $record): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $presenceCount = $totalPresenceCount[$record['student_id']] ?? 0; $studentTotalSessions = $record['total_sessions'] ?? 0; $textColor = $presenceCount < ($studentTotalSessions / 2) ? '#b02a37' : '#2c7a2c'; ?> <td> <strong><?php echo e($record['student_name']); ?></strong><br> <span style="color: <?php echo e($textColor); ?>; font-weight: 400;"> <?php echo e($presenceCount . ' از ' . $studentTotalSessions . ' جلسه'); ?> </span> </td> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php if(count($chunk) < 6): ?> <?php for($i = 0; $i < 6 - count($chunk); $i++): ?> <td></td> <?php endfor; ?> <?php endif; ?> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </table> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php $index++; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </body> </html> <?php /**PATH /home/maktab/server/resources/views/reportattend.blade.php ENDPATH**/ ?>
Copyright ©2k19 -
Hexid
|
Tex7ure