@extends('admin.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;">Vendor Shops</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;">Shop Name</th>
                                <th style="color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Category</th>

                                <th style="color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Vendor</th>
                                <th style="color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Location</th>

                                <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Logo</th>
                                <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;min-width: 90px;">Items</th>
                                <th style="text-align: center; color: #fff;padding-top: 3px;padding-bottom: 3px;font-size: 13px;">Sales</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($shops as $vs)
                            <tr>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: azure;">{{$no++}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: azure;">{{$vs->name}}</td>
                                <?php $cat = DB::table('categories')->where('id', $vs->cat_id)->first(); $vend = DB::table('vendors')->where('id', $vs->vendor_id)->first(); ?>

                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: azure;">{{$cat->cat_name}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: azure;">{{$vend->username}}</td>
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px; color: azure;">{{$vs->location}}</td>

                                
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: azure;">
                                    <img style="width: 30px;height:auto" src="{{URL::to($vs->logo)}}">
                                </td>
                                
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: azure;">{{$vs->item}}</td>

                         
                                <td style="padding-top: 3px;padding-bottom: 3px;font-size: 13px;text-align: center; color: blue;">{{$vs->sales}}</td>

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