@extends('master')
@section('body')

<!-- Dashboard Section -->
<div class="container py-5">
    <div class="row g-4">
        
        <!-- Profile + Payment -->
        <form action='{{route("payment")}}' method="post" onsubmit="return validatePayment()">
            @csrf
            <div class="col-12">
                <div class="card card-custom p-4">
                    <div class="row align-items-center">
                        <div class="col-md-8 d-flex align-items-center gap-4">
                            <div class="avatar-circle"><i class="fa-solid fa-user"></i></div>
                            <div>
                                <h5 class="mb-0">{{ Session::get('reseller_name') }}</h5>
                                <div class="text-muted small">Email: {{ $reseller->Email}}</div>
                                <div class="text-muted small">User Name: {{ $reseller->UserName}}</div>
                                <div class="text-muted small">Location: {{$reseller->Address}}</div>
                                <div class="text-muted small">Phone: {{$reseller->MobileNo}}</div>
                                @if($reseller->Status == 1)
                                <span class="badge bg-success mt-2">Active</span>
                                @elseif($reseller->Status == 2)
                                <span class="badge bg-success mt-2">Active</span>
                                @elseif($reseller->Status == 0)
                                <span class="badge bg-danger mt-2">Inactive</span>
                                @endif
                            </div>
                        </div>
                        <div class="col-md-4 text-end">
                            <div class="d-flex justify-content-end align-items-center gap-2 mb-2">
                                <img src="https://download.logo.wine/logo/BKash/BKash-Logo.wine.png" class="bkash-logo" alt="bKash">
                                <span class="fw-semibold text-danger">Payment</span>
                            </div>
                            
                                <h5 class="mb-2">Bill Amount:</h5>
                                <input type="number" class="my-3 border-1" style="width: 100px;" id="amount" name="amount" value="0"><br>
                                    <input type="hidden" name="customer_id" value="{{$reseller->UserId}}">
                                    <button class="btn btn-success btn-pay">Pay Now</button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <!-- Notice -->
        <div class="col-12">
            <h5 class="section-title">Notice</h5>
            @if(Session::has('wrong'))
            <div class="alert alert-danger" role="alert">
                <p class="mb-0"> {{ Session::get('wrong') }}</p>
            </div>
            @elseif(Session::has('success'))
            <div class="alert alert-success" role="alert">
                <p class="mb-0">{{ Session::get('success') }}</p>
            </div>
            @endif
        </div>
    </div>
</div>
<div class="container py-5">
    <div class="row g-4">
        <!-- Profile + Payment -->
        <div class="col-12">
            <div class="card card-custom p-4">
                <div class="row align-items-center">
                    <table class="table">
                        <thead>
                            <tr>
                                <th scope="col">#</th>
                                <th scope="col">Date</th>
                                <th scope="col">Description</th>
                                <th scope="col">Amount</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach($accountStatement as $statement)
                            <tr>
                                <th scope="row">{{$loop->iteration}}</th>
                                <td>{{$statement->date}}</td>
                                <td>{{$statement->description}}</td>
                                <td>{{$statement->amount}}</td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection