

<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="container-header">
        <h1>Admin profile</h1>
    </div>

    <div class="card p-20">
        <form action="<?php echo e(route('backend.profile.update')); ?>" method="POST" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>
            <?php echo method_field('PUT'); ?>

            <div class="row">
                <div class="form-group width-25">
                    <label class="form-label">Full name</label>
                    <input type="text" class="form-control" name="name" placeholder="Enter full name" value="<?php echo e(old('name', $admin->name)); ?>">
                </div>
                <div class="form-group width-25">
                    <label class="form-label">Username<span class="required">*</span></label>
                    <input type="text" class="form-control" name="username" placeholder="Enter username" value="<?php echo e(old('username', $admin->username)); ?>">
                </div>
                <div class="form-group width-25">
                    <label class="form-label">Email<span class="required">*</span></label>
                    <input type="email" class="form-control" name="email" placeholder="Enter email" value="<?php echo e(old('email', $admin->email)); ?>">
                </div>
                <div class="form-group width-25">
                    <label class="form-label">New password</label>
                    <input type="password" class="form-control" name="password" placeholder="Enter new password (optional)">
                </div>
            </div>

            <div class="row">
                <div class="image-container">
                    <label class="form-label">Profile image</label>
                    <div class="image-wrapper">
                        <img id="image_preview" src="<?php echo e($admin->image ? asset($admin->image) : 'https://via.placeholder.com/300x200?text=Profile+Image'); ?>" alt="Profile Image">
                        <input type="file" name="image" id="image_input" accept="image/*" style="display: none;">
                        <button type="button" class="btn btn-primary" onclick="document.getElementById('image_input').click()"><i class="las la-upload"></i>Upload image</button>
                    </div>
                </div>
            </div>

            <button type="submit" class="btn btn-primary"><i class="las la-save"></i>Update profile</button>
        </form>
    </div>
</div>

<?php $__env->startPush('script'); ?>
<script>
    (function(){
        const input = document.getElementById('image_input');
        const preview = document.getElementById('image_preview');
        if (input && preview) {
            input.addEventListener('change', function(e) {
                const file = e.target.files[0];
                if (file) {
                    const reader = new FileReader();
                    reader.onload = function(e) {
                        preview.src = e.target.result;
                    };
                    reader.readAsDataURL(file);
                }
            });
        }
    })();
</script>
<?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layout.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/namebud5/demo-nbverify.namebudget.net/core/resources/views/backend/admin/profile.blade.php ENDPATH**/ ?>