@extends('layouts.members')


@section('content')
    <div class="ontainer">
        <div class="card card-primary">
            <aside class="panel panel-default">
                @include('includes.flash')
                <div class="panel-heading">
                    <a href="{{route('member_new_brand')}}" class="btn btn-raised btn-primary">New Brand</a>
                    <hr/>
                    <h3 class="text-center">All Brands</h3>
                </div>

                <div class="panel-body">
                    <table id="dataTables" class="display table-responsive table-stripped" width="100%" cellspacing="0">
                        <thead>
                        <tr>
                            <th>S/N</th>
                            <th>Name</th>
                            <th>Brand</th>
                            <th>Logo</th>
                        </thead>
                        <tbody>
                        <?php $i = 0; ?>
                        @foreach($brands as $brand)
                            <tr>
                                <td><?= ++$i; ?></td>
                                <td>{!!$brand->name!!}</td>
                                <td>
                                    <img src="{{asset('assets/img/brandThumbs/'.$brand->logo)}}" alt=""logos style="max-width:100px;" class="responsive thumbnail">
                                </td>
                                <td>
                                    <div class="btn-group">
                                        <button type="button" class="btn btn-primary btn-raised">Action</button>
                                        <button type="button" class="btn btn-primary btn-raised dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                            <i class="zmdi zmdi-chevron-down right only"></i>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-primary">
                                            <li class="">
                                                <a href="{{route('member_brand_edit', $brand->id)}}">Edit</a>
                                            </li>
                                            <li>
                                                <a href="{{route('member_brand_delete', $brand->id)}}" id="delete-btn" onclick="return confirm('Are you sure you want to delete the brand?')" data-action="{{'/product/'.$brand->id.'/delete'}}">Delete</a>
                                            </li>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        @endforeach

                        </tbody>
                    </table>
                </div>

                <div class="panel-footer"></div>
            </aside>
        </div>
    </div>

@endsection