@extends('layouts.app')
@section('content')
<main>
    <header class="alert alert-success">
        <h4 class="container">新規定期契約 > 入力内容の確認</h4>
    </header>
    <section class="container mt30 mb50">
        <h3 class="mb30 offset-md-2 alert-success">ご入力内容をご確認ください。</h3>
        <form class="row form" action="{{ route('regular_contract.create_confirm_next', ['contract_id' => $contract_id]) }}" method="post">
            @csrf
            <!-- 本人確認書類1 -->
            <div class="col-12 offset-md-2">
                <img src="{{ asset('storage/photo/' . $user->photo_filename1) }}" style="max-width:200px; margin-top:8px;">
            </div>
            <!-- 本人確認書類2 -->
            <div class="col-12 offset-md-2">
                @if(isset($user->photo_filename2) && $user->photo_filename2 !== '')
                <img src="{{ asset('storage/photo/' . $user->photo_filename2) }}" style="max-width:200px; margin-top:10px; margin-bottom:30px;">
                @endif
            </div>
            <!-- 駐輪場名 -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="park_name">駐輪場名</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>{{ $park->park_name }}</h3>
            </div>
            <!-- お申し込み内容 -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="psection_subject">お申し込み内容</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>{{ $psection->psection_subject }}</h3>
            </div>
            <!-- お名前 -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_name">お名前</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>{{ $user->user_name }}</h3>
            </div>
            <!-- 性別 -->
            @if (!empty($park->gender_display_flag) && $park->gender_display_flag == 1)
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_gender">性別</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>{{ $user->user_gender }}</h3>
            </div>
            @endif
            <!-- 住所 -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_regident_zip">住所</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>
                    @php
                    $pre = $user->user_regident_pre;
                    $city = $user->user_regident_city;
                    $add = $user->user_regident_add;
                    @endphp
                    {{ $pre }}{{ $city }}{{ $add }}
                </h3>
            </div>
            <!-- 生年月日 -->
            @if (!empty($park->bd_display_flag) && $park->bd_display_flag == 1)
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_birthdate">生年月日</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>
                    @if(!empty($user->user_birthdate))
                    {{ \Carbon\Carbon::parse($user->user_birthdate)->format('Y年m月d日') }}
                    @endif
                </h3>
            </div>
            @endif
            <!-- 自宅電話番号 -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_homephone">自宅電話番号</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>
                    {{ $user->user_homephone }}
                </h3>
            </div>
            <!-- 携帯電話番号 -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_mobile">携帯電話番号</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>
                    {{ $user->user_mobile }}
                </h3>
            </div>
            <!-- メールアドレス -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_primemail">メールアドレス</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>{{ $user->user_primemail }}</h3>
            </div>
            <!-- 予備メールアドレス -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_submail">予備メールアドレス</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>{{ $user->user_submail }}</h3>
            </div>
            <!-- 利用者区分 -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_category">利用者区分</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>{{ $usertype->usertype_subject1 }}</h3>
            </div>
            @if ($usertype->usertype_subject1 === '学生')
            <!-- 学生の場合：学校名・卒業予定のみ表示 -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_school">学校名</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>{{ $user->user_school }}</h3>
            </div>
            @else
            <!-- 一般の場合：勤務先名のみ表示 -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_workplace">勤務先名</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>{{ $user->user_workplace }}</h3>
            </div>
            @endif
            <!-- 住所（関連） -->
            <div class="col-12 col-md-3 offset-0 offset-md-2">
                <label for="user_relate">住所</label>
            </div>
            <div class="col-12 col-lg-6 mb10">
                <h3>
                    @php
                    $pre = $user->user_relate_pre ?? '';
                    $city = $user->user_relate_city ?? '';
                    $add = $user->user_relate_add ?? '';
                    @endphp
                    {{ $pre }}{{ $city }}{{ $add }}
                </h3>
            </div>
            <div class="col-12 col-md-5 offset-0 offset-md-1 mt10">
                <button type="submit" class="btn btn-lg btn-block btn-success">確認して進む</button>
            </div>
            <div class="col-12 col-md-5 mt10">
                <a href="{{ route('regular_contract.upload_identity_create', ['contract_id' => $contract_id]) }}" class="btn btn-lg btn-block btn-outline-success">戻って修正する</a>
            </div>
        </form>
    </section>
</main>
@endsection