

<?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">
                        
                        
                        <form action="<?php echo e(route('news.save')); ?>" method="post" enctype="multipart/form-data">
                        
                            <?php echo e(csrf_field()); ?>

                            <div class="form-group">
                                <label for="Judul">Judul</label>
                                <input type="text" name="judul" class="form-control" placeholder="Judul Berita">
                            </div>
                            <div class="form-group">
                                <label for="Isi Berita">Isi</label>
                                <textarea name="isi" id="isi" class="form-control"></textarea>
                            </div>
                            <label for="Product Name">Upload Thumbnail</label>
                            <br />
                            <input type="file" class="form-control"  name="thumbnail" />
                            <br /><br />
                            <input type="submit" class="btn btn-primary" value="Publish" />
                        </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' => 'Berita', 'navName' => 'Tambah Berita', 'activeButton' =>
'laravel'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Sayang\project-g\resources\views/Beritas/create.blade.php ENDPATH**/ ?>