<?php
if (Auth('admin')->User()->dashboard_style == 'light') {
    $text = 'dark';
} else {
    $text = 'light';
}
?>
@extends('layouts.app')
@section('content')
    @include('admin.topmenu')
    @include('admin.sidebar')
    <div class="main-panel">
        <div class="content ">
            <div class="page-inner">
                <div class="mt-2 mb-4">
                    <h1 class="title1 ">All Applications</h1>
                </div>
                <x-danger-alert />

                @if (session('success'))
                    <div class="alert alert-success">
                        {{ session('success') }}
                    </div>
                @endif

                <div class="mb-5 row">
                    <div class="col card p-3 shadow ">
                        <div class="bs-example widget-shadow table-responsive" data-example-id="hoverable-table">
                            <span style="margin:3px;">
                                <table id="ShipTable" class="table table-hover ">
                                    <thead>
                                        <tr>
                                            <th>Client name</th>
                                            <th>Email</th>
                                            <th>Phone</th>
                                            <th>Loan Amount</th>
                                            <th>Income</th>
                                            <th>Country</th>

                                            <th>Date created</th>
                                            <th>Option</th>
                                            <th>Delete</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @foreach ($withdrawals as $deposit)
                                            <tr>

                                                <td>{{ $deposit->yourname }}</td>
                                                <td>{{ $deposit->email }}</td>
                                                <td>{{ $deposit->phonnumber }}</td>
                                                <td>${{ $deposit->loanamount }}</td>
                                                <td>{{ $deposit->income }}
                                                </td>
                                                <td>{{ $deposit->country }}
                                                </td>

                                                <td>{{ \Carbon\Carbon::parse($deposit->created_at)->toDayDateTimeString() }}
                                                </td>
                                                <td>
                                                    <a href="{{ route('ViewApplication', $deposit->id) }}"
                                                        class="m-1 btn btn-info btn-sm"><i class="fa fa-eye"></i> View</a>
                                                </td>


                                                <td>
                                                    <a href="{{ route('deleteApplication', $deposit->id) }}"
                                                        class="m-1 btn btn-danger btn-sm">Delete</a>
                                                </td>
                                            </tr>
                                        @endforeach
                                    </tbody>
                                </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    @endsection
