@extends('admin.layout.main')
@section('content')
<div class="row">
    <div class="col-12" >
        <div class="card border m-b-20" style="border-radius: 5px;">
            <div class="card-body" style="padding-top: 5px;padding-bottom: 5px;">
                <div class="row align-items-center">
                    <div class="col-12">
                        <h5 style="font-weight:bold;color: #7bedff;margin-top: 1rem!important;margin-bottom: 25px;font-size: 22px;">Cashback Status</h5> 
                    </div>
                </div>
                <div class="row align-items-center">
                    <div class="col-12">
                        <div class="table-responsive">
                            <table id="datatable" class="display table table-striped table-bordered" style="width: 100%;">
                                <thead style="background: #1f3740;">
                                    <tr>
                                        <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">No.</th>
                                        <th style="color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 120px;">Buy Date</th>
                                        <th style="color: #fff;text-align: center;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 100px;">Username</th>
                                        <th style="color: #fff;text-align: center;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 100px;">Point</th>
                                        <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 100px;">Profit Left</th>
                                        <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 100px;">Unpaid Profit</th>
                                        <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 100px;">Paid Profit</th>
                                        <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Status</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $no=1; ?>
                                    @foreach($cbacks as $pk)
                                    <tr>
                                        <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #fff;">{{$no++}}</td>
                                        <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: #fff;">{{ date_format(date_create($pk->created_at), 'd M Y') }}</td>
                                        <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: #fff;text-align: center;">{{$pk->username}}</td>
                                        <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: #fff;text-align: center;">{{$pk->amount}}</td>
                                        <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #fff;">{{$pk->pleft}}</td>                                
                                        <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #fff;">{{$pk->uppro}}</td>

                                        <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #fff;">{{$pk->ppro}}</td>

                                        @if($pk->status == 0)
                                        <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #7af6ff;">Active</td>
                                        @else
                                        <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #8eff24;">Complete</td>
                                        @endif
                                    </tr>
                                    @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

@endsection