@extends('layouts.main')

@section('breadcrumbs')
    {{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@php
    // $route = Route::currentRouteName();
    // dd($route);
    $route = explode('.', Route::currentRouteName());
@endphp

@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
    <!-- id ==> penawaran.id -->
    <input type="hidden" id="id" name="id" value="{{ $id }}">
    <div class="card border border-agi-100 pb-2.5">
        <div class="card-header bg-agi-50" id="basic_settings">
            <h3 class="card-title">
                Tambah Data Proses Penawaran Ulang
            </h3>
            <div class="flex items-center gap-2">
                <a href="{{ route('tender.prosespenawaran.show', $id) }}" class="btn btn-xs btn-primary" title="Detail"><i class="ki-filled ki-abstract-26"></i> Detail</a>
                <a href="{{ route('tender.prosespenawaran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
            </div>
        </div>
        <div class="card-body lg:py-7.5 grid grid-cols-3">
            <div class="mb-5">
                <h3 class="text-md font-medium text-gray-900">
                    Nama Debitur:
                </h3>
                <span class="text-2sm text-gray-700">
                    <label class="card-title" id="namaDebitur">
                       -
                    </label>
                </span>
            </div>
            <div class="mb-5">
                <h3 class="text-md font-medium text-gray-900">
                    Nomor Register Permohonan:
                </h3>
                <span class="text-2sm text-gray-700">
                    <label class="card-title" id="textReg">
                        No. registrasi
                    </label>
                </span>
            </div>

            <div class="mb-5">
                <h3 class="text-md font-medium text-gray-900">
                    Nomor Penawaran:
                </h3>
                <span class="text-2sm text-gray-700">
                    <label class="card-title" id="textCodePenawaran">
                        Nomor Penawaran
                    </label>
                </span>
            </div>

            <div class="mb-5">
                <h3 class="text-md font-medium text-gray-900">
                    Status Penawaran:
                </h3>
                <span class="text-2sm text-gray-700">
                    <label class="card-title" id="textStatusPenawaran">
                        Status
                    </label>
                </span>
            </div>
        </div>

        <!-- add kjpp -->
        <div class="card-body grid gap-5">
            <!-- datatables -->
            <div class="grid">
                <div class="card border border-agi-100 min-w-full">
                    <div class="card-header bg-agi-50">
                        <h3 class="card-title">Tambah KJPP</h3>
                    </div>
                    <div class="card-table scrollable-x-auto">
                        <table class="table table-border align-middle text-gray-700 font-medium text-sm">
                            <thead>
                                <tr>
                                    <th class="min-w-[180px]">KJPP</th>
                                    <th>No Proposal</th>
                                    <th>Tanggal Proposal</th>
                                    <th>Biaya Penawaran</th>
                                    <th>Upload Penawaran</th>
                                    <th class="min-w-[50px] text-center">Action</th>
                                </tr>
                            </thead>
                            <tbody id="tbodyKJPP0">
                                <tr>
                                    <td valign="top">
                                        <select class="inputku select " style="width: 25.5em" name="select" id="{{$route[1]}}_kjpps1">
                                            <option value="0"> - Pilih KJPP - </option>
                                        </select>
                                        <em id="{{$route[1]}}_kjpp1_msg" class="alert text-danger text-sm"></em>
                                    </td>
                                    <td valign="top">
                                        <input type="text" class="inputku file-input" id="{{$route[1]}}_no_proposal" name="{{$route[1]}}_no_proposal">
                                        <em id="{{$route[1]}}_no_proposal_msg" class="alert text-danger text-sm"></em>
                                    </td>
                                    <td valign="top">
                                        <input type="date" class="inputku file-input" id="{{$route[1]}}_tgl_proposal" name="{{$route[1]}}_tgl_proposal" >
                                        <em id="{{$route[1]}}_tgl_proposal_msg" class="alert text-danger text-sm"></em>
                                    </td>
                                    <td valign="top">
                                        <div class="input-group">
                                            <span class="inputku btn btn-input" id="{{$route[1]}}_rp">Rp.</span>
                                            <input type="text" style="text-align: right;" onkeydown="return numbersonly(this, event);" onkeyup="javascript:tandaPemisahTitik(this);" class="inputku input" id="{{$route[1]}}_biayaPenawaran" name="{{$route[1]}}_biayaPenawaran">
                                        </div>
                                        <em id="{{$route[1]}}_biayaPenawaran_msg" class="alert text-danger text-sm"></em>
                                    </td>
                                    <td valign="top">
                                        <input type="file" class="inputku file-input" id="{{$route[1]}}_dokumenPersetujuan" name="{{$route[1]}}_dokumenPersetujuan" accept="application/pdf" />
                                        <em id="{{$route[1]}}_dokumenPersetujuan_msg" class="alert text-danger text-sm"></em>
                                    </td>
                                    <td  valign="top" class="min-w-[50px] text-center">
                                        <div class="flex flex-nowrap justify-center">
                                            <a class="btn btn-sm btn-icon btn-clear btn-info" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Tambah KJPP" onclick="addDataUlang()"><i class="ki-outline ki-bookmark"></i></a>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- datatables -->
            <div class="flex justify-end">
               &nbsp;
            </div>
        </div>
        <!-- add kjpp -->
        <div class="card-body grid gap-5">
            <!-- datatables -->
            <div class="grid">
                <div class="card border border-agi-100 min-w-full">
                    <div class="card-header bg-agi-50">
                        <h3 class="card-title">Data KJPP</h3>
                        <button type="button" class="btn btn-sm btn-danger" id="{{$route[1]}}_toPenawaranUlang">
                            <i class="ki-filled ki-wrench"></i>Penawaran Ulang
                        </button>
                    </div>
                    <div class="card-table scrollable-x-auto">
                        <table class="table table-border align-middle text-gray-700 font-medium text-sm">
                            <thead>
                                <tr>
                                    <th class="w-14 text-center">No</th>
                                    <th class="min-w-[80px]">KJPP</th>
                                    <th>No Proposal</th>
                                    <th>Tanggal Proposal</th>
                                    <th>Biaya Penawaran</th>
                                    <th>Upload Penawaran</th>
                                    <th class="min-w-[50px] text-center">Action</th>
                                </tr>
                            </thead>
                            <tbody id="tbodyKJPP1">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- datatables -->
            <div class="flex justify-end">
               &nbsp;
            </div>
        </div>
    </div>
</div>
@endsection
@include('lpj::prosespenawaran.js.editulangjs')
