Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 5.75 KB | None | 0 0
  1.      <div class="card-body">
  2.                  @if(count($products) > 0)
  3.                 <table class="table table-bordered table-hover ">
  4.                  
  5.                   <thead>
  6.                       <tr>
  7.                         <th scope="col" class="text-center"><i class="fas fa-list"></i></th>
  8.                         <th scope="col" class="text-center">Suppliers</th>
  9.                         <th scope="col" class="text-center">Category</th>
  10.                         <th scope="col" class="text-center">Model</th>                        
  11.                         <th scope="col" class="text-center">Products</th>
  12.                         <th scope="col" class="text-center">Quantity</th>
  13.                         <th scope="col" class="text-center">Price</th>
  14.                         <th scope="col" class="text-center"><i class="fas fa-user-cog"></i> Settings</th>  
  15.                        
  16.                       </tr>
  17.                     </thead>
  18.                     @foreach($products as $product)
  19.                     <tbody>
  20.                       <tr>
  21.                         <td scope="row" class="text-center">{{ (($products->currentPage() - 1 ) * $products->perPage() ) + $loop->iteration}}</td>
  22.                         <td scope="row" class="text-center">{{$product->suppliers['company_name']}}</td>
  23.                         <td scope="row" class="text-center">{{$product->category['category']}}</td>
  24.                         @if($product->model !== null)<td scope="row" class="text-center">{{$product->model}}</td>@else<td scope="row" class="text-center">Unknown</td>@endif                        
  25.                         <td scope="row" class="text-center">{{$product->products_name}}</td>
  26.                         @if($product->quantity <= 20)<td class="text-center" bgcolor="#FF0000">{{$product->quantity}}</td>
  27.                         @elseif($product->quantity <= 49)<td class="text-center" bgcolor="#FFFF00">{{$product->quantity}}</td>
  28.                         @elseif($product->quantity >= 50)<td class="text-center" bgcolor="#00FF00">{{$product->quantity}}</td>
  29.                         @endif
  30.                         <td class="text-center">RM {{ number_format($product->unit_price, 2, '.', ',') }}</td>
  31.                         <td class="text-center">
  32.                             <div class="btn-group mr-2">
  33.                             <button class="btn btn-sm btn-secondary"><a href="/products/edit/{{$product->id}}" style="color:white"><i class="fas fa-edit" style="color:white"></i></a></button>
  34.                             </div>
  35.                             <div class="btn-group mr-2">
  36.                               <button class="btn btn-sm btn-danger" data-toggle="modal" data-target="#exampleModal" ><i class="fas fa-trash-alt" style="color:white"></i></button>
  37.                                
  38.                                
  39.                                
  40.                               <!-- Modal -->
  41.                               <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  42.                                 <div class="modal-dialog" role="document">
  43.                                   <div class="modal-content">
  44.                                     <div class="modal-header">
  45.                                       <h5 class="modal-title" id="exampleModalLabel">Delete Suppliers</h5>
  46.                                       <button type="submit" class="close" data-dismiss="modal" aria-label="Close">
  47.                                         <span aria-hidden="true">&times;</span>
  48.                                       </button>
  49.                                     </div>
  50.                                     <div class="modal-body">
  51.                                    Are you sure want to delete the product?
  52.                                     </div>
  53.                                     <div class="modal-footer">
  54.                                         <button type="button" class="btn btn-secondary" data-dismiss="modal">No</button>
  55.                                       <form action="{{ action('ProductsController@destroy', $product->id) }}" method="POST">
  56.                                   @csrf
  57.                                   @method('DELETE')
  58.                                   <button class="btn btn-danger" type="submit">Yes</button>
  59.                                 </form>            
  60.                                     </div>
  61.                                   </div>
  62.                                 </div>
  63.                               </div>        
  64.                         </div>                            
  65.                             </div>              
  66.                         </td>
  67.                        
  68.                          
  69.                       </tr>
  70.                   </tbody>
  71.                   @endforeach      
  72.                 </table>
  73.                 <div class="btn-group mr-2">
  74.                         {{-- {{ (($products->currentPage() - 1 ) * $products->perPage() ) + $loop->iteration }} --}}
  75.                         {{ $products->links() }}
  76.                         </div>
  77.                         <div class="btn-group mr-2">
  78.                             <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>  
  79.                         </div>
  80.                 @else                        
  81.                 <h5>You have no Products</h5></br>
  82.                 <div class="btn-group mr-2">
  83.                   <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>  
  84.               </div>                  
  85.                 @endif  
  86.               </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement