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

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

    <?php $__env->startPush('style'); ?>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Dropify/0.2.2/css/dropify.min.css"
            integrity="sha512-EZSUkJWTjzDlspOoPSpUFR0o0Xy7jdzW//6qhUkoZ9c4StFkVsp9fbbd0O06p9ELS3H486m4wmrCELjza4JEog=="
            crossorigin="anonymous" referrerpolicy="no-referrer" />
    <?php $__env->stopPush(); ?>

    <div class="page-content">
        <div class="container">
            <h2 style="margin-bottom: 50px">Profile</h2>

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

                </div>
            <?php endif; ?>

            <?php if($errors->any()): ?>
                <div id="error-alert" class="alert alert-danger">
                    <strong>Terjadi Kesalahan!</strong>
                    <ul>
                        <?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('profile.update', $user->id)); ?>" method="POST" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <?php echo method_field('PUT'); ?>

                <div class="mb-3">
                    <label for="name" class="form-label">Nama</label>
                    <input type="text" class="form-control" id="name" name="name" value="<?php echo e($user->name); ?>"
                        required>
                </div>

                <div class="mb-3">
                    <label for="email" class="form-label">Email</label>
                    <input type="email" class="form-control" id="email" name="email" value="<?php echo e($user->email); ?>"
                        required>
                </div>

                <div class="mb-3">
                    <label for="gambar" class="form-label">Foto Profil</label>
                    <input type="file" class="form-control dropify" id="gambar"
                        data-default-file="<?php echo e($user->gambar ? asset('storage/userImage/' . $user->gambar) : asset('assets/user/profil.jpg')); ?>"
                        name="gambar">
                </div>

                <div class="mb-3">
                    <label for="kampus" class="form-label">Nama Kampus</label>
                    <input type="text" class="form-control" id="kampus" name="kampus" value="<?php echo e($user->kampus); ?>"
                        required>
                </div>

                <div class="mb-3">
                    <label for="logo" class="form-label">Logo Kampus</label>
                    <input type="file" class="form-control dropify" id="logo"
                        data-default-file="<?php echo e($user->logo ? asset('storage/userImage/' . $user->logo) : 'https://kuliahkaryawan.net/assets/images/logok2-shadow.png'); ?>"
                        name="logo">
                </div>

                <button type="submit" class="btn btn-primary">Update Profile</button>
            </form>
        </div>
    </div>

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

<?php $__env->startPush('script'); ?>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Dropify/0.2.2/js/dropify.min.js"
        integrity="sha512-8QFTrG0oeOiyWo/VM9Y8kgxdlCryqhIxVeRpWSezdRRAvarxVtwLnGroJgnVW9/XBRduxO/z1GblzPrMQoeuew=="
        crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script>
        $('.dropify').dropify();
    </script>
    <script>
        // Fungsi untuk menghilangkan alert error setelah 10 detik
        document.addEventListener("DOMContentLoaded", function() {
            const errorAlert = document.getElementById("error-alert");
            if (errorAlert) {
                setTimeout(() => {
                    errorAlert.style.display = "none";
                }, 10000); // 10 detik
            }
        });
    </script>
    <script>
        // Fungsi untuk menghilangkan alert error setelah 10 detik
        document.addEventListener("DOMContentLoaded", function() {
            const errorAlert = document.getElementById("alert-success");
            if (errorAlert) {
                setTimeout(() => {
                    errorAlert.style.display = "none";
                }, 10000); // 10 detik
            }
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('dashboard.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\2025-instidla\resources\views/admin/profile.blade.php ENDPATH**/ ?>