@extends('website.layouts.app')

@section('title')
    Data Parameter Cuaca | Desa / Kelurahan
@endsection

@section('content')
    <!-- start page title -->
    <div class="row">
        <div class="col-12">
            <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                <h4 class="mb-sm-0">Data Parameter Cuaca</h4>

                <div class="page-title-right">
                    <ol class="breadcrumb m-0">
                        <li class="breadcrumb-item"><a href="javascript: void(0);">Parameters</a></li>
                        <li class="breadcrumb-item active">Desa / Kelurahan</li>
                    </ol>
                </div>

            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">

            <div class="card border card-border-warning">
                <div class="card-header">
                    <h6 class="card-title mb-0">Baca Terlebih Dahulu !!!</h6>
                </div>
                <div class="card-body">
                    <p class="card-text">
                        Berikut adalah data parameter cuaca pada setiap desa / kelurahan di Kabupaten Bondowoso.
                        Parameter Tersebut terdiri dari radiasi matahari, curah hujan, kelembapan, temperatur dan kecepatan
                        angin. Untuk parameter berjumlah 5 tersebut bersumber dari
                        <a href="https://power.larc.nasa.gov/data-access-viewer/" target="_blank">API Nasa Power</a>.
                    </p>
                </div>
            </div>
            <div class="card">
                <div class="card-header d-flex flex-column flex-sm-row align-items-sm-center justify-content-between gap-2">
                    <h4 class="card-title mb-0 flex-grow-1">Data Parameter Cuaca | Tahun <span id="span-year">2021</span>
                    </h4>

                    <div class="d-flex flex-column flex-sm-row justify-content-between gap-2 w-100">
                        <div class="d-flex flex-column flex-sm-row gap-2 w-100">
                            <select class="form-select w-100" id="choiceYear" aria-label="pilih-tahun">
                                <option selected value="2021">2021</option>
                                <option value="2022">2022</option>
                                <option value="2023">2023</option>
                            </select>

                            <select class="form-select w-100" id="choiceSubDistrict" aria-label="pilih-kecamatan">
                                @foreach ($listSubDistrict as $subDistrict)
                                    <option value="{{ $subDistrict->id }}"
                                        {{ $subDistrict->sub_district == 'Kec Cermee' ? 'selected' : '' }}>
                                        {{ $subDistrict->sub_district }}
                                    </option>
                                @endforeach
                            </select>
                        </div>

                        <div class="ms-1 w-sm-auto w-100">
                            <span id="btn-update-list-weather-village" class="btn btn-warning waves-effect waves-light">
                                Perbarui
                            </span>
                        </div>
                    </div>
                </div><!-- end card header -->

                <div class="card-body">
                    <div id="table-parameter-list-weather-village" class="table-responsive">
                    </div>
                </div><!-- end card-body -->
            </div><!-- end card -->
        </div>
        <!-- end col -->
    </div>


    <script src="{{ asset('assets/libs/prismjs/prism.js') }}"></script>
    <script src="{{ asset('assets/libs/gridjs/gridjs.umd.js') }}"></script>
    <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>

    <script src="{{ asset('assets/js/custom/parameter-list-weather-village.js') }}"></script>
@endsection
