CHANGE_INVOICE_PDF_PRODUCT_LIST_MANUFACTURER_DATA_TABLE_CSS_PRODUCT_EACH_COLUMN_SEARCH : AADHAVAN

This commit is contained in:
aadhavan valli 2024-05-04 17:20:50 +05:30
parent db91ef6d39
commit f5f643eb6b
29 changed files with 1187 additions and 449 deletions

View File

@ -63,6 +63,7 @@ $routes->post("get_models", "Products::get_models");
$routes->get("get_makes", "Products::get_makes");
$routes->post("save_make", "Products::save_make");
$routes->post("save_model", "Products::save_model");
$routes->post("save_manufacturer", "Products::save_manufacturer");
$routes->get("product_list_for_service", "Products::product_list_for_service");
//end products//
@ -158,6 +159,8 @@ $routes->get('dashboard', 'Users::dashboard');
//Spare manufacturer//
$routes->get('spare_manufacturer_index', 'Manufacturer::index');
$routes->post('create_manufacturer/(:any)', 'Manufacturer::create_manufacturer/$1');
$routes->post('create_manufacture_product_form', 'Manufacturer::create_manufacture_product_form');
//Spare manufacturer End's//

View File

@ -24,7 +24,7 @@ class Manufacturer extends BaseController
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$ManufacturerModel = new ManufacturerModel();
$spare_manufacturer = $ManufacturerModel->findAll();
$spare_manufacturer = $ManufacturerModel->where('business_id',$this->session->get('logged_user_business_id'))->findAll();
$data['manufacturer']=$spare_manufacturer;
return view('manufacturer_list',$data);
@ -45,12 +45,13 @@ class Manufacturer extends BaseController
];
if (!$manufacturer_id) {
$data['business_id'] = $this->session->get('logged_user_business_id');
$inserted = $ManufacturerModel->insert($data);
if ($inserted) {
$result = $data;
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
} else {
$result = "No Match's";
$result = "Duplicate Match!";
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
}
} else {
@ -70,4 +71,40 @@ class Manufacturer extends BaseController
}
}
}
public function create_manufacture_product_form()
{
try {
$manufacturer_name = $this->request->getPost('manufacturername');
$quality = $this->request->getPost('quality');
$ManufacturerModel = new ManufacturerModel();
$data = [
'manufacturer_name' => $manufacturer_name,
'quality' => $quality,
];
$data['business_id'] = $this->session->get('logged_user_business_id');
$manufacturer_find = $ManufacturerModel->where('manufacturer_name',$manufacturer_name)->first();
if (!$manufacturer_find) {
$inserted = $ManufacturerModel->insert($data);
if ($inserted) {
$manufacturer = $ManufacturerModel->where('manufacturer_id',$inserted)->first();
echo json_encode($manufacturer);
}
}else{
$result = "Duplicate Match!";
echo json_encode($result);
}
} catch (\Exception $e) {
echo json_encode($e);
}
}
}

View File

