@extends('component.app')
@section('title', 'Metode Pembayaran')
@section('active20', 'active')
@section('menu1', 'open')
@section('content')

    <style>
        table td {
            font-size: 14px;
        }
    </style>

    <div class="content-wrapper">
        <div class="container-xxl flex-grow-1 container-p-y">

            <!-- Invoice List Table -->
            <div class="card">
                <div class="header-menu d-flex justify-content-between align-items-center">
                    <h4 class="card-header">Metode Pembayaran</h4>
                    <button type="button" class="btn btn-primary me-2" data-bs-toggle="modal"
                        data-bs-target="#staticBackdrop"><i class="bx bx-plus bx-sm"></i> Add</button>
                </div>
                <div class="table-responsive">
                    <table class="table table-hover" id="Mytable">
                        <thead class="table-primary text-center">
                            <tr>
                                <th scope="col">Laundry</th>
                                <th scope="col">Jenis Pembayaran</th>

                                <th scope="col">No Rekening</th>
                                <th scope="col">Atas Nama</th>
                                <th scope="col">Status</th>
                                <th scope="col">Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach ($data as $data)
                                <tr>
                                    <td>{{ $data->laundry->nama_laundry }}</td>
                                    <td>{{ $data->jenis_pembayaran }}</td>
                                    <td>{{ $data->no_rek }}</td>
                                    <td>{{ $data->atas_nama }}</td>


                                    <td>
                                        @if ($data->is_active == '1')
                                            <span class="badge bg-label-success me-1">Aktif</span>
                                        @elseif ($data->is_active == '0')
                                            <span class="badge bg-label-danger me-1">Tidak Aktif</span>
                                        @endif
                                    </td>

                                    <td><a href="{{ route('metode-pembayaran.edit', $data->id) }}"
                                            class="btn btn-sm btn-label-secondary"> <i class="bx bx-edit-alt"></i></a>
                                    </td>

                                </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>

            </div>
            <!-- Modal -->
            <div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
                aria-labelledby="staticBackdropLabel" aria-hidden="true">
                <div class="modal-dialog modal-sm">
                    <div class="modal-content ">
                        <div class="modal-header">
                            <h5 class="modal-title" id="staticBackdropLabel">Tambah Data</h5>
                            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                        </div>
                        <div class="modal-body">
                            <form action="{{ route('metode-pembayaran.store') }}" method="POST"
                                enctype="multipart/form-data">
                                @csrf
                                <div class="row">
                                    <!-- Kolom Kiri -->
                                    <div class="col-md-12">
                                        <div class="mb-3">
                                            <label for="users_id" class="form-label">Pilih Laundry</label>
                                            <input type="text" name="id_laundry" value="{{ $laundry->id }}" hidden>
                                            <input type="text" class="form-control"
                                                value="{{ $laundry->id }} - {{ $laundry->nama_laundry }}" readonly>
                                        </div>
                                        <div class="mb-3">
                                            <label for="jenis_pembayaran" class="form-label">Jenis Pembayaran</label>
                                            <input type="text" class="form-control" id="jenis_pembayaran"
                                                name="jenis_pembayaran" placeholder="Ex. BNI" required>
                                        </div>
                                        <div class="mb-3">
                                            <label for="nama_parfum" class="form-label">No. Rekening</label>
                                            <input type="number" class="form-control" id="no_rek" name="no_rek"
                                                placeholder="Masukkan No rekening" required>
                                        </div>

                                        <!-- Logo Brand -->
                                        <div class="mb-3">
                                            <label for="atas_nama" class="form-label">Atas Nama</label>
                                            <input type="text" class="form-control" id="foto" name="atas_nama"
                                                placeholder="Ex. johndoe" required>
                                        </div>


                                    </div>
                                </div>

                        </div>

                        <div class="modal-footer">
                            {{-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> --}}
                            <button type="submit" class="btn btn-primary">Simpan</button>
                        </div>
                        </form>
                    </div>
                </div>
            </div>
        @endsection
