<?php $__env->startSection('title', 'Edit Data Beranda'); ?>

<?php $__env->startSection('content'); ?>
    <div class="page-content">
        <nav class="page-breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Dashboard</a></li>
                <li class="breadcrumb-item"><a href="<?php echo e(route('beranda')); ?>">Data Beranda</a></li>
                <li class="breadcrumb-item active" aria-current="page">Edit Beranda</li>
            </ol>
        </nav>
        <div class="row">
            <div class="stretch-card">
                <div class="card">
                    <div class="card-body">
                        <h4 class="card-title">Edit Beranda</h4>

                        <?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 method="POST" action="<?php echo e(route('beranda.edit', $beranda->beranda_id)); ?>">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('PUT'); ?>

                            <input type="hidden" name="token" value="<?php echo e($token); ?>">

                            <div class="form-group mb-3">
                                <label class="form-label">Halaman</label>
                                <select name="page" class="form-control" required>
                                    <option value="">--Pilih Halaman--</option>
                                    <?php $__currentLoopData = $pages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($page->id); ?>"
                                            <?php echo e($page->id == $beranda->page_id ? 'selected' : ''); ?>>
                                            <?php echo e($page->judul); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>

                            <div class="form-group mb-3">
                                <label class="form-label">Posisi</label>
                                <select name="posisi" class="form-control" required>
                                    <option value="">--Pilih Posisi--</option>
                                    <option value="slide" <?php echo e($beranda->tipe == 'slide' ? 'selected' : ''); ?>>Slide</option>
                                    <option value="posisi1" <?php echo e($beranda->tipe == 'posisi1' ? 'selected' : ''); ?>>Posisi 1
                                    </option>
                                    <option value="posisi2" <?php echo e($beranda->tipe == 'posisi2' ? 'selected' : ''); ?>>Posisi 2
                                    </option>
                                    <option value="posisi3" <?php echo e($beranda->tipe == 'posisi3' ? 'selected' : ''); ?>>Posisi 3
                                    </option>
                                    <option value="posisi4" <?php echo e($beranda->tipe == 'posisi4' ? 'selected' : ''); ?>>Posisi 4
                                    </option>
                                    <option value="posisi5" <?php echo e($beranda->tipe == 'posisi5' ? 'selected' : ''); ?>>Posisi 5
                                    </option>
                                </select>
                            </div>

                            <div class="form-group mb-3">
                                <label class="form-label">Urutan</label>
                                <input type="number" name="urut" class="form-control" value="<?php echo e($beranda->urut); ?>"
                                    required>
                            </div>

                            <div class="form-group mb-3">
                                <label class="form-label">Aktif</label>
                                <input type="checkbox" name="active" value="1"
                                    <?php echo e($beranda->active ? 'checked' : ''); ?>>
                            </div>

                            <div class="form-group">
                                <button type="submit" class="btn btn-primary">Update</button>
                                <a href="<?php echo e(route('beranda')); ?>" class="btn btn-danger">Kembali</a>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

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

<?php echo $__env->make('dashboard.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u768956174/domains/untag-smd.info/UNTAG-SMD/resources/views/admin/beranda/edit.blade.php ENDPATH**/ ?>