@ -36,7 +36,7 @@ class Products extends BaseController
return view('product_list',$data);
} else {
$ProductModel = new ProductModel();
$products = $ProductModel->where('branch_id',$this->session->get('logged_user_branch_id'))->orderBy('product_name')->findAll();
$products = $ProductModel->get_products($this->session->get('logged_user_branch_id'));
$data['products']=$products;
// echo "<pre>";
// print_r($products);die;
@ -391,6 +391,39 @@ class Products extends BaseController
}
public function save_manufacturer(){
$response = [];
$ManufacturerModel = new ManufacturerModel();
$manufacturer_name = $this->request->getPost('manufacturer_name');
$quality = $this->request->getPost('quality');
if (!empty($manufacturer_name) && !empty($quality)) {
$modelData = [
'manufacturer_name' => $manufacturer_name,
'quality' => $quality,
'business_id'=> $this->session->get('logged_user_business_id')
];
$manufacturer_id = $ManufacturerModel->insert($modelData);
$modelData = $ManufacturerModel->where('business_id', $this->session->get('logged_user_business_id'))->orderBy('manufacturer_name')->findAll();
$response['success'] = true;
$response['manufacturer_id'] = $manufacturer_id;
$response['quality'] = $quality;
$response['modelData'] = $modelData;
} else {
$response['success'] = false;
}
return $this->response->setJSON($response);
}
public function product_list_for_service(){
$ProductModel = new ProductModel();
$products = $ProductModel->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll();

View File

@ -155,6 +155,9 @@ public function add_sales()
$sales_order_id = $this->request->getPost('sales_order_id');
if (!empty($sales_order_id)) {
// print_r("hello");die;
if ($this->request->getPost('status') === "Paid") {
$data['mode_of_payment'] = $this->request->getPost('mode_of_payment');
}
$SalesOrderModel->update($sales_order_id, $data);
} else {
$SalesOrderModel->insert($data);
@ -354,6 +357,7 @@ public function delete_sales_product()
// Generate the PDF content (HTML) with data
$html = view('invoice_pdf_template', ['sales' => $data,'company_address'=>$company_address,'items'=>$items, 'business' => $business , 'vehicle' => $vehicle,'bike_model'=>$bike_model,'bike_make'=>$bike_make]);
// echo $html;die;
// Load HTML into the mPDF instance
$mpdf->WriteHTML($html);

View File

@ -5,7 +5,7 @@ class SalesOrderModel extends Model
{
protected $table = 'sales_order';
protected $primaryKey = 'sales_order_id';
protected $allowedFields = ['sales_order_id','client_name','vehicle_id','order_number','branch_id','status','mobile_no','billing_address','billing_city','billing_state','billing_country','billing_postal_code','total','tax','subtotal','discount','terms_condition','isactive'];
protected $allowedFields = ['sales_order_id','client_name','vehicle_id','order_number','branch_id','status','mode_of_payment','mobile_no','billing_address','billing_city','billing_state','billing_country','billing_postal_code','total','tax','subtotal','discount','terms_condition','isactive'];
//
public function getSalesPdf($sales_order_id){
return $this->db->table('sales_order')
@ -44,10 +44,13 @@ class SalesOrderModel extends Model
$result = $this->db->table('sales_order_product')
->where('sales_order_product.sales_order_id', $sales_order_id)
->join('products', 'products.product_id = sales_order_product.product_id')
->select('sales_order_product.*, products.product_name')
->select('sales_order_product.*, products.product_name, products.per, products.ml')
->get()
->getResult();
// echo "<pre>";
// print_r($result);die;
return $result;
}

View File

@ -21,7 +21,7 @@
<div class="card">
<div class="card-body">
<!-- <h4 class="header-title">Business List</h4> -->
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;text-align: center;width: 100%;">
<table id="datatable-buttons-2" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;text-align: center;width: 100%;">
<thead>
<tr>
<th>Model Name</th>
@ -60,7 +60,6 @@
</div>
<!-- Start Bike Model Create Pop-UP -->
<div id="bike_model_login-modal_1" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
@ -69,7 +68,6 @@
<div class="text-center mt-2 mb-4">
<h4 id="form_add_edit">Add Models</h4>
</div>
<form id="model_form_data" class="px-3">
<div class="form-group">
@ -96,16 +94,13 @@
<script>
function submitModels(params) {
console.log( $('#modelname').val());
var formData = {
make_id: $('#make_id').val(),
modelname: $('#modelname').val()
};
var edit_model_id = $('#edit_model_id').val();
if (!edit_model_id) {
edit_model_id =0;
}
@ -239,4 +234,54 @@
$('#modelname').val('');
}
</script>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Bike_Model', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Bike_Model', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Bike_Model', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -1,21 +1,19 @@
<?php include('layout/header.php'); ?>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title"><?php echo $page_name ?></h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
</ol>
</div>
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title"><?php echo $page_name ?></h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<form action="<?= base_url() . "edit_branch_form/". session()->get('logged_user_branch_id'); ?>" method="post">
<div class="form-row">
<div class="form-group col-md-6">
@ -50,5 +48,5 @@
</div>
</div>
</div>
</div>
</div>
<?php include('layout/footer.php'); ?>

View File

@ -1,143 +1,130 @@
<?php include('layout/header.php'); ?>
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Branch List - <?php echo $business_name;?></h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class=""> <a href="#" data-toggle="modal" data-target="#bike_make_login-modal" class="btn btn-primary waves-effect">
Add Branch
</a>
</li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> -->
</ol>
</div>
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Branch List - <?php echo $business_name;?></h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class=""> <a href="#" data-toggle="modal" data-target="#bike_make_login-modal" class="btn btn-primary waves-effect">
Add Branch
</a>
</ol>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<!-- <h4 class="header-title">Business List</h4> -->
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100"
style="width:100% !important;">
<thead>
<tr>
<th>Branch Name</th>
<th>Address</th>
<th>City</th>
<th>State</th>
<th>Postal Code</th>
<th>Mobile No</th>
<th>Active</th>
<th>User List</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($branch as $value) :
?>
<tr>
<td><?= $value['branch_name']; ?></td>
<td><?= $value['address']; ?></td>
<td><?= $value['city']; ?></td>
<td><?= $value['state']; ?></td>
<td><?= $value['postal_code']; ?></td>
<td><?= $value['mobile_no']; ?></td>
<td>
<?php if ($value['isactive'] == 0): ?>
<span style="color: red;">Inactive</span>
<?php else: ?>
<span style="color: green;">Active</span>
<?php endif; ?>
</td>
<td>
<a href="<?= base_url("user_list/" . $value['branch_id']) ?>" style="margin-left: 15px;">View</a>
</td>
<td>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<!-- <h4 class="header-title">Business List</h4> -->
<table id="datatable-buttons-2" class="table table-striped dt-responsive nowrap w-100"
style="width:100% !important;">
<thead>
<tr>
<th>Branch Name</th>
<th>Address</th>
<th>City</th>
<th>State</th>
<th>Postal Code</th>
<th>Mobile No</th>
<th>Active</th>
<th>User List</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($branch as $value) :
?>
<tr>
<td><?= $value['branch_name']; ?></td>
<td><?= $value['address']; ?></td>
<td><?= $value['city']; ?></td>
<td><?= $value['state']; ?></td>
<td><?= $value['postal_code']; ?></td>
<td><?= $value['mobile_no']; ?></td>
<td>
<?php if ($value['isactive'] == 0): ?>
<span style="color: red;">Inactive</span>
<?php else: ?>
<span style="color: green;">Active</span>
<?php endif; ?>
</td>
<td>
<a href="<?= base_url("user_list/" . $value['branch_id']) ?>" style="margin-left: 15px;">View</a>
</td>
<td>
<a data-toggle="modal" data-target="#bike_make_login-modal" value="<?= $value['branch_id']; ?>" onclick="editBranch(this)" class="edit-button"><i
class="ri-pencil-line" style="margin-right: 5px;"></i></a>
<a data-toggle="modal" data-target="#bike_make_login-modal" value="<?= $value['branch_id']; ?>" onclick="editBranch(this)" class="edit-button"><i
class="ri-pencil-line" style="margin-right: 5px;"></i></a>
<a href="<?= base_url("delete_branch/".$value['branch_id']); ?>"
class="delete-button"><i class="ri-delete-bin-line"></i></a>
</td>
<a href="<?= base_url("delete_branch/".$value['branch_id']); ?>"
class="delete-button"><i class="ri-delete-bin-line"></i></a>
</td>
<?php endforeach; ?>
<?php endforeach; ?>
</tr>
</tbody>
</table>
</div> <!-- end table-responsive-->
</div>
</div> <!-- end card -->
</div> <!-- end col -->
</tr>
</tbody>
</table>
</div> <!-- end table-responsive-->
</div>
</div> <!-- end card -->
</div> <!-- end col -->
<!-- Start Bike Make Create Pop-UP -->
<div id="bike_make_login-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="text-center mt-2 mb-4">
<h4>Add Branch - <?php echo $business_name;?></h4>
<!-- Start Bike Make Create Pop-UP -->
<div id="bike_make_login-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="text-center mt-2 mb-4">
<h4>Add Branch - <?php echo $business_name;?></h4>
</div>
<form id="model_form_data" class="px-3">
<input type="text" id="business_id" value="<?php echo $business_id; ?>" hidden>
<input type="text" id="branch_id" hidden>
<div class="form-group">
<label for="branchname">Branch Name </label>
<input class="form-control" name="branch_name" type="text" id="branch_name" required="" placeholder="Branch Name....">
</div>
<div class="form-group">
<label for="address">Address </label>
<input class="form-control" name="address" type="text" id="address" required="" placeholder="Address....">
</div>
<div class="form-group">
<label for="city">City </label>
<input class="form-control" name="city" type="text" id="city" required="" placeholder="City....">
</div>
<div class="form-group">
<label for="state">State </label>
<input class="form-control" name="state" type="text" id="state" required="" placeholder="State....">
</div>
<div class="form-group">
<label for="pincode">Pin Code </label>
<input class="form-control" name="postal_code" type="text" id="postal_code" required="" placeholder="Pin Code....">
</div>
<div class="form-group">
<label for="mobilenumber">Mobile Number </label>
<input class="form-control" name="mobile_no" type="text" id="mobile_no" required="" placeholder="Mobile Number....">
</div>
<form id="model_form_data" class="px-3">
<div class="form-group text-center">
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitBranch(this)">Submit</button>
</div>
<input type="text" id="business_id" value="<?php echo $business_id; ?>" hidden>
<input type="text" id="branch_id" hidden>
<div class="form-group">
<label for="branchname">Branch Name </label>
<input class="form-control" name="branch_name" type="text" id="branch_name" required="" placeholder="Branch Name....">
</div>
<div class="form-group">
<label for="address">Address </label>
<input class="form-control" name="address" type="text" id="address" required="" placeholder="Address....">
</div>
<div class="form-group">
<label for="city">City </label>
<input class="form-control" name="city" type="text" id="city" required="" placeholder="City....">
</div>
<div class="form-group">
<label for="state">State </label>
<input class="form-control" name="state" type="text" id="state" required="" placeholder="State....">
</div>
<div class="form-group">
<label for="pincode">Pin Code </label>
<input class="form-control" name="postal_code" type="text" id="postal_code" required="" placeholder="Pin Code....">
</div>
<div class="form-group">
<label for="mobilenumber">Mobile Number </label>
<input class="form-control" name="mobile_no" type="text" id="mobile_no" required="" placeholder="Mobile Number....">
</div>
<div class="form-group text-center">
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitBranch(this)">Submit</button>
</div>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- End Bike Make Create Pop-UP -->
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- End Bike Make Create Pop-UP -->
</div>
<script>
function submitBranch(params) {
if ($('#branch_id').val()) {
@ -186,7 +173,6 @@
}
});
}
function editBranch(params) {
$.ajax({
type: 'GET',
@ -210,6 +196,55 @@
}
});
}
</script>
<?php include('layout/footer.php'); ?>
<?php include('layout/footer.php'); ?>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Branch', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Branch', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Branch', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -1,24 +1,19 @@
<?php include('layout/header.php'); ?>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title"><?php echo $page_name ?></h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
</li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> -->
</ol>
</div>
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title"><?php echo $page_name ?></h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<form action="<?= base_url() . "add_business"; ?>" method="post">
<div class="form-row">
<div class="form-group col-md-6">

