<?php $__env->startSection('title', 'Edit User'); ?>
<?php $__env->startSection('content'); ?>

<div class="container-fluid py-3">
    <div class="d-flex justify-content-end mb-3">
        <a href="<?php echo e(route('users.index')); ?>" class="btn-back">
            <i class="fas fa-arrow-left me-2"></i> Back to Users
        </a>
    </div>

    <div class="card shadow-sm">
        <div class="card-header bg-primary text-white py-3">
            <h5 class="mb-0"><i class="fas fa-user-update me-2"></i> Edit User</h5>
        </div>

        <div class="card-body">
            <?php if(session('success')): ?>
                <div class="alert alert-success"><?php echo e(session('success')); ?></div>
            <?php endif; ?>

            <?php if($errors->any()): ?>
                <div class="alert alert-danger">
                    <ul class="mb-0">
                        <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li><?php echo e($error); ?></li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                </div>
            <?php endif; ?>

          <form action="<?php echo e(route('users.update', $user->id)); ?>" style="display:flex; flex-direction:column; gap:20px;" class="row g-3" method="post">

                <?php echo csrf_field(); ?>
                <?php echo method_field('PUT'); ?>
                <div class="row mb-3">
                    <div class="col-md-6">
                        <label for="name" class="form-label" style="font-weight: bold;">Full Name</label>
                        <input type="text" name="name" id="name" class="form-control shadow" placeholder="Full Name" value="<?php echo e(old('name', $user->name)); ?>">
                    </div>
                    <div class="col-md-6">
                        <label for="national_id" class="form-label" style="font-weight: bold;">National ID</label>
                        <input type="text" name="national_id" id="national_id" class="form-control shadow" placeholder="National ID" value="<?php echo e(old('national_id', $user->national_id)); ?>">
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-6">
                        <label for="email" class="form-label" style="font-weight: bold;">Email</label>
                        <input type="email" name="email" id="email" class="form-control shadow" placeholder="Email" value="<?php echo e(old('email', $user->email)); ?>">
                    </div>
                    <div class="col-md-6">
                        <label for="phone" class="form-label" style="font-weight: bold;">Phone Number</label>
                        <input type="text" name="phone" id="phone" class="form-control shadow" placeholder="Phone Number" value="<?php echo e(old('phone', $user->phone)); ?>">
                    </div>
                </div>

                <div class="row mb-3">
<div class="col-md-6">
    <label for="address" class="form-label" style="font-weight: bold;">Address</label>
    <textarea name="address" id="address" class="form-control shadow" placeholder="Enter Your address" rows="2" required><?php echo e(old('address', $user->address)); ?></textarea>
</div>

                    <div class="col-md-3">
                        <label for="group_id" class="form-label" style="font-weight: bold;">Group</label>
                        <select class="form-control shadow" name="group_id" id="group_id" required>
                            <option disabled>Select Group</option>
                            <?php $__currentLoopData = $groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $grp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($grp->id); ?>" <?php echo e(old('group_id', $user->group_id) == $grp->id ? 'selected' : ''); ?>><?php echo e($grp->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>

                    <div class="col-md-3">
                        <label for="role_id" class="form-label" style="font-weight: bold;">Role</label>
                        <select class="form-control shadow" name="role_id" id="role_id" required>
                            <option disabled>Select Role</option>
                            <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($role->id); ?>" <?php echo e(old('role_id', $user->role_id) == $role->id ? 'selected' : ''); ?>><?php echo e($role->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-6">
                        <label for="password" class="form-label" style="font-weight: bold;">Password</label>
                        <input type="password" name="password" id="password" class="form-control shadow" placeholder="Enter Password (leave blank to keep current)">
                    </div>
                    <div class="col-md-6">
                        <label for="password_confirmation" class="form-label" style="font-weight: bold;">Confirm Password</label>
                        <input type="password" name="password_confirmation" id="password_confirmation" class="form-control shadow" placeholder="Confirm Password">
                    </div>
                </div>

                <div style="padding-left: 15px; display:flex; gap:20px;" class="">
                    <button type="submit" class="btn btn-primary">Update</button>
                    <button type="reset" class="btn btn-secondary">Reset</button>
                </div>
            </form>

        </div>
    </div>
        <!-- Display Sales Analysis Data -->

        <div class="mt-4 text-center">
            <p class="text-muted">Copyright © Melsoft (Private) Limited</p>
        </div>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('styles'); ?>
<style>
.btn-back {
    text-decoration: none;
    color: #1AB9D9;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    padding: 5px 15px;
    border-radius: 4px;
    transition: all 0.3s;
}
.btn-back:hover {
    background-color: rgba(26, 185, 217, 0.1);
    text-decoration: none;
}
.card {
    border-radius: 8px;
    overflow: hidden;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}
.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 12px 20px;
}
.table th {
    background-color: #f8f9fa;
}
.table-responsive {
    overflow-x: auto;
}
.table-active {
    background-color: rgba(0,0,0,.05) !important;
}
.btn-process-all {
    background-color: #ffffff !important;
    color: #1AB9D9 !important;
    border: 1px solid rgba(26,185,217,0.35) !important;
    font-weight: 600 !important;
    padding: 7px 14px !important;
    box-shadow: none !important;
    line-height: 1 !important;
}
.btn-process-all:hover {
    background-color: #f5fbfc !important;
    color: #1498b0 !important;
    border-color: rgba(20,152,176,0.45) !important;
}

@media print {
    .btn-back, .card-header .btn, form {
        display: none !important;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    .table-responsive {
        overflow-x: visible;
    }
}
</style>
<?php $__env->stopSection(); ?>



<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH H:\systems\Quanta\demo\resources\views/users/edit.blade.php ENDPATH**/ ?>