@extends('views.layouts.master')
<link rel="stylesheet" href="{{ csset('/themes/pro/modunawa/resources/css/profile.css') }}">
@section('content')

<!--=====================================
BANNER PART START
=======================================-->
<section class="inner-section single-banner">
	<div class="container">
		<h2>회원정보</h2>
		<ol class="breadcrumb">
			<li class="breadcrumb-item"><a href="/">Home</a></li>
			<li class="breadcrumb-item active" aria-current="page">회원정보</li>
		</ol>
	</div>
</section>
<!--=====================================
BANNER PART END
=======================================-->

<!--=====================================
PROFILE PART START
=======================================-->
<section class="inner-section profile-part">
	<div class="container">
		<div class="row">
			<div class="col-lg-12">
				<div class="account-card">
					<div class="account-title">
						<h4>회원정보</h4>
						<div>
                            <button onclick="location.href='{{ route('member-withdrawal.index') }}'">회원 탈퇴</button>
                            <button type="button" class="medium-btn" data-attr="{{ route('my-page.member-edit.show', session('member')['MemberId']) }}">회원정보 변경</button>
                        </div>
					</div>
					<div class="account-content">
						<div class="row">
							<div class="col-lg-2">
								<div class="profile-image">
									<a href="#"><img src="{{ asset('/themes/pro/modunawa/resources/images/user.png') }}" alt="user"></a>
								</div>
							</div>
							<div class="col-md-6 col-lg-4">
								<div class="form-group">
									<label class="form-label">이름</label>
									<input class="form-control" type="text" value="{{ $member['C7'] }}" disabled>
								</div>
							</div>
							<div class="col-md-6 col-lg-4">
								<div class="form-group">
									<label class="form-label">이메일</label>
									<input class="form-control" type="email" value="{{ $member['C4'] }}" disabled>
								</div>
							</div>
							@if (empty($member['C5']))
                                <div class="col-lg-2">
                                    <div class="profile-btn">
                                        <a href="{{ route('find-member-pw-verify.index', ['email' => $member['C4']] ) }}">비밀번호 변경</a>
                                    </div>
                                </div>
                            @else
                                <div class="col-lg-2">
                                </div>
                            @endif
                            @if ($member['C12'] === '1')
                                @php
                                    $companyJson = json_decode($member['T1'], true);
                                @endphp
                                <div class="col-lg-2">
                                </div>
                                <div class="col-md-6 col-lg-4">
                                    <div class="form-group">
                                        <label class="form-label">사업자번호</label>
                                        <input class="form-control" type="text" value="{{ $member['C17'] }}" disabled>
                                    </div>
                                </div>
                                <div class="col-md-6 col-lg-4">
                                    <div class="form-group">
                                        <label class="form-label">VAN사 종류</label>
                                        <select class="form-control" disabled>
                                            <option value="">사용중인 카드 단말기 선택</option>
                                            @foreach(['한국정보통신(KICC)', '나이스정보통신', 'KSNET',
                                            '스마트로', 'KIS정보통신', '퍼스트데이타', 'KOVAN', 'JT NET',
                                            '다우데이타', '한국사이버결제(KCP)', 'KOCES', 'SPC', '금융결제원' ] as $title)
                                                <option value="{{ $title }}" {{ $companyJson['Van'] == $title ? "selected" : "" }}>
                                                    {{ $title }}
                                                </option>
                                            @endforeach
                                        </select>
                                    </div>
                                </div>
                            @endif
						</div>
					</div>
				</div>
			</div>
            <div class="col-lg-12">
                <div class="account-card">
                    <div class="account-title">
                        <h4>연락처</h4>
                        <button type="button" class="medium-btn" data-serialize-form="#checkout-form" data-attr="{{ route('contact.index', [ 'seq_no' =>  $listType1Book['Book'][0]['Page'] ? (int)$listType1Book['Book'][0]['Page'][count($listType1Book['Book'][0]['Page']) - 1]['C1'] + 1 : 0 ]) }}">
                            연락처 추가
                        </button>
                    </div>
                    <div class="account-content">
                        <div class="row" id="company-contact-bd-div">
                            @forelse ($listType1Book['Book'][0]['Page'] ?? [] as $contact)
                                <div class="col-md-6 col-lg-4 alert fade show">
                                    <div class="profile-card contact">
                                        <h6>(<span class="sort-txt">{{ DataConverter::execute($contact['C2'], "sort('company-contact-bd')") }}</span>) <span class="ship-contact-txt">{{ $contact['C3'] }}</span></h6>
                                        <p class="ship-mobile-txt">{{ $contact['C4'] }}</p>
                                        <ul>
                                            <li><button type="button" class="edit icofont-edit medium-btn" title="Edit This" data-attr="{{ route('contact.show', $contact['Id']) }}"></button></li>
                                            <li><button type="button" class="trash icofont-ui-delete destroy-btn save-prev-scroll-submits" title="Remove This" data-attr="{{ route('contact.destroy', $contact['Id']) }}"></button></li>
                                        </ul>
                                    </div>
                                </div>
                            @empty
                                <div class="col">
                                    비어있습니다
                                </div>
                            @endforelse
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-12">
                <div class="account-card">
                    <div class="account-title">
                        <h4>배송지</h4>
                        <button type="button" class="medium-btn" data-attr="{{ route('address.index', [ 'seq_no' =>  $listType1Book['Book'][1]['Page'] ? (int)$listType1Book['Book'][1]['Page'][count($listType1Book['Book'][1]['Page']) - 1]['C1'] + 1 : 0 ]) }}">주소 추가</button>
                    </div>
                    <div class="account-content">
                        <div class="row" id="company-destina-bd-div">
                            @forelse ($listType1Book['Book'][1]['Page'] ?? [] as $index => $address)
                                <div class="col-md-6 col-lg-4 alert fade show">
                                    <div class="profile-card address">
                                        <h6 class="sort">{{ DataConverter::execute($address['C2'], "sort('company-destina-bd')") }}</h6>
                                        <p>(<span class="ship-zip-code-txt">{{ $address['C3'] }}</span>) <span class="ship-addr1-txt">{{ $address['C4'] }}</span> <span class="ship-addr2-txt">{{ $address['C5'] }}</span></p>
                                        <ul class="user-action">
                                            <li><button type="button" class="edit icofont-edit medium-btn" title="Edit This" data-attr="{{ route('address.show', $address['Id']) }}"></button></li>
                                            <li><button type="button" class="trash icofont-ui-delete destroy-btn save-prev-scroll-submits" title="Remove This" data-attr="{{ route('address.destroy', $address['Id']) }}"></button></li>
                                        </ul>
                                    </div>
                                </div>
                            @empty
                                <div class="col">
                                    비어있습니다
                                </div>
                            @endforelse
                        </div>
                    </div>
                </div>
            </div>
{{--		<div class="col-lg-12">--}}
{{--			<div class="account-card mb-0">--}}
{{--				<div class="account-title">--}}
{{--					<h4>결제수단</h4>--}}
{{--					<button data-bs-toggle="modal" data-bs-target="#payment-add">카드 추가</button>--}}
{{--				</div>--}}
{{--					<div class="account-content">--}}
{{--						<div class="row">--}}
{{--							<div class="col-md-6 col-lg-4 alert fade show">--}}
{{--								<div class="payment-card payment active">--}}
{{--									<img src="{{ '/themes/pro/modunawa/resources/images/payment/png/msq.png' }}" alt="payment">--}}
{{--									<h4>Current Balance</h4>--}}
{{--									<p>--}}
{{--										<span>35,672</span>--}}
{{--										<span>MSQ</span>--}}
{{--									</p>--}}
{{--									<h5>0x4439e34ade78456793c743b98f3990bd295281f8</h5>--}}
{{--									<button class="trash icofont-ui-delete" title="Remove This" data-bs-dismiss="alert"></button>--}}
{{--								</div>--}}
{{--							</div>--}}
{{--							<div class="col-md-6 col-lg-4 alert fade show">--}}
{{--								<div class="payment-card payment">--}}
{{--									<img src="{{ '/themes/pro/modunawa/resources/images/payment/png/msqx.png' }}" alt="payment">--}}
{{--									<h4>Current Balance</h4>--}}
{{--									<p>--}}
{{--										<span>35,672</span>--}}
{{--										<span>MSQX</span>--}}
{{--									</p>--}}
{{--									<h5>0x4439e34ade78456793c743b98f3990bd295281f8</h5>--}}
{{--									<button class="trash icofont-ui-delete" title="Remove This" data-bs-dismiss="alert"></button>--}}
{{--								</div>--}}
{{--							</div>--}}
{{--							<div class="col-md-6 col-lg-4 alert fade show">--}}
{{--                                <div class="payment-card payment">--}}
{{--									<img src="{{ '/themes/pro/modunawa/resources/images/payment/png/p2u.png' }}" alt="payment">--}}
{{--									<h4>Current Balance</h4>--}}
{{--									<p>--}}
{{--										<span>35,672</span>--}}
{{--										<span>P2U</span>--}}
{{--									</p>--}}
{{--									<h5>0x4439e34ade78456793c743b98f3990bd295281f8</h5>--}}
{{--									<button class="trash icofont-ui-delete" title="Remove This" data-bs-dismiss="alert"></button>--}}
{{--								</div>--}}
{{--							</div>--}}
{{--						</div>--}}
{{--					</div>--}}
{{--                    <div class="account-content">--}}
{{--						<div class="row">--}}
{{--							<div class="col-md-6 col-lg-4 alert fade show">--}}
{{--								<div class="payment-card payment">--}}
{{--									<img src="{{ '/themes/pro/modunawa/resources/images/payment/png/01.png' }}" alt="payment">--}}
{{--									<h4>카드번호</h4>--}}
{{--									<p>--}}
{{--										<span>****</span>--}}
{{--										<span>****</span>--}}
{{--										<span>****</span>--}}
{{--										<sup>1876</sup>--}}
{{--									</p>--}}
{{--									<h5>miron mahmud</h5>--}}
{{--									<button class="trash icofont-ui-delete" title="Remove This" data-bs-dismiss="alert"></button>--}}
{{--								</div>--}}
{{--							</div>--}}
{{--							<div class="col-md-6 col-lg-4 alert fade show">--}}
{{--								<div class="payment-card payment">--}}
{{--									<img src="{{ '/themes/pro/modunawa/resources/images/payment/png/02.png '}}" alt="payment">--}}
{{--									<h4>카드번호</h4>--}}
{{--									<p>--}}
{{--										<span>****</span>--}}
{{--										<span>****</span>--}}
{{--										<span>****</span>--}}
{{--										<sup>1876</sup>--}}
{{--									</p>--}}
{{--									<h5>miron mahmud</h5>--}}
{{--									<button class="trash icofont-ui-delete" title="Remove This" data-bs-dismiss="alert"></button>--}}
{{--								</div>--}}
{{--							</div>--}}
{{--							<div class="col-md-6 col-lg-4 alert fade show">--}}
{{--								<div class="payment-card payment">--}}
{{--									<img src="{{ '/themes/pro/modunawa/resources/images/payment/png/03.png '}}" alt="payment">--}}
{{--									<h4>카드번호</h4>--}}
{{--									<p>--}}
{{--										<span>****</span>--}}
{{--										<span>****</span>--}}
{{--										<span>****</span>--}}
{{--										<sup>1876</sup>--}}
{{--									</p>--}}
{{--									<h5>miron mahmud</h5>--}}
{{--									<button class="trash icofont-ui-delete" title="Remove This" data-bs-dismiss="alert"></button>--}}
{{--								</div>--}}
{{--							</div>--}}
{{--						</div>--}}
{{--					</div>--}}
{{--				</div>--}}
{{--			</div>--}}
		</div>

	</div>