View File

@ -1,15 +1,13 @@
<?php include('layout/header.php'); ?>
<div class="container-fluid">
<div class="row">
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Business List</h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "new_business/0"; ?>" class="btn btn-primary waves-effect">Add Business</a>
</li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> -->
</li>
</ol>
</div>
</div>
@ -20,12 +18,7 @@
<div class="card">
<div class="card-body">
<!-- <h4 class="header-title">Business List</h4> -->
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100"
<table id="datatable-buttons-2" class="table table-striped dt-responsive nowrap w-100"
style="width:100% !important;">
<thead>
@ -76,10 +69,58 @@
</tbody>
</table>
</div> <!-- end table-responsive-->
</div>
</div> <!-- end card -->
</div> <!-- end col -->
</div>
<?php include('layout/footer.php'); ?>
<?php include('layout/footer.php'); ?>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Business', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Business', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Business', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -1,27 +1,22 @@
<?php include('layout/header.php'); ?>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title"><?php echo $page_name?></h4>
<div class="page-title-right">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title"><?php echo $page_name?></h4>
<div class="page-title-right">
<a href="<?= base_url() . "client_index"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
<ol class="breadcrumb m-0">
</li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> -->
</ol>
</div>
<ol class="breadcrumb m-0">
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="card-body">
<form action="<?= base_url() . "add_client"; ?>" method="post">
<h4 class="header-title">Client Details :</h4>
<h4 class="header-title">Client Details :</h4>
<div class="form-row">
<div class="form-group col-md-4">
<label for="inputEmail4" class="col-form-label">Client Name<span class="text-danger">*</span></label>
@ -78,9 +73,9 @@
</div>
</div>
</div>
<?php include('layout/footer.php'); ?>
</div>
<?php include('layout/footer.php'); ?>
<script>
function onlyNumbers(event){
var charcode;

View File

@ -1,14 +1,12 @@
<?php include('layout/header.php'); ?>
<div class="container-fluid">
<div class="row">
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Clilent List</h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "new_client/0"; ?>" class="btn btn-primary waves-effect"> Add Client</a>
</li>
<li class=""> <a href="<?= base_url() . "new_client/0"; ?>" class="btn btn-primary waves-effect"> Add Client</a></li>
</ol>
</div>
</div>
@ -19,12 +17,7 @@
<div class="card">
<div class="card-body">
<!-- <h4 class="header-title">Business List</h4> -->
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100"
<table id="datatable-buttons-2" class="table table-striped dt-responsive nowrap w-100"
style="width:100% !important;">
<thead>
@ -41,27 +34,74 @@
<tbody>
<?php foreach ($client as $value) :
if ($value['isactive'] == 1) : ?>
<tr>
<td><?= $value['client_name']; ?></td>
<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;
</td>
<?php endif?>
<?php endforeach; ?>
if ($value['isactive'] == 1) : ?>
<tr>
<td><?= $value['client_name']; ?></td>
<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;
</td>
<?php endif?>
<?php endforeach; ?>
</tr>
</tr>
</tbody>
</table>
</div> <!-- end table-responsive-->
</div>
</div> <!-- end card -->
</div> <!-- end col -->
</div>
<?php include('layout/footer.php'); ?>
</div>
<?php include('layout/footer.php'); ?>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Client', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Client', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Client', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -16,7 +16,7 @@
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;">
<table id="datatable-buttons-2" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;">
<thead>
<tr>
<th> Name</th>
@ -86,6 +86,7 @@
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<?php include('layout/footer.php'); ?>
<script>
@ -120,7 +121,6 @@
});
}
function editComplaint(params) {
var complaint_id = $(params).data('value');
$.ajax({
@ -152,9 +152,57 @@
});
}
function clearDetials(params) {
$('#form_add_edit').text('Add Complaint');
}
</script>
</script>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Complaint', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Complaint', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Complaint', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -5,11 +5,6 @@
<h4 class="page-title"><?php echo 'Dashboard' ?></h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
</li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> -->
</ol>
</div>
</div>

