<?php $__env->startSection('content'); ?>
<div class="clearfix">
    <div class="full-width-container">
        <?php echo $__env->make('masterHeaderAdmin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        <main class="main-container">
            <?php echo $__env->make('masterSidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            <div class="page-body">
                <div class="nav-breadcrumbs">
                    <ul class="breadcrumbs">
                        <li>
                            <a href="<?php echo e(route('admin')); ?>" class="breadcrumbs-link">TRANG CHỦ</a>
                        </li>
                        <li>
                            <a href="<?php echo e(route('ketquaxettuyen')); ?>" class="breadcrumbs-link">KẾT QUẢ XÉT TUYỂN</a>
                        </li>
                        <li>
                            <a href="<?php echo e(route('lop12')); ?>" class="breadcrumbs-link">XÉT THEO HỌC BẠ LỚP 12</a>
                        </li>
                        <li>
                            <a href="<?php echo e(route('lop12_chitiet',$MaForm)); ?>" class="breadcrumbs-link">XÉT THEO HỌC BẠ LỚP 12 CHI TIẾT</a>
                        </li>
                    </ul>
                    <a href="<?php echo e(route('lop12')); ?>" class="page-button">
                        <i class="fa-solid fa-rotate-left"></i> Quay lại
                    </a>
                </div>
                <form action="<?php echo e(route('post_lop12_chitiet',$MaForm)); ?>" method="post" class="page-form-table">
                    <label for="table-form-label"
                        class="page-button table-form__label table-form__label--float-right">
                        <i class="fas fa-save"></i>
                        <input type="submit" name="luu" size="0" class="table-form__submit-button" id="table-form-label"
                            value="Lưu thông tin">
                    </label>
                    <?php echo $__env->make('alert', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    <table class="table">
                        <?php $__currentLoopData = $forms; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $form): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tbody>
                            <tr class="table__section-header">
                                <td colspan="4">THÔNG TIN HỌC SINH</td>
                            </tr>
                            <tr>
                                <td>Họ và tên</td>
                                <td colspan="3">
                                    <input type="text" name="hoten" class="table__input-text" value="<?php echo e($form->HoTen); ?>">
                                </td>
                            </tr>
                            <tr>
                                <td>Giới tính</td>
                                <td colspan="2">
                                    <input type="radio" name="gioitinh" class="table__input-radio" value="1" <?php echo e(($form->GioiTinh==0)?'':'checked'); ?> >
                                    <label for="nam">Nam</label>
                                    <input type="radio" name="gioitinh" class="table__input-radio" value="0" <?php echo e(($form->GioiTinh==1)?'':'checked'); ?>>
                                    <label for="nu">Nữ</label>
                                </td>
                            </tr>
                            <tr>
                                <td>Ngày sinh</td>
                                <td>
                                    <input type="date" name="ngaysinh" class="table__input-text" value="<?php echo e(date('Y-m-d', strtotime($form->NgaySinh))); ?>">
                                </td>
                                <td>CCCD/CMND</td>
                                <td>
                                    <input type="text" name="cccd" class="table__input-text" value="<?php echo e($form->CCCD); ?>">
                                </td>
                            </tr>
                            <tr>
                                <td>Địa chỉ email</td>
                                <td>
                                    <input type="text" name="email" class="table__input-text"
                                        value="<?php echo e($form->Email); ?>">
                                </td>
                                <td>Số diện thoại</td>
                                <td>
                                    <input type="text" name="sdt" class="table__input-text" value="<?php echo e($form->SoDienThoai); ?>">
                                </td>
                            </tr>
                            <tr>
                                <td>Địa chỉ liên lạc</td>
                                <td colspan="3">
                                    <textarea name="diachi" class="table__input-textarea" cols="1"
                                        rows="1"><?php echo e($form->DiaChi); ?></textarea>
                                </td>
                            </tr>
                            <tr>
                                <td>Tỉnh</td>
                                <td>
                                    <select id="tinh" size="0" class="table__input-text" name="tinh" onchange="selectTinh(this)" required>
                                        <option  value="<?php echo e($form->truong->tinh->MaTinh); ?>"><?php echo e($form->truong->tinh->TenTinh); ?></option>
                                        <?php $__currentLoopData = $tinhs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tinh): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($tinh->MaTinh); ?>" <?php echo e($form->truong->tinh->MaTinh == $tinh->MaTinh ? 'hidden' : ''); ?>><?php echo e($tinh->TenTinh); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </td>
                                <td>Trường THPT</td>
                                <td>
                                    <select id="truong" size="0" class="table__input-text" name="truongTHPT" required>
                                        <option  value="<?php echo e($form->truong->MaTruong); ?>"><?php echo e($form->truong->TenTruong); ?></option>
                                        <?php $__currentLoopData = $truongs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $truong): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($truong->MaTruong); ?>"  <?php echo e($form->truong->MaTruong == $truong->MaTruong ? 'hidden' : ''); ?>><?php echo e($truong->TenTruong); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </td>
                            </tr>
                        </tbody>
                        <tbody>
                            <tr class="table__section-header">
                                <td colspan="4">THÔNG TIN ĐĂNG KÝ</td>
                            </tr>
                            <tr>
                                <td>Bậc học</td>
                                <td>
                                    <input type="text" disabled class="table__input-text" value="<?php echo e($form->nganhhoc->bachoc->TenBacHoc); ?>">
                                </td>
                                <td>Ngành học</td>
                                <td>
                                    <input type="text" disabled class="table__input-text"
                                        value="<?php echo e($form->nganhhoc->TenNganhHoc); ?>">
                                </td>
                            </tr>
                            <tr>
                                <td>Nhóm môn</td>
                                <td>
                                    <input type="text" disabled class="table__input-text"
                                        value="<?php echo e(implode(', ', $form->form_diem->pluck('monhoc.TenMonHoc')->toArray())); ?>">
                                </td>
                                <td>Nguyện vọng du học</td>
                                <td>
                                    <input type="checkbox" disabled class="table__input-checkbox" <?php echo e(($form->CoNguyenVongDuHoc==1)?'checked':''); ?>>
                                </td>
                            </tr>
                            <tr>
                                <td>Kết quả học tập</td>
                                <td colspan="3">
                                    <table class="table-grade">
                                        <thead>
                                            <tr>
                                                <th>Môn học</th>
                                                <th>Điểm TB</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php $__currentLoopData = $form->form_diem; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $formDiem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td><?php echo e($formDiem->monhoc->TenMonHoc); ?></td>
                                                <td><?php echo e($formDiem->Diem); ?></td>
                                            </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <td colspan="5">
                                                    <strong>
                                                        <?php
                                                            $tongDiem = 0;
                                                        ?>
                                                        <?php $__currentLoopData = $form->form_diem; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $formDiem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <?php
                                                                $tongDiem += $formDiem->Diem;
                                                            ?>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        Kết quả: <?php echo e($tongDiem); ?>

                                                    </strong>
                                                </td>
                                            </tr>
                                        </tfoot>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td>Đã tốt nghiệp THPT</td>
                                <td>
                                    <input type="checkbox" disabled class="table__input-checkbox" <?php echo e(($form->NamTotNghiep!=null)?'checked':''); ?>>
                                </td>
                                <td>
                                    Năm tốt nghiệp
                                </td>
                                <td>
                                    <input type="text" disabled class="table__input-text" value="<?php echo e(($form->NamTotNghiep!=null)?$form->NamTotNghiep:''); ?>">
                                </td>
                            </tr>
                            <tr>
                                <td>File học bạ</td>
                                <td>
                                    <a class="table__view-file" href=".<?php echo e(asset('assets')); ?>/img/images/header.png"
                                        target="_parent">
                                        Xem
                                    </a>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <div class="table__result-block">
                                        <div class="table__result">
                                            <label for="table-form-result" class="table-form__label">
                                                KẾT QUẢ XÉT TUYỂN
                                            </label>
                                            <input type="checkbox" class="table__input-checkbox" id="table-form-result" name="table-form-result" <?php echo e(($form->KetQua=='1')?'checked':''); ?> disabled>
                                        </div>
                                    </div>

                                </td>
                            </tr>
                        </tbody>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </table>
                <?php echo csrf_field(); ?>
                </form>
            </div>
        </main>

    </div>
</div>
<script>
    // Lấy trường học thông qua tỉnh
    let truongHocSelect = document.getElementById('truong');
     function selectTinh(t) {
        var maTinh = t.value;
        fetch(`/admin/ketquaxettuyen/get-truong-hoc/${maTinh}`)
            .then(response => response.json())
            .then(data => {
                truongHocSelect.innerHTML = '<option value="">Chọn trường THPT</option>';
                Object.keys(data).forEach(function(MaTruong) {
                    var option = document.createElement('option');
                    option.text = data[MaTruong];
                    option.value = MaTruong;
                    truongHocSelect.appendChild(option);
                });

            });
    }
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('masterAdmin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\tuyensinh\resources\views/admin/ketQuaXetTuyen_hocBaLop12_chitiet.blade.php ENDPATH**/ ?>