@extends('mobile.layouts.app')

@section('content')
<div id="exchange" class="container-fluid">
    <h5>환율</h5>
    <hr/>

    <dl>
        <dd>한국수출입은행이 제공하는 환율 정보입니다.</dd>
        <dd>현재 환율을 실시간으로 제공합니다.</dd>
        <dd>비영업일의 혹은 영업당일 11시 이전에 해당일의 환율 정보 제공안함.</dd>
    </dl>

    <div class="row mb-3">
        <div class="col align-self-center">
            <label>전체 : {{ $total }}</label>
        </div>
        <div class="col-auto">
            <form name="f_service_exchange" id="fServiceExchange" action="{{ route('service.financial.exchange') }}" method="get" accept-charset="UTF-8">
                @csrf
                <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>

    <div class="table-responsive">
        <table class="table table-hover table-bordered table-nowrap">
            <thead>
                <tr>
                    <th rowspan="2">No</th>
                    <th rowspan="2">통화코드</th>
                    <th rowspan="2">국가/통화명</th>
                    <th colspan="2">전신환(송금)</th>
                    <th rowspan="2">매매 기준율</th>
                    <th rowspan="2">장부 가격</th>
                    <th rowspan="2">년환가료율</th>
                    <th rowspan="2">10일환가료율</th>
                    <th colspan="2">서울외국환중개</th>
                </tr>
                <tr>
                    <th>받으실때</th>
                    <th>보내실때</th>
                    <th>매매기준율</th>
                    <th>장부가격</th>
                </tr>
            </thead>
            <tbody>
                @if($total > 0)
                    @foreach($list as $row)
                    <tr>
                        <td>{{ $loop->iteration }}</td>
                        <td>{{ $row->cur_unit }}</td>
                        <td>{{ $row->cur_nm }}</td>
                        <td>{{ $row->ttb }}</td>
                        <td>{{ $row->tts }}</td>
                        <td>{{ $row->deal_bas_r }}</td>
                        <td>{{ $row->bkpr }}</td>
                        <td>{{ $row->yy_efee_r }}</td>
                        <td>{{ $row->ten_dd_efee_r }}</td>
                        <td>{{ $row->kftc_deal_bas_r }}</td>
                        <td>{{ $row->kftc_bkpr }}</td>
                    </tr>
                    @endforeach
                @else
                    <tr>
                        <td colspan="11">
                            No data.
                        </td>
                    </tr>
                @endif
            </tbody>
        </table>
    </div>
</div>
@endsection
