Advertisement
Guest User

Products.blade.php

a guest
Aug 23rd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 6.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
  3.  
  4.   @include('layouts.head')
  5. <body>
  6. @include('inc.navbar')
  7.  
  8.  
  9. <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4"></br>
  10.     @include('inc.messages')
  11. <div class="limiter">
  12.  
  13. <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
  14.     <h1 class="h2">Products</h1>
  15. </div>
  16. </br>
  17. <div class="container">
  18.         <div class="card">
  19.  
  20.           <div class="card-header">
  21.               <div class="btn-toolbar justify-content-between">
  22.                 <h3>List of Products</h3>            
  23.                
  24.                 <form class="form-inline active-cyan-4" action="{{ action('ProductsController@search') }}">
  25.                     <input id="search" name="search" class="form-control form-control-sm mr-3 w-35" type="text" placeholder="Search"
  26.                      aria-label="Search">
  27.                       <button type="submit" class="btn btn-success">
  28.                     <i class="fas fa-search" aria-hidden="true"></i>
  29.                       </button>
  30.                   </form>
  31.                 </div>
  32.               </div>
  33.  
  34.               <div class="card-body">
  35.                 @if($product!=null)
  36.                 <table class="table table-bordered table-hover ">
  37.                  
  38.                   <thead>
  39.                       <tr>
  40.                         <th scope="col" class="text-center"><i class="fas fa-list"></i></th>
  41.                         <th scope="col" class="text-center">Suppliers</th>
  42.                         <th scope="col" class="text-center">Category</th>
  43.                         <th scope="col" class="text-center">Model</th>                        
  44.                         <th scope="col" class="text-center">Products</th>
  45.                         <th scope="col" class="text-center">Quantity</th>
  46.                         <th scope="col" class="text-center">Price</th>
  47.                         <th scope="col" class="text-center"><i class="fas fa-user-cog"></i> Settings</th>  
  48.                        
  49.                       </tr>
  50.                     </thead>
  51.                     @foreach($product as $products)
  52.                     <tbody>
  53.                       <tr>
  54.                         <td scope="row" class="text-center">{{ (($product->currentPage() - 1 ) * $product->perPage() ) + $loop->iteration}}</td>
  55.                         <td scope="row" class="text-center">{{$products->suppliers['company_name']}}</td>
  56.                         <td scope="row" class="text-center">{{$products->category['category']}}</td>
  57.                         @if($products->model !== null)<td scope="row" class="text-center">{{$products->model}}</td>@else<td scope="row" class="text-center">Unknown</td>@endif                        
  58.                         <td scope="row" class="text-center">{{$products->products_name}}</td>
  59.                         @if($products->quantity <= 20)<td class="text-center" bgcolor="#FF0000">{{$products->quantity}}</td>
  60.                         @elseif($products->quantity <= 49)<td class="text-center" bgcolor="#FFFF00">{{$products->quantity}}</td>
  61.                         @elseif($products->quantity >= 50)<td class="text-center" bgcolor="#00FF00">{{$products->quantity}}</td>
  62.                         @endif
  63.                         <td class="text-center">RM {{ number_format($products->unit_price, 2, '.', ',') }}</td>
  64.                         <td class="text-center">
  65.                             <div class="btn-group mr-2">
  66.                             <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>
  67.                             </div>
  68.                             <div class="btn-group mr-2">
  69.                               <button class="btn btn-sm btn-danger" data-toggle="modal" data-target="#exampleModal" ><i class="fas fa-trash-alt" style="color:white"></i></button>
  70.                                
  71.                                
  72.                                
  73.                               <!-- Modal -->
  74.                               <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  75.                                 <div class="modal-dialog" role="document">
  76.                                   <div class="modal-content">
  77.                                     <div class="modal-header">
  78.                                       <h5 class="modal-title" id="exampleModalLabel">Delete Suppliers</h5>
  79.                                       <button type="submit" class="close" data-dismiss="modal" aria-label="Close">
  80.                                         <span aria-hidden="true">&times;</span>
  81.                                       </button>
  82.                                     </div>
  83.                                     <div class="modal-body">
  84.                                    Are you sure want to delete the product?
  85.                                     </div>
  86.                                     <div class="modal-footer">
  87.                                         <button type="button" class="btn btn-secondary" data-dismiss="modal">No</button>
  88.                                       <form action="{{ action('ProductsController@destroy', $products->id) }}" method="POST">
  89.                                   @csrf
  90.                                   @method('DELETE')
  91.                                   <button class="btn btn-danger" type="submit">Yes</button>
  92.                                 </form>            
  93.                                     </div>
  94.                                   </div>
  95.                                 </div>
  96.                               </div>        
  97.                         </div>                            
  98.                             </div>              
  99.                         </td>
  100.                        
  101.                          
  102.                       </tr>
  103.                   </tbody>
  104.                   @endforeach      
  105.                 </table>
  106.                 <div class="btn-group mr-2">
  107.                        
  108.                         {{ $product->links() }}
  109.                         </div>
  110.                         <div class="btn-group mr-2">
  111.                             <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>  
  112.                         </div>
  113.                 @else                        
  114.                 <h5>You have no Products</h5></br>
  115.                 <div class="btn-group mr-2">
  116.                   <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>  
  117.               </div>                  
  118.                 @endif  
  119.               </div>
  120.             </div>          
  121. </div>
  122. </div>
  123. </main>
  124. </br>
  125. @include('layouts.footer')
  126. @include('layouts.script')
  127.  </body>
  128. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement