<?php echo $__env->make('admin.classroom.classroom.components.filter', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div class="table-responsive">
    <div id="basic-datatables_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4">
        <div class="row mb-4 align-items-center">
            <div class="col-md-3">
                <div class="dataTables_length" id="per_page">
                    <label>Hiển thị:
                        <select name="sort" id="per_page_select" onchange="handleRedirect(this)"
                            aria-controls="basic-datatables" class="form-control form-control-sm">
                            <option value="<?php echo e(route('classroom.index')); ?>?sort=10"
                                <?php echo e(request('sort') == 10 ? 'selected' : ''); ?>>10</option>
                            <option value="<?php echo e(route('classroom.index')); ?>?sort=25"
                                <?php echo e(request('sort') == 25 ? 'selected' : ''); ?>>25</option>
                            <option value="<?php echo e(route('classroom.index')); ?>?sort=50"
                                <?php echo e(request('sort') == 50 ? 'selected' : ''); ?>>50</option>
                            <option value="<?php echo e(route('classroom.index')); ?>?sort=100"
                                <?php echo e(request('sort') == 100 ? 'selected' : ''); ?>>100</option>
                        </select>
                        bản ghi
                    </label>
                </div>
            </div>
            <div class="col-md-9 d-flex justify-content-end">
                <form method="GET" action="<?php echo e(route('classroom.index')); ?>">
                    <input type="text" class="form-control form-control-sm" name="search" placeholder="Tìm kiếm"
                        value="<?php echo e(request('search')); ?>" style="width: auto; display: inline;">
                    <button type="submit" class="btn btn-primary btn-sm">Lọc</button>
                    <a href="<?php echo e(route('classroom.index')); ?>" class="btn btn-secondary btn-sm">Bỏ lọc</a>
                </form>
            </div>
        </div>
        <div id="table-container">
            <div class="table-responsive">
                <table id="basic-datatables" class="display table table-striped table-hover dataTable" role="grid">
                    <thead>
                        <tr role="row">
                            <th>Tên phòng học</th>
                            <th>Mô tả</th>
                            <th>Trạng Thái</th>
                            <th style="width:20%" class="text-center">Hành động</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $getAllClassroom; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $classroom): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr role="row" class="odd">
                                <td style="padding: 21px 24px !important;" class="text-dark"><?php echo e($classroom->name); ?>

                                </td>
                                <td style="padding: 21px 24px !important;" class="text-dark">
                                    <?php echo e($classroom->description); ?>

                                </td>
                                <td style="padding: 21px 24px !important;" class="text-dark">
                                    <?php echo $classroom->status == 0 ? '<span class="text-success">Hoạt Động</span>' : '<span class="text-danger">Không Hoạt Động</span>'; ?>

                                </td>
                                <td class="text-center">
                                    <?php if($classroom->deleted_by == 0): ?>
                                        <a href="<?php echo e(route('classroom.edit', ['id' => $classroom->id])); ?>"
                                            class="btn btn-sm btn-black" title="Cập nhật">
                                            <i class="fa fa-edit"></i>
                                        </a>
                                        <form action="<?php echo e(route('classroom.trash', ['id' => $classroom->id])); ?>"
                                            method="POST" style="display:inline-block;" title="Ẩn">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('POST'); ?>
                                            <button type="submit" class="btn btn-sm btn-danger">
                                                <i class="fa fa-trash"></i>
                                            </button>
                                        </form>
                                    <?php else: ?>
                                        <form action="<?php echo e(route('classroom.restore', ['id' => $classroom->id])); ?>"
                                            method="POST" style="display:inline-block;" title="Khôi phục">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('POST'); ?>
                                            <button type="submit" class="btn btn-sm btn-success">
                                                <i class="fas fa-undo-alt"></i>
                                            </button>
                                        </form>
                                        <form action="<?php echo e(route('classroom.delete', ['id' => $classroom->id])); ?>"
                                            method="POST" style="display:inline-block;"
                                            onsubmit="return confirm('Bạn có chắc chắn muốn xóa phòng học này?');"
                                            title="Xóa vĩnh viễn">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('POST'); ?>
                                            <button type="submit" class="btn btn-sm btn-danger">
                                                <i class="fas fa-trash-alt"></i>
                                            </button>
                                        </form>
                                    <?php endif; ?>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="3">
                                    <div class="alert alert-warning mb-0" role="alert">
                                        Không tìm thấy dữ liệu.
                                    </div>
                                </td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<?php /**PATH C:\laragon\www\3_LARAVEL\SchoolManagementSystem\SchoolManagementSystem\resources\views/admin/classroom/classroom/components/table.blade.php ENDPATH**/ ?>