

<?php $__env->startSection('content'); ?>
<div class="content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-body">
                        
                        <?php
                            if($data){
                                $judul = $data != null ? $data->judul : "";
                                $id = $data != null ? $data->id : "";
                                $isi = $data != null ? $data->isi : "";
                                $thumbnail = $data != null ? $data->thumbnail : "";
                            }
                            
                        ?>
                        
                        <form action="<?php echo e(route('news.update')); ?>" method="post" enctype="multipart/form-data">
                            <?php echo e(csrf_field()); ?>

                            <div class="form-group">
                                <label for="Product Name">Judul</label>
                                <input type="text" name="judul" class="form-control" value="<?php echo e($judul); ?>">
                                <input type="hidden" name="id" class="form-control" value="<?php echo e($id); ?>">
                            </div>
                            <div class="form-group">
                                <label for="Isi Berita">Isi</label>
                                <textarea name="isi" id="isi"  class="form-control">
                                    <?php echo e($isi); ?>

                                </textarea>
                            </div>
                            <label for="Product Name">Thumbnail</label>
                            <br />
                            <input type="file" class="form-control" value="<?php echo e($thumbnail); ?>" name="thumbnail" />
                            <input type="hidden" name="old_thumbnail" value="<?php echo e($thumbnail); ?>">
                            <br /><br />
                            <input type="submit" class="btn btn-primary" value="Upload" />
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>

<script type="text/javascript">
    
    $(document).ready(function () {
        // Javascript method's body can be found in assets/js/demos.js
        // getJenis();

    });

    function getJenis(){
        $.ajax({
            // data: $('#docForm').serialize(),
            url: "<?php echo e(route('jenis.all')); ?>",
            type: "GET",
            dataType: 'json',
            success: function (data) {
                $("#jenisDoc").empty();

                for( var i = 0; i<data.data.length; i++){
                    var id = data.data[i]['id'];
                    var name = data.data[i]['nama'];
                    
                    $("#jenisDoc").append("<option value='"+id+"'>"+name+"</option>");

                }

            },
            error: function (data) {
                console.log('Error:', data);
                // $('#saveBtn').html('Save Changes');
            }
        });
    }

</script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', ['activePage' => 'berita', 'title' => 'Edit Berita', 'navName' => 'Edit Berita', 'activeButton' =>
'laravel'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Sayang\project-g\resources\views/Beritas/edit.blade.php ENDPATH**/ ?>