@extends('layouts.admin')
@section('content')

<div class="card-header">
    <h4>Manage Accepted Withdraw Request </h4>
    <a class="btn btn-primary float-right" href="{{ SITEURL }}admin/withdrawrequest">Withdraw Request</a>
</div>
<div class="card-body">
    @if (Session::has('sucmessage'))
        <div class="alert alert-success alert-dismissible show fade">
            <div class="alert-body">
                <button class="close" data-dismiss="alert">
                    <span>&times;</span>
                </button>
                {{ Session::get('sucmessage') }}
            </div>
        </div>
    @endif

    @if (Session::has('message'))
        <div class="alert alert-danger alert-dismissible show fade">
            <div class="alert-body">
                <button class="close" data-dismiss="alert">
                    <span>&times;</span>
                </button>
                {{ Session::get('message') }}
            </div>
        </div>
    @endif

    <div class="table-responsive">
        <div class="table-responsive">
            <table class="table table-striped table-hover" id="tableExport" style="width:100%;">
                <thead>
                    <tr>
                        <th>S.No.</th>
                        <th>User Name</th>
                        <th>Withdraw Amount</th>
                        <th>Payment Method</th>
                        <th>UPI Number</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach ($wallethistory as $institutegroupsdata)
                    <tr>
                        <td>{{ $loop->iteration }}</td>
                        <td>{{ $institutegroupsdata->username }}</td>
                        <td>&#8377;{{ number_format((float) $institutegroupsdata->withdrawamt, 2) }}</td>
                        <td>{{ $institutegroupsdata->paymenttype }}</td>
                        <td>{{ $institutegroupsdata->mobilenumber }}</td>
                        <td>
                            <a class="btn btn-danger deletedata" data-toggle="tooltip" data-placement="top" title="Cancelled Request" href="{{ route('admin.changewithdrawstatus', ['id' => $institutegroupsdata->id, 'status' => 3]) }}">
                                <i class='fas fa-times'></i>
                            </a>
                        </td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>
<script>
jQuery(document).ready(function($) {
    $(".deletedata").click(function(){
        if(confirm("Are you sure you want to unapproved this?")){
            return true;
        }

        return false;
    });
});
</script>
@endsection
