<div class="modal fade" id="addUserModal">

    <div class="modal-dialog modal-lg">

        <form method="POST" action="<?php echo e(route('users.store')); ?>">

            <?php echo csrf_field(); ?>

            <div class="modal-content">

                <div class="modal-header">
                    <h5>Add User</h5>

                    <button type="button" class="btn-close" data-bs-dismiss="modal">
                    </button>
                </div>

                <div class="modal-body">

                    <div class="row">

                        <div class="col-md-6 mb-3">
                            <label>Full Name</label>
                            <input type="text" name="name" class="form-control" required>
                        </div>

                        <div class="col-md-6 mb-3">
                            <label>Username</label>
                            <input type="text" name="username" class="form-control" required>
                        </div>

                        <div class="col-md-6 mb-3">
                            <label>Phone</label>
                            <input type="text" name="phone" class="form-control">
                        </div>

                        <div class="col-md-6 mb-3">
                            <label>Role</label>

                            <select name="role" id="role" class="form-select" required>

                                <option value="">
                                    Select Role
                                </option>

                                <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($role->name); ?>">
                                        <?php echo e($role->name); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                            </select>

                        </div>

                        <div class="col-md-6 mb-3" id="border-station-wrapper" style="display:none;">

                            <label>Border Station</label>

                            <select name="border_station_id" id="border_station_id" class="form-select">

                                <option value="">
                                    Select Border
                                </option>

                                <?php $__currentLoopData = $borderStations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $station): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($station->id); ?>">
                                        <?php echo e($station->name); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                            </select>

                        </div>

                        <div class="col-md-6 mb-3">
                            <label>Password</label>

                            <input type="password" name="password" class="form-control" required>
                        </div>

                    </div>

                </div>

                <div class="modal-footer">

                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
                        Close
                    </button>

                    <button type="submit" class="btn btn-primary">
                        Save User
                    </button>

                </div>

            </div>

        </form>

    </div>

</div>


<?php $__env->startPush('scripts'); ?>
    <script>
        $(document).ready(function() {

            $('#role').on('change', function() {

                let role = $(this).val();

                if (role === 'Border Staff') {

                    $('#border-station-wrapper').show();

                    $('#border_station_id')
                        .prop('required', true);

                } else {

                    $('#border-station-wrapper').hide();

                    $('#border_station_id')
                        .prop('required', false)
                        .val('');

                }

            });

        });
    </script>
<?php $__env->stopPush(); ?>
<?php /**PATH D:\Projects\lms-ects\resources\views/users/partials/add-user-modal.blade.php ENDPATH**/ ?>