@extends('website.layouts.app')

@section('title')
    List Data Kriteria
@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">List Data Kriteria</h4>

                <div class="page-title-right">
                    <ol class="breadcrumb m-0">
                        <li class="breadcrumb-item"><a href="javascript: void(0);">Perhitungan Topsis</a></li>
                        <li class="breadcrumb-item active">List Data Kriteria</li>
                    </ol>
                </div>

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

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header d-flex align-items-center justify-content-between">
                    <h4 class="card-title mb-0 flex-grow-1">List Data Kriteria
                    </h4>
                    <div class="d-flex align-items-center">
                        <button class="btn btn-md btn-primary ms-2" data-bs-toggle="modal" data-bs-target="#btn-add">tambah
                            kriteria</button>
                    </div>
                </div><!-- end card header -->

                <div class="card-body">
                    <div id="table-list-criteria-data" class="table-responsive">
                    </div>
                </div><!-- end card-body -->
            </div><!-- end card -->
        </div>
        <!-- end col -->
    </div>

    <!-- update criteria modals -->
    <div class="modal fade" id="btn-edit" tabindex="-1" aria-labelledby="btn-editLabel" aria-modal="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="btn-editLabel">Ubah Data Kriteria</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <form action="{{ route('list-data-kriteria.updateCriteria') }}" method="POST">
                        @csrf
                        <div class="row g-3">
                            <input type="hidden" name="criteria_id" id="criteria_id">
                            <div class="col-lg-12">
                                <div>
                                    <label for="criteria" class="form-label">Nama Kriteria</label>
                                    <input type="text" class="form-control mb-1" id="criteria" name="criteria"
                                        placeholder="masukkan nama kriteria">
                                </div>
                            </div><!--end col-->
                            <div class="col-lg-12">
                                <div>
                                    <label for="bobot" class="form-label">Pilih Bobot Kriteria</label>
                                    <select class="form-select form-select-md  mb-1" aria-label=".form-select-md"
                                        id="bobot" name="bobot">
                                        <option selected>pilih bobot</option>
                                        <option value="1">1 (Satu)</option>
                                        <option value="2">2 (Dua)</option>
                                        <option value="3">3 (Tiga)</option>
                                        <option value="4">4 (Empat)</option>
                                        <option value="5">5 (Lima)</option>
                                    </select>
                                </div>
                            </div><!--end col-->
                            <div class="col-lg-12">
                                <div>
                                    <label for="keterangan" class="form-label">Pilih Keterangan</label>
                                    <select class="form-select form-select-md  mb-1" aria-label=".form-select-md"
                                        id="keterangan" name="keterangan">
                                        <option selected>pilih keterangan</option>
                                        <option value="benefit">benefit</option>
                                        <option value="cost">cost</option>
                                    </select>
                                </div>
                            </div><!--end col-->
                            <div class="col-lg-12">
                                <div class="hstack gap-2 justify-content-end">
                                    <button type="button" class="btn btn-light" data-bs-dismiss="modal">Close</button>
                                    <button type="submit" class="btn btn-primary">Submit</button>
                                </div>
                            </div><!--end col-->
                        </div><!--end row-->
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- add criteria modals -->
    <div class="modal fade" id="btn-add" tabindex="-1" aria-labelledby="btn-addLabel" aria-modal="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="btn-addLabel">Tambah Data Kriteria</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <form action="{{ route('list-data-kriteria.addCriteria') }}" method="POST">
                        @csrf
                        <div class="row g-3">
                            <div class="col-lg-12">
                                <div>
                                    <label for="criteria" class="form-label">Nama Kriteria</label>
                                    <input type="text" class="form-control mb-1" id="criteria" name="criteria"
                                        placeholder="masukkan nama kriteria">
                                </div>
                            </div><!--end col-->
                            <div class="col-lg-12">
                                <div>
                                    <label for="bobot" class="form-label">Pilih Bobot Kriteria</label>
                                    <select class="form-select form-select-md  mb-1" aria-label=".form-select-md"
                                        id="bobot" name="bobot">
                                        <option selected>pilih bobot</option>
                                        <option value="1">1 (Satu)</option>
                                        <option value="2">2 (Dua)</option>
                                        <option value="3">3 (Tiga)</option>
                                        <option value="4">4 (Empat)</option>
                                        <option value="5">5 (Lima)</option>
                                    </select>
                                </div>
                            </div><!--end col-->
                            <div class="col-lg-12">
                                <div>
                                    <label for="keterangan" class="form-label">Pilih Keterangan</label>
                                    <select class="form-select form-select-md  mb-1" aria-label=".form-select-md"
                                        id="keterangan" name="keterangan">
                                        <option selected>pilih keterangan</option>
                                        <option value="benefit">benefit</option>
                                        <option value="cost">cost</option>
                                    </select>
                                </div>
                            </div><!--end col-->
                            <div class="col-lg-12">
                                <div class="hstack gap-2 justify-content-end">
                                    <button type="button" class="btn btn-light" data-bs-dismiss="modal">Close</button>
                                    <button type="submit" class="btn btn-primary">Submit</button>
                                </div>
                            </div><!--end col-->
                        </div><!--end row-->
                    </form>
                </div>
            </div>
        </div>
    </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/pages/gridjs.init.js') }}"></script> --}}

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