<?php $__env->startSection('css'); ?>
<link href="<?php echo e(asset('css/dataTables.bootstrap4.min.css')); ?>" rel="stylesheet" />
<link href="<?php echo e(asset('css/sweetalert2.min.css')); ?>" rel="stylesheet" />
<link href="<?php echo e(asset('css/bootstrap-datepicker.min.css')); ?>" rel="stylesheet" />
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid pt-3">
    <div class="row mt-3">
        <div class="col">
            <div class="card card-outline card-success">
                <div class="card-header">
                    <h3 class="card-title text-bold">สรุปตารางวันที่ <?php echo e(formatDateFromDB($date)); ?></h3>
                </div>
                <div class="card-body table-responsive">
                    <table class="table" id="student-table">
                        <thead>
                          <tr>
                            <th scope="col" width="5%">#</th>
                            <th scope="col" width="10%">เลขที่</th>
                            <th scope="col" width="25%">ชื่อ-สกุล</th>
                            <th scope="col" width="26%">วิชา</th>
                            <th scope="col" width="10%">เวลา</th>
                            <th scope="col" width="10%">รถคันที่</th>
                            <th scope="col" width="9%"></th>
                          </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $tomorrows; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $indexKey => $tomorrow): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr class="hand-hover">
                                <td class="align-middle"><?php echo e($indexKey + 1); ?>.</td>
                                <td class="align-middle"><?php echo e($tomorrow->code_no."/".$tomorrow->code_month."/".$tomorrow->code_branch); ?></td>
                                <td class="align-middle">
                                    <a class="course-title-link" href="<?php echo e(route('student.show',$tomorrow->student_id)); ?>">
                                        <?php echo e($tomorrow->firstname ." ". $tomorrow->lastname); ?>

                                    </a>
                                </td>
                                <td class="align-middle"><?php echo e($tomorrow->module); ?></td>
                                <td class="align-middle"><?php echo e(formatTimeFromDB($tomorrow->starttime) .' - '. formatTimeFromDB($tomorrow->endtime)); ?></td>
                                <td class="align-middle"><?php echo e("รถคันที่ ". $tomorrow->number); ?></td>
                                <td class="align-middle text-center">
                                    <form id="del-frm<?php echo e($indexKey); ?>" class="d-inline"
                                        action="<?php echo e(route('calendar.cancel_booking')); ?>"
                                        method="post"
                                        onsubmit="confirmalert(event, <?php echo e($indexKey); ?>, 'ตารางเรียน')"
                                    >
                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('DELETE'); ?>
                                        <input type="hidden" name="vehicleBookingID" id="vehicle-cancle-booking<?php echo e($indexKey); ?>" value="<?php echo e($tomorrow->vid); ?>">
                                        <div class="clearfix float-right" >
                                            <button type="submit" id="cancelBtn<?php echo e($indexKey); ?>" class="btn btn-danger" >ยกเลิกนัด</button>
                                        </div>
                                    </form>
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                      </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-12">
            <div style="float:left">
                <a href="<?php echo e(route('home.index')); ?>" class="btn btn-outline-secondary"><i class="fas fa-chevron-left"></i> ย้อนกลับ</a>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('footerscript'); ?>
<script src="<?php echo e(asset('js/sweetalert2.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/jquery.dataTables.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/dataTables.bootstrap4.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/bootstrap-datepicker.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/bootstrap-datepicker.th.min.js')); ?>"></script>
<script src="<?php echo e(asset('js/custom.js')); ?>"></script>
<script>
    $(document).ready(function() {
        $('#student-table').DataTable({
            "lengthChange": false,
            "info": false,
            "pageLength": 30,
            "language": {
                "emptyTable":   "ไม่พบข้อมูล",
                "paginate": {
                    "first":    "หน้าแรก",
                    "last":     "หน้าสุดท้าย",
                    "next":     "ถัดไป",
                    "previous": "ก่อนหน้า"
                },
                "search":       "ค้นหา:",
                "lengthMenu":   "จำนวนนักเรียนทั้งหมด _MENU_ คน",
                "info":         "ทั้งหมด _TOTAL_ คน",
                "infoEmpty":    "ไม่พบนักเรียน",
            }
        });

        $('#student-table tr td:not(:last-child)').click(function () {
            var href = $(this).closest('tr').find('a').attr('href');
            location.href = href;
        });

    });
</script>
<?php if(session('feedback')): ?>
<script>
    Swal.fire({
                text: '<?php echo e(session('feedback')); ?>',
                icon: 'success',
                confirmButtonText: 'ตกลง',
                confirmButtonColor: '#62966C'
    })
</script>
<?php endif; ?>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.web', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/brigheyu/domain/system.pongpetrdriving.com/resources/views/home/show_tomorrow.blade.php ENDPATH**/ ?>