@extends('member.layout.main')
@section('content')
<div class="row">
    <div class="col-lg-12" style="padding-left: 4px;padding-right: 4px;">
        <div class="card m-b-30" style="border-radius: 5px;">
            <div class="card-header">
                <h5 class="card-title" style="font-weight: bold; padding-top: 15px; font-size: 20px;">Orders List</h5>
            </div>
            <div class="card-body">
            <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: 150px;">Issue Date</th>
                                <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Type</th>
                                <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 90px;">Amount</th>
                                <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 90px;">Paid</th>
                                <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 90px;">Due</th>
                                <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Status</th>
                                <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $no=1; ?>
                            @foreach($orders as $ord)
                            <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;">{{$ord->created_at}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #fff;">{{$ord->type}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #5ce9ae;">{{$ord->grand_total}}</td>   
                                @if($ord->payment_status == 'Paid')
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #71ebff;">{{$ord->sub_total}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #ff6262;">{{$ord->grand_total-$ord->sub_total}}</td>
                                @else
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #ff6262;">0</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #ff6262;">{{$ord->grand_total}}</td>
                                @endif
                                @if($ord->status == 0)
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: red;">Pending</td>
                                @else
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: blue;">Complete</td>
                                @endif

                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #fff !important;">
                                    <a target="_blank" href="{{url('invoice'.$ord->id)}}"><button class="btn btn-sm btn-danger" style="height: 20px; font-size:10px;border-radius: 20px;line-height: 12px;background: #d5980f;border: 1px solid #1e0429;">Invoice</button></a> 
                                </td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!-- End col -->
   
</div>
@endsection