<?php
use App\Models\ComplaintAgainst;

$departments =
ComplaintAgainst::where('status',1)
->orderBy('name')
->get();

?>



<?php $__env->startSection('content'); ?>
<style>
    .container {
        background: url('<?php echo e(asset('loginwall5.jpg')); ?>') no-repeat center center fixed;
        background-size: cover;
    }
    .card {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.9);
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.18);
    }
    .card-header {
        background: transparent;
        border-bottom: none;
    }
    .form-control {
        border-radius: 10px;
    }
    .btn-primary {
        background-color: #d9534f;
        border: none;
        border-radius: 10px;
        padding: 10px 20px;
        font-weight: bold;
        letter-spacing: 1px;
    }
    .btn-primary:hover {
        background-color: #c9302c;
    }
</style>

<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card shadow-lg">
                <div class="card-header text-center mb-2">
                    <h4 class="fw-bold text-uppercase  text-danger" style="letter-spacing: 2px;">
                         Home & Tribal Affair's Department <br> Khyber Pakhtunkhwa <br> Complaint Cell
                    </h4>
                    <h5 class="fw-bold text-uppercase text-danger">
                        User Registration
                    </h5>
                </div>

                <div class="card-body p-4">
                    <form method="POST" action="<?php echo e(route('register')); ?>">
                    <?php echo csrf_field(); ?>


                    <div class="mb-3">
                    <label>Name</label>

                    <input type="text"
                    class="form-control"
                    name="name"
                    value="<?php echo e(old('name')); ?>"
                    required>

                    </div>



                    <div class="mb-3">

                    <label>Email Address</label>

                    <input type="email"
                    class="form-control"
                    name="email"
                    value="<?php echo e(old('email')); ?>"
                    required>

                    </div>




                    <div class="mb-3">

                    <label>User Role</label>

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

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

                    <option value="operator">
                    Operator
                    </option>

                    <option value="coordinator">
                    Coordinator
                    </option>

                    <option value="department">
                    Department User
                    </option>

                    <option value="admin">
                    Admin
                    </option>


                    </select>

                    </div>











                    <div class="mb-3"
                    id="departmentBox"
                    style="display:none;">


                    <label class="form-label">
                    Department / Section
                    </label>



                    <select name="complaint_against_id"
                    class="form-control">


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


                    <?php $__currentLoopData = $departments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dept): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                    <option value="<?php echo e($dept->id); ?>">

                    <?php echo e($dept->name); ?>


                    </option>


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


                    </select>


                    </div>

        <script>

        document
        .getElementById('role')
        .addEventListener('change',function(){


        if(this.value=="department")
        {

        document
        .getElementById('departmentBox')
        .style.display='block';


        }

        else
        {

        document
        .getElementById('departmentBox')
        .style.display='none';


        }



        });


        </script>


                    <div class="mb-3">


                    <label>Password</label>


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


                    </div>




                    <div class="mb-4">


                    <label>Confirm Password</label>


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


                    </div>




                    <div class="form-check mb-3">


                    <input class="form-check-input"
                    type="checkbox"
                    name="is_admin"
                    value="1">


                    <label class="form-check-label">

                    Administrator

                    </label>


                    </div>





                    <button type="submit"
                    class="btn btn-primary w-100">

                    Register

                    </button>


                    </form>





                    <script>

                    document.getElementById('role')
                    .addEventListener('change',function(){


                    if(this.value=="department")
                    {

                    document.getElementById('departmentBox')
                    .style.display='block';

                    }

                    else
                    {

                    document.getElementById('departmentBox')
                    .style.display='none';

                    }


                    });


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

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\AppServ\www\laravel-app12\resources\views/auth/register.blade.php ENDPATH**/ ?>