@extends('mobile.layouts.app')

@section('content')
<div id="international" class="container-fluid">
    <h5>국제 금리</h5>
    <hr/>

    <dl>
        <dd>한국수출입은행이 제공하는 국제 금리입니다.</dd>
        <dd>SOFR 등 국제금리를 일 기준으로 제공합니다.</dd>
        <dd>참조: <a href="https://www.koreaexim.go.kr/wg/HPHKWG052M01#tab3" target="_blank">https://www.koreaexim.go.kr/wg/HPHKWG052M01#tab3</a></dd>
    </dl>

    <div class="row mb-3">
        <div class="col-auto">
            <form name="f_service_international" id="fServiceInternational" action="{{ route('service.financial.international') }}" method="get" accept-charset="UTF-8">
                <div class="row g-2">
                    <label for="date" class="col-auto col-form-label">기준일</label>
                    <div class="col">
                        <input type="text" name="date" id="date" class="form-control date-picker" value="{{ $date }}" />
                    </div>
                    <div class="col-auto">
                        <button type="submit" class="btn btn-dark">검색</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <table class="table table-hover table-bordered table-nowrap">
        <caption>
            <div class="row">
                <div class="col">
                    SOFR
                </div>
                <div class="col text-end">
                    <small>조회기준일 : {{ $date }}</small>
                </div>
            </div>
        </caption>
        <thead>
            <tr>
                <th>No</th>
                <th>통화</th>
                <th>익일물</th>
            </tr>
        </thead>
        <tbody>
            @if($sofrList)
                @foreach($sofrList as $row)
                <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $row->cur_fund }}</td>
                    <td>{{ $row->int_r }}</td>
                </tr>
                @endforeach
            @else
                <tr>
                    <td colspan="3">
                        No data.
                    </td>
                </tr>
            @endif
        </tbody>
    </table>

    <table class="table table-hover table-bordered table-nowrap">
        <caption>
            <div class="row">
                <div class="col">
                    ESTR
                </div>
                <div class="col text-end">
                    <small>조회기준일 : {{ $date }}</small>
                </div>
            </div>
        </caption>
        <thead>
        <tr>
            <th>No</th>
            <th>통화</th>
            <th>익일물</th>
        </tr>
        </thead>
        <tbody>
        @if($estrList)
            @foreach($estrList as $row)
                <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $row->cur_fund }}</td>
                    <td>{{ $row->int_r }}</td>
                </tr>
            @endforeach
        @else
            <tr>
                <td colspan="3">
                    No data.
                </td>
            </tr>
        @endif
        </tbody>
    </table>

    <table class="table table-hover table-bordered table-nowrap">
        <caption>
            <div class="row">
                <div class="col">
                    EURIBOR
                </div>
                <div class="col text-end">
                    <small>조회기준일 : {{ $date }}</small>
                </div>
            </div>
        </caption>
        <thead>
        <tr>
            <th>No</th>
            <th>통화</th>
            <th>1월</th>
            <th>3월</th>
            <th>6월</th>
            <th>12월</th>
        </tr>
        </thead>
        <tbody>
        @if($euriborList)
            @foreach($euriborList as $curFund => $rows)
                <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $curFund }}</td>
                    @foreach($rows as $row)
                        <td>{{ $row->int_r }}</td>
                    @endforeach
                </tr>
            @endforeach
        @else
            <tr>
                <td colspan="6">
                    No data.
                </td>
            </tr>
        @endif
        </tbody>
    </table>

    <table class="table table-hover table-bordered table-nowrap">
        <caption>
            <div class="row">
                <div class="col">
                    TONA
                </div>
                <div class="col text-end">
                    <small>조회기준일 : {{ $date }}</small>
                </div>
            </div>
        </caption>
        <thead>
        <tr>
            <th>No</th>
            <th>통화</th>
            <th>익일물</th>
        </tr>
        </thead>
        <tbody>
        @if($tonaList)
            @foreach($tonaList as $row)
                <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $row->cur_fund }}</td>
                    <td>{{ $row->int_r }}</td>
                </tr>
            @endforeach
        @else
            <tr>
                <td colspan="3">
                    No data.
                </td>
            </tr>
        @endif
        </tbody>
    </table>

    <table class="table table-hover table-bordered table-nowrap">
        <caption>
            <div class="row">
                <div class="col">
                    TIBOR
                </div>
                <div class="col text-end">
                    <small>조회기준일 : {{ $date }}</small>
                </div>
            </div>
        </caption>
        <thead>
        <tr>
            <th>No</th>
            <th>통화</th>
            <th>1월</th>
            <th>3월</th>
            <th>6월</th>
            <th>12월</th>
        </tr>
        </thead>
        <tbody>
        @if($tiborList)
            @foreach($tiborList as $curFund => $rows)
                <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $curFund }}</td>
                    @foreach($rows as $row)
                        <td>{{ $row->int_r }}</td>
                    @endforeach
                </tr>
            @endforeach
        @else
            <tr>
                <td colspan="6">
                    No data.
                </td>
            </tr>
        @endif
        </tbody>
    </table>

    <table class="table table-hover table-bordered table-nowrap">
        <caption>
            <div class="row">
                <div class="col">
                    SWAP(RFR)
                </div>
                <div class="col text-end">
                    <small>조회기준일 : {{ $date }}</small>
                </div>
            </div>
        </caption>
        <thead>
        <tr>
            <th>No</th>
            <th>통화</th>
            <th>6월</th>
            <th>12월</th>
            <th>2년</th>
        </tr>
        </thead>
        <tbody>
        @if($swapRfrList)
            @foreach($swapRfrList as $curFund => $rows)
                <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $curFund }}</td>
                    @foreach($rows as $row)
                        <td>{{ $row->int_r }}</td>
                    @endforeach
                </tr>
            @endforeach
        @else
            <tr>
                <td colspan="5">
                    No data.
                </td>
            </tr>
        @endif
        </tbody>
    </table>

    <table class="table table-hover table-bordered table-nowrap">
        <caption>
            <div class="row">
                <div class="col">
                    LIBOR
                </div>
                <div class="col text-end">
                    <small>조회기준일 : {{ $date }}</small>
                </div>
            </div>
        </caption>
        <thead>
        <tr>
            <th>No</th>
            <th>통화</th>
            <th>1월</th>
            <th>3월</th>
            <th>6월</th>
            <th>12월</th>
        </tr>
        </thead>
        <tbody>
        @if($liborList)
            @foreach($liborList as $curFund => $rows)
                <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $curFund }}</td>
                    @foreach($rows as $row)
                        <td>{{ $row->int_r ?? 0 }}</td>
                    @endforeach
                </tr>
            @endforeach
        @else
            <tr>
                <td colspan="6">
                    No data.
                </td>
            </tr>
        @endif
        </tbody>
    </table>

    <table class="table table-hover table-bordered table-nowrap">
        <caption>
            <div class="row">
                <div class="col">
                    SWAP(LIBOR)
                </div>
                <div class="col text-end">
                    <small>조회기준일 : {{ $date }}</small>
                </div>
            </div>
        </caption>
        <thead>
        <tr>
            <th>No</th>
            <th>통화</th>
            <th>6월</th>
            <th>12월</th>
            <th>2년</th>
        </tr>
        </thead>
        <tbody>
        @if($swapList)
            @foreach($swapList as $curFund => $rows)
                <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $curFund }}</td>
                    @foreach($rows as $row)
                        <td>{{ $row->int_r ?? 0 }}</td>
                    @endforeach
                </tr>
            @endforeach
        @else
            <tr>
                <td colspan="5">
                    No data.
                </td>
            </tr>
        @endif
        </tbody>
    </table>

    <table class="table table-hover table-bordered table-nowrap">
        <caption>
            <div class="row">
                <div class="col">
                    CIRR
                </div>
                <div class="col text-end">
                    <small>조회기준일 : {{ $date }}</small>
                </div>
            </div>
        </caption>
        <thead>
        <tr>
            <th>No</th>
            <th>통화</th>
            <th>6월</th>
            <th>12월</th>
            <th>2년</th>
        </tr>
        </thead>
        <tbody>
        @if($cirrList)
            @foreach($cirrList as $curFund => $rows)
                <tr>
                    <td>{{ $loop->iteration }}</td>
                    <td>{{ $curFund }}</td>
                    @foreach($rows as $row)
                        <td>{{ $row->int_r }}</td>
                    @endforeach
                </tr>
            @endforeach
        @else
            <tr>
                <td colspan="5">
                    No data.
                </td>
            </tr>
        @endif
        </tbody>
    </table>
</div>
@endsection