View File

@ -10,165 +10,145 @@
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-xl-4">
<div class="card text-center">
<div class="card-body">
<h4 class="mt-3 mb-0"><?php echo $users['name']; ?></h4>
<p class="text-muted">@<?php echo $role['roles']; ?></p>
<div class="col-lg-4 col-xl-4">
<div class="card text-center">
<div class="card-body">
<h4 class="mt-3 mb-0"><?php echo $users['name']; ?></h4>
<p class="text-muted">@<?php echo $role['roles']; ?></p>
<div class="text-left mt-3" style=" margin-bottom: 16px;">
<div class="table-responsive">
<table class="table table-borderless table-sm">
<tbody>
<tr>
<th scope="row">Full Name :</th>
<td class="text-muted"><?php echo $users['name']; ?></td>
</tr>
<tr>
<th scope="row">Mobile :</th>
<td class="text-muted"><?php echo $users['mobile_no']; ?></td>
</tr>
<tr>
<th scope="row">Email :</th>
<td class="text-muted"><?php echo $users['email']; ?></td>
</tr>
<div class="text-left mt-3" style=" margin-bottom: 16px;">
<div class="table-responsive">
<table class="table table-borderless table-sm">
<tbody>
<tr>
<th scope="row">Full Name :</th>
<td class="text-muted"><?php echo $users['name']; ?></td>
</tr>
<tr>
<th scope="row">Mobile :</th>
<td class="text-muted"><?php echo $users['mobile_no']; ?></td>
</tr>
<tr>
<th scope="row">Email :</th>
<td class="text-muted"><?php echo $users['email']; ?></td>
</tr>
</tbody>
</table>
</div>
</tbody>
</table>
</div>
<input type="hidden" id="user_id" name="user_id" value="<?= isset($users['user_id']) ? $users['user_id'] : '' ?>">
</div>
</div> <!-- end card -->
</div>
<div class="col-lg-8 col-xl-8">
<div class="card">
<div class="card-body">
<div class="tab-pane show active" id="settings">
<form>
<h5 class="mb-3 text-uppercase bg-light p-2"><i class="mdi mdi-account-circle mr-1"></i> Personal Info</h5>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" name="name" value="<?php echo $users['name']; ?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="mobile_no">Mobile Number</label>
<input type="text" class="form-control" id="mobile_no" value="<?php echo $users['mobile_no']; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="text" class="form-control" id="user_id" value="<?php echo $users['user_id']; ?>" hidden>
<label for="useremail">Email Address</label>
<input type="email" class="form-control" id="useremail" value="<?php echo $users['email']; ?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group" style="margin-top: 28px;">
<button type="button" class="btn btn-primary" style="float: inline-end;" onclick="submitPersonalInfo()">Update</button>
</div>
</div>
</div>
</form>
</div>
<!-- end settings content-->
</div>
<input type="hidden" id="user_id" name="user_id" value="<?= isset($users['user_id']) ? $users['user_id'] : '' ?>">
</div>
</div>
<div class="col-lg-12 col-xl-12">
<div class="card text-center">
<div class="card-body">
<div class="text-left mt-3">
<h5 class="mb-3 text-uppercase bg-light p-2"><i class="mdi mdi-account-circle mr-1"></i> Change Password</h5>
</div> <!-- end card -->
</div>
<div class="col-lg-8 col-xl-8">
<div class="card">
<div class="card-body">
<div class="tab-pane show active" id="settings">
<form>
<h5 class="mb-3 text-uppercase bg-light p-2"><i class="mdi mdi-account-circle mr-1"></i> Personal Info</h5>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="old_password">Old Password</label>
<div class="input-group">
<input type="password" class="form-control" id="old_password" required>
<div class="input-group-append">
<span class="input-group-text">
<i class="fa fa-eye" id="toggleOldPassword"></i>
</span>
</div>
</div>
<label for="name">Name</label>
<input type="text" class="form-control" id="name" name="name" value="<?php echo $users['name']; ?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="new_password">New Password</label>
<div class="input-group">
<input type="password" class="form-control" id="new_password" required>
<div class="input-group-append">
<span class="input-group-text">
<i class="fa fa-eye" id="toggleNewPassword"></i>
</span>
</div>
</div>
<label for="mobile_no">Mobile Number</label>
<input type="text" class="form-control" id="mobile_no" value="<?php echo $users['mobile_no']; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="confirm_password">Confirm Password</label>
<div class="input-group">
<input type="password" class="form-control" id="confirm_password" required>
<div class="input-group-append">
<span class="input-group-text">
<i class="fa fa-eye" id="toggleConfirmPassword"></i>
</span>
</div>
</div>
<input type="text" class="form-control" id="user_id" value="<?php echo $users['user_id']; ?>" hidden>
<label for="useremail">Email Address</label>
<input type="email" class="form-control" id="useremail" value="<?php echo $users['email']; ?>">
</div>
</div>
<div class="col-md-6" style="margin-top: 27px;">
<button type="submit" class="btn btn-primary" id="submit_password" style="float: inline-end;" onclick="changePassword(this)">Submit</button>
<div class="col-md-6">
<div class="form-group" style="margin-top: 28px;">
<button type="button" class="btn btn-primary" style="float: inline-end;" onclick="submitPersonalInfo()">Update</button>
</div>
</div>
</div>
</form>
</div>
<!-- end settings content-->
</div>
</div> <!-- end card -->
</div>
</div>
</div>
<div class="col-lg-12 col-xl-12">
<div class="card text-center">
<div class="card-body">
<div class="text-left mt-3">
<h5 class="mb-3 text-uppercase bg-light p-2"><i class="mdi mdi-account-circle mr-1"></i> Change Password</h5>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="old_password">Old Password</label>
<div class="input-group">
<input type="password" class="form-control" id="old_password" required>
<div class="input-group-append">
<span class="input-group-text">
<i class="fa fa-eye" id="toggleOldPassword"></i>
</span>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="new_password">New Password</label>
<div class="input-group">
<input type="password" class="form-control" id="new_password" required>
<div class="input-group-append">
<span class="input-group-text">
<i class="fa fa-eye" id="toggleNewPassword"></i>
</span>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="confirm_password">Confirm Password</label>
<div class="input-group">
<input type="password" class="form-control" id="confirm_password" required>
<div class="input-group-append">
<span class="input-group-text">
<i class="fa fa-eye" id="toggleConfirmPassword"></i>
</span>
</div>
</div>
</div>
</div>
<div class="col-md-6" style="margin-top: 27px;">
<button type="submit" class="btn btn-primary" id="submit_password" style="float: inline-end;" onclick="changePassword(this)">Submit</button>
</div>
</div>
</div>
</div>
</div> <!-- end card -->
</div>
</div>
<?php include('layout/footer.php'); ?>
<script>
function submitPersonalInfo(params) {
var user_id = $('#user_id').val();
@ -194,8 +174,6 @@
}
});
}
function changePassword(params) {
var user_id = $('#user_id').val();
@ -229,11 +207,7 @@
});
}
</script>
<script>
var oldPasswordField = document.getElementById("old_password");
var toggleOldPassword = document.getElementById("toggleOldPassword");
@ -265,11 +239,7 @@
toggle.className = "fa fa-eye";
}
}
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var newPasswordField = document.getElementById('new_password');

