<div class="fv-row mb-7">
    <label class="fs-6 fw-semibold form-label mt-3" for="name"><span class="required">الاسم</span></label>
    <input type="text" class="form-control form-control-solid" name="name" id="name"
        value="<?= old('name', esc($user->name)) ?>">
</div>

<div class="fv-row mb-7">
    <label class="fs-6 fw-semibold form-label mt-3" for="email"><span class="required">البريد الالكتروني</span></label>
    <input type="text" class="form-control form-control-solid" name="email" id="email"
        value="<?= old('email', esc($user->email)) ?>">
</div>

<div class="fv-row mb-7">
    <label class="fs-6 fw-semibold form-label mt-3" for="password"><span class="required">كلمة المرور</span></label>
    <input type="password" class="form-control form-control-solid" name="password">
    <?php if ($user->id): ?>
        <p>أبقه فارغ لعدم تغيير كلمة المرور</p>
    <?php endif; ?>
</div>

<div class="fv-row mb-7">
    <label class="fs-6 fw-semibold form-label mt-3" for="password_confirmation"><span class="required">إعادة كلمة
            المرور</span></label>
    <input type="password" class="form-control form-control-solid" name="password_confirmation">
</div>

<div class="fv-row mb-7">
    <div class="form-check form-check-custom form-check-solid">
        <?php if ($user->id == current_user()->id): ?>

            <input class="form-check-input" type="checkbox" checked disabled />
            <label class="form-check-label" for="is_active">
                الحساب مفعل
            </label>

        <?php else: ?>
            <input type="hidden" name="is_active" value="0">

            <input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1" <?php if (old('is_active', $user->is_active)): ?>checked<?php endif; ?> />
            <label class="form-check-label" for="is_active">
                تفعيل الحساب
            </label>
        <?php endif; ?>
    </div>
</div>

<div class="fv-row mb-7">
<div class="form-check form-check-custom form-check-solid">
        <?php if ($user->id == current_user()->id): ?>

            <input class="form-check-input" type="checkbox" checked disabled />
            <label class="form-check-label" for="is_admin">
                حساب مدير
            </label>

        <?php else: ?>
            <input type="hidden" name="is_admin" value="0">

            <input type="checkbox" class="form-check-input" id="is_admin" name="is_admin" value="1" <?php if (old('is_admin', $user->is_admin)): ?>checked<?php endif; ?> />
            <label class="form-check-label" for="is_admin">
                حساب مدير
            </label>
        <?php endif; ?>
    </div>
</div>