@include('layout.header')

<div class="profile_container">
    <div class="d-flex justify-content-between">
        <div class="d-flex gap-2">
            <div>
                <img class="profile_avatar" src="{{ asset('assets/img/personcenter_cur.png') }}" alt="" />
            </div>
            <div class="text-white f14">
                ID {{ $user->id }}
                <br />
                <span class="border-bottom border-primary">
                    Mobile +91{{ $user->mobile }}
                </span>
                <br />
            </div>
        </div>
        <div>
            <div data-bs-toggle="modal" data-bs-target="#exampleModal2" class="bell pointer">
                <img src="{{ asset('assets/img/bell.png') }}" />
            </div>
        </div>
    </div>
    <div class="col-12 mt-4 text-white text-center">
        <div class="row d-flex justify-content-center">
            <div class="col-4">
                ₹ {{ $user->amount }}
                <br>
                Balance
                <br>
                <button class="rounded-0 btn mt-2 f14 shadow-sm btn-sm btn-primary">
                    <a class="text-white text-decoration-none" href="{{ url('/user/recharge') }}">
                        Recharge
                    </a>
                </button>
            </div>
            <div class="col-4">
                @if ($user->latestInterest != null)
                    ₹ {{ $user->latestInterest->interest }}
                    <br>
                    Interest
                @else
                    ₹ 0
                    <br>
                    Interest
                @endif
            </div>
            <div class="col-4">
                ₹ {{ user_bonus_from_recharge() }}
                <br>
                Commission
                <br>
                <button class="rounded-0 btn mt-2 f14 shadow-sm btn-sm btn-primary">
                    <a class="text-white text-decoration-none" href="{{ url('/user/promotion') }}">
                        See
                    </a>
                </button>
            </div>
        </div>
    </div>
    <br />
</div>
<!-- PROFILE -->

<!-- PROFILE BODY -->
@include('userDashboard.layout.sidebar')
<!-- PROFILE BODY -->

<!-- The actual snackbar -->

<!-- MODAL -->
<div class="modal fade modal_ signin" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="wrapper p-4">
                <p class="tz_title">Sign In</p>
                @php
                    $sign_in = if_signed_in();
                @endphp
                <div class="signinInfo">
                    <p class="signinfo">Total：{{ $sign_in['total_days'] }} Days</p>
                    <p class="signinfo" id="today_rebate">Today Rebates：₹ {{ $sign_in['today_rebate'] }}</p>
                    <p class="signinfo" id="total_rebates">Total Rebates：₹ {{ $sign_in['total_rebates'] }}</p>
                    @if ($sign_in['status'])
                        <p class="signinfo" id="sign_in_status">Status：Had signed in</p>
                    @else
                        <p class="signinfo">Not signed in</p>
                    @endif
                </div>
                <div class="d-flex justify-content-end tz_close gap-3 mt-4">
                    <button data-bs-dismiss="modal" class="bg-transparent border-0 fw500"
                        style="color: rgb(136, 136, 136)">
                        CANCEL</button>
                    <button class="text-primary border-0 fw500 bg-transparent" onclick="get_sign_in()">
                        SIGN IN
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- MODAL -->
<div class="modal fade modal_ signin" id="exampleModal3" tabindex="-1" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="wrapper p-4">
                <p class="tz_title">Confirm</p>
                <div class="signinInfo">
                    <p class="signinfo">Do you want to logout?</p>
                    <!---->
                </div>
                <div class="d-flex justify-content-end tz_close gap-3 mt-4">
                    <button data-bs-dismiss="modal" class="bg-transparent border-0 fw500">
                        CLOSE
                    </button>
                    <a href="{{ url('/user/logout') }}" class="bg-transparent border-0 fw500 text-primary">
                        YES
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- MODAL -->
<div class="modal fade modal_ signin" id="exampleModal2" tabindex="-1" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="wrapper p-4">
                <p class="tz_title">Notice</p>
                <div class="signinInfo">
                    <p class="signinfo">{{ $website->notification }}</p>
                    <!---->
                </div>
                <div class="d-flex justify-content-end tz_close gap-3 mt-4">
                    <button data-bs-dismiss="modal" class="bg-transparent border-0 fw500 text-primary">
                        CLOSE
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>

@include('layout.footer')
