

<?php $__env->startSection('content'); ?>
    <h1 class="text-3xl font-bold mb-8">Edit Agenda</h1>

    <div class="bg-white rounded-2xl shadow p-6">
        <form action="<?php echo e(route('admin.agendas.update', $agenda)); ?>" method="POST" enctype="multipart/form-data"
            class="space-y-6">
            <?php echo csrf_field(); ?>
            <?php echo method_field('PUT'); ?>

            <div>
                <label class="block mb-2 font-medium">Judul</label>
                <input type="text" name="title" value="<?php echo e(old('title', $agenda->title)); ?>"
                    class="w-full border border-slate-300 rounded-xl px-4 py-3">
                <?php $__errorArgs = ['title'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p class="text-red-600 text-sm mt-2"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div>
                <label class="block mb-2 font-medium">Deskripsi</label>
                <textarea id="description" name="description" rows="8"
                    class="w-full border border-slate-300 rounded-xl px-4 py-3"><?php echo e(old('description', $agenda->description)); ?></textarea>
            </div>

            <div class="grid md:grid-cols-3 gap-6">
                <div>
                    <label class="block mb-2 font-medium">Tanggal</label>
                    <input type="date" name="event_date"
                        value="<?php echo e(old('event_date', optional($agenda->event_date)->format('Y-m-d'))); ?>"
                        class="w-full border border-slate-300 rounded-xl px-4 py-3">
                    <?php $__errorArgs = ['event_date'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p class="text-red-600 text-sm mt-2"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <div>
                    <label class="block mb-2 font-medium">Waktu</label>
                    <input type="text" name="event_time" value="<?php echo e(old('event_time', $agenda->event_time)); ?>"
                        class="w-full border border-slate-300 rounded-xl px-4 py-3">
                </div>

                <div>
                    <label class="block mb-2 font-medium">Lokasi</label>
                    <input type="text" name="location" value="<?php echo e(old('location', $agenda->location)); ?>"
                        class="w-full border border-slate-300 rounded-xl px-4 py-3">
                </div>
            </div>

            <div>
                <label class="block mb-2 font-medium">Gambar</label>
                <?php if($agenda->image): ?>
                    <img src="<?php echo e(asset($agenda->image)); ?>" alt="<?php echo e($agenda->title); ?>"
                        class="w-48 h-32 object-cover rounded-lg mb-3">
                <?php endif; ?>
                <input type="file" name="image" class="w-full border border-slate-300 rounded-xl px-4 py-3">
            </div>

            <div class="flex items-center gap-2">
                <input type="checkbox" name="is_published" value="1" <?php echo e(old('is_published', $agenda->is_published) ? 'checked' : ''); ?>>
                <label>Publish</label>
            </div>

            <div class="flex gap-3">
                <button type="submit" class="bg-blue-900 hover:bg-blue-800 text-white px-6 py-3 rounded-xl font-semibold">
                    Update
                </button>
                <a href="<?php echo e(route('admin.agendas.index')); ?>"
                    class="bg-slate-300 hover:bg-slate-400 text-slate-800 px-6 py-3 rounded-xl font-semibold">
                    Kembali
                </a>
            </div>
        </form>
    </div>
    <script src="<?php echo e(asset('vendor/tinymce/tinymce/tinymce.min.js')); ?>"></script>
    <script>
        tinymce.init({
            selector: '#description',
            height: 400,
            menubar: true,
            license_key: 'gpl',
            base_url: "<?php echo e(asset('vendor/tinymce/tinymce')); ?>",
            suffix: '.min',
            plugins: 'lists link image table code preview fullscreen wordcount',
            toolbar: 'undo redo | blocks | bold italic underline | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image table | preview code fullscreen',
            branding: false
        });
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/kepx5469/public_html/diklat.keperawatanrsbalimeddenpasar.org/resources/views/admin/agendas/edit.blade.php ENDPATH**/ ?>