@extends('vendor.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;">Pending Orders</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="color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Customer Name</th>
                                <th style="color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Customer Mobile</th>
                                <th style="color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Shop Name</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;">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: #000;">{{$no++}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: #000;">{{$ord->created_at}}</td>
                                
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;color: #000;">{{$ord->cus_name}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;color: #000;">{{$ord->cus_mobile}}</td>

                                <?php $shop = DB::table('shops')->where('id', $ord->shop_id)->first(); ?>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;color: #000;">{{$shop->name}}</td>

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

                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: red;">Pending</td>

                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: #fff !important;">
                                    <a href="{{url('vendor/invoice/'.$ord->id)}}"><button class="btn btn-sm btn-danger" style="height: 24px; margin-bottom: 2px; font-size:10px;border-radius: 20px;line-height: 12px;background: #2d3235;border: 1px solid #1e0429;">Invoice</button></a> 

                                    <a href="{{url('vendor/ordmng/'.$ord->id)}}"><button class="btn btn-sm btn-danger" style="height: 24px; margin-bottom: 2px; font-size:10px;border-radius: 20px;line-height: 12px;background: #2d3235;border: 1px solid #1e0429;">Manage</button></a> 
                                </td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
   
</div>
@endsection