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

<div class="row">
    <div class="col-xl-12 col-lg-12">
        <div class="alert alert-success my-3" style="display:none;" id="success"></div>

        <div class="card">
            <div class="card-header">
                <h4 class="card-title mb-0">Profile</h4>
            </div>

            <div class="card-body">
                <form accept-charset="utf-8" name="update-form" id="update-form">
                    <?php echo csrf_field(); ?>
                    <div class="row">
                        <div class="col-lg-6">
                            <div class="mb-3">
                                <label for="update-name" class="form-label"><?php echo e($dbs_users['name_req']); ?><?php echo e($dbs_users['name_title']); ?></label>
                                <input type = '<?php echo e($dbs_users['name_html5_type']); ?>' name = "name" id = "update-name"
                                       autocomplete = 'off' maxlength ='<?php echo e($dbs_users['name_max']); ?>' value='<?php echo e($row->name); ?>'
                                       <?php if($dbs_users['name_html5_req'] != ''): ?> <?php echo e($dbs_users['name_html5_req']); ?> = <?php echo e($dbs_users['name_html5_req']); ?> <?php endif; ?>
                                       class= 'form-control'>
                                <span class='text-danger' id='update-nameError'></span>
                            </div>
                        </div>

                        <div class="col-lg-6">
                            <div class="mb-3">
                                <label for="update-email" class="form-label"><?php echo e($dbs_users['email_req']); ?><?php echo e($dbs_users['email_title']); ?></label>
                                <input type = '<?php echo e($dbs_users['email_html5_type']); ?>' name = "email" id = "update-email"
                                       autocomplete = 'off' maxlength ='<?php echo e($dbs_users['email_max']); ?>'
                                       value='<?php echo e($row->email); ?>'
                                       <?php if($dbs_users['email_html5_req'] != ''): ?> <?php echo e($dbs_users['email_html5_req']); ?> = <?php echo e($dbs_users['email_html5_req']); ?> <?php endif; ?>
                                       class= 'form-control' oninput='validateEmailInput(this)'>
                                <span class='text-danger' id='update-emailError'></span>
                            </div>
                        </div>

                        <div class="col-lg-6">
                            <div class="mb-3">
                                <label class="form-label"><?php echo e($dbs_users['password_title']); ?></label>
                                <div class="input-group mt-2" id='password-1' style="display: none;">
                                    <input type="<?php echo e($dbs_users['password_html5_type']); ?>" class="form-control"
                                           id="password1" name="password" maxlength="<?php echo e($dbs_users['password_max']); ?>"
                                           autocomplete="off" />
                                    <div class="input-group-text">
                                        <a href="javascript:;" onclick="doShowPassword('password1', this);">
                                            <i class="ri-eye-line"></i>
                                        </a>
                                    </div>
                                </div>
                                <div id='password-note' style="display: none;" class="text-muted small mt-2">
                                    <i class="ri-information-line"></i> Leave blank if you do not want to change the password.
                                </div>
                                <p id="password-change-password" class="mt-2">
                                    <a href="javascript:;" onclick="doChangePassword('password')" class="text-primary">
                                        <i class="ri-key-line"></i> Change password..
                                    </a>
                                </p>
                                <span class="text-danger" id="passwordError"></span>
                            </div>
                        </div>
</div>
    <div class="row">
                        <div class="col-lg-6">
                            <div class="mb-3">
                                <label for="update-picture" class="form-label"><?php echo e($dbs_users['picture_req']); ?><?php echo e($dbs_users['picture_title']); ?></label>

                                <?php if(!empty($row->picture)): ?>
                                <div class="mb-3">
                                    <label class="form-label text-muted">Current Picture</label>
                                    <div class="border rounded p-2">
                                        <div class="d-flex align-items-center">
                                            <div class="flex-shrink-0 me-3">
                                                <a href="<?php echo e(asset('images/' . $row->picture)); ?>" target="_blank">
                                                    <img class="img-thumbnail rounded" src="<?php echo e(asset('images/' . $row->picture)); ?>" alt="Current Picture" style="width: 80px; height: 80px; object-fit: cover;">
                                                </a>
                                            </div>
                                            <div class="flex-grow-1">
                                                <h6 class="fs-14 mb-1">Current Image</h6>
                                                <p class="fs-13 text-muted mb-0">Click below to change</p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <?php endif; ?>

                                <div class="dropzone bg-light-subtle py-4 rounded" id="picture-dropzone-update">
                                    <div class="fallback">
                                        <input type='<?php echo e($dbs_users['picture_html5_type']); ?>' id="update-picture" accept='image/*'
                                               onchange="suResizeImage(event, 'resized-update-picture', 'update-picture-filename'); handleImagePreview(event, 'update-picture-preview');" style="display: none;">
                                    </div>
                                    <div class="dz-message needsclick text-center" onclick="document.getElementById('update-picture').click();" style="cursor: pointer;" ondrop="event.preventDefault(); handleFileDrop(event, 'update-picture');" ondragover="event.preventDefault();" ondragenter="event.preventDefault(); this.classList.add('border-primary');" ondragleave="this.classList.remove('border-primary');">
                                        <i class="ri-upload-cloud-2-line fs-48 text-primary"></i>
                                        <h5 class="mt-3 mb-1">Drop your image here, or <span class="text-primary">click to browse</span></h5>
                                        <span class="text-muted fs-13">PNG, JPG and GIF files are allowed</span>
                                    </div>
                                </div>
                                <div id="update-picture-preview" class="mt-3" style="display: none;">
                                    <div class="border rounded p-2">
                                        <div class="d-flex align-items-center">
                                            <div class="flex-shrink-0 me-3">
                                                <div class="avatar-lg bg-light rounded">
                                                    <img id="update-picture-preview-img" class="img-fluid rounded d-block" src="#" alt="Preview" style="max-width: 80px; max-height: 80px; object-fit: cover;">
                                                </div>
                                            </div>
                                            <div class="flex-grow-1">
                                                <h6 class="fs-14 mb-1" id="update-picture-preview-name">New Image Preview</h6>
                                                <p class="fs-13 text-muted mb-0">Click above to change image</p>
                                            </div>
                                            <div class="flex-shrink-0">
                                                <button type="button" class="btn btn-sm btn-danger" onclick="clearImagePreview('update-picture', 'update-picture-preview');">
                                                    <i class="ri-delete-bin-line"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <input type='hidden' id='resized-update-picture' name='resized-picture'>
                                <input type='hidden' id='update-picture-filename' name='picture' value='<?php echo e($row->picture); ?>'>
                                <span class='text-danger' id='update-pictureError'></span>
                            </div>
                        </div>
                    </div>

                    <div class="p-3 mb-3 rounded">
                        <div class="row justify-content-end g-2">
                            <div class="col-lg-3">
                                <div id="edit-mode">
                                    <button type='submit' name='update-submit' id='update-submit'
                                            class='btn btn-outline-secondary w-100' data-args1='<?php echo e(route("profile.update")); ?>'
                                            data-args2='admin/profile' onclick='addUpdate(event, "update")'>
                                        <i class="ri-save-line"></i> Save
                                    </button>
                                </div>
                            </div>
                            <div class="col-lg-2">
                                <a href="<?php echo e(url('/admin/dashboard')); ?>" class="btn btn-primary w-100">
                                    <i class="ri-close-circle-line"></i> Cancel
                                </a>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

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

<?php echo $__env->make('layouts.metor.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/MAMP/htdocs/test1/resources/views/profile/edit.blade.php ENDPATH**/ ?>