<div class="content-wrapper">
    <div class="container-xxl flex-grow-1 container-p-y">
        <div class="row">
            <div class="col">
                <div class="card shadow">
                    <div class="card-header text-uppercase custom-header bg-primary text-bg-info fw-bold">
                        <i class="menu-icon ti ti-map-search"></i> Create New Gn Division
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <form id="gnDivisionForm" action="/createGnDivisiondata" method="POST">
                                <?php echo csrf_field(); ?>
                                <?php if($errors->any()): ?>
                                    <div class="row">
                                        <?php echo implode('', $errors->all('<div class="alert alert-danger col-sm-12 col-md-12" role="alert">:message</div>')); ?>

                                    </div>
                                <?php endif; ?>

                                <?php if(session('success')): ?>
                                    <div class="mt-3 alert alert-success success-alert">
                                        <?php echo e(session('success')); ?>

                                    </div>
                                <?php endif; ?>

                                <?php if(session('error')): ?>
                                    <div class="mt-3 alert alert-danger danger-alert">
                                        <?php echo e(session('error')); ?>

                                    </div>
                                <?php endif; ?>

                                <div class="row mt-3">
                                    <div class="col-sm-12 col-md-6 mt-3">
                                        <label for="divisionId" class="form-label fw-bold">Select Division</label>
                                        <select name="divisionId" id="divisionId" class="selectize">
                                            <?php $__currentLoopData = $getDivision; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $division): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($division->id); ?>"><?php echo e($division->divisionName); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                    <div class="col-sm-12 col-md-6">
                                        <label class="form-label w-100" for="gnDivisionName">Gn Division Name</label>
                                        <div class="input-group input-group-merge mt-2">
                                            <input id="gnDivisionName" name="gnDivisionName" class="form-control"
                                                type="text" placeholder="GN Division Name" />
                                        </div>
                                    </div>
                                    <div class="col-12 text-center d-flex justify-content-end mt-3">
                                        <button type="submit" class="btn btn-primary me-3"
                                            value="createGnDivisiondata">Create</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- GN Division List -->
        <div class="row mt-4">
            <div class="col">
                <div class="card shadow">
                    <div class="card-header text-uppercase custom-header bg-secondary text-white fw-bold">
                        <i class="menu-icon ti ti-list"></i> GN Division List
                    </div>
                    <div class="card-body">
    <div class="table-responsive" style="max-height: 500px; overflow-y:auto;">
        <table class="table table-striped table-bordered align-middle">
            <thead class="table-light">
                <tr>
                    
                    <th>ID</th>
                    <th>Division</th>
                    <th>GN Division</th>
                    <th>Created At</th>
                </tr>
            </thead>
            <tbody>
                <?php $count = ($getGnDivision->currentPage() - 1) * $getGnDivision->perPage() + 1; ?>
                <?php $__currentLoopData = $getGnDivision; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gn): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        
                        <td><?php echo e($gn->id); ?></td>
                        <td><?php echo e($gn->division->divisionName ?? '-'); ?></td>
                        <td><?php echo e($gn->gnDivisionName); ?></td>
                        <td><?php echo e($gn->created_at ? $gn->created_at->format('Y-m-d') : '-'); ?></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php if($getGnDivision->isEmpty()): ?>
                    <tr>
                        <td colspan="4" class="text-center text-muted">No GN Divisions found.</td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>

    <!-- Pagination Links -->
    <div class="d-flex justify-content-center mt-3">
        <?php echo e($getGnDivision->links('pagination::bootstrap-5')); ?>

    </div>
</div>
</div>
<?php /**PATH /home/techhdyz/swd.technathi.cloud/resources/views/pages/allpages/create_gn_division.blade.php ENDPATH**/ ?>