CHANGE_OUTSOURCE_PDF_DOWNLOAD_ALL_LIST_VIEW_ACTION_CHANEG : AADHAVAN

This commit is contained in:
aadhavan valli 2024-05-20 14:13:51 +05:30
parent fd9d319773
commit c5580b4a9d
21 changed files with 467 additions and 172 deletions

View File

@ -89,6 +89,7 @@ $routes->get("download_jobcard_invoice/(:any)", "Jobcard::download_jobcard_invoi
// $routes->post("save_vehicle", "Jobcard::save_vehicle");
$routes->get("download_jobcard/(:any)", "Jobcard::download_jobcard/$1");
$routes->get("download_os", "Jobcard::download_os");
$routes->get("individual_download_os/(:any)", "Jobcard::individual_download_os/$1");
$routes->post("getServices", "Jobcard::getServices");
//End Job Card //

View File

@ -30,6 +30,7 @@ class Jobcard extends BaseController
public $BikemakeModel;
public $BusinessModel;
public $JobcardModel;
public $JobcardOSModel;
public $BranchModel;
public function __construct()
{
@ -39,6 +40,7 @@ class Jobcard extends BaseController
$this->BikemakeModel = new BikemakeModel();
$this->BusinessModel = new BusinessModel();
$this->JobcardModel = new JobcardModel();
$this->JobcardOSModel = new JobcardOSModel();
$this->BranchModel = new BranchModel();
}
@ -52,6 +54,8 @@ class Jobcard extends BaseController
$jobs=$JobcardModel->getJobCardsWithProductsAndService($this->session->get('logged_user_branch_id'), $data);
$data['jobs']=$jobs;
$data['logged_user_role'] = $this->session->get('logged_user_role');
// echo "<pre>";
// print_r($data);die;
return view('jobs_list',$data);
}
@ -79,6 +83,7 @@ class Jobcard extends BaseController
public function download_jobcard_invoice($job_card_id)
{
$data['vehicle'] = $this->JobcardModel->get_jobcard_vehicle_details($job_card_id);
// print_r($data['vehicle']);die;
$bus_id = $this->session->get('logged_user_business_id');
$data['job_card'] = $this->JobcardModel->where('job_card_id',$job_card_id)->findAll();
$data['company_address'] = $this->BranchModel->where('branch_id', $this->session->get('logged_user_branch_id'))->where('business_id', $bus_id)->where('isactive', 1)->findAll();
@ -116,7 +121,7 @@ class Jobcard extends BaseController
$discount = ($data['job_card'][0]['is_rework'] == 1) ? 0 : $data['job_card'][0]['discount'] ;
$amt_with_tax = $totalAmount + ($totalAmount * $totalTax / 100);
$totalAmount = ($amt_with_tax - $discount) / (1 + ($totalTax/100));
$totalAmount = ($amt_with_tax - (float)$discount) / (1 + ($totalTax/100));
// Create single output array
$labour_data[0] = [
"product_name" => "Labour Cost",
@ -219,54 +224,166 @@ class Jobcard extends BaseController
$JobcardProductModel = new JobcardProductModel();
$outsource = $this->JobcardModel->download_os($this->session->get('logged_user_branch_id'));
foreach ($outsource as &$value) {
$products = [];
$product_ids = !empty(json_decode($value['product_id'], true)) ? json_decode($value['product_id'], true) : [0];
$product = $JobcardProductModel->select('job_card_product.job_card_product_id,job_card_product.product_id,job_card_product.qty,products.product_name as pname')
->join('products', 'products.product_id = job_card_product.product_id')
->whereIn('job_card_product.job_card_product_id', $product_ids)->find();
foreach ($product as $pr_value) {
array_push($products,$pr_value);
if (count($outsource) > 0) {
foreach ($outsource as &$value) {
$products = [];
$product_ids = !empty(json_decode($value['product_id'], true)) ? json_decode($value['product_id'], true) : [0];
$product = $JobcardProductModel->select('job_card_product.job_card_product_id,job_card_product.product_id,job_card_product.qty,products.product_name as pname')
->join('products', 'products.product_id = job_card_product.product_id')
->whereIn('job_card_product.job_card_product_id', $product_ids)->find();
foreach ($product as $pr_value) {
array_push($products,$pr_value);
}
$value['products'] = $products;
}
$groupedJobs = [];
// Iterate over each job
foreach ($outsource as $job) {
$jobCardId = $job['job_card_id'];
// Check if the job_card_id already exists in $groupedJobs
if (!isset($groupedJobs[$jobCardId])) {
// If not, initialize an array for that job_card_id with all details except 'name'
$groupedJobs[$jobCardId] = $job;
// Remove the 'name' key and initialize 'names' array
unset($groupedJobs[$jobCardId]['name']);
$groupedJobs[$jobCardId]['names'] = [];
}
$value['products'] = $products;
// Add the name to the 'names' array
$groupedJobs[$jobCardId]['names'][] = $job['name'];
}
usort($groupedJobs, function($a, $b) {
return strtotime($a['delivery_date']) - strtotime($b['delivery_date']);
});
$data['outsource'] = $groupedJobs;
// Create an mPDF object
$mpdf = new Mpdf([
'mode' => '',
'format' => 'A5',
'default_font_size' => 0,
'default_font' => '',
// 'margin_right' => 1,
'margin_top' => 6,
'margin_bottom' => 6,
'margin_header' => 6,
'margin_footer' =>-30,
'orientation' => 'P',
]);
$mpdf->autoLangToFont = true;
$mpdf->autoScriptToLang = true;
// Set PDF properties
$mpdf->SetTitle('Invoice');
// $mpdf->SetAuthor($data[0]->branch_name);
$mpdf->SetCreator('');
// echo "<pre>";
// print_r($data);die;
// Generate the PDF content (HTML) with data
$html = view('outsourcing_template', $data);
// echo $html;die;
// Load HTML into the mPDF instance
$mpdf->WriteHTML($html);
// Output the PDF to the browser for download
$mpdf->Output('OS_' . date('Y-m-d H-i-s') . '.pdf', 'D');
}else{
return redirect()->with('download_os', 'No Out Source')->back();
}
$data['outsource'] = $outsource;
}
// Create an mPDF object
$mpdf = new Mpdf([
'mode' => '',
'format' => 'A5',
'default_font_size' => 0,
'default_font' => '',
// 'margin_right' => 1,
'margin_top' => 6,
'margin_bottom' => 6,
'margin_header' => 6,
'margin_footer' =>-30,
'orientation' => 'P',
]);
public function individual_download_os($job_card_id){
$JobcardProductModel = new JobcardProductModel();
$outsource = $this->JobcardOSModel->individual_download_os($job_card_id);
$mpdf->autoLangToFont = true;
$mpdf->autoScriptToLang = true;
// Set PDF properties
$mpdf->SetTitle('Invoice');
// $mpdf->SetAuthor($data[0]->branch_name);
$mpdf->SetCreator('');
// Generate the PDF content (HTML) with data
$html = view('outsourcing_template', $data);
// echo $html;die;
// Load HTML into the mPDF instance
$mpdf->WriteHTML($html);
// Output the PDF to the browser for download
$mpdf->Output('OS_' . date('Y-m-d H-i-s') . '.pdf', 'D');
if (count($outsource) > 0) {
foreach ($outsource as &$value) {
$products = [];
$product_ids = !empty(json_decode($value['product_id'], true)) ? json_decode($value['product_id'], true) : [0];
$product = $JobcardProductModel->select('job_card_product.job_card_product_id,job_card_product.product_id,job_card_product.qty,products.product_name as pname')
->join('products', 'products.product_id = job_card_product.product_id')
->whereIn('job_card_product.job_card_product_id', $product_ids)->find();
foreach ($product as $pr_value) {
array_push($products,$pr_value);
}
$value['products'] = $products;
}
$groupedJobs = [];
// Iterate over each job
foreach ($outsource as $job) {
$jobCardId = $job['job_card_id'];
// Check if the job_card_id already exists in $groupedJobs
if (!isset($groupedJobs[$jobCardId])) {
// If not, initialize an array for that job_card_id with all details except 'name'
$groupedJobs[$jobCardId] = $job;
// Remove the 'name' key and initialize 'names' array
unset($groupedJobs[$jobCardId]['name']);
$groupedJobs[$jobCardId]['names'] = [];
}
// Add the name to the 'names' array
$groupedJobs[$jobCardId]['names'][] = $job['name'];
}
usort($groupedJobs, function($a, $b) {
return strtotime($a['delivery_date']) - strtotime($b['delivery_date']);
});
$data['outsource'] = $groupedJobs;
// Create an mPDF object
$mpdf = new Mpdf([
'mode' => '',
'format' => 'A5',
'default_font_size' => 0,
'default_font' => '',
// 'margin_right' => 1,
'margin_top' => 6,
'margin_bottom' => 6,
'margin_header' => 6,
'margin_footer' =>-30,
'orientation' => 'P',
]);
$mpdf->autoLangToFont = true;
$mpdf->autoScriptToLang = true;
// Set PDF properties
$mpdf->SetTitle('Invoice');
// $mpdf->SetAuthor($data[0]->branch_name);
$mpdf->SetCreator('');
// echo "<pre>";
// print_r($data);die;
// Generate the PDF content (HTML) with data
$html = view('outsourcing_template', $data);
// echo $html;die;
// Load HTML into the mPDF instance
$mpdf->WriteHTML($html);
// Output the PDF to the browser for download
$mpdf->Output('OS_' . date('Y-m-d H-i-s') . '.pdf', 'D');
}else{
return redirect()->with('msg', 'failed')->back();
}
}

View File

@ -74,6 +74,7 @@ class Model extends BaseController
if (!$model_id) {
try {
$data['business_id'] = $this->session->get('logged_user_business_id');
$inserted = $BikemodelsModel->insert($data);
} catch (\CodeIgniter\Database\Exceptions\DatabaseException $e) {

View File

@ -15,8 +15,9 @@ class JobcardModel extends Model
public function getJobCardsWithProductsAndService($logged_user_branch_id,$data)
{
$this->select('job_card.*, COUNT(job_card_product.job_card_id) AS product_count, vehicle.reg_no');
$this->select('job_card.*, COUNT(job_card_product.job_card_id) AS product_count,COUNT(job_card_os.job_card_id) AS os_count, vehicle.reg_no');
$this->join('job_card_product', 'job_card_product.job_card_id = job_card.job_card_id', 'left');
$this->join('job_card_os', 'job_card_os.job_card_id = job_card.job_card_id', 'left');
$this->join('vehicle', 'vehicle.vehicle_id = job_card.vehicle_id', 'left');
$this->groupBy('job_card.job_card_id');
$this->where('job_card.isactive', 1);
@ -149,7 +150,7 @@ class JobcardModel extends Model
job_card_os.job_card_id,job_card_os.os_id,job_card_os.product_id,
out_source.name,
vehicle.reg_no, vehicle.make, vehicle.colour,vehicle.model,
make.make as bike_name, model.model_name as bike_modal_name'
make.make as bike_name, model.model_name as bike_modal_name,job_card.delivery_date'
);
// $this->from('job_card');
$this->join('job_card_os', 'job_card_os.job_card_id = job_card.job_card_id');
@ -166,6 +167,8 @@ class JobcardModel extends Model
return $this->findAll();
}
}

View File

@ -6,4 +6,27 @@ class JobcardOSModel extends Model
protected $table = 'job_card_os';
protected $primaryKey = 'job_card_os_id';
protected $allowedFields = ['job_card_os_id','job_card_id','os_id', 'labour_cost','product_id', 'qty', 'tax', 'amount','isactive'];
public function individual_download_os($job_card_id)
{
$this->select('
job_card.job_card_id, job_card.created_at, job_card.branch_id, job_card.isactive, job_card.vehicle_id,
job_card_os.job_card_id AS job_card_os_job_card_id, job_card_os.os_id, job_card_os.product_id,
out_source.name,
vehicle.reg_no, vehicle.make, vehicle.colour, vehicle.model,
make.make AS bike_name, model.model_name AS bike_modal_name, job_card.delivery_date
');
$this->join('job_card', 'job_card.job_card_id = job_card_os.job_card_id');
$this->join('out_source', 'out_source.id = job_card_os.os_id', 'left');
$this->join('vehicle', 'vehicle.vehicle_id = job_card.vehicle_id', 'left');
$this->join('make', 'make.make_id = vehicle.make', 'left');
$this->join('model', 'model.model_id = vehicle.model', 'left');
$this->where('job_card_os.job_card_id', $job_card_id);
$this->where('job_card_os.is_active', 1);
$this->orderBy('job_card.job_card_id', 'DESC');
return $this->findAll();
}
}

View File

@ -41,13 +41,19 @@
<?php endif; ?>
</td>
<td>
<a data-toggle="modal" data-target="#bike_model_login-modal_1" data-value="<?php echo $item['model_id']; ?>" class="edit-button" onclick="editModel(this)"><i class="ri-pencil-line"></i></a>
<a data-value="<?php echo $item['model_id']; ?>" onclick="deleteModel(this)"><i style="color: #526dee;margin-left: 10px;" class="ri-delete-bin-line"></i></a>
<?php if($item['isactive'] == 1): ?>
<a style="color:red; margin-left:12px;" data-id="<?php echo $item['model_id']; ?>" data-isactive="<?php echo $item['isactive']; ?>" title="Deactivate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;"></i></a>
<?php else: ?>
<a style="color:green; margin-left:12px;" data-id="<?php echo $item['model_id']; ?>" data-isactive="<?php echo $item['isactive']; ?>" title="Activate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i></a>
<?php endif; ?>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a data-toggle="modal" data-target="#bike_model_login-modal_1" data-value="<?php echo $item['model_id']; ?>" class="dropdown-item edit-button" onclick="editModel(this)"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a data-value="<?php echo $item['model_id']; ?>" class="dropdown-item" onclick="deleteModel(this)"><i style="color: #526dee;" class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
<?php if($item['isactive'] == 1): ?>
<a class="dropdown-item" data-id="<?php echo $item['model_id']; ?>" data-isactive="<?php echo $item['isactive']; ?>" title="Deactivate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;"></i>Deactivate</a>
<?php else: ?>
<a class="dropdown-item" data-id="<?php echo $item['model_id']; ?>" data-isactive="<?php echo $item['isactive']; ?>" title="Activate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i>Activate</a>
<?php endif; ?>
</div>
</div>
</td>
</tr>
<?php endforeach; ?>
@ -120,25 +126,27 @@
$('tbody').html('');
$.each(response.model_list, function(index, item) {
response.model_list.forEach(function(item) {
var row = '<tr>' +
'<td class="model_name">' + item.model_name + '</td>' +
'<td class="make">' + item.model_name + '</td>' +
'<td>';
if (item.isactive == 1) {
row += '<span style="color:green">Active</span>';
} else if (item.isactive == 0) {
row += '<span style="color:red">Inactive</span>';
}
row += '</td><td>';
row += '<a data-toggle="modal" data-target="#bike_model_login-modal_1" data-value="' + item.model_id + '" class="edit-button" onclick="editModel(this)"><i class="ri-pencil-line"></i></a>';
// Check the isactive status and set the icon color accordingly
if (item.isactive == 1) {
row += '<a style="color:red; margin-left:12px;" data-id="' + item.model_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)" ><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;"></i></a>';
row += '<span style="color:green">Active</span>';
} else if (item.isactive == 0) {
row += '<a style="color:green; margin-left:12px;" data-id="' + item.model_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)" ><i class="fa fa-bicycle"></i></a>';
row += '<span style="color:red">Inactive</span>';
}
row += '</td><td>' +
'<div class="btn-group dropdown">' +
'<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>' +
'<div class="dropdown-menu dropdown-menu-right">' +
'<a data-toggle="modal" data-target="#bike_model_login-modal_1" data-value="' + item.model_id + '" class="dropdown-item edit-button" onclick="editModel(this)"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>'+
'<a data-value="' + item.model_id + '" class="dropdown-item" onclick="deleteModel(this)"><i style="color: #526dee;" class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle"></i>Delete</a>';
if (item.isactive == 1) {
row += '<a class="dropdown-item" data-id="' + item.model_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)" ><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;"></i>Deactivate</a>';
} else if (item.isactive == 0) {
row += '<a class="dropdown-item" data-id="' + item.model_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)" ><i class="fa fa-bicycle"></i>Activate</a>';
}
row += '</td><td></td></tr>';
@ -147,7 +155,7 @@
$('tbody').append(row);
});
}
window.location.reload();
// window.location.reload();
},
error: function(xhr, status, error) {
// Handle error response here
@ -180,10 +188,10 @@
if (response.status == "success") {
$('tbody').html('');
$.each(response.data, function(index, item) {
response.data.forEach(function(item) {
var row = '<tr>' +
'<td class="model_name">' + item.model_name + '</td>' +
'<td>';
'<td class="make">' + item.model_name + '</td>' +
'<td>';
if (item.isactive == 1) {
row += '<span style="color:green">Active</span>';
@ -191,21 +199,23 @@
row += '<span style="color:red">Inactive</span>';
}
row += '</td><td>';
row += '</td><td>' +
'<div class="btn-group dropdown">' +
'<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>' +
'<div class="dropdown-menu dropdown-menu-right">' +
'<a data-toggle="modal" data-target="#bike_model_login-modal_1" data-value="' + item.model_id + '" class="dropdown-item edit-button" onclick="editModel(this)"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>'+
'<a data-value="' + item.model_id + '" class="dropdown-item" onclick="deleteModel(this)"><i style="color: #526dee;" class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle"></i>Delete</a>';
if (item.isactive == 1) {
row += '<a class="dropdown-item" data-id="' + item.model_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)" ><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;"></i>Deactivate</a>';
} else if (item.isactive == 0) {
row += '<a class="dropdown-item" data-id="' + item.model_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)" ><i class="fa fa-bicycle"></i>Activate</a>';
}
row += '<a data-toggle="modal" data-target="#bike_model_login-modal_1" data-value="' + item.model_id + '" class="edit-button" onclick="editModel(this)"><i class="ri-pencil-line"></i></a>';
// Check the isactive status and set the icon color accordingly
if (item.isactive == 1) {
row += '<a style="color:red; margin-left:12px;" data-id="' + item.model_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)" ><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;"></i></a>';
} else if (item.isactive == 0) {
row += '<a style="color:green; margin-left:12px;" data-id="' + item.model_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)" ><i class="fa fa-bicycle"></i></a>';
}
row += '</td><td></td></tr>';
row += '</td><td></td></tr>';
// Append the row to the tbody
$('tbody').append(row);
});
// Append the row to the tbody
$('tbody').append(row);
});
}
},
error: function(xhr, status, error) {

View File

@ -40,8 +40,15 @@
<td><?= $value['mobile_no']; ?></td>
<td><?= $value['email']; ?></td>
<td>
<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" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?= "new_client/" . $value['client_id']; ?>" class="dropdown-item edit-button"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="<?= "delete_client/" . $value['client_id']; ?>" class="dropdown-item delete-button"><i class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle" style="font-size: 20px;"></i>Delete</a>
</div>
</div>
</td>
<td>
</td>
<?php endif?>

View File

@ -43,8 +43,14 @@
<?php endif; ?>
</td>
<td>
<a data-toggle="modal" data-target="#complaint-add-modal" data-value="<?php echo $value['complaint_id']; ?>" onclick="editComplaint(this)" class="delete-button"><i class="ri-pencil-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_complaint/" . $value['complaint_id']; ?>" class="delete-button"><i class="ri-delete-bin-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a data-toggle="modal" data-target="#complaint-add-modal" data-value="<?php echo $value['complaint_id']; ?>" onclick="editComplaint(this)" class="dropdown-item edit-button"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="<?= "delete_complaint/" . $value['complaint_id']; ?>" class="dropdown-item delete-button"><i class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
</div>
</div>
</td>
<?php endforeach; ?>
</tr>

View File

@ -250,8 +250,13 @@ p {
<td style="border: 0.5px solid black;"><?php
if(isset($item['custom_amount']))
{
echo ($item['custom_amount']) * $item['qty'];
$sub_tot += ($item['custom_amount']) * $item['qty'];
$custom_amount = str_replace(',', '', $item['custom_amount']);
$custom_amount = floatval($custom_amount);
echo $custom_amount * $item['qty'];
$sub_tot += $custom_amount * $item['qty'];
}
else
{
@ -265,14 +270,35 @@ p {
<td style="border: 0.5px solid black;"><?php echo isset($item['custom_tax']) ? ($item['custom_tax'] / 2) : ($item['amount'] * ($item['tax'] / 2) / 100) ?></td>
<td style="border: 0.5px solid black;">
<?php if(isset($item['custom_tax'])) {
echo round(( ($item['custom_amount'] * $item['qty']) * $item['tax'] / 100));
$tax+= (( ($item['custom_amount']* $item['qty'] ) * $item['tax'] / 100));
$custom_amount = str_replace(',', '', $item['custom_amount']);
$custom_amount = floatval($custom_amount);
$result = round((($custom_amount * $item['qty']) * $item['tax'] / 100));
echo $result;
$tax += $result;
} else {
echo ( ($item['amount']* $item['qty']) * $item['tax'] / 100);
$tax+= ( ($item['amount']* $item['qty']) * $item['tax'] / 100);
} ?></td>
<td style="border: 0.5px solid black;"><?php echo isset($item['custom_total']) ? round( ($item['custom_amount'] + ($item['custom_amount'] * $item['tax'] / 100)) * $item['qty'] ) : ($item['amount'] + ($item['amount'] * $item['tax'] / 100) ) * $item['qty'] ?></td>
<?php
// Sanitize and convert custom_amount and amount
$custom_amount = isset($item['custom_amount']) ? floatval(str_replace(',', '', $item['custom_amount'])) : 0;
$amount = isset($item['amount']) ? floatval(str_replace(',', '', $item['amount'])) : 0;
$tax = isset($item['tax']) ? floatval($item['tax']) : 0;
$qty = isset($item['qty']) ? intval($item['qty']) : 0;
// Calculate the custom total
$custom_total = ($custom_amount + ($custom_amount * $tax / 100)) * $qty;
// Calculate the amount total
$amount_total = ($amount + ($amount * $tax / 100)) * $qty;
?>
<td style="border: 0.5px solid black;">
<?php echo isset($item['custom_total']) ? round($custom_total) : round($amount_total); ?>
</td>
</tr>
<?php endforeach; ?>
<tr>

View File

@ -1,4 +1,6 @@
<?php include('layout/header.php'); ?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
<style>
.dataTables_wrapper button{
background: #f1f5f7;
@ -8,7 +10,13 @@
.dataTables_wrapper .dt-buttons{
float:left;
}
.issued-status{
color:red;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<?php
$admins = $logged_user_role == 'Administrator' || $logged_user_role == 'Job Card Manager' || $logged_user_role == "Floor Manager";
?>
@ -63,7 +71,15 @@
<td><?= $value['reg_no']; ?></td>
<td><?= $value['client_name']; ?><br><?= $value['client_mobile_no']; ?></td>
<td><?= $value['total']; ?></td>
<td><?= ($value['is_rework'] == 1) ? 'Rework/'.$value['status'] :$value['status']; ?></td>
<td class="<?php
if ($value['status'] == 'Issued') {
echo 'issued-status';
} elseif ($value['status'] == 'Created') {
echo 'created-status';
} elseif ($value['status'] == 'Paid') {
echo 'paid-status';
}
?>"><?= ($value['is_rework'] == 1) ? 'Rework/'.$value['status'] :$value['status']; ?></td>
<td>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
@ -79,6 +95,10 @@
<?php if($value['status'] == 'Paid' && $admins && $value['is_rework'] == 0) { ?>
<a href="<?= "new_jobcard/" . $value['job_card_id'] . "/re-work" ?>" class="dropdown-item edit-button"><i class="ri-registered-fill mr-2 text-muted font-18 vertical-middle"></i>Rework</a>
<?php } ?>
<?php if($value['os_count'] > 0) { ?>
<a href="<?= "individual_download_os/" . $value['job_card_id'] ?>" class="dropdown-item edit-button"><i class="ri-download-fill mr-2 text-muted font-18 vertical-middle"></i>Out Source</a>
<?php } ?>
</div>
</div>
</td>
@ -142,4 +162,16 @@
"ordering": false
});
});
</script>
</script>
<script>
$(document).ready(function() {
var msg = "<?= session()->getFlashdata('download_os'); ?>";
if (msg) {
toastr.warning(msg);
}
})
</script>

View File

@ -42,19 +42,24 @@
<?php endif; ?>
</td>
<td>
<a data-toggle="modal" data-target="#bike_make_login-modal" data-value="<?php echo $item['make_id']; ?>" class="edit-button" onclick="editMake(this)"><i class="ri-pencil-line" style="font-size:20px"></i></a>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a data-toggle="modal" data-target="#bike_make_login-modal" data-value="<?php echo $item['make_id']; ?>" class="dropdown-item edit-button" onclick="editMake(this)"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="#" data-toggle="modal" data-target="#bike_model_login-modal" class="dropdown-item add-button" title="Add" data-id="<?php echo $item['make_id']; ?>" data-value="<?php echo $item['make']; ?>" onclick="setMakeName(this)">
<i class="ri-add-line mr-2 text-muted font-18 vertical-middle" ></i>Add Model
</a>
<a href="<?= "bike_model_index/" . $item['make_id']; ?>" class="dropdown-item view-list-button" title="Model List">
<i class="ri-list-check-2 mr-2 text-muted font-18 vertical-middle"></i>Model List
</a>
<?php if($item['isactive'] == 1): ?>
<a class="dropdown-item" data-id="<?php echo $item['make_id']; ?>" data-isactive="<?php echo $item['isactive']; ?>" title="Deactivate" onclick="statusChange(this)" ><i class="fa fa-bicycle " style="font-size:20px"></i><i class="fa fa-times" style="font-size: x-small;" style="font-size:20px"></i>Deactivate</a>
<?php else: ?>
<a class="dropdown-item" data-id="<?php echo $item['make_id']; ?>" data-isactive="<?php echo $item['isactive']; ?>" title="Activate" onclick="statusChange(this)" ><i class="fa fa-bicycle" style="font-size:20px"></i>Activate</a>
<?php endif; ?>
<a href="#" data-toggle="modal" data-target="#bike_model_login-modal" style="margin-left: 12px;" class="add-button" title="Add" data-id="<?php echo $item['make_id']; ?>" data-value="<?php echo $item['make']; ?>" onclick="setMakeName(this)">
<i class="ri-add-line icon-large" style="font-size:20px"></i>
</a>
<a href="<?= "bike_model_index/" . $item['make_id']; ?>" class="view-list-button" title="Model List" style="margin-left: 12px;">
<i class="ri-list-check-2 icon-large" style="font-size:20px"></i>
</a>
<?php if($item['isactive'] == 1): ?>
<a style="color:red; margin-left:12px;" data-id="<?php echo $item['make_id']; ?>" data-isactive="<?php echo $item['isactive']; ?>" title="Deactivate" onclick="statusChange(this)" ><i class="fa fa-bicycle" style="font-size:20px"></i><i class="fa fa-times" style="font-size: x-small;" style="font-size:20px"></i></a>
<?php else: ?>
<a style="color:green; margin-left:12px;" data-id="<?php echo $item['make_id']; ?>" data-isactive="<?php echo $item['isactive']; ?>" title="Activate" onclick="statusChange(this)" ><i class="fa fa-bicycle" style="font-size:20px"></i></a>
<?php endif; ?>
</div>
</div>
</td>
</tr>
<?php endforeach; ?>
@ -290,10 +295,11 @@
if (response.status == "success") {
$('tbody').html('');
$.each(response.data, function(index, item) {
// Assuming `items` is an array containing your data
response.data.forEach(function(item) {
var row = '<tr>' +
'<td class="make">' + item.make + '</td>' +
'<td>';
'<td class="make">' + item.make + '</td>' +
'<td>';
if (item.isactive == 1) {
row += '<span style="color:green">Active</span>';
@ -301,24 +307,26 @@
row += '<span style="color:red">Inactive</span>';
}
row += '</td><td>';
row += '</td><td>' +
'<div class="btn-group dropdown">' +
'<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>' +
'<div class="dropdown-menu dropdown-menu-right">' +
'<a data-toggle="modal" data-target="#bike_make_login-modal" data-value="' + item.make_id + '" class="dropdown-item edit-button" onclick="editMake(this)"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>' +
'<a href="#" data-toggle="modal" data-target="#bike_model_login-modal" class="dropdown-item add-button" title="Add" data-id="' + item.make_id + '" data-value="' + item.make + '" onclick="setMakeName(this)"><i class="ri-add-line mr-2 text-muted font-18 vertical-middle"></i>Add Model</a>' +
'<a href="bike_model_index/' + item.make_id + '" class="dropdown-item view-list-button" title="Model List"><i class="ri-list-check-2 mr-2 text-muted font-18 vertical-middle"></i>Model List</a>';
// Check the isactive status and set the icon color accordingly
row += '<a data-toggle="modal" data-target="#bike_make_login-modal" data-value="'+ item.make_id +'" class="edit-button" onclick="editMake(this)"><i class="ri-pencil-line" style="font-size:20px;"></i></a>';
row +='<a href="#" data-toggle="modal" data-target="#bike_model_login-modal" style="margin-left: 12px;" class="add-button" title="Add" data-id="'+ item.make_id+'" data-value="' +item.make+'" onclick="setMakeName(this)"><i class="ri-add-line icon-large" style="font-size:20px;"></i></a>';
row +='<a href="bike_model_index/' +item.make_id+'" class="view-list-button" title="Model List" style="margin-left: 12px;"><i class="ri-list-check-2 icon-large" style="font-size:20px;"></i></a>';
if (item.isactive == 1) {
row += '<a style="color:red; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;" style="font-size:20px;"></i></a>';
row += '<a class="dropdown-item" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)"><i class="fa fa-bicycle" style="font-size:20px;"></i><i class="fa fa-times" style="font-size: x-small;"></i>Deactivate</a>';
} else if (item.isactive == 0) {
row += '<a style="color:green; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)"><i class="fa fa-bicycle" style="font-size:20px;"></i></a>';
row += '<a class="dropdown-item" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)"><i class="fa fa-bicycle" style="font-size:20px;"></i>Activate</a>';
}
row += '</td><td></td></tr>';
row += '</div></div></td></tr>';
// Append the row to the tbody
$('tbody').append(row);
});
}
},
error: function(xhr, status, error) {

View File

@ -34,11 +34,17 @@
<td class="manufacturer_name"><?php echo $item['manufacturer_name']; ?></td>
<td class="quality"><?php echo $item['quality']; ?></td>
<td>
<a data-toggle="modal" data-target="#manufacturer_login-modal" data-value="<?php echo $item['manufacturer_id']; ?>" class="edit-button" onclick="editManufacturer(this)"><i class="ri-pencil-line" style="font-size:20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a data-toggle="modal" data-target="#manufacturer_login-modal" data-value="<?php echo $item['manufacturer_id']; ?>" class="dropdown-item edit-button" onclick="editManufacturer(this)"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle" ></i>Edit</a>
<a href="<?= "product_index/" . $item['manufacturer_id']; ?>" class="dropdown-item view-list-button" title="Model List">
<i class="ri-list-check-2 mr-2 text-muted font-18 vertical-middle" ></i>Model List
</a>
</div>
</div>
<a href="<?= "product_index/" . $item['manufacturer_id']; ?>" class="view-list-button" title="Model List" style="margin-left: 16px;">
<i class="ri-list-check-2 icon-large" style="font-size:20px;"></i>
</a>
</td>
</tr>
<?php endforeach; ?>

View File

@ -42,8 +42,13 @@
<?php endif; ?>
</td>
<td>
<a data-toggle="modal" data-target="#os-add-modal" data-value="<?php echo $value['id']; ?>" onclick="editOS(this)" class="delete-button"><i class="ri-pencil-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_complaint/" . $value['id']; ?>" class="delete-button"><i class="ri-delete-bin-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a data-toggle="modal" data-target="#os-add-modal" data-value="<?php echo $value['id']; ?>" onclick="editOS(this)" class="dropdown-item edit-button"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="<?= "delete_complaint/" . $value['id']; ?>" class="dropdown-item delete-button"><i class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
</div>
</div>
</td>
</tr>
<?php endforeach; ?>

View File

@ -3,6 +3,8 @@
<head>
<meta charset="UTF-8">
<style>
/* Add your CSS styles here to format the invoice for mPDF */
body {
@ -11,6 +13,11 @@
font-size: 12px; /* Change this value to your desired font size */
}
/* Define a class for bottom border */
.bottom-border {
border-bottom: 1px solid black !important;
}
/* Style for the main table with border */
table.main-table {
width: 100%;
@ -181,7 +188,7 @@ p {
<tr style="border: 1px solid black;">
<th style="border: 0.5px solid black;">Bike Detail</th>
<th style="border: 0.5px solid black;">Out Source List</th>
<th style="border: 0.5px solid black;">Product</th>
<th style="border: 0.5px solid black;"></th>
</tr>
<?php foreach ($outsource as $key => $item) : ?>
@ -190,9 +197,20 @@ p {
<?= $item['reg_no'] ?><br>
<?= $item['bike_name'] ?> - <?= $item['bike_modal_name'] ?><br>
<?= $item['colour'] ?> color<br>
<?= $item['delivery_date'] ?><br>
</td>
<td style="border: 0.5px solid black;">
<?= $item['name'] ?><br>
<td style="padding: 0;width: 33%;border: 0.5px solid black;">
<table style="margin-left: -2px;width: 101%;padding: 0;">
<?php $nameCount = count($item['names']); ?>
<?php foreach ($item['names'] as $index => $name): ?>
<tr>
<!-- Apply the class conditionally -->
<td class="inner-box" style="<?= $index !== $nameCount - 1 ? 'border-bottom: 1px solid black;' : '' ?>">
<?= $name ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</td>
<td style="border: 0.5px solid black;">
<?php foreach ($item['products'] as $key => $item) : ?>

View File

@ -97,10 +97,13 @@
<!-- Call the model method -->
<?php if(!$manufacturer_id) { ?>
<td>
<a href="<?= "new_product/" . $value['product_id']; ?>" class="edit-button"><i
class="ri-pencil-line" style="font-size:20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_product/" . $value['product_id']; ?>"
class="delete-button"><i class="ri-delete-bin-line" style="font-size:20px;"></i></a>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?= "new_product/" . $value['product_id']; ?>" class="dropdown-item edit-button"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="<?= "delete_product/" . $value['product_id']; ?>" class="dropdown-item delete-button"><i class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
</div>
</div>
</td>
<?php } ?>
<?php endif?>

View File

@ -47,8 +47,15 @@
<td><?= $value['qty_stock']; ?></td>
<td><?= $value['purchase_order_level']; ?></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['prefered_vendor']; ?>" class="edit-button" title="Raise PO"><i class="fas fa-file-invoice"></i>Raise</a>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<!-- <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['prefered_vendor']; ?>" class="dropdown-item edit-button" title="Raise PO"><i class="fas fa-file-invoice mr-2 text-muted font-18 vertical-middle"></i>Raise</a>
</div>
</div>
</td>
<td>
</td>
<?php endforeach; ?>

View File

@ -74,7 +74,12 @@
<td><?= $value['return_qty']; ?></td>
<td><?= $value['status']; ?></td>
<td>
<a href="<?= "edit_return_order/" . $value['return_order_id']; ?>" class="edit-button" title="Return"><i class="ri-pencil-line" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?= "edit_return_order/" . $value['return_order_id']; ?>" class="dropdown-item edit-button" title="Return"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
</div>
</div>
</td>
<?php endforeach; ?>

View File

@ -38,12 +38,13 @@
<td><?= $value['cgst'] + $value['sgst']; ?></td>
<td><?= $value['description']; ?></td>
<td>
<a href="<?= "new_service/" . $value['service_id']; ?>" class="edit-button">
<i class="ri-pencil-line" style="font-size:20px;"></i>
</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_service/" . $value['service_id']; ?>" class="delete-button">
<i class="ri-delete-bin-line" style="font-size:20px;"></i>
</a>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?= "new_service/" . $value['service_id']; ?>" class="dropdown-item edit-button"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="<?= "delete_service/" . $value['service_id']; ?>" class="dropdown-item delete-button"><i class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle" ></i>Delete</a>
</div>
</div>
</td>
</tr>
<?php endif;

View File

@ -43,22 +43,27 @@
<tbody>
<?php foreach ($users as $value) :
if ($value['isactive'] == 1) : ?>
<tr>
<td><?= $value['user_id']; ?></td>
<td><?= $value['name']; ?></td>
<td><?= $value['email']; ?></td>
<td><?= $value['mobile_no']; ?></td>
<td><?= $roleModel->getRoleNameById($value['role']); ?></td> <!-- Call the model method -->
<td>
<a href="<?= "new_user/" . $value['user_id']; ?>" class="edit-button" style="font-size: 20px;"><i class="ri-pencil-line"></i></a>
<a href="<?= "delete_user/" . $value['user_id']; ?>" class="delete-button" style="font-size: 20px;"><i class="ri-delete-bin-line"></i></a>
</td>
<?php endif?>
<?php endforeach; ?>
if ($value['isactive'] == 1) : ?>
<tr>
<td><?= $value['user_id']; ?></td>
<td><?= $value['name']; ?></td>
<td><?= $value['email']; ?></td>
<td><?= $value['mobile_no']; ?></td>
<td><?= $roleModel->getRoleNameById($value['role']); ?></td> <!-- Call the model method -->
<td>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?= "new_user/" . $value['user_id']; ?>" class="dropdown-item edit-button"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="<?= "delete_user/" . $value['user_id']; ?>" class="dropdown-item delete-button"><i class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
</div>
</div>
</td>
<?php endif?>
<?php endforeach; ?>
</tr>
</tr>
</tbody>
</table>

View File

@ -41,9 +41,15 @@
<td><?= $value['client_name']; ?></td>
<td><?= $value['mobile_no']; ?></td>
<td>
<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" style="font-size: 20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?= "new_vehicle/" . $value['vehicle_id']; ?>" class="dropdown-item edit-button"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="<?= "delete_vehicle/" . $value['vehicle_id']; ?>" class="dropdown-item delete-button"><i class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
</div>
</div>
</td>
<?php endif?>
<?php endforeach; ?>

View File

@ -42,21 +42,26 @@
<tbody>
<?php foreach ($vendor as $value) :
if ($value['isactive'] == 1) : ?>
<tr>
<td><?= $value['vendor_id']; ?></td>
<td><?= $value['vendor_name']; ?></td>
<td><?= $value['contact_person_mobile1']; ?></td>
<td><?= $value['category']; ?></td> <!-- Call the model method -->
<td>
<a href="<?= "new_vendor/" . $value['vendor_id']; ?>" class="edit-button"><i class="ri-pencil-line" style="font-size:20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_vendor/" . $value['vendor_id']; ?>" class="delete-button"><i class="ri-delete-bin-line" style="font-size:20px;"></i></a>
</td>
<?php endif?>
<?php endforeach; ?>
if ($value['isactive'] == 1) : ?>
<tr>
<td><?= $value['vendor_id']; ?></td>
<td><?= $value['vendor_name']; ?></td>
<td><?= $value['contact_person_mobile1']; ?></td>
<td><?= $value['category']; ?></td> <!-- Call the model method -->
<td>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?= "new_vendor/" . $value['vendor_id']; ?>" class="dropdown-item edit-button"><i class="ri-pencil-line mr-2 text-muted font-18 vertical-middle" style="font-size:20px;"></i>Edit</a>
<a href="<?= "delete_vendor/" . $value['vendor_id']; ?>" class="dropdown-item delete-button"><i class="ri-delete-bin-line mr-2 text-muted font-18 vertical-middle" style="font-size:20px;"></i>Delete</a>
</div>
</div>
</td>
<?php endif?>
<?php endforeach; ?>
</tr>
</tr>
</tbody>
</table>