View File

@ -65,26 +65,31 @@
<p><?= $value->company_mobile_no ?></p>
</td>
</tr>
<?php endforeach; ?>
<tr>
<td><span>GSTIN: <?php echo $business['gstno']?> </span><br>
<tr>
<td>
<div ><span>GSTIN: <?php echo $business['gstno']?> </span><br>
<span>State Name: <?php echo $business['state']?> , Code: <?php echo $business['code']?> </span><br>
<span>Contact : <?php echo $business['mobile']?></span><br>
<span>Email : <?php echo $business['email']?></span><br><br>
<span>Buyer (Bill To) </span>
</div>
</td>
</tr>
</tr>
<?php endforeach; ?>
</table>
</td>
<td>
<table class="invoice-info-table" >
<tbody >
<tr>
<td>Invoice No.</td><td>1</td>
<td>Invoice No.</td><td><?= $sales[0]->order_number ?></td>
</tr>
<tr>
<td>Dated</td><td>2</td>
<td>Dated</td><td><?= date('Y-m-d', strtotime($sales[0]->created_at)) ?></td>
</tr>
<tr>
<td>Bike Name</td><td><?php echo $bike_make['make'], $bike_model['model_name']; ?></td>
@ -99,16 +104,13 @@
<td>Contact Number</td><td><?php echo $vehicle['mobile_no']?></td>
</tr>
<tr>
<td>Job Card No. </td><td>5</td>
</tr>
<tr>
<td>Dated</td><td>5</td>
<td>Sale Order No. </td><td><?= $sales[0]->sales_order_id ?></td>
</tr>
<tr>
<td>Delivery Date</td><td>5</td>
</tr>
<tr>
<td>Mode Of Payment</td><td>5</td>
<td>Mode Of Payment</td><td><?= $sales[0]->mode_of_payment ?></td>
</tr>
</tbody>
</table>
@ -137,9 +139,10 @@
<tr >
<th >S no</th>
<th >Description Of Goods</th>
<th >Taxable Value</th>
<th>Rate</th>
<th >Quantity</th>
<th >Per</th>
<th >Taxable Amount</th>
<th >GST</th>
<th >CGST Amount</th>
<th >SGST Amount</th>
@ -149,50 +152,56 @@
</thead>
<tbody>
<?php $serialNumber = 1; ?>
<?php foreach ($items as $item) : ?>
<?php $total_taxable_amount = 0; $total_CGST = 0; $total_SGST = 0; foreach ($items as $item) :
?>
<tr>
<?php $taxPercentage = $item->tax / 100;
$taxAmount = $item->amount * $taxPercentage;
$amountWithoutTax = $item->amount - $taxAmount;
$value_tax = number_format($taxAmount, 2, '.', ',');?>
<?php $taxable_amount = $item->net_price * $item->qty;
$total_taxable_amount += $taxable_amount;
$cgst = ($taxable_amount * $item->tax / 100 ) /2;
$sgst = ($taxable_amount * $item->tax / 100 ) /2;
$total_CGST += $cgst;
$total_SGST += $sgst;
?>
<td style="border: 1px solid black;">
<?= $serialNumber++; ?>
</td>
<td style="border: 0.5px solid black;"><?= $item->product_name ?></td>
<td style="border: 0.5px solid black;"> <?php echo number_format($amountWithoutTax, 2, '.', ','); ?></td>
<td style="border: 0.5px solid black;"> <?php echo $item->net_price; ?></td>
<td style="border: 0.5px solid black;"><?= $item->qty ?></td>
<td style="border: 0.5px solid black;"></td>
<td style="border: 0.5px solid black;"><?php echo ($item->per == "ml") ? $item->ml . $item->per : $item->per; ?></td>
<td style="border: 0.5px solid black;"><?= $taxable_amount ?></td>
<td style="border: 0.5px solid black;"><?= $item->tax ?>%</td>
<td style="border: 0.5px solid black;"><?php echo $value_tax /2;?>
<td style="border: 0.5px solid black;"><?php echo $cgst; ?></td>
<td style="border: 0.5px solid black;"><?php echo $sgst; ?>
</td>
<td style="border: 0.5px solid black;"><?php echo $value_tax /2;?>
</td>
<td style="border: 0.5px solid black;"><?php echo $value_tax;?></td>
<td style="border: 0.5px solid black;"><?php echo $taxable_amount * $item->tax / 100 ?></td>
<td style="border: 0.5px solid black;"><?= $item->amount ?></td>
</tr>
<?php endforeach; ?>
<tr>
<td colspan="6" style="border-top: 0.5px solid black;border-left: 0.5px solid black;"></td>
<td colspan="3" style="text-align:center;border: 0.5px solid black;">Total Taxable Value</td>
<td style="border: 0.5px solid black;"></td>
<td colspan="7" style="border-top: 0.5px solid black;border-left: 0.5px solid black;"></td>
<td colspan="3" style="text-align:center;border: 0.5px solid black;">Total Taxable Amount</td>
<td style="border: 0.5px solid black;"><?= $total_taxable_amount; ?></td>
</tr>
<tr>
<td colspan="6" style="border-left: 0.5px solid black;"></td>
<td colspan="7" style="border-left: 0.5px solid black;"></td>
<td colspan="3" style="text-align:center;border: 0.5px solid black;">CGST</td>
<td style="border: 0.5px solid black;"></td>
<td style="border: 0.5px solid black;"><?= $total_CGST; ?></td>
</tr>
<tr>
<td colspan="6" style="border-left: 0.5px solid black;"></td>
<td colspan="7" style="border-left: 0.5px solid black;"></td>
<td colspan="3" style="text-align:center;border: 0.5px solid black;">SGST</td>
<td style="border: 0.5px solid black;"></td>
<td style="border: 0.5px solid black;"><?= $total_SGST; ?></td>
</tr>
<tr>
<td colspan="6" style="border-left: 0.5px solid black;"></td>
<td colspan="7" style="border-left: 0.5px solid black;"></td>
<td colspan="3" style="text-align:center;border: 0.5px solid black;">Total</td>
<td style="border: 0.5px solid black;"></td>
<td style="border: 0.5px solid black;"><?= $total_taxable_amount+$total_CGST+$total_SGST; ?></td>
</tr>
<tr>
<td colspan="10" style="border: 0.5px solid black;">Amount Chargeable (in words)</td>
<td colspan="11" style="border: 0.5px solid black;">Amount Chargeable (in words)</td>
</tr>
<tr><td></td></tr>

