@extends('indexlayout')

@section('title', 'TPS')
@push('style')
@endpush
@section('content')
    <div class="row">
        <main id="js-page-content" role="main" class="page-content">
            <ol class="breadcrumb page-breadcrumb">
                <li class="breadcrumb-item"><a href="javascript:void(0);">Sarana & Prasarana</a></li>
                <li class="breadcrumb-item active">2025</li>
                <li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
            </ol>

            <div class="row">
                <div class="col-xl-12">
                    <div id="panel-1" class="panel">
                        <div class="panel-hdr">
                            <h2>
                                TPS 3R 2025
                            </h2>
                        </div>
                        <div class="panel-container show">

                            <div class="panel-content">
                                <div class="col-xl-3">
                                    <div id="js_default_list ">
                                        <div class="input-group mb-g">
                                            <input type="text" class="form-control form-control-lg shadow-inset-2"
                                                onkeyup="searchTable()" id="searchInput" placeholder="Filter list">
                                            <div class="input-group-append">
                                                <div class="input-group-text">
                                                    <i class="fal fa-search fs-xl"></i>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-xl-12" style="padding-block-end: 10px">
                                    <div class="demo">
                                        <a href="{{ route('sadmin.tps.tps2') }}"><button
                                                type="button"class="btn btn-primary">2022</button></a>
                                        <a href="{{ route('sadmin.tps.tps3') }}"><button
                                                type="button"class="btn btn-secondary">2023</button></a>
                                        <a href="{{ route('sadmin.tps.tps4') }}"><button
                                                type="button"class="btn btn-success">2024</button></a>
                                        <a href="{{ route('sadmin.tps.tps') }}"><button
                                                type="button"class="btn btn-info">2025</button></a>
                                    </div>
                                </div>

                                {{-- <input type="text" id="searchInput" onkeyup="searchTable()"
                                    placeholder="Cari berdasarkan Tujuan, Sasaran, atau Indikator Kinerja Utama..."> --}}
                                <!-- datatable start -->
                                <table id="ikuTable" class="table table-bordered table-hover table-striped w-100 ">
                                    <thead style="text-align:center">
                                        <tr>
                                            <th rowspan="2">No</th>
                                            <th rowspan="2">Wilayah</th>
                                            <th colspan="3">Rencana 2025</th>
                                            <th rowspan="2" style="text-align: center">Action</th>
                                        </tr>
                                        <tr>
                                            <td>Lokasi</td>
                                            <td>Kapasitas (TPD)</td>
                                            <td>Anggaran (Rp)</td>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>1</td>
                                            <td>Dinas (Perencanaan TPS3R)</td>
                                            <td>Belum Tau Lokasinya</td>
                                            <td>-</td>
                                            <td>1,496,880,000</td>
                                            <td><a href="{{ route('sadmin.tps.lokasitps.lokasi2') }}"
                                                    class="btn btn-primary">Detail</a></td>
                                        </tr>
                                        <tr>
                                            <td>2</td>
                                            <td>Sudin LH Jakarta Pusat</td>
                                            <td>-</td>
                                            <td>-</td>
                                            <td>-</td>
                                            <td><a href="{{ route('sadmin.tps.lokasitps.lokasi2') }}"
                                                    class="btn btn-primary">Detail</a></td>
                                        </tr>
                                        <tr>
                                            <td>3</td>
                                            <td>Sudin LH Jakarta Utara</td>
                                            <td>-</td>
                                            <td>-</td>
                                            <td>-</td>
                                            <td><a href="{{ route('sadmin.tps.lokasitps.lokasi2') }}"
                                                    class="btn btn-primary">Detail</a></td>
                                        </tr>
                                        <tr>
                                            <td>4</td>
                                            <td>Sudin LH Jakarta Barat</td>
                                            <td>
                                                <p>1: TPS Hanura (Tanah Sareal), Tambora</p>
                                                <p>2: TPS Pesakih, Cengkareng </p>
                                                <p>3: TPS THI, Jelambar Baru</p>
                                            </td>
                                            <td>
                                                <p>1.saat ini 5-10 ton/hr, rencana 25 ton</p>
                                                <p> 2.rencana 25 ton</p>
                                                <p> 3.rencana 25 ton</p>
                                            </td>
                                            <td>
                                                <p>1. Rp. 15.118.384.054,-</p>
                                                <p>2. Rp. 19.620.369.654,-
                                                </p>
                                                <p>3. Rp. 15.126.705.654,-</p>
                                                <p>Pengadaan Barang 3 lokasi : 107.731.889</p>
                                                <p>Anggaran Aktivitas 50.139.840.310</p>
                                            </td>
                                            <td><a href="{{ route('sadmin.tps.lokasitps.lokasi2') }}"
                                                    class="btn btn-primary">Detail</a></td>
                                        </tr>
                                        <tr>
                                            <td>5</td>
                                            <td>Sudin LH Jakarta Selatan</td>
                                            <td>
                                                <p>1. TPS Brigif - Jagakarsa</p>
                                                <p>2. TPS Dharma Jaya : Mampang</p>
                                                <p>3. Kampung Kandang </p>
                                                <p>4 Juanda Cilandak</p>
                                            </td>
                                            <td>
                                                <p>1. 50 Ton</p>
                                                <p>2. 50 Ton</p>
                                            </td>
                                            <td>
                                                <p>Rp. 49.661.584.098,-</p>
                                                <p>Anggaran Aktivitas </p>
                                                <p>49.661.584.098</p>
                                            </td>
                                            <td><a href="{{ route('sadmin.tps.lokasitps.lokasi2') }}"
                                                    class="btn btn-primary">Detail</a></td>
                                        </tr>
                                        <tr>
                                            <td>6</td>
                                            <td>Sudin LH Jakarta Timur</td>
                                            <td>
                                                <p>Kantor Satpel Matraman</p>
                                            </td>
                                            <td>-</td>
                                            <td>-</td>
                                            <td><a href="{{ route('sadmin.tps.lokasitps.lokasi2') }}"
                                                    class="btn btn-primary">Detail</a></td>
                                        </tr>
                                        <tr>
                                            <td>7</td>
                                            <td>Sudin LH Kepulauan Seribu</td>
                                            <td>
                                                <p>1. Pulau Kelapa</p>
                                                <p>2. Pulau Harapan</p>
                                            </td>
                                            <td>360 kg × 8 jam = 2,88 Ton</td>
                                            <td>
                                                <p>Pulau kelapa : Rp. 12.845.980.690,-</p>
                                                <p>Pulau harapan : Rp. 11.728.939.036,-</p>
                                                <p>Anggaran Aktivitas </p>
                                                <p>31.498.479.726</p>
                                            </td>
                                            <td><a href="{{ route('sadmin.tps.lokasitps.lokasi2') }}"
                                                    class="btn btn-primary">Detail</a></td>
                                        </tr>
                                    </tbody>
                                </table>
                                <!-- datatable end -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </main>

    @endsection

    @push('script')
        <script src="{{ asset('layout/dist/js/datagrid/datatables/datatables.bundle.js') }}"></script>
        {{-- <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script> --}}
        <script src="{{ asset('layout/dist/js/tabel.js') }}"></script>
        <script src="{{ asset('layout/dist/js/linechart.js') }}"></script>
        <script src="{{ asset('layout/dist/js/iku.js') }}"></script>
        <script>
            function searchTable() {
                var input, filter, table, tr, td, i, txtValue;
                input = document.getElementById("searchInput");
                filter = input.value.toLowerCase();
                table = document.getElementById("ikuTable");
                tr = table.getElementsByTagName("tr");

                for (i = 1; i < tr.length; i++) {
                    tr[i].style.display = "none"; // Hide all rows initially
                    td = tr[i].getElementsByTagName("td");

                    for (var j = 0; j < td.length; j++) {
                        if (td[j]) {
                            txtValue = td[j].textContent || td[j].innerText;
                            if (txtValue.toLowerCase().indexOf(filter) > -1) {
                                tr[i].style.display = ""; // Show row if match is found
                                break;
                            }
                        }
                    }
                }
            }
        </script>
    @endpush
