@extends('layouts.app')

@section('content')
<div id="lotto" class="container-fluid">
    @include('service.navTabs')

    <h5>로또 회차별 당첨번호</h5>
    <hr/>

    <dl>
        <dd>동행복권에서 제공하는 로또 당첨번호입니다.</dd>
    </dl>

    <form name="f_service_lotto_rank" id="fServiceLottoRank" action="{{ route('service.lotto') }}" method="get" accept-charset="UTF-8">
        <input type="hidden" name="tab" value="{{ $params->tab }}"/>
        <div class="row g-2">
            <label for="date" class="col-auto col-form-label">날짜</label>
            <div class="col-auto">
                <select name="number" id="number" class="form-select">
                    @foreach(range($last, 1) as $number)
                        <option value="{{ $number }}" @if($number == $params->number) selected @endif>{{ $number }}</option>
                    @endforeach
                </select>
            </div>
            <div class="col-auto">
                <button type="submit" class="btn btn-dark">검색</button>
            </div>
        </div>
    </form>

    <br/>
    <div class="table-responsive">
        <table class="table table-hover table-bordered table-nowrap w-50">
            <caption class="caption-top">
                <h5>{{ $params->number }}회 당첨번호</h5>
                ({{ date('Y년 m월d일', strtotime($result->drwNoDate)) }} 추첨)
            </caption>
            <thead>
                <tr class="text-center">
                    <th colspan="7">당첨번호</th>
                    <th>보너스</th>
                </tr>
            </thead>
            <tbody>
                <tr class="text-center">
                    <td>{{ $result->drwtNo1 }}</td>
                    <td>{{ $result->drwtNo2 }}</td>
                    <td>{{ $result->drwtNo3 }}</td>
                    <td>{{ $result->drwtNo4 }}</td>
                    <td>{{ $result->drwtNo5 }}</td>
                    <td>{{ $result->drwtNo6 }}</td>
                    <td>+</td>
                    <td>{{ $result->bnusNo }}</td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="4" class="text-center">1등 총 당첨금액</td>
                    <td colspan="4" class="text-end">{{ number_format($result->firstAccumamnt) }} 원</td>
                </tr>
                <tr>
                    <td colspan="4" class="text-center">1게임당 당첨금액</td>
                    <td colspan="4" class="text-end">{{ number_format($result->firstWinamnt) }} 원</td>
                </tr>
                <tr>
                    <td colspan="4" class="text-center">총 판매금액</td>
                    <td colspan="4" class="text-end">{{ number_format($result->totSellamnt) }} 원</td>
                </tr>
            </tfoot>
        </table>
        당첨금 지급기한 : 지급개시일로부터 1년 (휴일인 경우 익영업일)
    </div>
</div>
@endsection

@push('styles')
    <link rel="stylesheet" href="{{ asset('css/desktop/service/index.css') }}"/>
@endpush
