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

<?php $__env->startSection('vendor-style'); ?>
    
    <link rel="stylesheet" href="<?php echo e(asset(mix('vendors/css/tables/datatable/dataTables.bootstrap5.min.css'))); ?>">
    <link rel="stylesheet" href="<?php echo e(asset(mix('vendors/css/tables/datatable/responsive.bootstrap5.min.css'))); ?>">
    <link rel="stylesheet" href="<?php echo e(asset(mix('vendors/css/pickers/flatpickr/flatpickr.min.css'))); ?>">
    <link rel="stylesheet" href="<?php echo e(asset(mix('vendors/css/forms/select/select2.min.css'))); ?>">
    <script src="<?php echo e(asset('vendors/js/charts/apexcharts.min.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-style'); ?>
    
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('css/base/plugins/forms/pickers/form-flat-pickr.css')); ?>">

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


<?php $__env->startSection('content'); ?>
    <style>
        .template_from {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        }

        @media screen and (max-width:1420px) {
            .template_from {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media screen and (max-width:650px) {
            .template_from {
                grid-template-columns: repeat(1, 1fr);
            }
        }
    </style>
    <!-- Ajax Sourced Server-side -->
    <section id="ajax-datatable">
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-header border-bottom d-flex " style="justify-content: space-between !important">
                        <h4 class="card-title">Laporan Hasil Perhitungan Hulu Sungai</h4>
                    </div>
                    <div class="card-datatable m-1">
                        <?php if(session()->get('success')): ?>
                            <div class="alert alert-success m-2 p-1"><?php echo e(session()->get('success')); ?></div>
                        <?php endif; ?>
                        <?php if(session()->get('error')): ?>
                            <div class="alert alert-danger m-2 p-1"><?php echo e(session()->get('error')); ?></div>
                        <?php endif; ?>
                        <?php if($errors->any()): ?>
                        <div class="alert m-2 p-1 alert-danger">
                            <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(url('laporan_hasil_perhitungan/search')); ?>" method="POST"
                            enctype="multipart/form-data">
                            <?php echo csrf_field(); ?>
                            <div class="template_from">
                                <div class="box">
                                    <label for="awal">
                                        <h5>Tanggal Mulai</h5>
                                    </label>
                                    <input type="date" value="" name="awal"
                                        class="form-control <?php $__errorArgs = ['awal'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                          is-invalid
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                        required>
                                    <?php $__errorArgs = ['awal'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <small class="text-danger"><?php echo e($message); ?></small>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <div class="box">
                                    <label for="akhir">
                                        <h5>Tanggal Sampai</h5>
                                    </label>
                                    <input type="date" value="" name="akhir"
                                        class="form-control <?php $__errorArgs = ['akhir'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                          is-invalid
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                        required>
                                    <?php $__errorArgs = ['akhir'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <small class="text-danger"><?php echo e($message); ?></small>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <div class="box">
                                    <label for="device">
                                        <h5>Pilih Perangkat</h5>
                                    </label>
                                    <select name="device" id="select2-nested-empat"
                                        class="select2 <?php $__errorArgs = ['device'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                          is-invalid
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> form-select"
                                        required>
                                        <option value="">Pilih</option>
                                        <?php $__currentLoopData = $result; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $devices): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($devices->no); ?>"><?php echo e($devices->nama_device); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                    <?php $__errorArgs = ['device'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <small class="text-danger"><?php echo e($message); ?></small>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <div class="box" style="margin-top: 25px;">
                                    <button class="btn-primary btn" type="submit" name="kirim"
                                        value="filter">Filter</button>
                                    <button class="btn-primary btn" type="submit" name="kirim"
                                        value="excel">EXCELL</button>
                                    <button class="btn-primary btn" type="submit" name="kirim"
                                        value="pdf">PDF</button>
                                </div>
                            </div>
                        </form>
                        <div class="table-responsive">
                            <table class=" table-hover  table-striped table tables-responsive" style="width:100% !important"
                                id="table">
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>Nama Perangkat</th>
                                        <th>Lokasi</th>
                                        <th>Koordinat</th>
                                        <th>Rata-Rata Ketinggian</th>
                                        <th>Status Siaga</th>
                                        <th>Tanggal Interval</th>
                                        <th>Tanggal Kalkulasi</th>
                                    </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

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


<?php $__env->startSection('vendor-script'); ?>
    
    <script src="<?php echo e(asset(mix('vendors/js/tables/datatable/jquery.dataTables.min.js'))); ?>"></script>
    <script src="<?php echo e(asset(mix('vendors/js/tables/datatable/dataTables.bootstrap5.min.js'))); ?>"></script>
    <script src="<?php echo e(asset(mix('vendors/js/tables/datatable/dataTables.responsive.min.js'))); ?>"></script>
    <script src="<?php echo e(asset(mix('vendors/js/tables/datatable/responsive.bootstrap5.js'))); ?>"></script>
    <script src="<?php echo e(asset(mix('vendors/js/pickers/flatpickr/flatpickr.min.js'))); ?>"></script>
    <script src="<?php echo e(asset(mix('vendors/js/forms/select/select2.full.min.js'))); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-script'); ?>
    
    <script src="<?php echo e(asset(mix('js/scripts/tables/table-datatables-advanced.js'))); ?>"></script>
    <script src="<?php echo e(asset(mix('js/scripts/forms/form-select2.js'))); ?>"></script>
    <script src="<?php echo e(asset(mix('js/scripts/components/components-modals.js'))); ?>"></script>
    <script>
        $(document).ready(function() {
            $("#table").DataTable({
                processing: true,
                serverSide: true,
                ajax: "<?php echo e(url('laporan_hasil_perhitungan/ambil_laporan')); ?>",
                columns: [{
                        data: "DT_RowIndex",
                        name: "DT_RowIndex",
                        orderable: false,
                        searchable: false
                    },
                    {
                        data: 'nama_device',
                        name: 'nama_device'
                    },
                    {
                        data: 'location',
                        name: 'location'
                    },
                    {
                        data: 'lat',
                        name: 'lat'
                    },
                    {
                        data: 'depth_average',
                        name: 'depth_average'
                    },
                    {
                        data: 'status_siaga',
                        name: 'status_siaga'
                    },
                    {
                        data: 'datetime_calculate',
                        name: 'datetime_calculate'   
                    },
                    {
                        data: 'last_time',
                        name: 'last_time'
                    }
                ]
            });
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts/contentLayoutMaster', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\project\project_ews_clone\resources\views//content/hasil_perhitungan/laporan.blade.php ENDPATH**/ ?>