View File

@ -221,7 +221,7 @@ p {
<tr style="border: 1px solid black;">
<th style="border: 0.5px solid black;">S no</th>
<th style="border: 0.5px solid black;">Description Of Goods</th>
<th style="border: 0.5px solid black;">Taxable Value</th>
<th style="border: 0.5px solid black;">Amount with Tax</th>
<th style="border: 0.5px solid black;">Quantity</th>
<th style="border: 0.5px solid black;">Per</th>
<th style="border: 0.5px solid black;">GST</th>
@ -254,8 +254,8 @@ p {
<?php endforeach; ?>
<tr>
<td colspan="6" style="border-top: 0.5px solid black;border-left: 0.5px solid black;"></td>
<td colspan="3" style="text-align:center;border: 0.5px solid black;">Total Taxable Value</td>
<td style="border: 0.5px solid black;"><?= $job_card[0]['subtotal'] ?></td>
<td colspan="3" style="text-align:center;border: 0.5px solid black;">Total Amount with Tax</td>
<td style="border: 0.5px solid black;"></td>
</tr>
<tr>
<td colspan="6" style="border-left: 0.5px solid black;"></td>

View File

@ -49,6 +49,28 @@
}
</style>
<style>
.dataTables_wrapper button{
background: #f1f5f7;
color: #343a40;
border-width: 0;
}
.dataTables_wrapper .dt-buttons{
float:left;
}
.cancelled-status {
color: red;
}
.created-status {
color: blue;
}
.paid-status {
color: green;
}
</style>
<script>
toastr.options = {
@ -125,7 +147,8 @@
<li>
<a href="#sidebarLayouts1" data-toggle="collapse">
<i class="mdi mdi-sale"></i>
<!-- <i class="mdi mdi-sale"></i> -->
<i class="ri-file-chart-fill"></i>
<span> Sales </span>
<span class="menu-arrow"></span>
</a>

View File

@ -22,7 +22,7 @@
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;text-align: center;width: 100%;">
<table id="datatable-buttons-2" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;text-align: center;width: 100%;">
<thead>
<tr>
<th>Bike Make</th>
@ -42,18 +42,18 @@
<?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"></i></a>
<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>
<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"></i>
<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"></i>
<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"></i><i class="fa fa-times" style="font-size: x-small;"></i></a>
<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"></i></a>
<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; ?>
</td>
</tr>
@ -325,3 +325,52 @@
}
</script>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Make', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Make', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Make', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -68,8 +68,7 @@
</div>
<div class="form-group">
<label for="manufacturername">Quality</label>
<select name="quality" id="quality" class="form-control" style="border-color: lightgray;color: #6c757d;">
<option value="0">Select Quality</option>
<select name="quality" id="quality" class="form-control" style="border-color: lightgray;color: #6c757d;" required="true">
<option value="Q1">Q1</option>
<option value="Q2">Q2</option>
<option value="Q3">Q3</option>
@ -78,7 +77,7 @@
</div>
<div class="form-group text-center">
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitMake(this)">Submit</button>
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitManufacturer(this)">Submit</button>
</div>
</form>
@ -96,7 +95,7 @@
function submitMake(params) {
function submitManufacturer(params) {
var formData = {
manufacturername: $('#manufacturer_name').val(),
quality: $('#quality').val()

View File

@ -53,6 +53,7 @@
</div>
<div class="form-group col-md-4">
<label for="manufacturer" class="col-form-label">Manufacturer<span class="text-danger">*</span></label>
<?= isset($products['product_id']) ? '' : '<i type="button" class="fe-plus-circle" id="addManufacturerButton" style="font-size: 18px;" data-toggle="modal" data-target="#manufacturer_login-modal" title="Add Client"></i>' ?>
<select class="form-control SelExample" id="manufacturer" name="manufacturer" required>
<option value="">Select a Manufacturer</option>
<?php foreach ($manufacturers as $value): ?>
@ -308,6 +309,44 @@
</div>
</div>
<!-- Start Biake Mnufacturer Create Pop-UP -->
<div id="manufacturer_login-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="text-center mt-2 mb-4">
<h4 id="form_add_edit">Add Manufacturer</h4>
</div>
<div class="form-group">
<label for="manufacturername">Manufacturer Name </label>
<input type="text" id="manufacturer_id" hidden>
<input class="form-control" type="text" id="manufacturer_name" required="" placeholder="Manufacturer Name....">
</div>
<div class="form-group">
<label for="manufacturername">Quality</label>
<select name="quality" id="manufacturer_quality" class="form-control" style="border-color: lightgray;color: #6c757d;" required="true">
<option value="Q1">Q1</option>
<option value="Q2">Q2</option>
<option value="Q3">Q3</option>
<option value="Q4">Q4</option>
</select>
</div>
<div class="form-group text-center">
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitManufacturers(this)">Submit</button>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- End Bike Make Create Pop-UP -->
<script>
/** CALCULATE TOTAL AMOUNT ( UNIT PRICE + TAX ) */
$(document).ready(function() {
@ -618,6 +657,8 @@ $('#saveMakeBtn').click(function() {
} else {
toastr.error("Failed to save model");
}
$('#model').val(response.model_id);
},
error: function(xhr, status, error) {
console.error('Error occurred while saving model:', error);
@ -639,6 +680,59 @@ $('#saveMakeBtn').click(function() {
}
})
function submitManufacturers(params) {
var formData = {
manufacturer_name: $('#manufacturer_name').val(),
quality: $('#manufacturer_quality').val()
};
var edit_manufacturer_id = $('#manufacturer_id').val();
if (!edit_manufacturer_id) {
edit_manufacturer_id =0;
}
if (!$('#manufacturer_name').val() || !$('#manufacturer_quality').val()) {
return false;
}
$.ajax({
url: '<?php echo base_url().'save_manufacturer'?>',
type: 'POST',
data: formData,
dataType: 'json',
success: function(response) {
$('#manufacturer_login-modal').modal('hide');
$('#manufacturer_name').val('');
if(response.modelData){
$('#manufacturer').empty();
response.modelData.forEach(function(manufacturer) {
$('#manufacturer').append($('<option>', {
value: manufacturer.manufacturer_id,
text: manufacturer.manufacturer_name
}));
});
if(response.manufacturer_id) {
$('#manufacturer').val(response.manufacturer_id);
if (response.quality) {
$('#quality').val(response.quality);
}
}
}
},
error: function(xhr, status, error) {
// Handle error response here
console.error(xhr.responseText);
}
});
}
</script>
<style>
.select2-container--default .select2-results__option--highlighted[aria-selected]{

View File

@ -1,4 +1,26 @@
<?php include('layout/header.php'); ?>
<style>
.dataTables_wrapper button{
background: #f1f5f7;
color: #343a40;
border-width: 0;
}
.dataTables_wrapper .dt-buttons{
float:left;
}
.cancelled-status {
color: red;
}
.created-status {
color: blue;
}
.paid-status {
color: green;
}
</style>
<div class="container-fluid">
<div class="row">
<div class="col-12">
@ -21,39 +43,57 @@
<div class="card-body">
<!-- <h4 class="header-title">Business List</h4> -->
<table id="datatable-buttons2" class="table table-striped dt-responsive nowrap w-100"
style="width:100% !important;">
<thead>
<tr>
<td>
<input class="form-control form-control-sm" type="text" id="searchSKUId" placeholder="Search SKU Id">
</td>
<td>
<input class="form-control form-control-sm" type="text" id="searchProductName" placeholder="Search Product Name">
</td>
<td>
<input class="form-control form-control-sm" type="text" id="searchManufacturerName" placeholder="Search Manufacturer Name">
</td>
<td>
<input class="form-control form-control-sm" type="text" id="searchCategory" placeholder="Search Category">
</td>
<td>
<input class="form-control form-control-sm" type="text" id="searchUnitPrice" placeholder="Search Unit Price">
</td>
<td>
<input class="form-control form-control-sm" type="text" id="searchQtyStock" placeholder="Search Qty in Stock">
</td>
<td>
<input class="form-control form-control-sm" type="text" id="searchRackNo" placeholder="Search Rack No">
</td>
</tr>
<tr>
<th>SKU Id</th>
<th>Product Name</th>
<!-- <th>Manufacturer Name</th> -->
<th>Manufacturer Name</th>
<th>Category</th>
<th>Unit Price</th>
<th>Qty in Stock</th>
<th>Rack No</th>
<?php if(!$manufacturer_id) { ?><th>Actions</th><?php } ?>
</tr>
</thead>
<tbody>
<?php foreach ($products as $value) :
if ($value['isactive'] == 1) : ?>
<tr>
<td><?= $value['sku_id']; ?></td>
<td><?= $value['product_name']; ?></td>
<td><?= $value['manufacturer_name']; ?></td>
<td><?= $value['product_category']; ?></td>
<td><?= number_format($value['unit_price']); ?></td>
<td><?= $value['qty_stock']; ?></td>
<td><?= $value['rack_number']; ?></td>
<!-- Call the model method -->
<?php if(!$manufacturer_id) { ?>
<td>
@ -65,16 +105,13 @@
<?php } ?>
<?php endif?>
<?php endforeach; ?>
</tr>
</tbody>
</table>
</div> <!-- end table-responsive-->
</div>
</div> <!-- end card -->
</div> <!-- end col -->
</div>
<?php include('layout/footer.php'); ?>
@ -122,7 +159,27 @@
"language": {
"search": "Search: " // Customize search label
},
// "ordering": false
});
});
</script>
<script>
$(document).ready(function() {
// Event listener for input changes in search fields
$('input[type="text"]').on('input', function() {
var columnIndex = $(this).closest('td').index() + 1; // Get the index of the input field's parent td
var searchText = $(this).val().toLowerCase();
$('#datatable-buttons2 tbody tr').each(function() {
var cellText = $(this).find('td:nth-child(' + columnIndex + ')').text().toLowerCase();
if (cellText.includes(searchText)) {
$(this).show();
} else {
$(this).hide();
}
});
});
});
</script>

View File

@ -22,7 +22,7 @@
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;">
<table id="datatable-buttons-2" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;">
<thead>
<tr>
@ -62,4 +62,53 @@
</div> <!-- end col -->
</div>
<?php include('layout/footer.php'); ?>
<?php include('layout/footer.php'); ?>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Mechanic', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Mechanic', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Mechanic', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -67,7 +67,7 @@
<?php if (isset($sales['status']) && $sales['status'] !== ''): ?>
(<?= $sales['status'] ?>)
<?php endif; ?></label>
<select class="form-control status-select" name="status" required data-toggle="select2">
<select class="form-control status-select status_class_for_change" name="status" required data-toggle="select2">
<?php if (isset($sales['status'])): ?>
<?php if ($sales['status'] === 'Cancelled'): ?>
@ -88,6 +88,18 @@
</select>
</div>
<?php if (isset($sales['status']) && $sales['status'] !== ''): ?>
<div class="form-group col-md-4" id="mode_of_payment_parent_div_id" <?= $sales['status'] === 'Paid' ? '' : 'style="display:none;"' ?>>
<label for="mode_of_payment" class="col-form-label">Mode Of Payment<span class="text-danger">*</span>
<select class="form-control" name="mode_of_payment" id="mode_of_payment" >
<option value>Select Mode Of Payment</option>
<option value="online" <?= $sales['mode_of_payment'] === 'online' ? 'selected' : '' ?> >Online</option>
<option value="cash" <?= $sales['mode_of_payment'] === 'cash' ? 'selected' : '' ?>>Cash</option>
</select>
</div>
<?php endif; ?>
</div><br>
@ -950,9 +962,20 @@ $(document).on('click', '#selectClient', function() {
}
</style>
<script>
// Assuming you have an edit button with an ID 'editButton'
$('#editaddbutton').click(function() {
// Enable the vendor dropdown
$('#vehicle_id').prop('disabled', false);
});
// Assuming you have an edit button with an ID 'editButton'
$('#editaddbutton').click(function() {
// Enable the vendor dropdown
$('#vehicle_id').prop('disabled', false);
});
$('.status_class_for_change').change(function (params) {
if($(this).val() === 'Paid'){
$('#mode_of_payment_parent_div_id').css('display','');
$('#mode_of_payment').prop('required','required');
}else{
$('#mode_of_payment_parent_div_id').css('display','none');
$('#mode_of_payment').removeAttr('required');
}
})
</script>

View File

@ -61,8 +61,8 @@
<div class="form-group col-md-3">
<label for="model" class="col-form-label">Product</label>
<select class="form-control SelExample" id="productSelect" name="product_id[]" multiple>
<!-- <option value="">Select a Product</option> -->
<!-- <option value="0" <?= isset($services['product_id']) && in_array(0, json_decode($services['product_id'])) ? 'selected' : '' ?>>None</option> -->
<option value="">Select a Product</option>
<option value="0" <?= !empty($services['product_id']) && (isset($services['product_id']) && in_array(0, json_decode($services['product_id']))) ? 'selected' : '' ?>>None</option>
<?php foreach ($product as $value) : ?>
<?php if ((int)$value["isactive"] === 1) : ?>
<option value="<?= $value["product_id"] ?>" <?= isset($services['product_id']) && in_array($value['product_id'], json_decode($services['product_id'])) ? 'selected' : '' ?>>
@ -75,11 +75,11 @@
<div class="form-group col-md-3">
<label for="model" class="col-form-label">Service</label>
<select class="form-control SelExample" id="serviceSelected" name="sub_service_id[]" multiple>
<!-- <option value="">Select a Service</option> -->
<!-- <option value="0" <?= isset($services['sub_service_id']) && in_array(0, json_decode($services['sub_service_id'])) ? 'selected' : '' ?>>None</option> -->
<option value="">Select a Service</option>
<option value="0" <?= isset($services['sub_service_id']) && in_array(0, json_decode($services['sub_service_id'])) ? 'selected' : '' ?>>None</option>
<?php foreach ($service as $value) : ?>
<?php if ((int)$value["isactive"] === 1) : ?>
<option value="<?= $value["service_id"] ?>" <?= isset($services['sub_service_id']) && in_array($value['sub_service_id'], json_decode($services['sub_service_id'])) ? 'selected' : '' ?>>
<option value="<?= $value["service_id"] ?>" <?= isset($services['sub_service_id']) && !empty($services['sub_service_id']) && in_array($value['sub_service_id'], json_decode($services['sub_service_id'])) ? 'selected' : '' ?>>
<?= $value["service_name"]; ?>
</option>
<?php endif; ?>

View File

@ -19,7 +19,7 @@
<div class="card-body">
<!-- <h4 class="header-title">Business List</h4> -->
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;">
<table id="datatable-buttons-2" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;">
<thead>
<tr>
<th>Service Name</th>
@ -64,4 +64,53 @@
</div> <!-- end col -->
</div>
<?php include('layout/footer.php'); ?>
<?php include('layout/footer.php'); ?>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Service', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Service', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Service', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -27,7 +27,7 @@
<table id="datatable-buttons" class="table dt-responsive nowrap w-100">
<table id="datatable-buttons-2" class="table dt-responsive nowrap w-100">
<thead>
<tr>
<th>#</th>
@ -69,4 +69,52 @@
</div> <!-- end col -->
<?php include('layout/footer.php'); ?>
</div>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'User', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'User', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'User', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -17,7 +17,7 @@
<div class="card">
<div class="card-body">
<!-- <h4 class="header-title">Business List</h4> -->
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100"
<table id="datatable-buttons-2" class="table table-striped dt-responsive nowrap w-100"
style="width:100% !important;">
<thead>
<tr>
@ -58,4 +58,53 @@
</div> <!-- end col -->
</div>
<?php include('layout/footer.php'); ?>
<?php include('layout/footer.php'); ?>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Vehicle', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Vehicle', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Vehicle', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>

View File

@ -27,7 +27,7 @@
<table id="datatable-buttons" class="table dt-responsive nowrap w-100">
<table id="datatable-buttons-2" class="table dt-responsive nowrap w-100">
<thead>
<tr>
<th>#</th>
@ -65,6 +65,53 @@
</div>
</div> <!-- end card -->
</div> <!-- end col -->
<?php include('layout/footer.php'); ?>
</div>
<?php include('layout/footer.php'); ?> </div>
<script>
$(document).ready(function() {
$('#datatable-buttons-2').DataTable({
"order": [[2, 'desc']], // Set initial sorting to descending on the first column
"dom": 'Bfrtip', // Show export buttons
"buttons": [ {
extend: 'pdfHtml5',
title: 'Vendor', // Set your custom PDF title here
text: 'PDF',
customize: function(doc) {
// You can further customize the PDF here if needed
// doc.content[1].table.body.forEach(function(row) {
// row.splice(0, 1); // Remove the first column (ID column)
// });
}
},
{
extend: 'print',
title: 'Vendor', // Set your custom print title here
text: 'Print',
customize: function(win) {
// You can further customize the print output here if needed
// $(win.document.body).find('table').find('th:first-child, td:first-child').remove();
}
},
{
extend: 'copy',
text: 'Copy', // Set the title for the Copy button
titleAttr: 'Copy', // Set the tooltip for the Copy button
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
},
{
extend: 'csv',
text: 'CSV', // Set the title for the CSV button
title: 'Vendor', // Set your custom print title here
exportOptions: {
// columns: ':not(:first-child)' // Exclude the first column (ID column)
}
}], // Enable export options
"language": {
"search": "Search: " // Customize search label
},
"ordering": false
});
});
</script>