</section>
<!--=====================================
PROFILE PART END
=======================================-->


<!--=====================================
MODAL EDIT FORM START
=======================================-->
<!-- profile edit form -->
{{--<div class="modal fade" id="profile-edit">--}}
{{--	<div class="modal-dialog modal-dialog-centered">--}}
{{--		<div class="modal-content">--}}
{{--			<button class="modal-close" data-bs-dismiss="modal"><i class="icofont-close"></i></button>--}}
{{--			<form class="modal-form">--}}
{{--				<div class="form-title">--}}
{{--					<h3>회원정보 수정</h3>--}}
{{--				</div>--}}
{{--				<div class="form-group">--}}
{{--					<label class="form-label">프로파일 이미지</label>--}}
{{--					<input class="form-control" type="file">--}}
{{--				</div>--}}
{{--				<div class="form-group">--}}
{{--					<label class="form-label">이름</label>--}}
{{--					<input class="form-control" type="text" value="Miron Mahmud">--}}
{{--					</div>--}}
{{--				<div class="form-group">--}}
{{--					<label class="form-label">이메일</label>--}}
{{--					<input class="form-control" type="text" value="mironcoder@gmail.com">--}}
{{--				</div>--}}
{{--				<button class="form-btn" type="submit">저장</button>--}}
{{--			</form>--}}
{{--		</div>--}}
{{--	</div>--}}
{{--</div>--}}
@endsection

@push('modal')
    @include('views.modals.medium')
@endpush
