Does anyone knows about Laravel inventory management system? I am sharing one link of video. Please check
https://youtu.be/1rOVrp2HgWA?si=qxOdMSGnKiBpOhza.
In this link when you move forward at time 10 minutes, he approves products. I do not know how to do that. Can anyone tell me please. The thing which I understand that he is not passing any ID and use jquery.
What I have tried:
This is my listing:
@extends('layouts.home')
@section('content')
<div class="content-wrapper">
<div class="card">
<div class="card-header">
<h3 class="card-title">DataTable with default features</h3>
</div>
<!--
<div class="card-body">
<div class="table-responsive">
<table id="example1"
class="table table-bordered table-striped">
<thead>
<tr>
<th scope="col">Sr.N0</th>
<th scope="col">Product Name</th>
<th scope="col">Catagory Name</th>
<th scope="col">Supplier Name</th>
<th scope="col">Purchase Date</th>
<th scope="col">PO NO</th>
<th scope="col">QTY</th>
<th scope="col">Status</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
@php($sr=0)
@foreach ( $request as $item)
@php($sr++)
<tr >
<td>{{$sr}}</td>
<td>{{$item->product_name}}</td>
<td>{{$item->name}}</td>
<td>{{$item->sup_name}}</td>
<td>{{$item->purchase_product_date}}</td>
<td>{{$item->productno}}</td>
<td>{{$item->quantity}}</td>
<td><a href="" class="badge badge-success rounded-pill">{{$item->status}}</a></td>
<td>
<a href="{{route('purchaseproductlist')}} " class="btn btn-primary delete-confirm">Action</a>
</td>
</tr>
@endforeach
</table>
</div>
</div>
<!--
</div>
</div>
<script type="text/javascript">
$('.delete-confirm').on('click', function (e) {
e.preventDefault();
const url = $(this).attr('href');
swal({
title: 'Are you sure?',
text: 'You want to approve it!',
icon: 'warning',
buttons: ["cancel!","Approve it"],
}).then(function(approve) {
if (approve) {
swal({
title: "Approved",
icon: "success",
timer: 4000
});
window.location.href = url;
}
else {
swal("Your file is not updated!");
}
});
});
</script>
@endsection
Here is controlller
<pre> function product_list(Request $request){
$request=DB::table('product_purchase_orders')
->join('products','products.productid','=',
'product_purchase_orders.product_id')
-
>join('catagories','catagories.catagoriesid','=',
'product_purchase_orders.catid')
->join('suppliers','suppliers.supplierid','=',
'product_purchase_orders.supid')
->join('product_purchases','product_purchases.id','=',
'product_purchase_orders.prod_puechase_id')
->select('product_purchase_orders.id','product_purchases.id',
'products.product_name','catagories.name',
'suppliers.name as sup_name',
'product_purchases.purchase_product_date',
'product_purchases.productno',
'product_purchase_orders.quantity','product_purchases.status')
// ->where('suppliers.supplierid','=','product_purchases.supplier')
->get();
// return $request;
// $id=$request->id;
// return $id;
return view('Purchase.Purchase_product_listing',['request'=>$request]);
}
function approve_list(Request $request){
$request=DB::table('product_purchase_orders')
->join('products','products.productid','=',
'product_purchase_orders.product_id')
->join('catagories','catagories.catagoriesid','=',
'product_purchase_orders.catid')
->join('suppliers','suppliers.supplierid','=',
'product_purchase_orders.supid')
->join('product_purchases','product_purchases.id','=',
'product_purchase_orders.prod_puechase_id')
->select('product_purchase_orders.id',
'products.product_name',
'product_purchase_orders.product_id',
'catagories.name','suppliers.name as sup_name',
'product_purchases.purchase_product_date',
'product_purchases.productno',
'product_purchase_orders.quantity',
'product_purchases.status')
// ->where('suppliers.supplierid','=','product_purchases.supplier')
->get();
// return $request;
// $id=$request->productid;
// return $id;
return view('Purchase.Approve_product_listing',['request'=>$request]);
Here is
web.php:
All purchase Products
--------------------------------------------*/
Route::get('/addPurchaseProduct',[PurchaseProductController::class,"PurchaseProduct"])->name('productpurchase');
Route::get('/gert_catagory',[PurchaseProductController::class,"Getcatagory"])->name('get.catagory');
Route::get('/gert_product',[PurchaseProductController::class,"Getproduct"])->name('get.productname');
Route::post('/insert_product_purchase',[PurchaseProductController::class,"insertproduct"])->name('addproductpurchase');
Route::get('/get_approve',[PurchaseProductController::class,"product_list"])->name('purchaseproductlist');
// Route::get('/get_approve/{product_id}',[PurchaseProductController::class,"product_list_approve"])->name('purchaseproduct_approvelist');
Route::get('/approve_products',[PurchaseProductController::class,"approve_list"])->name('approve_productlist');
/*
}