hjkhghtjhjjhjhjhjhjjhjhjjhrrtrtoirh
bnmbertsurrttrtrtrtrjhjhjjhjhhjhjhjhf'tdfg
/
home
/
u506006416
/
public_html
/
public_html
/
travelsangi
/
resources
/
views
/
admin
/
products
/
Upload FileeE
HOME
@extends("layouts.admin_app") @section("pageTitle",' Products List') @section('MainContent') <div class="d-sm-flex align-items-center justify-content-between mb-4"> <h1 class="h3 mb-0 text-gray-800">Products</h1> <a href="{{route('products.create')}}" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"> <i class="fas fa-plus fa-sm text-white-50"></i> Create Products </a> </div> <div class="row"> <div class="card shadow mb-4" style="width: 100%;"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">All Products</h6> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Id</th> <th>Product Name</th> <th>Sub Category </th> <th>Category </th> <th>Image</th> <th>Status</th> <th>Show on Menu</th> <th>Action</th> </tr> </thead> <tbody> @foreach($product as $key=>$value) <tr> <td>{{$key+1}}</td> <td>{{$value->title}}</td> <td><b>{{$value->subCattitle}}</b></td> <td><b>{{$value->cattitle}}</b></td> <td>@if($value->image)<img id="imagesrc" src="{{asset('image/product/'.$value->image)}}" style="height:60px;width:60px;border-radius:50px"> @else <img id="imagesrc" src="{{asset('image/dymmy.jpg')}}" style="height:60px;width:60px;border-radius:50px"> @endif </td> <td><label class="switch" onclick="ChangeStatus({{$value->status}},{{$value->id}},'status')"> <input type="checkbox" @if(isset($value->status)) @if($value->status == 1) checked @endif @endif> <span class="slider round"></span> </label> </td> <td><label class="switch" onclick="ChangeStatus({{$value->onMenu}},{{$value->id}},'menu')"> <input type="checkbox" @if(isset($value->onMenu)) @if($value->onMenu == 1) checked @endif @endif> <span class="slider round"></span> </label> </td> <td> <a data-toggle="tooltip" data-placement="top" title="Edit Product Details" href="{{route('products.edit',$value->id)}}" class="btn btn-sm btn-outline-primary btn-icon"><i class="fa fa-edit"></i></a> <a data-toggle="tooltip" data-placement="top" title="View Product Details" href="{{ route('products.show',$value->id) }}" class="btn btn-sm btn-outline-info btn-icon"><i class="fa fa-eye"></i></a> <a onclick="ChangeStatus({{$value->status}},{{$value->id}},'trash')" data-toggle="tooltip" data-placement="top" title="Delete Product" href="javascript:void('0')" class="btn btn-sm btn-outline-danger btn-icon"><i class="fa fa-trash" ></i></a> </td> </tr> @endforeach </tbody> </table> </div> </div> </div> </div> @endsection @section('MainCss') @endsection @section('MainJS') <script> $(document).ready(function() { $('#dataTable').DataTable(); }); </script> <script type="text/javascript"> function ChangeStatus(currentStatus,SubCatId,statusType){ var url = "{{ route('products.show', ':id') }}?update="+statusType+"¤tStatus="+currentStatus; url = url.replace(':id', SubCatId); window.location.href=url; } </script> @endsection