<div class="col-xl-12">
    <div class="card card-flush h-lg-100" id="kt_contacts_main">
        <div class="card-header pt-7" id="kt_chat_contacts_header">
            <div class="card-title">
                <h2>تعديل الملف الشخصي</h2>
            </div>
        </div>
        <div class="card-body pt-5">

            <?php if (session()->has('errors')): ?>
                <div class="alert alert-danger d-flex align-items-center p-5">
                    <span class="svg-icon svg-icon-2hx svg-icon-danger me-3"><svg xmlns="http://www.w3.org/2000/svg"
                            width="16" height="16" fill="currentColor" class="bi bi-exclamation-diamond-fill"
                            viewBox="0 0 16 16">
                            <path
                                d="M9.05.435c-.58-.58-1.52-.58-2.1 0L.436 6.95c-.58.58-.58 1.519 0 2.098l6.516 6.516c.58.58 1.519.58 2.098 0l6.516-6.516c.58-.58.58-1.519 0-2.098L9.05.435zM8 4c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995A.905.905 0 0 1 8 4zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z" />
                        </svg></span>
                    <div class="d-flex flex-column">
                        <h4 class="mb-1 text-dark">هناك خطأ!</h4>
                        <?php foreach (session('errors') as $error): ?>
                            <span>
                                <?= $error ?>
                            </span>
                        <?php endforeach; ?>
                    </div>
                </div>
            <?php endif ?>

            <?= form_open('dashboard/profile/update') ?>

            <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="separator mb-6"></div>

            <div class="d-flex justify-content-end">

                <a href="<?= base_url('dashboard/profile') ?>" class="btn btn-light me-3">ألغ</a>

                <button type="submit" class="btn btn-primary">
                    <span class="indicator-label">حفظ</span>
                    <span class="indicator-progress">برجاء الانتظار ...
                        <span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
                </button>

            </div>

            <?= form_close() ?>

        </div>
    </div>
</div>