FIX_validation in all modules for release today : GWM

This commit is contained in:
bitbucket 2024-04-18 16:45:01 +05:30
parent c39e293484
commit 655bc5bb5a
24 changed files with 741 additions and 625 deletions

View File

@ -11,16 +11,16 @@ class Client extends BaseController
{ {
public $session; public $session;
protected $UsersModel;
public function __construct() public function __construct()
{ {
$this->session = session(); // Initialize session
$this->session = session();
$this->UsersModel = new UsersModel(); $this->UsersModel = new UsersModel();
} }
public function client_index() public function client_index()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$ClientModel = new ClientModel(); $ClientModel = new ClientModel();
$client = $ClientModel->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll(); $client = $ClientModel->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll();
$data['client']=$client; $data['client']=$client;
@ -32,7 +32,7 @@ class Client extends BaseController
public function new_client($client_id) public function new_client($client_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
if ($client_id === '0') { if ($client_id === '0') {
$data['client'] = []; $data['client'] = [];
@ -53,7 +53,7 @@ class Client extends BaseController
public function add_client() public function add_client()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$ClientModel = new ClientModel(); $ClientModel = new ClientModel();
@ -86,8 +86,10 @@ class Client extends BaseController
return redirect()->to('client_index'); return redirect()->to('client_index');
} }
public function delete_client($client_id) public function delete_client($client_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$model = new ClientModel(); $model = new ClientModel();
$where = ['client_id' => $client_id, 'isactive' => 1 , 'branch_id' => $this->session->get('logged_user_branch_id')]; // Assuming 'isactive' is a column in your database $where = ['client_id' => $client_id, 'isactive' => 1 , 'branch_id' => $this->session->get('logged_user_branch_id')]; // Assuming 'isactive' is a column in your database
$existingBusiness = $model->where($where)->first(); $existingBusiness = $model->where($where)->first();
@ -106,6 +108,7 @@ class Client extends BaseController
} }
public function client_quick_create(){ public function client_quick_create(){
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
// Load ClientModel // Load ClientModel
$ClientModel = new ClientModel(); $ClientModel = new ClientModel();

View File

@ -11,7 +11,7 @@ class Manufacturer extends BaseController
public $session; public $session;
use ResponseTrait; use ResponseTrait;
protected $ManufacturerModel;
public function __construct() public function __construct()
{ {
@ -21,6 +21,7 @@ class Manufacturer extends BaseController
public function index() public function index()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$ManufacturerModel = new ManufacturerModel(); $ManufacturerModel = new ManufacturerModel();
$spare_manufacturer = $ManufacturerModel->findAll(); $spare_manufacturer = $ManufacturerModel->findAll();
@ -33,6 +34,7 @@ class Manufacturer extends BaseController
public function create_manufacturer() public function create_manufacturer()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
try { try {
$manufacturer_name = $this->request->getPost('manufacturername'); $manufacturer_name = $this->request->getPost('manufacturername');
$quality = $this->request->getPost('quality'); $quality = $this->request->getPost('quality');

View File

@ -22,7 +22,7 @@ class Products extends BaseController
public function product_index($manufacturer_id = null) public function product_index($manufacturer_id = null)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
if ($manufacturer_id) { if ($manufacturer_id) {
$ProductModel = new ProductModel(); $ProductModel = new ProductModel();
$ManufacturerModel = new ManufacturerModel(); $ManufacturerModel = new ManufacturerModel();
@ -54,7 +54,7 @@ class Products extends BaseController
public function new_product($product_id) public function new_product($product_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
if ($product_id === '0') { if ($product_id === '0') {
$data['products'] = []; $data['products'] = [];
@ -113,7 +113,7 @@ class Products extends BaseController
public function add_product() public function add_product()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$ProductModel = new ProductModel(); $ProductModel = new ProductModel();
$tax= $this->request->getPost('tax')/2; $tax= $this->request->getPost('tax')/2;
@ -140,11 +140,13 @@ class Products extends BaseController
'rack_number' => $this->request->getPost('rack_number'), 'rack_number' => $this->request->getPost('rack_number'),
'manufacturer_id' => $this->request->getPost('manufacturer'), 'manufacturer_id' => $this->request->getPost('manufacturer'),
'prefered_vendor' => $this->request->getPost('prefered_vendor'), 'prefered_vendor' => $this->request->getPost('prefered_vendor'),
'specification' => $this->request->getPost('specification'),
'hsn_sac' => $this->request->getPost('hsn_sac'),
'isactive' => 1 , 'isactive' => 1 ,
'branch_id' => $this->session->get('logged_user_branch_id') 'branch_id' => $this->session->get('logged_user_branch_id')
]; ];
// print_r($data);die;
$product_id = $this->request->getPost('product_id'); $product_id = $this->request->getPost('product_id');
@ -158,7 +160,7 @@ class Products extends BaseController
} }
$orderNumber = 'TM' . str_pad($product_id, 8, '0', STR_PAD_LEFT); $orderNumber = 'TM' . str_pad($product_id, 8, '0', STR_PAD_LEFT);
// print_r($orderNumber);die;
// Update sales order with generated order number // Update sales order with generated order number
$ProductModel->update($product_id, ['sku_id' => $orderNumber]); $ProductModel->update($product_id, ['sku_id' => $orderNumber]);
return redirect()->to('product_index'); return redirect()->to('product_index');
@ -166,6 +168,7 @@ class Products extends BaseController
public function delete_product($product_id) public function delete_product($product_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$model = new ProductModel(); $model = new ProductModel();
$where = ['product_id' => $product_id, 'isactive' => 1 , 'branch_id' => $this->session->get('logged_user_branch_id')]; // Assuming 'isactive' is a column in your database $where = ['product_id' => $product_id, 'isactive' => 1 , 'branch_id' => $this->session->get('logged_user_branch_id')]; // Assuming 'isactive' is a column in your database
$existingProduct = $model->where($where)->first(); $existingProduct = $model->where($where)->first();

View File

@ -21,6 +21,7 @@ class Purchase extends BaseController
public function purchase_index() public function purchase_index()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$PurchaseOrderModel = new PurchaseOrderModel(); $PurchaseOrderModel = new PurchaseOrderModel();
// $purchase = $PurchaseOrderModel->where('purchase_order.branch_id', $this->session->get('logged_user_business_id')) // $purchase = $PurchaseOrderModel->where('purchase_order.branch_id', $this->session->get('logged_user_business_id'))
@ -40,6 +41,7 @@ class Purchase extends BaseController
public function new_purchase($purchase_order_id) public function new_purchase($purchase_order_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
if ($purchase_order_id === '0') { if ($purchase_order_id === '0') {
$data['purchase'] = []; $data['purchase'] = [];
@ -109,6 +111,7 @@ class Purchase extends BaseController
public function add_purchase() public function add_purchase()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$PurchaseOrderModel = new PurchaseOrderModel(); $PurchaseOrderModel = new PurchaseOrderModel();
$ProductModel = new ProductModel(); $ProductModel = new ProductModel();
$PurchaseOrderChildModel = new PurchaseOrderChildModel(); $PurchaseOrderChildModel = new PurchaseOrderChildModel();
@ -132,10 +135,7 @@ class Purchase extends BaseController
'branch_id'=> $this->session->get('logged_user_branch_id'), 'branch_id'=> $this->session->get('logged_user_branch_id'),
]; ];
// echo '<pre>';
// print_r($this->request->getPost());
// echo '</pre>';
//die;
$purchase_order_id = $this->request->getPost('purchase_order_id'); $purchase_order_id = $this->request->getPost('purchase_order_id');
// echo $purchase_order_id;die; // echo $purchase_order_id;die;
if (!empty($purchase_order_id)) { if (!empty($purchase_order_id)) {
@ -211,9 +211,11 @@ class Purchase extends BaseController
return redirect()->to('purchase_index'); return redirect()->to('purchase_index');
} }
private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
{
private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
{
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
// Fetch current product quantity // Fetch current product quantity
$product = $ProductModel->find($product_id); $product = $ProductModel->find($product_id);
$current_qty = $product['qty_stock']; $current_qty = $product['qty_stock'];
@ -227,6 +229,7 @@ class Purchase extends BaseController
public function delete_purchase($purchase_order_id) public function delete_purchase($purchase_order_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$PurchaseOrderModel = new PurchaseOrderModel(); $PurchaseOrderModel = new PurchaseOrderModel();
$where = ['purchase_order_id' => $purchase_order_id, 'isactive' => 1 ]; // Assuming 'isactive' is a column in your database $where = ['purchase_order_id' => $purchase_order_id, 'isactive' => 1 ]; // Assuming 'isactive' is a column in your database
$existingPurchase = $PurchaseOrderModel->where($where)->first(); $existingPurchase = $PurchaseOrderModel->where($where)->first();
@ -258,7 +261,8 @@ class Purchase extends BaseController
return json_encode($products); return json_encode($products);
} }
public function getVendorProducts()
public function getVendorProducts()
{ {
// Retrieve make_id and model_id from the request // Retrieve make_id and model_id from the request
// $makeId = $this->request->getPost(''); // $makeId = $this->request->getPost('');

View File

@ -22,18 +22,21 @@ class Reorderlevel extends BaseController
public function reorder_level_index() public function reorder_level_index()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$productModel = new ProductModel(); $productModel = new ProductModel();
$reorder = $productModel->where('qty_stock <= purchase_order_level')->findAll(); $reorder = $productModel->select('products.*, vendor.vendor_name as prefered_vendor_name')
->join('vendor', 'vendor.vendor_id = products.prefered_vendor')
->where('products.qty_stock <= purchase_order_level')
->findAll();
// print_r($reorder);die;
$data['reorder']=$reorder; $data['reorder']=$reorder;
// echo "<pre>";
// print_r($data);die;
return view('reorder_level_list',$data); return view('reorder_level_list',$data);
} }
public function rise_order($product_id) public function rise_order($product_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$data['page_name']="Rise Order"; $data['page_name']="Rise Order";
$ProductModel = new ProductModel(); $ProductModel = new ProductModel();
$products=$ProductModel->where('product_id', $product_id)->get()->getRowArray(); $products=$ProductModel->where('product_id', $product_id)->get()->getRowArray();

View File

@ -16,6 +16,7 @@ use App\Models\PurchaseOrderModel;
class ReturnOrder extends BaseController class ReturnOrder extends BaseController
{ {
public $session; public $session;
protected $returnModel;
public function __construct() public function __construct()
{ {
$this->session = session(); $this->session = session();
@ -24,24 +25,24 @@ class ReturnOrder extends BaseController
public function return_order_index() public function return_order_index()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$PurchaseOrderModel = new PurchaseOrderModel(); $PurchaseOrderModel = new PurchaseOrderModel();
$purchase = $PurchaseOrderModel->getPurchaseOrdersWithProducts($this->session->get('logged_user_branch_id')); $purchase = $PurchaseOrderModel->getPurchaseOrdersWithProducts($this->session->get('logged_user_branch_id'));
// echo "<pre>";
// print_r($product);die;
$data['purchase']=$purchase; $data['purchase']=$purchase;
$return = $this->returnModel->findAll(); $return = $this->returnModel->findAll();
$data['return']=$return; $data['return']=$return;
// echo "<pre>";
// print_r($data);die;
return view('return_order_liist',$data); return view('return_order_liist',$data);
} }
public function return_order() public function return_order()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$ReturnModel = new ReturnModel(); $ReturnModel = new ReturnModel();
$return_orders = $ReturnModel->select('return_order.*, vendor.vendor_name as vendor_name, COUNT(return_order_child.return_order_id) AS return_count') $return_orders = $ReturnModel->select('return_order.*, vendor.vendor_name as vendor_name, COUNT(return_order_child.return_order_id) AS return_count')
@ -61,6 +62,7 @@ class ReturnOrder extends BaseController
} }
public function new_return($purchase_order_id) public function new_return($purchase_order_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$data['page_name']="Create Return Order"; $data['page_name']="Create Return Order";
@ -90,7 +92,7 @@ class ReturnOrder extends BaseController
$PurchaseOrderChildModel = new PurchaseOrderChildModel(); $PurchaseOrderChildModel = new PurchaseOrderChildModel();
$purchase_product=$PurchaseOrderChildModel->where('purchase_order_id', $purchase_order_id)->findAll(); $purchase_product=$PurchaseOrderChildModel->where('purchase_order_id', $purchase_order_id)->findAll();
$data['purchase_product']=$purchase_product; $data['purchase_product'] = $purchase_product;
echo view('return_order_form',$data); echo view('return_order_form',$data);
@ -98,6 +100,7 @@ class ReturnOrder extends BaseController
public function add_return_purchase() public function add_return_purchase()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$ProductModel = new ProductModel(); $ProductModel = new ProductModel();
@ -294,7 +297,7 @@ class ReturnOrder extends BaseController
return $this->response->setJSON(['product'=>$product] ); return $this->response->setJSON(['product'=>$product] );
} else { } else {
// If product is not found, return an empty response or appropriate message // If product is not found, return an empty response or appropriate message
return $this->response->setJSON(['product'=>[] , 'modelName'=>$modelName ,'makeName'=>$makeName]); return $this->response->setJSON(['product'=>[] ]);
} }
} }
public function delete_purchase_product() public function delete_purchase_product()

View File

@ -13,6 +13,8 @@ use Mpdf\Mpdf;
class Sales extends BaseController class Sales extends BaseController
{ {
public $session; public $session;
protected $BikemodelsModel;
protected $BikemakeModel;
public function __construct() public function __construct()
{ {
@ -24,11 +26,11 @@ class Sales extends BaseController
public function sales_order_index() public function sales_order_index()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$SalesOrderModel = new SalesOrderModel(); $SalesOrderModel = new SalesOrderModel();
$sales=$SalesOrderModel->getSalesOrdersWithProducts($this->session->get('logged_user_branch_id')); $sales=$SalesOrderModel->getSalesOrdersWithProducts($this->session->get('logged_user_branch_id'));
$data['sales']=$sales; $data['sales']=$sales;
// print_r($sales);die;
return view('sales_list',$data); return view('sales_list',$data);
} }
@ -36,7 +38,7 @@ class Sales extends BaseController
public function new_sale($sales_order_id) public function new_sale($sales_order_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
if ($sales_order_id === '0') { if ($sales_order_id === '0') {
$data['page_name']="Create Sales Order"; $data['page_name']="Create Sales Order";
$data['sales'] = []; $data['sales'] = [];
@ -48,7 +50,7 @@ class Sales extends BaseController
$vehicle = $VehicleModel->getCustomerandVehicle($this->session->get('logged_user_branch_id')); $vehicle = $VehicleModel->getCustomerandVehicle($this->session->get('logged_user_branch_id'));
// ->where('isactive',1) // ->where('isactive',1)
// ->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll(); // ->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll();
// print_r($vehicle);die;
$ProductModel = new ProductModel(); $ProductModel = new ProductModel();
$product=$ProductModel $product=$ProductModel
->where('isactive',1) ->where('isactive',1)
@ -66,15 +68,15 @@ class Sales extends BaseController
$data['page_name']="Edit Sale Order"; $data['page_name']="Edit Sale Order";
$ClientModel = new ClientModel(); $ClientModel = new ClientModel();
$client=$ClientModel->where('isactive',1)->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll(); $client=$ClientModel->where('isactive',1)->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll();
$SalesOrderModel = new SalesOrderModel(); $SalesOrderModel = new SalesOrderModel();
$sales=$SalesOrderModel->where('sales_order_id', $sales_order_id)->get()->getRowArray(); $sales=$SalesOrderModel->where('sales_order_id', $sales_order_id)->get()->getRowArray();
$data['sales']=$sales; $data['sales']=$sales;
$VehicleModel = new VehicleModel(); $VehicleModel = new VehicleModel();
$vehicles = $VehicleModel->where('isactive',1)->where('vehicle_id',$sales['vehicle_id']) $vehicles = $VehicleModel->where('isactive',1)->where('vehicle_id',$sales['vehicle_id'])
->where('branch_id',$this->session->get('logged_user_branch_id')) ->where('branch_id',$this->session->get('logged_user_branch_id'))
->first(); ->first();
$makeId = $vehicles['make']; $makeId = $vehicles['make'];
$modelId = $vehicles['model']; $modelId = $vehicles['model'];
// Encode the modelId before searching // Encode the modelId before searching
@ -88,12 +90,12 @@ $makeId = $vehicles['make'];
->where('JSON_CONTAINS(models_id, \'' . $encodedModelId . '\')', null, false) ->where('JSON_CONTAINS(models_id, \'' . $encodedModelId . '\')', null, false)
->findAll(); ->findAll();
$data['product']=$product; $data['product']=$product;
$SalesProductOrderModel = new SalesOrderProductModel(); $SalesProductOrderModel = new SalesOrderProductModel();
$sales_product=$SalesProductOrderModel->where('sales_order_id', $sales_order_id)->findAll(); $sales_product=$SalesProductOrderModel->where('sales_order_id', $sales_order_id)->findAll();
$data['sales_product']=$sales_product; $data['sales_product']=$sales_product;
$data['client']=$client; $data['client']=$client;
// print_r($sales_product);die;
$VehicleModel = new VehicleModel(); $VehicleModel = new VehicleModel();
$vehicle=$VehicleModel $vehicle=$VehicleModel
->where('isactive',1) ->where('isactive',1)
->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll(); ->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll();
@ -101,7 +103,7 @@ $VehicleModel = new VehicleModel();
} }
// print_r($data);die;
$data['sales_order_id'] = $sales_order_id; $data['sales_order_id'] = $sales_order_id;
$bikeMakeModel = new BikeMakeModel(); $bikeMakeModel = new BikeMakeModel();
$data['makeData'] =$bikeMakeModel->findAll(); $data['makeData'] =$bikeMakeModel->findAll();
@ -109,8 +111,9 @@ $VehicleModel = new VehicleModel();
} }
public function add_sales() public function add_sales()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$SalesOrderModel = new SalesOrderModel(); $SalesOrderModel = new SalesOrderModel();
$ProductModel = new ProductModel(); $ProductModel = new ProductModel();
$SalesOrderProductModel = new SalesOrderProductModel(); // Assuming you have a model for sales_order_product $SalesOrderProductModel = new SalesOrderProductModel(); // Assuming you have a model for sales_order_product
@ -134,7 +137,7 @@ $VehicleModel = new VehicleModel();
'isactive' => 1, // Assuming this is a default value or handled separately 'isactive' => 1, // Assuming this is a default value or handled separately
'branch_id'=> $this->session->get('logged_user_branch_id'), 'branch_id'=> $this->session->get('logged_user_branch_id'),
]; ];
// print_r($data);die;
// Insert or update sales order // Insert or update sales order
$sales_order_id = $this->request->getPost('sales_order_id'); $sales_order_id = $this->request->getPost('sales_order_id');
if (!empty($sales_order_id)) { if (!empty($sales_order_id)) {
@ -145,10 +148,10 @@ $VehicleModel = new VehicleModel();
$sales_order_id = $SalesOrderModel->getInsertID(); // Get the last inserted ID $sales_order_id = $SalesOrderModel->getInsertID(); // Get the last inserted ID
} }
$orderNumber = 'SO' . str_pad($sales_order_id, 8, '0', STR_PAD_LEFT); $orderNumber = 'SO' . str_pad($sales_order_id, 8, '0', STR_PAD_LEFT);
// print_r($orderNumber);die;
// Update sales order with generated order number // Update sales order with generated order number
$SalesOrderModel->update($sales_order_id, ['order_number' => $orderNumber]); $SalesOrderModel->update($sales_order_id, ['order_number' => $orderNumber]);
// print_r();die;
// Prepare data for sales order product // Prepare data for sales order product
$product_ids = $this->request->getPost('item_details'); $product_ids = $this->request->getPost('item_details');
$quantities = $this->request->getPost('quantity'); $quantities = $this->request->getPost('quantity');
@ -158,10 +161,10 @@ $VehicleModel = new VehicleModel();
$itemtax=$this->request->getPost('item-tax'); $itemtax=$this->request->getPost('item-tax');
$unitprice=$this->request->getPost('unit-price'); $unitprice=$this->request->getPost('unit-price');
$sales_product_id = $this->request->getPost('sales_order_product_id'); $sales_product_id = $this->request->getPost('sales_order_product_id');
// print_r($product_ids);die;
// print_r($status);die;
$status = $this->request->getPost('status');
$status = $this->request->getPost('status');
foreach ($product_ids as $key => $product_id) { foreach ($product_ids as $key => $product_id) {
$qty = isset($quantities[$key]) ? $quantities[$key] : 0; $qty = isset($quantities[$key]) ? $quantities[$key] : 0;
if ($status == 'Created') { if ($status == 'Created') {
@ -212,6 +215,7 @@ $status = $this->request->getPost('status');
private function addBackProductQuantity($ProductModel, $product_id, $sold_qty) private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
// Fetch current product quantity // Fetch current product quantity
$product = $ProductModel->find($product_id); $product = $ProductModel->find($product_id);
$current_qty = $product['qty_stock']; $current_qty = $product['qty_stock'];
@ -224,6 +228,7 @@ private function addBackProductQuantity($ProductModel, $product_id, $sold_qty)
} }
private function updateProductQuantity($ProductModel, $product_id, $sold_qty) private function updateProductQuantity($ProductModel, $product_id, $sold_qty)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
// Fetch current product quantity // Fetch current product quantity
$product = $ProductModel->find($product_id); $product = $ProductModel->find($product_id);
$current_qty = $product['qty_stock']; $current_qty = $product['qty_stock'];
@ -237,6 +242,7 @@ private function updateProductQuantity($ProductModel, $product_id, $sold_qty)
public function delete_sales_product() public function delete_sales_product()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$sales_order_product_id = $this->request->getPost('sales_order_product_id'); $sales_order_product_id = $this->request->getPost('sales_order_product_id');
if (!empty($sales_order_product_id)) { if (!empty($sales_order_product_id)) {
@ -256,6 +262,7 @@ public function delete_sales_product()
public function delete_sale($sales_order_id) public function delete_sale($sales_order_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$model = new SalesOrderModel(); $model = new SalesOrderModel();
$where = ['sales_order_id' => $sales_order_id, 'isactive' => 1]; // Assuming 'isactive' is a column in your database $where = ['sales_order_id' => $sales_order_id, 'isactive' => 1]; // Assuming 'isactive' is a column in your database
$existingProduct = $model->where($where)->first(); $existingProduct = $model->where($where)->first();
@ -272,9 +279,11 @@ public function delete_sales_product()
return redirect()->to('sales_order_index'); return redirect()->to('sales_order_index');
} }
public function download_invoice($sales_order_id) public function download_invoice($sales_order_id)
{ {
// echo "hello"; die; if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
// Fetch the invoice data based on $invoice_id // Fetch the invoice data based on $invoice_id
$model = new SalesOrderModel(); $model = new SalesOrderModel();
$data = $model->getSalesPdf($sales_order_id); $data = $model->getSalesPdf($sales_order_id);
@ -283,11 +292,6 @@ public function delete_sales_product()
// print_r($items);die();
// print_r($invoiceItems);die();
// Create an mPDF object
$mpdf = new Mpdf([ $mpdf = new Mpdf([
'mode' => '', 'mode' => '',
'format' => 'A5', 'format' => 'A5',
@ -332,7 +336,7 @@ public function delete_sales_product()
// Generate the PDF content (HTML) with data // Generate the PDF content (HTML) with data
$html = view('invoice_pdf_template', ['sales' => $data,'items'=>$items]); $html = view('invoice_pdf_template', ['sales' => $data,'items'=>$items]);
// echo $html;die;
// Load HTML into the mPDF instance // Load HTML into the mPDF instance
$mpdf->WriteHTML($html); $mpdf->WriteHTML($html);
@ -342,6 +346,7 @@ public function delete_sales_product()
public function save_vehicle(){ public function save_vehicle(){
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
// Load ClientModel // Load ClientModel
$VehicleModel = new VehicleModel(); $VehicleModel = new VehicleModel();
@ -415,6 +420,7 @@ public function get_vehicle_products(){
public function getProducts() public function getProducts()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
// Retrieve make_id and model_id from the request // Retrieve make_id and model_id from the request
$makeId = $this->request->getPost('make_id'); $makeId = $this->request->getPost('make_id');
$modelId = $this->request->getPost('model_id'); $modelId = $this->request->getPost('model_id');
@ -428,6 +434,7 @@ public function getProducts()
// Query the database to find the product based on make_id and model_id // Query the database to find the product based on make_id and model_id
$product = $productModel->where('make_id', $makeId) $product = $productModel->where('make_id', $makeId)
->where('JSON_CONTAINS(models_id, \'' . $encodedModelId . '\')', null, false) ->where('JSON_CONTAINS(models_id, \'' . $encodedModelId . '\')', null, false)
->where('qty_stock >',0)
->findAll(); ->findAll();
$modelName = $this->BikemodelsModel->where('model_id',$modelId)->get()->getRow()->model_name; $modelName = $this->BikemodelsModel->where('model_id',$modelId)->get()->getRow()->model_name;

View File

@ -13,6 +13,8 @@ class Vehicle extends BaseController
public $session; public $session;
protected $bikeMakeModel;
protected $bikeModelsModel;
public function __construct() public function __construct()
{ {
$this->session = session(); $this->session = session();
@ -22,7 +24,7 @@ class Vehicle extends BaseController
public function vehicle_index() public function vehicle_index()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$VehicleModel = new VehicleModel(); $VehicleModel = new VehicleModel();
$vehicle = $VehicleModel->getCustomerandVehicle($this->session->get('logged_user_branch_id')); $vehicle = $VehicleModel->getCustomerandVehicle($this->session->get('logged_user_branch_id'));
$data['vehicle'] = $vehicle; $data['vehicle'] = $vehicle;
@ -38,7 +40,7 @@ class Vehicle extends BaseController
public function new_vehicle($vehicle_id) public function new_vehicle($vehicle_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
if ($vehicle_id === '0') { if ($vehicle_id === '0') {
$ClientModel = new ClientModel(); $ClientModel = new ClientModel();
$data['vehicle'] = []; $data['vehicle'] = [];
@ -69,7 +71,7 @@ class Vehicle extends BaseController
public function add_vehicle() public function add_vehicle()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$VehicleModel = new VehicleModel(); $VehicleModel = new VehicleModel();
@ -90,7 +92,7 @@ class Vehicle extends BaseController
'specific' => $this->request->getPost('specific'), 'specific' => $this->request->getPost('specific'),
'isactive' => 1 // Assuming this is a default value or handled separately 'isactive' => 1 // Assuming this is a default value or handled separately
]; ];
// print_r($data);die;
$vehicle_id = $this->request->getPost('vehicle_id'); $vehicle_id = $this->request->getPost('vehicle_id');
@ -106,8 +108,10 @@ class Vehicle extends BaseController
return redirect()->to('vehicle_index'); return redirect()->to('vehicle_index');
} }
public function delete_vehicle($vehicle_id) public function delete_vehicle($vehicle_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$model = new VehicleModel(); $model = new VehicleModel();
$where = ['vehicle_id' => $vehicle_id, 'isactive' => 1]; // Assuming 'isactive' is a column in your database $where = ['vehicle_id' => $vehicle_id, 'isactive' => 1]; // Assuming 'isactive' is a column in your database
$existingBusiness = $model->where($where)->first(); $existingBusiness = $model->where($where)->first();

View File

@ -14,6 +14,7 @@ class Vendor extends BaseController
{ {
public $session; public $session;
protected $UsersModel;
public function __construct() public function __construct()
{ {
@ -23,7 +24,7 @@ class Vendor extends BaseController
public function vendor_index() public function vendor_index()
{ {
// print_r("hi");die; if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$VendorModel = new VendorModel(); $VendorModel = new VendorModel();
$vendor = $VendorModel->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll(); $vendor = $VendorModel->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll();
$data['vendor']=$vendor; $data['vendor']=$vendor;
@ -34,6 +35,7 @@ class Vendor extends BaseController
public function new_vendor($vendor_id) public function new_vendor($vendor_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
if ($vendor_id === '0') { if ($vendor_id === '0') {
$data['vendor'] = []; $data['vendor'] = [];
$data['page_name'] = "Add Vendor"; $data['page_name'] = "Add Vendor";
@ -58,6 +60,7 @@ class Vendor extends BaseController
public function add_vendor() public function add_vendor()
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$VendorModel = new VendorModel(); $VendorModel = new VendorModel();
@ -99,6 +102,7 @@ class Vendor extends BaseController
public function delete_vendor($vendor_id) public function delete_vendor($vendor_id)
{ {
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$model = new VendorModel(); $model = new VendorModel();
$where = ['vendor_id' => $vendor_id, 'isactive' => 1 , 'branch_id' => $this->session->get('logged_user_branch_id')]; // Assuming 'isactive' is a column in your database $where = ['vendor_id' => $vendor_id, 'isactive' => 1 , 'branch_id' => $this->session->get('logged_user_branch_id')]; // Assuming 'isactive' is a column in your database
$existingBusiness = $model->where($where)->first(); $existingBusiness = $model->where($where)->first();

View File

@ -5,7 +5,7 @@ class ProductModel extends Model
{ {
protected $table = 'products'; protected $table = 'products';
protected $primaryKey = 'product_id'; protected $primaryKey = 'product_id';
protected $allowedFields = ['sku_id','product_id','rack_number','manufacturer_id','make_id','models_id','quality','product_name','branch_id','prefered_vendor','product_category','mfr_part_no','purchase_order_level','unit_price','commision_rate','sgst','cgst','purchase_cost','usage_unit','vendor','qty_stock','reorder_level','handler','qty_in_demand','product_image','description','isactive']; protected $allowedFields = ['sku_id','product_id','rack_number','manufacturer_id','make_id','models_id','quality','product_name','branch_id','prefered_vendor','product_category','mfr_part_no','purchase_order_level','unit_price','commision_rate','sgst','cgst','purchase_cost','usage_unit','vendor','qty_stock','reorder_level','handler','qty_in_demand','product_image','description','specification','hsn_sac','isactive'];
public function getTax() public function getTax()

View File

@ -33,11 +33,6 @@
<th>Client Name</th> <th>Client Name</th>
<th>Mobile</th> <th>Mobile</th>
<th>Email</th> <th>Email</th>
<th>Address</th>
<th>City</th>
<th>State</th>
<th>Country</th>
<th>Pin Code</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -51,14 +46,9 @@
<td><?= $value['client_name']; ?></td> <td><?= $value['client_name']; ?></td>
<td><?= $value['mobile_no']; ?></td> <td><?= $value['mobile_no']; ?></td>
<td><?= $value['email']; ?></td> <td><?= $value['email']; ?></td>
<td><?= $value['address']; ?></td>
<td><?= $value['city'] != 0 ? $value['city'] : ''; ?></td>
<td><?= $value['state']; ?></td>
<td><?= $value['country']; ?></td>
<td><?= $value['postal_code']; ?></td>
<td> <td>
<a href="<?= "new_client/" . $value['client_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a> <a href="<?= "new_client/" . $value['client_id']; ?>" class="edit-button"><i class="ri-pencil-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_client/" . $value['client_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a> <a href="<?= "delete_client/" . $value['client_id']; ?>" class="delete-button"><i class="ri-delete-bin-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td> </td>
<?php endif?> <?php endif?>

View File

@ -42,7 +42,7 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="inputState" class="col-form-label">Role</label> <label for="inputState" class="col-form-label">Role</label>
<select id="inputState" class="form-control" name="role" required> <select id="inputState" class="form-control" name="role" readonly required >
<option value="">Select Role</option> <option value="">Select Role</option>
<?php foreach ($roles as $role): ?> <?php foreach ($roles as $role): ?>
<option value="<?= $role['role_id'] ?>" <?= isset($users['role']) && $users['role'] == $role['role_id'] ? 'selected' : '' ?>><?= $role['roles'] ?></option> <option value="<?= $role['role_id'] ?>" <?= isset($users['role']) && $users['role'] == $role['role_id'] ? 'selected' : '' ?>><?= $role['roles'] ?></option>
@ -52,7 +52,7 @@
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="inputState" class="col-form-label">Business</label> <label for="inputState" class="col-form-label">Business</label>
<select id="business" class="form-control" name="business" required> <select id="business" class="form-control" name="business" readonly required>
<option value="">Select Business</option> <option value="">Select Business</option>
<?php foreach ($business as $busin): ?> <?php foreach ($business as $busin): ?>
<option value="<?= $busin['business_id'] ?>" <?= isset($users['business_id']) && $users['business_id'] == $busin['business_id'] ? 'selected' : '' ?>><?= $busin['business_name'] ?></option> <option value="<?= $busin['business_id'] ?>" <?= isset($users['business_id']) && $users['business_id'] == $busin['business_id'] ? 'selected' : '' ?>><?= $busin['business_name'] ?></option>
@ -61,7 +61,7 @@
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="inputState" class="col-form-label">Branch</label> <label for="inputState" class="col-form-label">Branch</label>
<select id="branch" class="form-control" name="branch" required> <select id="branch" class="form-control" name="branch" readonly required>
<option value="">Select Branch</option> <option value="">Select Branch</option>
<?php foreach ($branches as $branch): ?> <?php foreach ($branches as $branch): ?>
<option value="<?= $branch['branch_id'] ?>" <?= isset($users['branch_id']) && $users['branch_id'] == $branch['branch_id'] ? 'selected' : '' ?>><?= $branch['branch_name'] ?></option> <option value="<?= $branch['branch_id'] ?>" <?= isset($users['branch_id']) && $users['branch_id'] == $branch['branch_id'] ? 'selected' : '' ?>><?= $branch['branch_name'] ?></option>

View File

@ -124,7 +124,7 @@
<tr> <tr>
<td style="width:10%;"> <td style="width:10%;">
<select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" id="" style="width: 249px !important;"> <select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" id="" style="width: 249px !important;" readonly>
<option value="">Select a Product</option> <option value="">Select a Product</option>
<?php foreach ($product as $value) : ?> <?php foreach ($product as $value) : ?>
<?php if ((int)$value["isactive"] === 1) : ?> <?php if ((int)$value["isactive"] === 1) : ?>
@ -136,7 +136,7 @@
</select> </select>
</td> </td>
<td style="width:5%;"> <td style="width:5%;">
<input type="number" class="form-control item-quantity" name="quantity[]" min="0" value="<?= isset($purchasechild['qty']) ? $purchasechild['qty'] : '' ?>"> <input type="number" class="form-control item-quantity" name="quantity[]" min="0" value="<?= isset($purchasechild['qty']) ? $purchasechild['qty'] : '' ?>" readonly>
</td> </td>

View File

@ -111,9 +111,9 @@
<li> <li>
<a href="<?php echo base_url('sales_order_index') ?>">Sales Order</a> <a href="<?php echo base_url('sales_order_index') ?>">Sales Order</a>
</li> </li>
<li> <!-- <li>
<a href="<?php echo base_url('job_card_index') ?>">Job Card</a> <a href="<?php echo base_url('job_card_index') ?>">Job Card</a>
</li> </li> -->
<li> <li>
<a href="<?php echo base_url('vehicle_index') ?>">Vehicles</a> <a href="<?php echo base_url('vehicle_index') ?>">Vehicles</a>
</li> </li>
@ -174,9 +174,9 @@
<li> <li>
<a href="<?php echo base_url('product_index') ?>">Products</a> <a href="<?php echo base_url('product_index') ?>">Products</a>
</li> </li>
<li> <!-- <li>
<a href="<?php echo base_url('service_index') ?>">Services</a> <a href="<?php echo base_url('service_index') ?>">Services</a>
</li> </li> -->
</ul> </ul>
</div> </div>
</li> </li>

View File

@ -107,16 +107,78 @@
</select> </select>
</div> </div>
<div class="form-group col-md-3">
<div class="form-group col-md-4"> <label for="inputEmail4" class="col-form-label">HSN/SAC<span class="text-danger"></span></label>
<label for="inputEmail4" class="col-form-label">Product Category<span class="text-danger"></span></label> <input type="text" class="form-control" name="hsn_sac" placeholder="HSN/SAC" value="<?= isset($products['hsn_sac']) ? $products['hsn_sac'] : '' ?>" >
<input type="text" class="form-control" name="productcategory" placeholder="Product Category" value="<?= isset($products['product_category']) ? $products['product_category'] : '' ?>" >
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-3">
<label for="inputEmail4" class="col-form-label">Product Category<span class="text-danger"></span></label>
<select class="form-control status-select SelExample" name="productcategory" required data-toggle="select2">
<option value="" >Select Category</option>
<option value="Bearings" <?= (isset($products['product_category']) && $products['product_category'] == 'Bearings') ? 'selected' : '' ?>>Bearings</option>
<option value="Paste" <?= (isset($products['product_category']) && $products['product_category'] == 'Paste') ? 'selected' : '' ?>>Paste</option>
<option value="Clutch Plates" <?= (isset($products['product_category']) && $products['product_category'] == 'Clutch Plates') ? 'selected' : '' ?>>Clutch Plates</option>
<option value="Head Beeding" <?= (isset($products['product_category']) && $products['product_category'] == 'Head Beeding') ? 'selected' : '' ?>>Head Beeding</option>
<option value="Oil Seal" <?= (isset($products['product_category']) && $products['product_category'] == 'Oil Seal') ? 'selected' : '' ?>>Oil Seal</option>
<option value="Switches" <?= (isset($products['product_category']) && $products['product_category'] == 'Switches') ? 'selected' : '' ?>>Switches</option>
<option value="Speedometer" <?= (isset($products['product_category']) && $products['product_category'] == 'Speedometer') ? 'selected' : '' ?>>Speedometer</option>
<option value="Oil" <?= (isset($products['product_category']) && $products['product_category'] == 'Oil') ? 'selected' : '' ?>>Oil</option>
<option value="Cone set" <?= (isset($products['product_category']) && $products['product_category'] == 'Cone set') ? 'selected' : '' ?>>Cone set</option>
<option value="Brake" <?= (isset($products['product_category']) && $products['product_category'] == 'Brake') ? 'selected' : '' ?>>Brake</option>
<option value="Oil Filter" <?= (isset($products['product_category']) && $products['product_category'] == 'Oil Filter') ? 'selected' : '' ?>>Oil Filter</option>
<option value="Battery" <?= (isset($products['product_category']) && $products['product_category'] == 'Battery') ? 'selected' : '' ?>>Battery</option>
<option value="Lubricants" <?= (isset($products['product_category']) && $products['product_category'] == 'Lubricants') ? 'selected' : '' ?>>Lubricants</option>
<option value="Mirror" <?= (isset($products['product_category']) && $products['product_category'] == 'Mirror') ? 'selected' : '' ?>>Mirror</option>
<option value="Spark Plug" <?= (isset($products['product_category']) && $products['product_category'] == 'Spark Plug') ? 'selected' : '' ?>>Spark Plug</option>
<option value="Belt" <?= (isset($products['product_category']) && $products['product_category'] == 'Belt') ? 'selected' : '' ?>>Belt</option>
<option value="Indicators" <?= (isset($products['product_category']) && $products['product_category'] == 'Indicators') ? 'selected' : '' ?>>Indicators</option>
<option value="Wiring" <?= (isset($products['product_category']) && $products['product_category'] == 'Wiring') ? 'selected' : '' ?>>Wiring</option>
<option value="Light" <?= (isset($products['product_category']) && $products['product_category'] == 'Light') ? 'selected' : '' ?>>Light</option>
<option value="Flasher" <?= (isset($products['product_category']) && $products['product_category'] == 'Flasher') ? 'selected' : '' ?>>Flasher</option>
<option value="Buzzer" <?= (isset($products['product_category']) && $products['product_category'] == 'Buzzer') ? 'selected' : '' ?>>Buzzer</option>
<option value="Bush" <?= (isset($products['product_category']) && $products['product_category'] == 'Bush') ? 'selected' : '' ?>>Bush</option>
<option value="Wheel rubber" <?= (isset($products['product_category']) && $products['product_category'] == 'Wheel rubber') ? 'selected' : '' ?>>Wheel rubber</option>
<option value="Stand" <?= (isset($products['product_category']) && $products['product_category'] == 'Stand') ? 'selected' : '' ?>>Stand</option>
<option value="Kicker" <?= (isset($products['product_category']) && $products['product_category'] == 'Kicker') ? 'selected' : '' ?>>Kicker</option>
<option value="Gear" <?= (isset($products['product_category']) && $products['product_category'] == 'Gear') ? 'selected' : '' ?>>Gear</option>
<option value="Disc Pad" <?= (isset($products['product_category']) && $products['product_category'] == 'Disc Pad') ? 'selected' : '' ?>>Disc Pad</option>
<option value="Foot Rest" <?= (isset($products['product_category']) && $products['product_category'] == 'Foot Rest') ? 'selected' : '' ?>>Foot Rest</option>
<option value="Petrol Tap" <?= (isset($products['product_category']) && $products['product_category'] == 'Petrol Tap') ? 'selected' : '' ?>>Petrol Tap</option>
<option value="Bolts ,Nuts & screws" <?= (isset($products['product_category']) && $products['product_category'] == 'Bolts ,Nuts & screws') ? 'selected' : '' ?>>Bolts ,Nuts & screws</option>
<option value="Tyres & Tubes" <?= (isset($products['product_category']) && $products['product_category'] == 'Tyres & Tubes') ? 'selected' : '' ?>>Tyres & Tubes</option>
<option value="Gasket" <?= (isset($products['product_category']) && $products['product_category'] == 'Gasket') ? 'selected' : '' ?>>Gasket</option>
<option value="Clutch Switch" <?= (isset($products['product_category']) && $products['product_category'] == 'Clutch Switch') ? 'selected' : '' ?>>Clutch Switch</option>
<option value="Fuse" <?= (isset($products['product_category']) && $products['product_category'] == 'Fuse') ? 'selected' : '' ?>>Fuse</option>
<option value="Gaskets" <?= (isset($products['product_category']) && $products['product_category'] == 'Gaskets') ? 'selected' : '' ?>>Gaskets</option>
<option value="Yoke" <?= (isset($products['product_category']) && $products['product_category'] == 'Yoke') ? 'selected' : '' ?>>Yoke</option>
<option value="Air Filter" <?= (isset($products['product_category']) && $products['product_category'] == 'Air Filter') ? 'selected' : '' ?>>Air Filter</option>
<option value="Glass" <?= (isset($products['product_category']) && $products['product_category'] == 'Glass') ? 'selected' : '' ?>>Glass</option>
<option value="Chain Adjuster" <?= (isset($products['product_category']) && $products['product_category'] == 'Chain Adjuster') ? 'selected' : '' ?>>Chain Adjuster</option>
<option value="Spokes" <?= (isset($products['product_category']) && $products['product_category'] == 'Spokes') ? 'selected' : '' ?>>Spokes</option>
<option value="V bush" <?= (isset($products['product_category']) && $products['product_category'] == 'V bush') ? 'selected' : '' ?>>V bush</option>
<option value="Stay Bush" <?= (isset($products['product_category']) && $products['product_category'] == 'Stay Bush') ? 'selected' : '' ?>>Stay Bush</option>
<option value="Roller Bush" <?= (isset($products['product_category']) && $products['product_category'] == 'Roller Bush') ? 'selected' : '' ?>>Roller Bush</option>
<option value="Brake Shoe" <?= (isset($products['product_category']) && $products['product_category'] == 'Brake Shoe') ? 'selected' : '' ?>>Brake Shoe</option>
<option value="Mud Flap" <?= (isset($products['product_category']) && $products['product_category'] == 'Mud Flap') ? 'selected' : '' ?>>Mud Flap</option>
<option value="Grip" <?= (isset($products['product_category']) && $products['product_category'] == 'Grip') ? 'selected' : '' ?>>Grip</option>
<option value="Rubber" <?= (isset($products['product_category']) && $products['product_category'] == 'Rubber') ? 'selected' : '' ?>>Rubber</option>
<option value="Cables" <?= (isset($products['product_category']) && $products['product_category'] == 'Cables') ? 'selected' : '' ?>>Cables</option>
</select>
</div>
<div class="form-group col-md-3">
<label for="inputEmail4" class="col-form-label">Specification<span class="text-danger"></span></label>
<input type="text" class="form-control" name="specification" placeholder="Specification" value="<?= isset($products['specification']) ? $products['specification'] : '' ?>" >
</div>
<div class="form-group col-md-3">
<label for="inputEmail4" class="col-form-label">Rack Number<span class="text-danger"></span></label> <label for="inputEmail4" class="col-form-label">Rack Number<span class="text-danger"></span></label>
<input type="text" class="form-control" name="rack_number" placeholder="Rack Number" value="<?= isset($products['rack_number']) ? $products['rack_number'] : '' ?>" > <input type="text" class="form-control" name="rack_number" placeholder="Rack Number" value="<?= isset($products['rack_number']) ? $products['rack_number'] : '' ?>" >
</div> </div>
</div> </div>
<input type="hidden" id="product_id" name="product_id" value="<?= isset($products['product_id']) ? $products['product_id'] : '' ?>"><br> <input type="hidden" id="product_id" name="product_id" value="<?= isset($products['product_id']) ? $products['product_id'] : '' ?>"><br>
<h4 class="header-title">Pricing Information :</h4><br> <h4 class="header-title">Pricing Information :</h4><br>
@ -339,10 +401,10 @@ document.addEventListener('DOMContentLoaded', function() {
// Listen for the keyup event on qty in stock input // Listen for the keyup event on qty in stock input
qtyInStockInput.addEventListener('keyup', function() { qtyInStockInput.addEventListener('keyup', function() {
const qtyInStock = parseFloat(qtyInStockInput.value); const qtyInStock = parseFloat(qtyInStockInput.value);
const purchaseorderLevel = qtyInStock / 2; // Calculate the purchase reorder level (half of qty in stock) purchaseorderLevel = qtyInStock / 2; // Calculate the purchase reorder level (half of qty in stock)
purchaseOrderLevel = Math.floor(purchaseorderLevel);
// Update the value of purchase reorder level input // Update the value of purchase reorder level input
purchaseOrderLevelInput.value = isNaN(purchaseorderLevel) ? '' : purchaseorderLevel; purchaseOrderLevelInput.value = isNaN(purchaseOrderLevel) ? '' : purchaseOrderLevel;
purchaseReorderLevelInput.value = isNaN(qtyInStock) ? '' : qtyInStock; purchaseReorderLevelInput.value = isNaN(qtyInStock) ? '' : qtyInStock;
}); });
}); });

View File

@ -35,8 +35,7 @@
<th>Category</th> <th>Category</th>
<th>Unit Price</th> <th>Unit Price</th>
<th>Qty in Stock</th> <th>Qty in Stock</th>
<th>Sgst</th> <th>Rack No</th>
<th>Cgst</th>
<?php if(!$manufacturer_id) { ?><th>Actions</th><?php } ?> <?php if(!$manufacturer_id) { ?><th>Actions</th><?php } ?>
</tr> </tr>
</thead> </thead>
@ -52,8 +51,7 @@
<td><?= number_format($value['unit_price']); ?></td> <td><?= number_format($value['unit_price']); ?></td>
<td><?= $value['qty_stock']; ?></td> <td><?= $value['qty_stock']; ?></td>
<td><?= $value['cgst']; ?>%</td> <td><?= $value['rack_number']; ?></td>
<td><?= $value['sgst']; ?>%</td>
<!-- Call the model method --> <!-- Call the model method -->
<?php if(!$manufacturer_id) { ?> <?php if(!$manufacturer_id) { ?>

View File

@ -41,7 +41,7 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="contact_person_name" class="col-form-label">Contact Person Name<span class="text-danger">*</span></label> <label for="contact_person_name" class="col-form-label">Contact Person Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" name="contact_person_name" id="contact_person_name" placeholder="Contact Person Name.."value="<?= isset($purchase['contact_person_name']) ? $purchase['contact_person_name'] : '' ?>" required> <input type="text" class="form-control" name="contact_person_name" id="contact_person_name" placeholder="Contact Person Name"value="<?= isset($purchase['contact_person_name']) ? $purchase['contact_person_name'] : '' ?>" required>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="contact_person_mobile" class="col-form-label">Contact Person Mobile<span class="text-danger">*</span></label> <label for="contact_person_mobile" class="col-form-label">Contact Person Mobile<span class="text-danger">*</span></label>
@ -83,7 +83,7 @@
</div> </div>
<h4 class="header-title">Billing Addresss :</h4><br>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="billing_address" class="col-form-label">Billing Addresss<span class="text-danger">*</span></label> <label for="billing_address" class="col-form-label">Billing Addresss<span class="text-danger">*</span></label>
@ -103,7 +103,7 @@
</div> </div>
</div><br> </div><br>
<h4 class="header-title">Shipping Addresss :</h4><br>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="shipping_address" class="col-form-label">Shipping Addresss<span class="text-danger">*</span></label> <label for="shipping_address" class="col-form-label">Shipping Addresss<span class="text-danger">*</span></label>
@ -208,9 +208,7 @@
<label for="inputPassword4" class="col-form-label">Terms & Condition</label> <label for="inputPassword4" class="col-form-label">Terms & Condition</label>
<textarea class="form-control" name="terms_condition" placeholder="Terms & Condition" > <textarea class="form-control" name="terms_condition" placeholder="Terms & Condition" ><?= isset($sales['terms_condition']) ? $sales['terms_condition'] : 'Please check the products properly before purchase. Products once sold cannot be returned.' ?></textarea>
<?= isset($sales['terms_condition']) ? $sales['terms_condition'] : 'Please check the products properly before purchase. Products once sold cannot be returned.' ?>
</textarea>
</div> </div>
</div> </div>

View File

@ -79,9 +79,9 @@
} elseif ($value['status'] == 'Received') { } elseif ($value['status'] == 'Received') {
echo 'paid-status'; echo 'paid-status';
} }
?>"> ?>">
<?= $value['status']; ?> <?= $value['status']; ?>
</td> </td>
<!-- Call the model method --> <!-- Call the model method -->

View File

@ -3,7 +3,7 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="page-title-box page-title-box-alt"> <div class="page-title-box page-title-box-alt">
<h4 class="page-title">Product List </h4> <h4 class="page-title">Re-order Products List </h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
@ -22,44 +22,32 @@
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100" <table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;">
style="width:100% !important;">
<thead> <thead>
<tr> <tr>
<th>Product Name</th> <th>Product Name</th>
<th>Vendor Name</th>
<th>Unit Price</th> <th>Unit Price</th>
<th>Qty in Stock</th> <th>Qty in Stock</th>
<th>Purchase Order Level</th> <th>Re-Order Level</th>
<th>Purchase Re-Order Level</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($reorder as $value) : <?php foreach ($reorder as $value) : ?>
?>
<tr> <tr>
<td hidden><?= $value['product_id']; ?></td>
<td><?= $value['product_name']; ?></td> <td><?= $value['product_name']; ?></td>
<td><?= $value['prefered_vendor_name']; ?></td>
<td><?= number_format($value['unit_price']); ?></td> <td><?= number_format($value['unit_price']); ?></td>
<td><?= $value['qty_stock']; ?></td> <td><?= $value['qty_stock']; ?></td>
<td><?= $value['purchase_order_level']; ?></td> <td><?= $value['purchase_order_level']; ?></td>
<td><?= $value['reorder_level']; ?></td>
<td> <td>
<a href="<?= "rise_order/" . $value['product_id']; ?>" class="edit-button"><i class="ri-arrow-up-circle-fill"></i>Rise</a> <a href="<?= "rise_order/" . $value['product_id']; ?>" class="edit-button"><i class="ri-arrow-up-circle-fill"></i>Rise</a>
</td> </td>
<!-- Call the model method -->
<td>
</td>
<?php endforeach; ?> <?php endforeach; ?>
</tr> </tr>

View File

@ -24,7 +24,7 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="page-title-box page-title-box-alt"> <div class="page-title-box page-title-box-alt">
<h4 class="page-title">Return Order List </h4> <h4 class="page-title">Purchase Return List </h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "return_order_index"; ?>" class="btn btn-primary waves-effect"> <i class="ri-add-line"></i></a> <li class=""> <a href="<?= base_url() . "return_order_index"; ?>" class="btn btn-primary waves-effect"> <i class="ri-add-line"></i></a>
@ -54,7 +54,7 @@
<th>Order Date</th> <th>Order Date</th>
<th>Contact Person Details</th> <th>Contact Person Details</th>
<!-- <th>Contact Person Mobile</th> --> <!-- <th>Contact Person Mobile</th> -->
<th>Quantity</th> <th>Items</th>
<th>Status</th> <th>Status</th>
<th>Actions</th> <th>Actions</th>

View File

@ -149,7 +149,7 @@
</select> </select>
</td> </td>
<td style="width:5%;"> <td style="width:5%;">
<input type="number" class="form-control item-quantity" name="quantity[]" min="0" value="<?= isset($purchasechild['qty']) ? $purchasechild['qty'] : '' ?>"> <input type="number" class="form-control item-quantity" name="quantity[]" min="1" max="<?= isset($purchasechild['qty']) ? $purchasechild['qty'] : '' ?>" value="<?= isset($purchasechild['qty']) ? $purchasechild['qty'] : '' ?>">
</td> </td>
<td style="width:7%;"> <td style="width:7%;">
<input type="checkbox" class="form-control-check-input" name="return_selected_items[]" value="<?= $key; ?>"> <input type="checkbox" class="form-control-check-input" name="return_selected_items[]" value="<?= $key; ?>">

View File

@ -24,11 +24,10 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="page-title-box page-title-box-alt"> <div class="page-title-box page-title-box-alt">
<h4 class="page-title">Return Order List </h4> <h4 class="page-title">Create Purchase Return Order </h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<!-- <li class=""> <a href="<?= base_url() . "new_return/0"; ?>" class="btn btn-primary waves-effect"> <i class="ri-add-line"></i></a> <a href="<?= base_url() . "return_order"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
</li> -->
</ol> </ol>
</div> </div>
</div> </div>
@ -53,7 +52,7 @@
<th>Vendor Name</th> <th>Vendor Name</th>
<th>Order Date</th> <th>Order Date</th>
<th>Contact Person Details</th> <th>Contact Person Details</th>
<th>Quantity</th> <th>Items</th>
<th>Status</th> <th>Status</th>
<th>Actions</th> <th>Actions</th>
@ -85,7 +84,7 @@
<!-- Call the model method --> <!-- Call the model method -->
<td> <td>
<a href="<?= "new_return/" . $value['purchase_order_id']; ?>" class="edit-button" title="Return"><i class="ri-arrow-left-circle-fill" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="<?= "new_return/" . $value['purchase_order_id']; ?>" class="edit-button" title="Create Purchase Return"><i class="fa fa-plus-circle" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_purchase/" . $value['purchase_order_id']; ?>" class="delete-button" title="Delete"><i class="ri-delete-bin-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="<?= "delete_purchase/" . $value['purchase_order_id']; ?>" class="delete-button" title="Delete"><i class="ri-delete-bin-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "download_purchase_invoice/" . $value['purchase_order_id']; ?>" class="edit-button" title="Download"><i class="ri-download-2-fill" style="font-size: 20px;"></i></a> <a href="<?= "download_purchase_invoice/" . $value['purchase_order_id']; ?>" class="edit-button" title="Download"><i class="ri-download-2-fill" style="font-size: 20px;"></i></a>
</td> </td>

View File

@ -7,14 +7,14 @@
<a href="<?= base_url() . "sales_order_index"; ?>" class="btn btn-secondary waves-effect">Cancel</a> <a href="<?= base_url() . "sales_order_index"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
</li> </li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li> <!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> --> <li class="breadcrumb-item active">Datatables</li> -->
</ol> </ol>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
@ -25,15 +25,18 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="inputEmail4" class="col-form-label">Vehicle<span class="text-danger">*</span></label> <label for="inputEmail4" class="col-form-label">Vehicle<span
class="text-danger">*</span></label>
<?= isset($sales['vehicle_id']) ? '' : '<i type="button" class="fe-plus-circle" id="addVehicleModalButton" style="font-size: 18px;" data-toggle="modal" data-target="#addVehicleModal" title="Add Client"></i>' ?> <?= isset($sales['vehicle_id']) ? '' : '<i type="button" class="fe-plus-circle" id="addVehicleModalButton" style="font-size: 18px;" data-toggle="modal" data-target="#addVehicleModal" title="Add Client"></i>' ?>
<select class="form-control vehicle-select SelExample" name="vehicle_id" id="vehicle_id" <?= isset($sales['vehicle_id']) ? 'disabled' : 'required' ?>> <select class="form-control vehicle-select SelExample" name="vehicle_id" id="vehicle_id"
<?= isset($sales['vehicle_id']) ? 'disabled' : 'required' ?>>
<?= isset($sales['vehicle_id']) ? '' : '<option value="">Select a vehicle</option>' ?> <?= isset($sales['vehicle_id']) ? '' : '<option value="">Select a vehicle</option>' ?>
<?php foreach ($vehicle as $value) : ?> <?php foreach ($vehicle as $value) : ?>
<?php if ((int)$value["isactive"] === 1) : ?> <?php if ((int)$value["isactive"] === 1) : ?>
<option value="<?= $value["vehicle_id"] ?>" <?= isset($sales['vehicle_id']) && $sales['vehicle_id'] == $value["vehicle_id"] ? 'selected' : '' ?>> <option value="<?= $value["vehicle_id"] ?>"
<?= isset($sales['vehicle_id']) && $sales['vehicle_id'] == $value["vehicle_id"] ? 'selected' : '' ?>>
<?= $value["reg_no"]?> <?= $value["reg_no"]?>
</option> </option>
<?php endif; ?> <?php endif; ?>
@ -47,12 +50,17 @@
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="inputPassword4" class="col-form-label">Client Name<span class="text-danger"></span></label> <label for="inputPassword4" class="col-form-label">Client Name<span
<input type="text" class="form-control" name="client_id" placeholder="Client"value="<?= isset($sales['client_name']) ? $sales['client_name'] : '' ?>" readonly> class="text-danger"></span></label>
<input type="text" class="form-control" name="client_id" placeholder="Client"
value="<?= isset($sales['client_name']) ? $sales['client_name'] : '' ?>" readonly>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="inputPassword4" class="col-form-label">Mobile No<span class="text-danger">*</span></label> <label for="inputPassword4" class="col-form-label">Mobile No<span
<input type="text" class="form-control" name="mobile_no" placeholder="Mobile" value="<?= isset($sales['mobile_no']) ? $sales['mobile_no'] : '' ?>" maxlength="10" minlength="10" onkeypress = "return onlyNumbers(event)" readonly> class="text-danger">*</span></label>
<input type="text" class="form-control" name="mobile_no" placeholder="Mobile"
value="<?= isset($sales['mobile_no']) ? $sales['mobile_no'] : '' ?>" maxlength="10"
minlength="10" onkeypress="return onlyNumbers(event)" readonly>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="inputPassword4" class="col-form-label">Status<span class="text-danger">*</span> <label for="inputPassword4" class="col-form-label">Status<span class="text-danger">*</span>
@ -62,12 +70,16 @@
<select class="form-control status-select" name="status" required data-toggle="select2"> <select class="form-control status-select" name="status" required data-toggle="select2">
<?php if (isset($sales['status'])): ?> <?php if (isset($sales['status'])): ?>
<?php if ($sales['status'] === 'Cancelled'): ?> <?php if ($sales['status'] === 'Cancelled'): ?>
<option value="Created" <?= $sales['status'] === 'Created' ? 'selected' : '' ?>>Created</option>
<option value="Created" <?= $sales['status'] === 'Created' ? 'selected' : '' ?>>Created </option>
<option value="Paid" <?= $sales['status'] === 'Paid' ? 'selected' : '' ?>>Paid</option> <option value="Paid" <?= $sales['status'] === 'Paid' ? 'selected' : '' ?>>Paid</option>
<?php else: ?> <?php else: ?>
<option>Select Status</option> <option>Select Status</option>
<option value="Paid" <?= $sales['status'] === 'Paid' ? 'selected' : '' ?>>Paid</option> <option value="Paid" <?= $sales['status'] === 'Paid' ? 'selected' : '' ?>>Paid</option>
<option value="Cancelled" <?= $sales['status'] === 'Cancelled' ? 'selected' : '' ?>>Cancelled</option> <option value="Cancelled" <?= $sales['status'] === 'Cancelled' ? 'selected' : '' ?>>Cancelled</option>
<?php endif; ?> <?php endif; ?>
<?php else: ?> <?php else: ?>
<option value="Created" selected>Created</option> <option value="Created" selected>Created</option>
@ -83,25 +95,35 @@
<h4 class="header-title">Billing Address Details :</h4><br> <h4 class="header-title">Billing Address Details :</h4><br>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="inputPassword4" class="col-form-label">Address<span class="text-danger"></span></label> <label for="inputPassword4" class="col-form-label">Address<span
<input type="text" class="form-control" name="billing_address" placeholder="Address"value="<?= isset($sales['billing_address']) ? $sales['billing_address'] : '' ?>" > class="text-danger"></span></label>
<input type="text" class="form-control" name="billing_address" placeholder="Address"
value="<?= isset($sales['billing_address']) ? $sales['billing_address'] : '' ?>">
</div> </div>
<input type="hidden" id="sales_order_id" name="sales_order_id" value="<?= isset($sales['sales_order_id']) ? $sales['sales_order_id'] : '' ?>"readonly> <input type="hidden" id="sales_order_id" name="sales_order_id"
value="<?= isset($sales['sales_order_id']) ? $sales['sales_order_id'] : '' ?>" readonly>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="inputPassword4" class="col-form-label">City<span class="text-danger"></span></label> <label for="inputPassword4" class="col-form-label">City<span
<input type="text" class="form-control" name="city" placeholder="City"value="<?= isset($sales['billing_city']) ? $sales['billing_city'] : 'Chennai' ?>" > class="text-danger"></span></label>
<input type="text" class="form-control" name="city" placeholder="City"
value="<?= isset($sales['billing_city']) ? $sales['billing_city'] : 'Chennai' ?>">
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="inputPassword4" class="col-form-label">State<span class="text-danger"></span></label> <label for="inputPassword4" class="col-form-label">State<span
<input type="text" class="form-control" name="state" placeholder="State"value="<?= isset($sales['billing_state']) ? $sales['billing_state'] : 'Tamil Nadu' ?>" > class="text-danger"></span></label>
<input type="text" class="form-control" name="state" placeholder="State"
value="<?= isset($sales['billing_state']) ? $sales['billing_state'] : 'Tamil Nadu' ?>">
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="inputPassword4" class="col-form-label">Pin Code<span class="text-danger"></span></label> <label for="inputPassword4" class="col-form-label">Pin Code<span
<input type="text" class="form-control" name="postalcode" placeholder="Pin Code"value="<?= isset($sales['billing_postal_code']) ? $sales['billing_postal_code'] : '' ?>" maxlength="6" minlength="6" > class="text-danger"></span></label>
<input type="text" class="form-control" name="postalcode" placeholder="Pin Code"
value="<?= isset($sales['billing_postal_code']) ? $sales['billing_postal_code'] : '' ?>"
maxlength="6" minlength="6">
</div> </div>
@ -133,11 +155,13 @@
if ($salechild['isactive'] == 1) : ?> if ($salechild['isactive'] == 1) : ?>
<tr> <tr>
<td> <td>
<select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" id="" style="width: 249px !important;"> <select class="form-control book-select SelExample" name="item_details[]"
required data-toggle="select2" id="" style="width: 249px !important;">
<option value="">Select a Product</option> <option value="">Select a Product</option>
<?php foreach ($product as $value) : ?> <?php foreach ($product as $value) : ?>
<?php if ((int)$value["isactive"] === 1) : ?> <?php if ((int)$value["isactive"] === 1) : ?>
<option value="<?= $value["product_id"] ?>" <?= isset($salechild['product_id']) && $salechild['product_id'] == $value["product_id"] ? 'selected' : '' ?>> <option value="<?= $value["product_id"] ?>"
<?= isset($salechild['product_id']) && $salechild['product_id'] == $value["product_id"] ? 'selected' : '' ?>>
<?= $value["product_name"]; ?> <?= $value["product_name"]; ?>
</option> </option>
<?php endif; ?> <?php endif; ?>
@ -145,13 +169,18 @@
</select> </select>
</td> </td>
<td style="width:10%;"> <td style="width:10%;">
<input type="number" class="form-control item-quantity" name="quantity[]" min="0" value="<?= isset($salechild['qty']) ? $salechild['qty'] : '1' ?>"> <input type="number" class="form-control item-quantity" name="quantity[]"
min="0"
value="<?= isset($salechild['qty']) ? $salechild['qty'] : '1' ?>">
</td> </td>
<td style="width:10%;"> <td style="width:10%;">
<input type="text" class="form-control item-rate" name="unit-price[]" readonly value="<?= isset($salechild['net_price']) ? $salechild['net_price'] : '' ?>"> <input type="text" class="form-control item-rate" name="unit-price[]"
readonly
value="<?= isset($salechild['net_price']) ? $salechild['net_price'] : '' ?>">
</td> </td>
<td style="width:10%;"> <td style="width:10%;">
<input type="text" class="form-control item-tax" name="item-tax[]" value="<?= isset($salechild['tax']) ? $salechild['tax'] : '' ?>"> <input type="text" class="form-control item-tax" name="item-tax[]"
value="<?= isset($salechild['tax']) ? $salechild['tax'] : '' ?>">
</td> </td>
<!-- <td style="width:12%;"> <!-- <td style="width:12%;">
<input type="number" class="form-control item-discount-amount" min="0" name="discount_amount[]" value="<?= isset($salechild['discount']) ? $salechild['discount'] : '' ?>"> <input type="number" class="form-control item-discount-amount" min="0" name="discount_amount[]" value="<?= isset($salechild['discount']) ? $salechild['discount'] : '' ?>">
@ -163,9 +192,12 @@
</select> </select>
</td> --> </td> -->
<td style="width:12%;"> <td style="width:12%;">
<input type="text" class="form-control item-amount" name="amount[]" value="<?= isset($salechild['amount']) ? $salechild['amount'] : '' ?>"> <input type="text" class="form-control item-amount" name="amount[]"
value="<?= isset($salechild['amount']) ? $salechild['amount'] : '' ?>">
</td> </td>
<td hidden><input type="hidden" value="<?= isset($salechild['sales_order_product_id']) ? $salechild['sales_order_product_id'] : '' ?>"name="sales_order_product_id[]"></td> <td hidden><input type="hidden"
value="<?= isset($salechild['sales_order_product_id']) ? $salechild['sales_order_product_id'] : '' ?>"
name="sales_order_product_id[]"></td>
<td style="width:12%;"> <td style="width:12%;">
<center><i class="fa fa-trash remove-item"></i></center> <center><i class="fa fa-trash remove-item"></i></center>
</td> </td>
@ -175,13 +207,13 @@
<?php endif; ?> <?php endif; ?>
<!-- You can add more rows as needed using JavaScript --> <!-- You can add more rows as needed using JavaScript -->
</tbody> </tbody>
</table> </table>
<div class="form-group text-right m-b-0"> <div class="form-group text-right m-b-0">
<!-- Show the "Add More Item" button only if invoice_type is not 1 --> <!-- Show the "Add More Item" button only if invoice_type is not 1 -->
<a class="btn" id="addItem"> <a class="btn" id="addItem">
<h4><i class="fa fa-plus" aria-hidden="true"></i> Add Product</h4> <h4><i class="fa fa-plus" aria-hidden="true"></i> Add Product</h4>
</a> </a>
</div> </div>
</div> </div>
@ -192,12 +224,14 @@
<h4>Calculation</h4> <h4>Calculation</h4>
<div class="form-group"> <div class="form-group">
<label for="subtotal">Subtotal</label> <label for="subtotal">Subtotal</label>
<input type="text" class="form-control" id="subtotal" name="sub_total" value="<?= isset($sales['subtotal']) ? $sales['subtotal'] : '' ?>"readonly > <input type="text" class="form-control" id="subtotal" name="sub_total"
value="<?= isset($sales['subtotal']) ? $sales['subtotal'] : '' ?>" readonly>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="invoicetax">Tax Amount<span id=""></span></label> <label for="invoicetax">Tax Amount<span id=""></span></label>
<input type="text" class="form-control" id="invoicetax" name="invoice_tax" readonly value="<?= isset($sales['tax']) ? $sales['tax'] : '' ?>"> <input type="text" class="form-control" id="invoicetax" name="invoice_tax" readonly
value="<?= isset($sales['tax']) ? $sales['tax'] : '' ?>">
</div> </div>
@ -209,7 +243,8 @@
</div> --> </div> -->
<div class="form-group"> <div class="form-group">
<label for="grandtotal">Total</label> <label for="grandtotal">Total</label>
<input type="text" class="form-control" id="grandtotal" name="grand_total" readonly value="<?= isset($sales['total']) ? $sales['total'] : '' ?>"> <input type="text" class="form-control" id="grandtotal" name="grand_total" readonly
value="<?= isset($sales['total']) ? $sales['total'] : '' ?>">
</div> </div>
@ -222,24 +257,23 @@
<label for="inputPassword4" class="col-form-label">Terms & Condition</label> <label for="inputPassword4" class="col-form-label">Terms & Condition</label>
<textarea class="form-control" name="terms_condition" placeholder="Terms & Condition" > <textarea class="form-control" name="terms_condition" placeholder="Terms & Condition"><?= isset($sales['terms_condition']) ? $sales['terms_condition'] : 'Please check the products properly before purchase. Products once sold cannot be returned.' ?></textarea>
<?= isset($sales['terms_condition']) ? $sales['terms_condition'] : 'Please check the products properly before purchase. Products once sold cannot be returned.' ?>
</textarea>
</div> </div>
</div> </div>
<?php if (!isset($sales['status']) || $sales['status'] !== 'Paid') : ?> <?php if (!isset($sales['status']) || $sales['status'] !== 'Paid') : ?>
<button type="submit" id="editaddbutton" class="btn btn-primary">Submit</button> <button type="submit" id="editaddbutton" class="btn btn-primary">Submit</button>
<?php endif; ?> <?php endif; ?>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<?php include('layout/footer.php'); ?> <?php include('layout/footer.php'); ?>
</div> </div>
<div class="modal fade" id="addVehicleModal" tabindex="-1" role="dialog" aria-labelledby="addVehicleModalLabel" aria-hidden="true"> <div class="modal fade" id="addVehicleModal" tabindex="-1" role="dialog" aria-labelledby="addVehicleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -249,17 +283,19 @@
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form > <form>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<!-- <div class="form-group"> --> <!-- <div class="form-group"> -->
<label for="inputPassword4" class="col-form-label">Make</label> <label for="inputPassword4" class="col-form-label">Make</label>
<select class="form-control SelExample" name="make" id="make" <?= isset($vehicle['make']) ? '' : 'required' ?>> <select class="form-control SelExample" name="make" id="make"
<?= isset($vehicle['make']) ? '' : 'required' ?>>
<?= isset($vehicle['make']) ? '' : '<option value="">Select a Make</option>' ?> <?= isset($vehicle['make']) ? '' : '<option value="">Select a Make</option>' ?>
<?php foreach ($makeData as $value) : ?> <?php foreach ($makeData as $value) : ?>
<?php if ((int)$value["isactive"] === 1) : ?> <?php if ((int)$value["isactive"] === 1) : ?>
<option value="<?= $value["make_id"] ?>" <?= isset($vehicle['make']) && $vehicle['make'] == $value["make_id"] ? 'selected' : '' ?>> <option value="<?= $value["make_id"] ?>"
<?= isset($vehicle['make']) && $vehicle['make'] == $value["make_id"] ? 'selected' : '' ?>>
<?= $value["make"]; ?> <?= $value["make"]; ?>
</option> </option>
<?php endif; ?> <?php endif; ?>
@ -269,9 +305,10 @@
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="inputPassword4" class="col-form-label">Model</label> <label for="inputPassword4" class="col-form-label">Model</label>
<select class="form-control SelExample" name="model" id="model" <?= isset($vehicle['model']) ? '' : 'required' ?>> <select class="form-control SelExample" name="model" id="model"
<?= isset($vehicle['model']) ? '' : 'required' ?>>
<?php if (isset($vehicle["model_name"])) : ?> <?php if (isset($vehicle["model_name"])) : ?>
<option value="<?= $vehicle["model"] ?>" > <option value="<?= $vehicle["model"] ?>">
<?= $vehicle["model_name"]; ?> <?= $vehicle["model_name"]; ?>
</option> </option>
<?php endif; ?> <?php endif; ?>
@ -282,7 +319,8 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="inputPassword4" class="col-form-label">Reg Number</label> <label for="inputPassword4" class="col-form-label">Reg Number</label>
<input type="text" class="form-control" name="reg_no" id="reg_no" placeholder="Reg Number"value="<?= isset($vehicle['reg_no']) ? $vehicle['reg_no'] : '' ?>" required> <input type="text" class="form-control" name="reg_no" id="reg_no" placeholder="Reg Number"
value="<?= isset($vehicle['reg_no']) ? $vehicle['reg_no'] : '' ?>" required>
</div> </div>
</div> </div>
@ -292,7 +330,7 @@
<div class="form-group col-md-12 select"> <div class="form-group col-md-12 select">
<label for="clientName">Client Name</label> <label for="clientName">Client Name</label>
<i type="button" class="fe-user-plus" id="createClient" style="font-size: 18px;" ></i> <i type="button" class="fe-user-plus" id="createClient" style="font-size: 18px;"></i>
<select class="form-control cleint-select SelExample" id="clientName" required> <select class="form-control cleint-select SelExample" id="clientName" required>
<option value="">Select a Client</option> <option value="">Select a Client</option>
<?php foreach ($client as $value) : ?> <?php foreach ($client as $value) : ?>
@ -305,7 +343,8 @@
<div class="form-group col-md-12 select"> <div class="form-group col-md-12 select">
<label for="clientMobile">Mobile</label> <label for="clientMobile">Mobile</label>
<input type="text" class="form-control" id="clientMobile" placeholder="Enter mobile number" maxlength="10" minlength="10"onkeypress = "return onlyNumbers(event)"required> <input type="text" class="form-control" id="clientMobile" placeholder="Enter mobile number"
maxlength="10" minlength="10" onkeypress="return onlyNumbers(event)" required>
</div> </div>
@ -313,22 +352,25 @@
<div class="form-group col-md-12 create" style="display:none;"> <div class="form-group col-md-12 create" style="display:none;">
<label for="create-clientName">Client Name</label> <label for="create-clientName">Client Name</label>
<i type="button" class="fe-user-check" id="selectClient" style="font-size: 18px;" ></i> <i type="button" class="fe-user-check" id="selectClient" style="font-size: 18px;"></i>
<input type="text" class="form-control" id="create-clientName" placeholder="Enter client name" required> <input type="text" class="form-control" id="create-clientName"
placeholder="Enter client name" required>
</div> </div>
<div class="form-group col-md-6 create" style="display:none;"> <div class="form-group col-md-6 create" style="display:none;">
<label for="create-clientMobile">Mobile</label> <label for="create-clientMobile">Mobile</label>
<input type="text" class="form-control" id="create-clientMobile" placeholder="Enter mobile number" maxlength="10" minlength="10"onkeypress = "return onlyNumbers(event)"required> <input type="text" class="form-control" id="create-clientMobile"
placeholder="Enter mobile number" maxlength="10" minlength="10"
onkeypress="return onlyNumbers(event)" required>
</div> </div>
<div class="form-group col-md-6 create" style="display:none;"> <div class="form-group col-md-6 create" style="display:none;">
<label for="create-clientType">Client Type</label> <label for="create-clientType">Client Type</label>
<select class="form-control status-select" id="create-clientType" required > <select class="form-control status-select" id="create-clientType" required>
<option value="">Select a Type</option> <option value="">Select a Type</option>
<option value="Direct" >Direct</option> <option value="Direct">Direct</option>
<option value="Mechanic" >Mechanic</option> <option value="Mechanic">Mechanic</option>
<option value="Exp" >Exp</option> <option value="Exp">Exp</option>
</select> </select>
</div> </div>
@ -346,7 +388,6 @@
<script> <script>
productarray = []; productarray = [];
$(document).ready(function() { $(document).ready(function() {
// Function to fetch make and model information based on make and model IDs // Function to fetch make and model information based on make and model IDs
@ -420,7 +461,7 @@ $(document).ready(function() {
}); });
<?php <?php
$product_json = json_encode($product); $product_json = json_encode($product);
?> ?>
@ -464,8 +505,8 @@ $(document).ready(function() {
var amount = rate * quantity; var amount = rate * quantity;
console.log(amount); console.log(amount);
var taxamount = amount * tax/100; var taxamount = amount * tax / 100;
var finalamt=amount + taxamount; var finalamt = amount + taxamount;
console.log("samount".samount); console.log("samount".samount);
$(row).find('.item-amount').val(finalamt); $(row).find('.item-amount').val(finalamt);
} }
@ -473,6 +514,7 @@ $(document).ready(function() {
// Event listener for product selection // Event listener for product selection
$(document).on('change', 'select[name="item_details[]"]', function() { $(document).on('change', 'select[name="item_details[]"]', function() {
var productId = $(this).val(); var productId = $(this).val();
var quantity = $(this).closest('tr').find('.item-quantity').val(1); var quantity = $(this).closest('tr').find('.item-quantity').val(1);
@ -481,6 +523,9 @@ $(document).ready(function() {
return item.product_id == productId; return item.product_id == productId;
}); });
$(this).closest('tr').find('.item-quantity').attr('max', product.qty_stock);
// Access unit price from product and set it as rate // Access unit price from product and set it as rate
var unitPrice = parseFloat(product.unit_price); // Convert to float if necessary var unitPrice = parseFloat(product.unit_price); // Convert to float if necessary
$(this).closest('tr').find('.item-rate').val(unitPrice); $(this).closest('tr').find('.item-rate').val(unitPrice);
@ -514,10 +559,10 @@ $(document).ready(function() {
// console.log(taxPercentage); // console.log(taxPercentage);
var amount = parseFloat($(this).closest('tr').find('.item-amount').val()) || 0; var amount = parseFloat($(this).closest('tr').find('.item-amount').val()) || 0;
// console.log(amount); // console.log(amount);
var qty=parseFloat($(this).closest('tr').find('.item-quantity').val()) || 0; var qty = parseFloat($(this).closest('tr').find('.item-quantity').val()) || 0;
// console.log(qty); // console.log(qty);
var rate=parseFloat($(this).closest('tr').find('.item-rate').val()) || 0; var rate = parseFloat($(this).closest('tr').find('.item-rate').val()) || 0;
var taxamount=rate * qty; var taxamount = rate * qty;
// console.log(taxamount); // console.log(taxamount);
var taxValue = (taxPercentage / 100) * taxamount; // Convert percentage to absolute value var taxValue = (taxPercentage / 100) * taxamount; // Convert percentage to absolute value
tax += taxValue; tax += taxValue;
@ -573,16 +618,17 @@ $(document).ready(function() {
// Event listener for "Add More Item" button // Event listener for "Add More Item" button
$('#addItem').click(function() { $('#addItem').click(function() {
console.log(productarray); console.log(productarray);
var newRow = '<tr>' + '<td><select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" style="width: 249px !important;"><option value="">Select a Product</option>'; var newRow = '<tr>' +
'<td><select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" style="width: 249px !important;"><option value="">Select a Product</option>';
for (var i = 0; i < productarray.length; i++) for (var i = 0; i < productarray.length; i++) {
{
var product = productarray[i]; var product = productarray[i];
newRow += '<option value="' + product.product_id + '">' + product.product_name + '</option>'; newRow += '<option value="' + product.product_id + '" >' + product.product_name +
'</option>';
} }
newRow += '</select></td>' + newRow += '</select></td>' +
'<td style="width:10%;"><input type="number" class="form-control item-quantity" min="0" name="quantity[]"/></td>' + '<td style="width:10%;"><input type="number" class="form-control item-quantity" min="0" max="" name="quantity[]"/></td>' +
'<td style="width:10%;"><input type="text" class="form-control item-rate" name="unit-price[]" readonly /></td>' + '<td style="width:10%;"><input type="text" class="form-control item-rate" name="unit-price[]" readonly /></td>' +
'<td style="width:8%;"><input type="text" class="form-control item-tax" name="item-tax[]" readonly /></td>' + '<td style="width:8%;"><input type="text" class="form-control item-tax" name="item-tax[]" readonly /></td>' +
'<td style="width:12%;"><input type="text" class="form-control item-amount" name="amount[]"/></td>' + '<td style="width:12%;"><input type="text" class="form-control item-amount" name="amount[]"/></td>' +
@ -609,11 +655,9 @@ function initializeRowCalculations(row) {
calculateAmount(row); calculateAmount(row);
updateCalculations(); updateCalculations();
} }
</script> </script>
<script> <script>
// Event listener for removing item // Event listener for removing item
// Event listener for removing item // Event listener for removing item
$(document).on('click', '.remove-item', function() { $(document).on('click', '.remove-item', function() {
var salesOrderProductId = $(this).closest('tr').find('input[name="sales_order_product_id[]"]').val(); var salesOrderProductId = $(this).closest('tr').find('input[name="sales_order_product_id[]"]').val();
@ -622,7 +666,9 @@ $(document).on('click', '.remove-item', function() {
$.ajax({ $.ajax({
url: '<?php echo base_url()."delete_sales_product"?>', url: '<?php echo base_url()."delete_sales_product"?>',
method: 'POST', method: 'POST',
data: { sales_order_product_id: salesOrderProductId }, data: {
sales_order_product_id: salesOrderProductId
},
success: function(response) { success: function(response) {
// Check if the deletion was successful // Check if the deletion was successful
if (response.success) { if (response.success) {
@ -663,10 +709,9 @@ $(document).ready(function() {
} }
}); });
}); });
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// Event listener for customer selection change // Event listener for customer selection change
$('.cleint-select').change(function() { $('.cleint-select').change(function() {
@ -688,32 +733,33 @@ $(document).ready(function() {
}); });
</script> </script>
<script> <script>
// Define the clients array and populate it with data // Define the clients array and populate it with data
var vehicles = <?php echo json_encode($vehicle); ?>; var vehicles = <?php echo json_encode($vehicle); ?>;
var clients = <?php echo json_encode($client); ?>; var clients = <?php echo json_encode($client); ?>;
</script> </script>
<script> <script>
function onlyNumbers(event){ function onlyNumbers(event) {
var charcode; var charcode;
charcode = event.which || event.keyCode; charcode = event.which || event.keyCode;
if(charcode>= 48 && charcode <= 57)return true; if (charcode >= 48 && charcode <= 57) return true;
return false; return false;
} }
</script> </script>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>
<script> <script>
$(document).ready(function(){ $(document).ready(function() {
// Initialize select2 // Initialize select2
$(".SelExample").select2(); $(".SelExample").select2();
}); });
function initializeSelect2() { function initializeSelect2() {
$('.SelExample').select2({ $('.SelExample').select2({
width: '249px' // Adjust width as needed width: '249px' // Adjust width as needed
}); });
} }
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
@ -735,16 +781,17 @@ $(document).ready(function() {
var createclientMobile = $('#create-clientMobile').val(); var createclientMobile = $('#create-clientMobile').val();
var createclientType = $('#create-clientType').val(); var createclientType = $('#create-clientType').val();
if (formType == 'select') if (formType == 'select') {
{ var ifStatementCondition =
var ifStatementCondition = "clientName !== '' && clientMobile !== '' && reg_no !== '' && model !== '' && make !== ''"; "clientName !== '' && clientMobile !== '' && reg_no !== '' && model !== '' && make !== ''";
} else { } else {
var ifStatementCondition = "createclientName !== '' && createclientMobile !== '' && createclientType !== '' && reg_no !== '' && model !== '' && make !== ''"; var ifStatementCondition =
"createclientName !== '' && createclientMobile !== '' && createclientType !== '' && reg_no !== '' && model !== '' && make !== ''";
} }
console.log(ifStatementCondition); console.log(ifStatementCondition);
if( eval(ifStatementCondition) ){ if (eval(ifStatementCondition)) {
// Send AJAX request to save the client // Send AJAX request to save the client
$.ajax({ $.ajax({
@ -753,13 +800,13 @@ $(document).ready(function() {
data: { data: {
client_id: clientName, client_id: clientName,
mobile_no: clientMobile, mobile_no: clientMobile,
reg_no:reg_no, reg_no: reg_no,
model:model, model: model,
make:make, make: make,
createclientName:createclientName, createclientName: createclientName,
createclientMobile:createclientMobile, createclientMobile: createclientMobile,
createclientType:createclientType, createclientType: createclientType,
formType:formType, formType: formType,
}, },
success: function(response) { success: function(response) {
@ -778,34 +825,36 @@ $(document).ready(function() {
} }
}); });
}else{ } else {
toastr.warning("Please Fill All Data"); toastr.warning("Please Fill All Data");
} }
}); });
}); });
</script> </script>
<script> <script>
$(".SelExample").select2(); $(".SelExample").select2();
// Event listener for change in make select dropdown // Event listener for change in make select dropdown
$("#make").on('change', function() { $("#make").on('change', function() {
var selected_makes = $(this).val(); // Get an array of selected make IDs var selected_makes = $(this).val(); // Get an array of selected make IDs
// AJAX request to fetch models based on selected make IDs // AJAX request to fetch models based on selected make IDs
$.ajax({ $.ajax({
url: '<?= base_url("fetch_models") ?>', // URL to your controller method for fetching models url: '<?= base_url("fetch_models") ?>', // URL to your controller method for fetching models
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
data: { selected_makes: [selected_makes] }, data: {
selected_makes: [selected_makes]
},
success: function(response) { success: function(response) {
// Clear existing options in model select dropdown // Clear existing options in model select dropdown
$("#model").empty(); $("#model").empty();
$("#model").append('<option value=""> Select a Model </option>'); $("#model").append('<option value=""> Select a Model </option>');
// Populate model select dropdown with fetched models // Populate model select dropdown with fetched models
$.each(response, function(index, model) { $.each(response, function(index, model) {
$("#model").append('<option value="' + model.model_id + '">' + model.model_name + '</option>'); $("#model").append('<option value="' + model.model_id + '">' + model
.model_name + '</option>');
}); });
// Refresh select2 to reflect changes // Refresh select2 to reflect changes
@ -814,19 +863,17 @@ $.ajax({
error: function(xhr, status, error) { error: function(xhr, status, error) {
console.error(error); // Log any errors to the console console.error(error); // Log any errors to the console
} }
}); });
}); });
document.getElementById('reg_no').addEventListener('input', function(event) { document.getElementById('reg_no').addEventListener('input', function(event) {
var inputText = event.target.value; var inputText = event.target.value;
event.target.value = inputText.toUpperCase(); event.target.value = inputText.toUpperCase();
}); });
</script> </script>
<script> <script>
$(document).on('click', '#createClient', function() { $(document).on('click', '#createClient', function() {
$('.create').show(); $('.create').show();
$('.select').hide(); $('.select').hide();
$('#formType').val('create'); $('#formType').val('create');
@ -836,8 +883,8 @@ document.getElementById('reg_no').addEventListener('input', function(event) {
$('#clientMobile').val(''); $('#clientMobile').val('');
}); });
$(document).on('click', '#selectClient', function() { $(document).on('click', '#selectClient', function() {
$('.select').show(); $('.select').show();
$('.create').hide(); $('.create').hide();
$('#formType').val('select'); $('#formType').val('select');
@ -845,27 +892,30 @@ document.getElementById('reg_no').addEventListener('input', function(event) {
$('#create-clientName').val(''); $('#create-clientName').val('');
$('#create-clientMobile').val(''); $('#create-clientMobile').val('');
$('#create-clientType').val(''); $('#create-clientType').val('');
}); });
</script> </script>
<style> <style>
.select2-container--default .select2-results__option--highlighted[aria-selected]{ .select2-container--default .select2-results__option--highlighted[aria-selected] {
color:#ffffff; color: #ffffff;
background: #526dee!important; background: #526dee !important;
} }
.select2-container .select2-selection--single{
.select2-container .select2-selection--single {
height: 36px; height: 36px;
border:1px solid #ced4da; border: 1px solid #ced4da;
} }
.select2-container--default .select2-selection--single .select2-selection__rendered{
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 36px; line-height: 36px;
} }
.select2-container--default .select2-selection--single .select2-selection__arrow{
top:4px; .select2-container--default .select2-selection--single .select2-selection__arrow {
} top: 4px;
}
</style> </style>
<script> <script>
// Assuming you have an edit button with an ID 'editButton' // Assuming you have an edit button with an ID 'editButton'

View File

@ -31,8 +31,7 @@
<tr> <tr>
<th>Reg No</th> <th>Reg No</th>
<th>Make & Model</th> <th>Make & Model</th>
<th>Manf Year</th> <th>Year of Manf</th>
<th>Colour</th>
<th>Client Name</th> <th>Client Name</th>
<th>Mobile</th> <th>Mobile</th>
<th>Actions</th> <th>Actions</th>
@ -48,12 +47,11 @@
<td><?= $value['reg_no']; ?></td> <td><?= $value['reg_no']; ?></td>
<td><?= $value['make_name'].' '.$value['model_name']; ?></td> <td><?= $value['make_name'].' '.$value['model_name']; ?></td>
<td><?= $value['year_of_manufacturing']; ?></td> <td><?= $value['year_of_manufacturing']; ?></td>
<td><?= $value['colour']; ?></td>
<td><?= $value['client_name']; ?></td> <td><?= $value['client_name']; ?></td>
<td><?= $value['mobile_no']; ?></td> <td><?= $value['mobile_no']; ?></td>
<td> <td>
<a href="<?= "new_vehicle/" . $value['vehicle_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a> <a href="<?= "new_vehicle/" . $value['vehicle_id']; ?>" class="edit-button"><i class="ri-pencil-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_vehicle/" . $value['vehicle_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a> <a href="<?= "delete_vehicle/" . $value['vehicle_id']; ?>" class="delete-button"><i class="ri-delete-bin-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td> </td>
<?php endif?> <?php endif?>