@extends('include.dashboard')
@section('content')
   <div class="nk-content">
                        <div class="container-fluid">
                            <div class="nk-content-inner">




                                <div class="nk-content-body">
                                    <div class="nk-block-head nk-block-head-sm">
                                        <div class="nk-block-between">
                                            <div class="nk-block-head-content">
                                                <h4 class="nk-block-title page-title">Generated Vouchers</h4>
                                                <div class="nk-block-des text-soft"></div>
                                            </div>

                                        </div>
                                    </div>





                                    <div class="nk-block">
                                        <div class="card card-bordered card-stretch">
                                            <div class="card-inner-group">
                                                <div class="card-inner position-relative card-tools-toggle">
                                                     <div class="card-head"><h5 class="card-title card-title-md">Print <strong> Already Generated</strong> Airtime Voucher</h5></div>
                                                     <div class="card-text"><p>Please note that generating any amount of airtime using our API will result to debiting your deposit wallet</strong> </p></div>

                                                </div>




                                                <div class="card-inner p-0">

                                                    <div class="nk-tb-list nk-tb-ulist table-responsive">


                                                        <div class="nk-tb-item nk-tb-head">
                                                            <div class="nk-tb-col nk-tb-col-check">
                                                                <div class="custom-control custom-control-sm custom-checkbox notext">
                                                                    <input type="checkbox" class="custom-control-input" id="uid" /><label class="custom-control-label" for="uid"></label>
                                                                </div>
                                                            </div>
                                                            <div class="nk-tb-col"><span class="sub-text">Network</span></div>
                                                            <div class="nk-tb-col tb-col-mb"><span class="sub-text">Amount</span></div>
                                                            <div class="nk-tb-col tb-col-mb"><span class="sub-text">Quantity</span></div>

                                                            <div class="nk-tb-col tb-col-mb"><span class="sub-text">Date Generated</span></div>
                                                            <div class="nk-tb-col tb-col-mb"><span class="sub-text">Action</span></div>
                                                            <div class="nk-tb-col nk-tb-col-tools text-right">
                                                                <div class="dropdown">

                                                                </div>
                                                            </div>
                                                        </div>


                                                            @if(count($log) > 0)
                                                         @foreach($log as $k=>$data)

                                                        <div class="nk-tb-item">
                                                            <div class="nk-tb-col nk-tb-col-check">
                                                                <div class="custom-control custom-control-sm custom-checkbox notext">
                                                                    <input type="checkbox" class="custom-control-input" id="uid1" /><label class="custom-control-label" for="uid1"></label>
                                                                </div>
                                                            </div>
                                                            <div class="nk-tb-col">
                                                                <a href="#">
                                                                    <div class="user-card">
                                                                        <div class="user-avatar sm bg-primary"><img src="{{asset(App\Internet::whereName ($data->network)->first()->image ?? '')}} " width="100" alt="Avatar"></div>
                                                                         <div class="user-info">
                                                                            <span class="tb-lead">{{$data->network}} </span>

                                                                        </div>
                                                                    </div>
                                                                </a>
                                                            </div>
                                                            <div class="nk-tb-col tb-col-mb">

                                                            <span class="tb-lead">{{number_format($data->amount, $basic->decimal)}}{{$basic->currency}}<span class="dot dot-success d-md-none ml-1"></span></span>


                                                            </div>
                                                            <div class="nk-tb-col tb-col-mb"><span>{{$data->quantity}}</span></div>

                                                            <div class="nk-tb-col tb-col-mb"><span>{{$data->created_at}}</span></div>
                                                            <div class="nk-tb-col tb-col-mb">
                                                                <a href="{{route('reprintvouchernow',$data->trx)}}" class="btn btn-info btn-sm">Print</a>
                                                            </div>
                                                            <div class="nk-tb-col nk-tb-col-tools">

                                                            </div>
                                                        </div>

@endforeach
@else
<div class="example-alert">
                                                            <div class="alert alert-warning alert-icon">
                                                                <em class="icon ni ni-alert-circle"></em> <strong>Empty!</strong></div>
                                                        </div>
@endif


                                                    </div>
                                                </div>





                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                            </div>

@stop
