Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
- @include('layouts.head')
- <body>
- @include('inc.navbar')
- <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4"></br>
- @include('inc.messages')
- <div class="limiter">
- <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
- <h1 class="h2">Products</h1>
- </div>
- </br>
- <div class="container">
- <div class="card">
- <div class="card-header">
- <div class="btn-toolbar justify-content-between">
- <h3>List of Products</h3>
- <form class="form-inline active-cyan-4" action="{{ action('ProductsController@search') }}">
- <input id="search" name="search" class="form-control form-control-sm mr-3 w-35" type="text" placeholder="Search"
- aria-label="Search">
- <button type="submit" class="btn btn-success">
- <i class="fas fa-search" aria-hidden="true"></i>
- </button>
- </form>
- </div>
- </div>
- <div class="card-body">
- @if($product!=null)
- <table class="table table-bordered table-hover ">
- <thead>
- <tr>
- <th scope="col" class="text-center"><i class="fas fa-list"></i></th>
- <th scope="col" class="text-center">Suppliers</th>
- <th scope="col" class="text-center">Category</th>
- <th scope="col" class="text-center">Model</th>
- <th scope="col" class="text-center">Products</th>
- <th scope="col" class="text-center">Quantity</th>
- <th scope="col" class="text-center">Price</th>
- <th scope="col" class="text-center"><i class="fas fa-user-cog"></i> Settings</th>
- </tr>
- </thead>
- @foreach($product as $products)
- <tbody>
- <tr>
- <td scope="row" class="text-center">{{ (($product->currentPage() - 1 ) * $product->perPage() ) + $loop->iteration}}</td>
- <td scope="row" class="text-center">{{$products->suppliers['company_name']}}</td>
- <td scope="row" class="text-center">{{$products->category['category']}}</td>
- @if($products->model !== null)<td scope="row" class="text-center">{{$products->model}}</td>@else<td scope="row" class="text-center">Unknown</td>@endif
- <td scope="row" class="text-center">{{$products->products_name}}</td>
- @if($products->quantity <= 20)<td class="text-center" bgcolor="#FF0000">{{$products->quantity}}</td>
- @elseif($products->quantity <= 49)<td class="text-center" bgcolor="#FFFF00">{{$products->quantity}}</td>
- @elseif($products->quantity >= 50)<td class="text-center" bgcolor="#00FF00">{{$products->quantity}}</td>
- @endif
- <td class="text-center">RM {{ number_format($products->unit_price, 2, '.', ',') }}</td>
- <td class="text-center">
- <div class="btn-group mr-2">
- <button class="btn btn-sm btn-secondary"><a href="/products/edit/{{$products->id}}" style="color:white"><i class="fas fa-edit" style="color:white"></i></a></button>
- </div>
- <div class="btn-group mr-2">
- <button class="btn btn-sm btn-danger" data-toggle="modal" data-target="#exampleModal" ><i class="fas fa-trash-alt" style="color:white"></i></button>
- <!-- Modal -->
- <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="exampleModalLabel">Delete Suppliers</h5>
- <button type="submit" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- Are you sure want to delete the product?
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary" data-dismiss="modal">No</button>
- <form action="{{ action('ProductsController@destroy', $products->id) }}" method="POST">
- @csrf
- @method('DELETE')
- <button class="btn btn-danger" type="submit">Yes</button>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </tbody>
- @endforeach
- </table>
- <div class="btn-group mr-2">
- {{ $product->links() }}
- </div>
- <div class="btn-group mr-2">
- <button class="btn btn-sm btn-success"><a href="/products/add" style="color:white"><i class="fas fa-plus style="color:white"></i> New Product</a></button>
- </div>
- @else
- <h5>You have no Products</h5></br>
- <div class="btn-group mr-2">
- <button class="btn btn-sm btn-success"><a href="/products/add" style="color:white"><i class="fas fa-plus style="color:white"></i> New Product</a></button>
- </div>
- @endif
- </div>
- </div>
- </div>
- </div>
- </main>
- </br>
- @include('layouts.footer')
- @include('layouts.script')
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement