Add Asset Details
-Add Asset Details
+Add Config Details
-| S.NO | -Configuration Value | -Action | - - - +
|---|
| S.NO | +Configuration Value | +Action | + + + + - + -
|---|
diff --git a/.gitignore b/.gitignore index f7d2f266..327112bf 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# Ignore Composer files +vendor +composer.lock + + # Ignore PHPStorm files /.idea/* *.sublime-* @@ -111,9 +116,7 @@ php_errors.log /app/Views/*.tmp -# Ignore Composer files -vendor -composer.lock + # Ignore environment-specific settings .env diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 9e2a7c9c..8a1d236e 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -31,6 +31,7 @@ $routes->get('reports', 'Report::index'); // User Routes $routes->get('addNew', 'User::addNew'); +$routes->post('fetchEmployeeDetails', 'User::fetchEmployeeDetails'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'addNewUser', 'User::addNewUser'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'userListing', 'User::userListing'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'userListing/(:num)', 'User::userListing/$1'); @@ -72,6 +73,8 @@ $routes->get('exportcost', 'CostCenter::exportcost'); // Asset Detail Routes $routes->get('assetListing', 'Assetdetails::assetListing'); $routes->get('addasset', 'Assetdetails::addasset'); +$routes->get('assetdetails/editOldasset', 'Assetdetails::editOldasset'); +// $routes->post('addNewasset', 'Assetdetails::addNewasset'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'editOldasset', 'Assetdetails::editasset'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'editOldasset/(:num)', 'Assetdetails::editasset/$1'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'editasset', 'Assetdetails::editasset'); @@ -259,6 +262,13 @@ $routes->get('download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZi $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituploadfile'); + +// Non IGR / Expense +$routes->get('ListIGR', 'Expense::index'); +$routes->post('addExpense', 'Expense::addExpense'); +$routes->get('getExpenseDetails', 'Expense::getExpenseDetails'); + + // Application OGR Page $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'AddOgr', 'Inwardgateregister::addoutwardgateregister'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'ViewOgr', 'Inwardgateregister::ViewOgr'); diff --git a/app/Controllers/Assetdetails.php b/app/Controllers/Assetdetails.php index aff0adda..b09799f2 100644 --- a/app/Controllers/Assetdetails.php +++ b/app/Controllers/Assetdetails.php @@ -66,7 +66,7 @@ class Assetdetails extends BaseController $data['AssetStatus'] = $this->assetdetails_model->getConfigValue('C015'); $data['po'] = $this->assetdetails_model->getPO(); - //print_r($data);die(); + // print_r($data);die(); $this->global['pageTitle'] = 'Add Asset'; $this->loadViews("addasset", $this->global, $data, NULL); @@ -186,47 +186,48 @@ class Assetdetails extends BaseController function addNewasset() { - $this->validator->setRules([ - 'AssetName' => 'trim|required', - 'Department' => 'trim|callback_Department_validate', - 'Location' => 'trim|required', - 'User' => 'trim|required', - 'SupplierName' => 'trim|callback_Supplier_validate', - 'DateOfCommission' => 'trim|required', - 'Assetvalue' => 'trim|required', - 'AssetStatus' => 'trim|callback_Asset_validate' - ]); + // $this->validator->setRules([ + // 'AssetName' => 'trim|required', + // 'Department' => 'trim|callback_Department_validate', + // 'Location' => 'trim|required', + // 'User' => 'trim|required', + // 'SupplierName' => 'trim|callback_Supplier_validate', + // 'DateOfCommission' => 'trim|required', + // 'Assetvalue' => 'trim|required', + // 'AssetStatus' => 'trim|callback_Asset_validate' + // ]); - $this->validator->setMessage([ - 'AssetName' => [ - 'required' => 'Please enter Asset Name.' - ], - 'Department' => [ - 'Department_validate' => 'Please select a valid Department.' - ], - 'Location' => [ - 'required' => 'Please enter Location.' - ], - 'User' => [ - 'required' => 'Please enter User.' - ], - 'SupplierName' => [ - 'Supplier_validate' => 'Please select a valid Supplier.' - ], - 'DateOfCommission' => [ - 'required' => 'Please enter Date of Commission.' - ], - 'Assetvalue' => [ - 'required' => 'Please enter Asset Value.' - ], - 'AssetStatus' => [ - 'Asset_validate' => 'Please select a valid Asset Status.' - ] - ]); + // $this->validator->setMessage([ + // 'AssetName' => [ + // 'required' => 'Please enter Asset Name.' + // ], + // 'Department' => [ + // 'Department_validate' => 'Please select a valid Department.' + // ], + // 'Location' => [ + // 'required' => 'Please enter Location.' + // ], + // 'User' => [ + // 'required' => 'Please enter User.' + // ], + // 'SupplierName' => [ + // 'Supplier_validate' => 'Please select a valid Supplier.' + // ], + // 'DateOfCommission' => [ + // 'required' => 'Please enter Date of Commission.' + // ], + // 'Assetvalue' => [ + // 'required' => 'Please enter Asset Value.' + // ], + // 'AssetStatus' => [ + // 'Asset_validate' => 'Please select a valid Asset Status.' + // ] + // ]); - if (!$this->validator->run()) { - $this->addasset(); + // if (!$this->validator->run()) { + if (false) { + // $this->addasset(); } else { $assetName = $this->request->getPost('AssetName'); $AssetName = (!empty($assetName)) ? strtoupper((string)$assetName) : ""; @@ -273,11 +274,11 @@ class Assetdetails extends BaseController if ($result > 0) { // $this->session->set_flashdata('success', 'New Asset created successfully'); echo ""; - redirect('assetListing', 'refresh'); } else { + // $this->session->set_flashdata('failed', 'Asset Created Failed!'); echo ""; - redirect('assetListing', 'refresh'); } + return redirect()->route('assetListing'); } } /** @@ -325,49 +326,50 @@ class Assetdetails extends BaseController $Asset_Code = $this->request->getPost('AssetCode'); - $this->validator->setRules([ - 'AssetName' => 'trim|required', - 'Description' => 'trim|required', - 'Department' => 'trim|callback_Department_validate', - 'Location' => 'trim|required', - 'User' => 'trim|required', - 'SupplierName' => 'trim|callback_Supplier_validate', - 'DateOfCommission' => 'trim|required', - 'Assetvalue' => 'trim|required', - 'AssetStatus' => 'trim|callback_Asset_validate' - ]); + // $this->validator->setRules([ + // 'AssetName' => 'trim|required', + // 'Description' => 'trim|required', + // 'Department' => 'trim|callback_Department_validate', + // 'Location' => 'trim|required', + // 'User' => 'trim|required', + // 'SupplierName' => 'trim|callback_Supplier_validate', + // 'DateOfCommission' => 'trim|required', + // 'Assetvalue' => 'trim|required', + // 'AssetStatus' => 'trim|callback_Asset_validate' + // ]); - $this->validator->setMessage([ - 'AssetName' => [ - 'required' => 'Please enter Asset Name.' - ], - 'Description' => [ - 'required' => 'Please enter Description.' - ], - 'Department' => [ - 'Department_validate' => 'Please select a valid Department.' - ], - 'Location' => [ - 'required' => 'Please enter Location.' - ], - 'User' => [ - 'required' => 'Please enter User.' - ], - 'SupplierName' => [ - 'Supplier_validate' => 'Please select a valid Supplier.' - ], - 'DateOfCommission' => [ - 'required' => 'Please enter Date of Commission.' - ], - 'Assetvalue' => [ - 'required' => 'Please enter Asset Value.' - ], - 'AssetStatus' => [ - 'Asset_validate' => 'Please select a valid Asset Status.' - ] - ]); + // $this->validator->setMessage([ + // 'AssetName' => [ + // 'required' => 'Please enter Asset Name.' + // ], + // 'Description' => [ + // 'required' => 'Please enter Description.' + // ], + // 'Department' => [ + // 'Department_validate' => 'Please select a valid Department.' + // ], + // 'Location' => [ + // 'required' => 'Please enter Location.' + // ], + // 'User' => [ + // 'required' => 'Please enter User.' + // ], + // 'SupplierName' => [ + // 'Supplier_validate' => 'Please select a valid Supplier.' + // ], + // 'DateOfCommission' => [ + // 'required' => 'Please enter Date of Commission.' + // ], + // 'Assetvalue' => [ + // 'required' => 'Please enter Asset Value.' + // ], + // 'AssetStatus' => [ + // 'Asset_validate' => 'Please select a valid Asset Status.' + // ] + // ]); - if ($this->validator->run() == FALSE) { + // if ($this->validator->run() == FALSE) { + if (FALSE) { $this->editOldasset($Asset_Code); } else { @@ -419,11 +421,10 @@ class Assetdetails extends BaseController if ($result == true) { echo ""; - redirect('assetListing', 'refresh'); } else { echo ""; - redirect('assetListing', 'refresh'); } + return redirect()->route('assetListing'); } } diff --git a/app/Controllers/Expense.php b/app/Controllers/Expense.php new file mode 100644 index 00000000..efc417dc --- /dev/null +++ b/app/Controllers/Expense.php @@ -0,0 +1,105 @@ +expense_model = new Expense_model(); + $this->supplier_model = new Supplier_model(); + + $this->session = session(); + helper('form'); //$this->load->library('form_validation'); + + $this->isLoggedIn(); + } + public function index() + { + $data['expense_list'] = $this->expense_model->getAllExpense(); + $data['supplier_list'] = json_encode($this->supplier_model->supplierlisting()); + $this->global['pageTitle'] = 'Non IGR / Expense List'; + // echo "
";
+ // print_r($data);die;
+ $this->loadViews("expense_list", $this->global, $data, NULL);
+ }
+
+ function addExpense()
+ {
+ $data = array(
+ 'transporter_file' => $this->request->getPost('transporterfile'),
+ 'supplier_id' => $this->request->getPost('supplierid'),
+ 'remarks' => $this->request->getPost('remarks'),
+ 'cost' => $this->request->getPost('cost'),
+ 'gst' => $this->request->getPost('gst'),
+ 'total' => $this->request->getPost('total'),
+ 'status' => $this->request->getPost('status'),
+ 'payment_method' => $this->request->getPost('payment_method')
+ );
+
+ $insert_id = $this->expense_model->insertExpense($data);
+
+ if ($insert_id) {
+ // Return success response or redirect
+ // $this->session->set_flashdata('success', 'Expense added successfully.');
+ // redirect('your_controller/your_method'); // Replace with your redirect path
+ return json_encode('true');
+ } else {
+ // Return error response
+ // $this->session->set_flashdata('error', 'Failed to add expense.');
+ // redirect('your_controller/your_method'); // Replace with your redirect path
+ return json_encode('false');
+ }
+ }
+
+ public function getExpenseDetails() {
+ $id = $this->request->getPost('id');
+
+ if ($id) {
+ $expense = $this->expense_model->getExpenseById($id);
+ echo json_encode($expense);
+ } else {
+ echo json_encode(['error' => 'Invalid ID']);
+ }
+ }
+
+ public function updateExpense() {
+ // $id = $this->input->post('id');
+ // $data = [
+ // 'transporterfile' => $this->input->post('transporterfile'),
+ // 'supplierid' => $this->input->post('supplierid'),
+ // 'remarks' => $this->input->post('remarks'),
+ // 'cost' => $this->input->post('cost'),
+ // 'gst' => $this->input->post('gst'),
+ // 'total' => $this->input->post('total'),
+ // 'status' => $this->input->post('status'),
+ // 'payment_method' => $this->input->post('payment_method')
+ // ];
+
+ // if ($id) {
+ // $result = $this->Expense_model->updateExpense($id, $data);
+ // if ($result) {
+ // echo json_encode(['success' => 'Expense updated successfully']);
+ // } else {
+ // echo json_encode(['error' => 'Failed to update expense']);
+ // }
+ // } else {
+ // echo json_encode(['error' => 'Invalid ID']);
+ // }
+ }
+}
diff --git a/app/Controllers/User.php b/app/Controllers/User.php
index 6eb84fa6..c3f79358 100644
--- a/app/Controllers/User.php
+++ b/app/Controllers/User.php
@@ -917,14 +917,10 @@ class User extends BaseController
// else
// {
$data['EmpList'] = $this->user_model->getAllEmployees();
-
-
$data['roles'] = $this->user_model->getUserRoles();
-
// $data['Department'] = $this->costcenter_model->getDepartment();
$this->global['pageTitle'] = 'Add New User';
-
$this->loadViews("addUser", $this->global, $data, NULL);
// }
}
@@ -1637,4 +1633,19 @@ class User extends BaseController
}
// END zoho API
-}
\ No newline at end of file
+ function fetchEmployeeDetails() {
+ $EmpID = $this->request->getPost('EmpID');
+
+ if (!$EmpID) {
+ return $this->response->setJSON(['success' => false, 'message' => 'Employee ID not provided']);
+ }
+
+ $userInfo = $this->user_model->findEmp($EmpID);
+
+ if ($userInfo) {
+ return $this->response->setJSON(['success' => true, 'userInfo' => $userInfo]);
+ } else {
+ return $this->response->setJSON(['success' => false, 'message' => 'Employee not found']);
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/Models/Expense_model.php b/app/Models/Expense_model.php
new file mode 100644
index 00000000..c3727ee1
--- /dev/null
+++ b/app/Models/Expense_model.php
@@ -0,0 +1,38 @@
+join('t_supplierdetailsn', 't_expense.supplier_id = t_supplierdetailsn.SupplierID')
+ ->where('t_expense.isactive', 1)
+ ->orderBy('t_expense.created_on', 'DESC')
+ ->findAll();
+ }
+
+ // Insert new expense
+ public function insertExpense($data) {
+ return $this->insert($data) ? $this->insertID() : false;
+ }
+
+ // Get expense by ID
+ public function getExpenseById($id) {
+ return $this->where($this->primaryKey, $id)->first(); // Use primary key
+ }
+
+ // Update expense by ID
+ public function updateExpense($id, $data) {
+ return $this->update($id, $data); // Use primary key
+ }
+}
+?>
diff --git a/app/Models/User_model.php b/app/Models/User_model.php
index d51487b4..17bf2148 100644
--- a/app/Models/User_model.php
+++ b/app/Models/User_model.php
@@ -304,4 +304,18 @@ GROUP BY financial_year ";
return $r;
}
}
+
+
+
+
+ function findEmp($EmpId)
+ {
+ $builder = $this->db->table('tbl_users')
+ ->select('tbl_users.*, t_employee_details.*')
+ ->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID' ,'left')
+ ->where('tbl_users.EmpID', $EmpId);
+ $query = $builder->get();
+
+ return $query->getResult();
+ }
}
\ No newline at end of file
diff --git a/app/Views/addSupplier.php b/app/Views/addSupplier.php
index 78900c1f..16590348 100644
--- a/app/Views/addSupplier.php
+++ b/app/Views/addSupplier.php
@@ -46,7 +46,7 @@
@@ -161,7 +161,7 @@
-
+
diff --git a/app/Views/addUser.php b/app/Views/addUser.php
index a2191582..2ba400bc 100644
--- a/app/Views/addUser.php
+++ b/app/Views/addUser.php
@@ -12,8 +12,8 @@
-
-
+
+
@@ -21,263 +21,257 @@
-
-
-
-
-
-
-
+ getFlashdata('error');
+ if ($error) {
+ ?>
+
+
+ getFlashdata('error'); ?>
+
+
+
+ getFlashdata('success');
+ if ($success) {
+ ?>
+
+
+ getFlashdata('success'); ?>
+
+
+
+
+
+
+
+
+
+
-
+
+
+
- $('#addPop').click(function ()
- {
- if ($('#distriList option:selected').val() != null)
- {
-
- if($('#distriList option:selected').val()==0 )
- {
- alert('please select Department');
- }
-
- else
- {
-
- var tempSelect = $('#distriList option:selected').val();
- var tempText = $('#distriList option:selected').text();
-
- var o = new Option(tempText,tempSelect);
- var hidval = tempSelect;
- var orgVal = $('#txtSelectedDepartment').val();
- var Selectedval = ''
-
- if(orgVal != '')
- {
- Selectedval = orgVal + ':' + hidval;
- }
- else
- {
- Selectedval = hidval
- }
- $('#txtSelectedDepartment').val(Selectedval);
-
- $(o).html(tempText);
- $("#selectDistriList").append(o);
-
-
- $('#distriList option:selected').remove();
- $("#distriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected");
- $("#selectDistriList").attr('selectedIndex', '-1').find("option:selected").removeAttr("selected");
-
- tempSelect = '';
- tempText = '';
- Selectedval = '';
- }
- }
-
- else
- {
- alert("Before add please select any position.");
- }
- });
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/Views/addasset.php b/app/Views/addasset.php
index 1b95b3c2..8228925b 100644
--- a/app/Views/addasset.php
+++ b/app/Views/addasset.php
@@ -1,95 +1,93 @@
-
-
-
-
-
-
-
- Add Asset Details
-
-
-
- Back
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ Add Asset Details
+
+
+
+ Back
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+ ?>
+
-
-
+
+
-
+
-
+
-
+
@@ -99,355 +97,337 @@
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
-
+
- >
+ >
-
-
-
+
+
+
-
-
-
-
-
- getFlashdata('listErrors');
- if($listErrors)
- {
- ?>
-
-
-
-
- getFlashdata('listErrors'); ?>
-
+
+
+
-
-
-
getFlashdata('error');
- if($error)
- {
+ $listErrors = session()->getFlashdata('listErrors');
+ if ($listErrors) {
?>
+
+
+
+
+ getFlashdata('listErrors'); ?>
+
+
+
+
+
+
+ getFlashdata('error');
+ if ($error) {
+ ?>
- getFlashdata('error'); ?>
+ getFlashdata('error'); ?>
-
-
- getFlashdata('success');
- if($success)
- {
- ?>
+
+
+ getFlashdata('success');
+ if ($success) {
+ ?>
getFlashdata('success'); ?>
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/Views/addconfig.php b/app/Views/addconfig.php
index 131b3c2e..603ab023 100644
--- a/app/Views/addconfig.php
+++ b/app/Views/addconfig.php
@@ -1,81 +1,82 @@
-
-
-
-
-
-
-
-
- Add Config Details
-
-
-
- Back
-
-
- getFlashdata('error');
- if ($error) {
- ?>
-
-
- getFlashdata('error'); ?>
-
-
- getFlashdata('success');
- if ($success) {
- ?>
-
-
- getFlashdata('success'); ?>
-
-
-
-
-
-
-
-
-
-
-
- 'configurationname', 'value' => set_value('configurationname'), 'id' => 'configurationname', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20');
- echo form_input($data); ?>
-
-
-
-
-
- 'Comments', 'value' => set_value('Comments'), 'id' => 'Comments', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20');
- echo form_input($data);
- ?>
-
-
-
-
-
-
-
-
-
- S.NO
- Configuration Value
- Action
-
-
-
+
+
+
+
+
+ Add Config Details
+
+
+
+ Back
+
+
+ getFlashdata('error');
+ if ($error) {
+ ?>
+
+
+ getFlashdata('error'); ?>
+
+
+ getFlashdata('success');
+ if ($success) {
+ ?>
+
+
+ getFlashdata('success'); ?>
+
+
+
+
+
+
+
+
+
+
+
+ 'configurationname', 'value' => set_value('configurationname'), 'id' => 'configurationname', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20');
+ echo form_input($data); ?>
+
+
+
+
+
+ 'Comments', 'value' => set_value('Comments'), 'id' => 'Comments', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20');
+ echo form_input($data);
+ ?>
+
+
+
+
+
+
+
+
+
+ S.NO
+ Configuration Value
+ Action
+
+
+
+
-
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
getFlashdata('error');
- if ($error) {
- ?>
-
-
- getFlashdata('error'); ?>
-
-
- getFlashdata('success');
- if ($success) {
- ?>
-
-
- getFlashdata('success'); ?>
-
-
-
- t
-
+ helper('form');
+ $error = session()->getFlashdata('error');
+ if ($error) {
+ ?>
+
+
+ getFlashdata('error'); ?>
+
+
+ getFlashdata('success');
+ if ($success) {
+ ?>
+
+
+ getFlashdata('success'); ?>
+
+
+
+ t
+
+
+
-
+
\ No newline at end of file
diff --git a/app/Views/adddepartment.php b/app/Views/adddepartment.php
index f0a5a425..a4c78054 100644
--- a/app/Views/adddepartment.php
+++ b/app/Views/adddepartment.php
@@ -20,7 +20,7 @@
diff --git a/app/Views/companyview.php b/app/Views/companyview.php
index 46a90455..3765317a 100644
--- a/app/Views/companyview.php
+++ b/app/Views/companyview.php
@@ -469,7 +469,7 @@ function ValidateUA() {
diff --git a/app/Views/configlisting.php b/app/Views/configlisting.php
index 2315dbda..89e51d14 100644
--- a/app/Views/configlisting.php
+++ b/app/Views/configlisting.php
@@ -39,22 +39,22 @@
-
-
-
-
-
-
-
-
- Configuration Details
-
-
-
-
-
+
+
+
+
+
+
+
+ Configuration Details
+
+
+
+
+ getFlashdata('error');
if ($error) {
@@ -74,73 +74,73 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
@@ -171,78 +171,83 @@
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
-
+
// Initialize the DataTable
var table = $('#config_list_table').DataTable({
- dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
- buttons: [
- 'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
- ],
- pageLength: 10, // Default rows per page
- lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
- responsive: true, // Responsive table
- order: [[0, 'desc']], // Default ordering (column index 0, descending)
- language: {
- paginate: {
- next: '', // Next button icon
- previous: '' // Previous button icon
- }
+ dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
+ buttons: [
+ 'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
+ ],
+ pageLength: 10, // Default rows per page
+ lengthMenu: [
+ [10, 20, 30, 50, -1],
+ [10, 20, 30, 50, "All"]
+ ], // Rows per page options
+ responsive: true, // Responsive table
+ order: [
+ [0, 'desc']
+ ], // Default ordering (column index 0, descending)
+ language: {
+ paginate: {
+ next: '', // Next button icon
+ previous: '' // Previous button icon
}
+ }
});
// Date range filter function
$.fn.dataTable.ext.search.push(
- function(settings, data, dataIndex) {
- var fromDate = $('#fromDate').val();
- var toDate = $('#toDate').val();
-
- if (!fromDate || !toDate) {
- return true; // If no dates selected, don't filter
- }
-
- var dateStr = data[0]; // Assuming the date is in the first column
- var dateParts = dateStr.split("-");
- var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
-
- var startDate = new Date(fromDate);
- var endDate = new Date(toDate);
-
- // Adjust startDate to include the day before the selected fromDate
- startDate.setDate(startDate.getDate() - 1);
-
- // Ensure endDate includes the entire end date by setting time to the end of the day
- endDate.setHours(23, 59, 59, 999);
+ function(settings, data, dataIndex) {
+ var fromDate = $('#fromDate').val();
+ var toDate = $('#toDate').val();
- // Return true if the date is within the range
- return date >= startDate && date <= endDate;
+ if (!fromDate || !toDate) {
+ return true; // If no dates selected, don't filter
}
+
+ var dateStr = data[0]; // Assuming the date is in the first column
+ var dateParts = dateStr.split("-");
+ var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
+
+ var startDate = new Date(fromDate);
+ var endDate = new Date(toDate);
+
+ // Adjust startDate to include the day before the selected fromDate
+ startDate.setDate(startDate.getDate() - 1);
+
+ // Ensure endDate includes the entire end date by setting time to the end of the day
+ endDate.setHours(23, 59, 59, 999);
+
+ // Return true if the date is within the range
+ return date >= startDate && date <= endDate;
+ }
);
// Handle form submission for the date range filter
$("#DateRangeFilter").submit(function(e) {
- e.preventDefault();
- table.draw(); // Redraw the table to apply the filter
+ e.preventDefault();
+ table.draw(); // Redraw the table to apply the filter
});
// Reset button functionality
$("#resetButton").click(function() {
- $("#fromDate").val('');
- $("#toDate").val('');
- table.draw(); // Redraw the table to clear the filter
+ $("#fromDate").val('');
+ $("#toDate").val('');
+ table.draw(); // Redraw the table to clear the filter
});
// Automatically focus and open the To Date picker when From Date is selected
document.getElementById('fromDate').addEventListener('change', function() {
- var fromDate = this.value;
- var toDateInput = document.getElementById('toDate');
-
- // Set the min attribute of the To Date input to the selected From Date
- toDateInput.min = fromDate;
+ var fromDate = this.value;
+ var toDateInput = document.getElementById('toDate');
- // Optionally reset the To Date input if the current value is before the new min date
- if (toDateInput.value < fromDate) {
- toDateInput.value = fromDate;
- }
+ // Set the min attribute of the To Date input to the selected From Date
+ toDateInput.min = fromDate;
+
+ // Optionally reset the To Date input if the current value is before the new min date
+ if (toDateInput.value < fromDate) {
+ toDateInput.value = fromDate;
+ }
});
-});
+ });
\ No newline at end of file
diff --git a/app/Views/editOld.php b/app/Views/editOld.php
index 10089914..e64069f5 100644
--- a/app/Views/editOld.php
+++ b/app/Views/editOld.php
@@ -38,244 +38,115 @@ if(!empty($EmpList))
?>
-
-
-
-
- Edit User = ' - '.$EmpId; ?> Details
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ Edit User = ' - '.$EmpId; ?> Details
+
+
+
+ Back
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
'Select Department',
- "1"=>'System Administrator');
- // print_r($Departmentlist);
-
- if(!empty($Departmentlist))
- {
- foreach ($Departmentlist as $SID):
-
-
- $options[$SID->DEPCode] = $SID->DEPCode.' '.' - '.' '.$SID->DepartmentName;
-
- endforeach;
- }
- echo form_multiselect('distriList', $options,set_value('distriList', array()),'id="distriList"' ,'class="form-control required"','required="true"');
-
- ?>
+ $listErrors = session()->getFlashdata('listErrors');
+ if ($listErrors) {
+ ?>
+
+
+ getFlashdata('listErrors'); ?>
+
+
+ getFlashdata('error');
+ if ($error) {
+ ?>
+
+
+ getFlashdata('error'); ?>
+
+
+ getFlashdata('success');
+ if ($success) {
+ ?>
+
+
+ getFlashdata('success'); ?>
+
+
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
- AssDep == '1')
- {
- $option[$SID->AssDep] = "01-System Administrator";
- }
-
- else
- {
- $option[$SID->AssDep] = $SID->AssDep.' '.' - '.' '.$SID->DepartmentName;
- }
- endforeach;
- }
-
-
-
-
-
- echo form_multiselect('selectDistriList[]', $option,set_value('selectDistriList[]', array()),'id="selectDistriList"','size="10"');
-
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getFlashdata('error');
- if($error)
- {
- ?>
-
-
- getFlashdata('error'); ?>
-
-
- getFlashdata('success');
- if($success)
- {
- ?>
-
-
- getFlashdata('success'); ?>
-
-
-
-
-
- listErrors('', ' '); ?>
-
-
-
-
-
diff --git a/app/Views/editOldasset.php b/app/Views/editOldasset.php
index 016a229c..a1c25d40 100644
--- a/app/Views/editOldasset.php
+++ b/app/Views/editOldasset.php
@@ -11,81 +11,72 @@ $DateOfPurchase = '';
$DateOfCommison = '';
$AssetValue = '';
$AssetStatus = '';
-$IsActive ='';
+$IsActive = '';
$Remarks = '';
-$DepartmentName ='';
-$Department ='';
+$DepartmentName = '';
+$Department = '';
$SupplierCode = '';
$MaterialCode = '';
$PONO = '';
-$POLineItem='';
-$Quantity='';
+$POLineItem = '';
+$Quantity = '';
$UOM = '';
-$MaterialName='';
-$DeliveryDate='';
+$MaterialName = '';
+$DeliveryDate = '';
$DDate = '';
-if(!empty($assetList))
-{
- foreach ($assetList as $Asset)
- {
- //print_r($Asset);die();
- $AssetCode = $Asset->AssetCode;
- $AssetName = $Asset->AssetName;
- $Description = $Asset->Description;
+if (!empty($assetList)) {
+ foreach ($assetList as $Asset) {
+ //print_r($Asset);die();
+ $AssetCode = $Asset->AssetCode;
+ $AssetName = $Asset->AssetName;
+ $Description = $Asset->Description;
$Department = $Asset->DEPCode;
$DepartmentName = $Asset->DepartmentName;
- $Location = $Asset->Location;
- $User = $Asset->UserName;
- $SupplierName = $Asset->SupplierName;
+ $Location = $Asset->Location;
+ $User = $Asset->UserName;
+ $SupplierName = $Asset->SupplierName;
$SupplierCode = $Asset->SupplierCode;
- $DateOfPurchase = $Asset->DateOfPurchase;//print_r($Asset->DateOfPurchase);
- if($DateOfPurchase != '' && $DateOfPurchase != '0000-00-00 00:00:00' ) {
- $PODate = new DateTime($DateOfPurchase);
- $DateOfPurchase = $PODate->format('d-m-Y');
- }
- else {
- $DateOfPurchase = '';
- }
- $DateOfCommison = $Asset->DateOfCommison;
- if($DateOfCommison != '' && $DateOfCommison != '0000-00-00 00:00:00' ) {
- $DateOfCommission= new DateTime($Asset->DateOfCommison, new DateTimeZone('Asia/Kolkata'));
- $DateOfCommison = $DateOfCommission->format('d-m-Y');
- }
- else {
- $DateOfCommison = '';
- }
+ $DateOfPurchase = $Asset->DateOfPurchase; //print_r($Asset->DateOfPurchase);
+ if ($DateOfPurchase != '' && $DateOfPurchase != '0000-00-00 00:00:00') {
+ $PODate = new DateTime($DateOfPurchase);
+ $DateOfPurchase = $PODate->format('d-m-Y');
+ } else {
+ $DateOfPurchase = '';
+ }
+ $DateOfCommison = $Asset->DateOfCommison;
+ if ($DateOfCommison != '' && $DateOfCommison != '0000-00-00 00:00:00') {
+ $DateOfCommission = new DateTime($Asset->DateOfCommison, new DateTimeZone('Asia/Kolkata'));
+ $DateOfCommison = $DateOfCommission->format('d-m-Y');
+ } else {
+ $DateOfCommison = '';
+ }
+
-
$AssetValue = $Asset->AssetValue;
- $AssetStatus = $Asset->AssetStatus;
- $MaterialCode = $Asset->MaterialCode;
- $PONO = $Asset->PONO;
- $POLineItem = $Asset->POLineItem;
- $Quantity = $Asset->Quantity;
- $MaterialName = $Asset->MaterialName;
- $UOM = $Asset->UOM;
- $DDt = $Asset->DeliveryDate;
- if($DDt != '' && $DDt != '0000-00-00 00:00:00'){
- $DDate = new DateTime($DDt, new DateTimeZone('Asia/Kolkata'));
- $DeliveryDate = $DDate->format('d-m-Y');
- }
- else
- {
- $DeliveryDate = '';
- }
+ $AssetStatus = $Asset->AssetStatus;
+ $MaterialCode = $Asset->MaterialCode;
+ $PONO = $Asset->PONO;
+ $POLineItem = $Asset->POLineItem;
+ $Quantity = $Asset->Quantity;
+ $MaterialName = $Asset->MaterialName;
+ $UOM = $Asset->UOM;
+ $DDt = $Asset->DeliveryDate;
+ if ($DDt != '' && $DDt != '0000-00-00 00:00:00') {
+ $DDate = new DateTime($DDt, new DateTimeZone('Asia/Kolkata'));
+ $DeliveryDate = $DDate->format('d-m-Y');
+ } else {
+ $DeliveryDate = '';
+ }
- $Remarks = $Asset->Remarks;
+ $Remarks = $Asset->Remarks;
$chk = $Asset->IsActive;
-
- if($chk == 1)
- {
- $IsActive = 'checked';
- }
- else
- {
- $IsActive = '';
- }
-
+
+ if ($chk == 1) {
+ $IsActive = 'checked';
+ } else {
+ $IsActive = '';
+ }
+
// if($DateOfPurchase != '')
// {
// $dtpurchase = new DateTime($DateOfPurchase);
@@ -96,479 +87,322 @@ if(!empty($assetList))
// $dtCommission = new DateTime($DateOfCommission);
// $DOCommission = $dtCommission ->format('Y-m-d');
// }
- }
+ }
}
?>
-
-
-
-
-
- Edit Asset Details-
-
-
-
-
-
- Back
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Asset Name*
-
-
-
-
+
+
+
+
+
+
+ Edit Asset Details -
+
+
+
+ Back
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
- Asset Description*
-
-
+
+
+
-
-
-
-
-
- Asset User*
-
-
+
+
+
+
+
+
+
-
-
-
-
- Asset Location*
-
-
-
-
-
-
-
-
-
-
-
- Purchase Order Number*
-
-
-
- PONO;
- if(trim($PONO1) != trim($PONO))
- {
- if ($_POST['PONO'] == $PONO1)
- {
-
- echo "";
- }
- else
- {
- echo "";
- }
- }
+
+
+
+
+
+ PONO;
+ if (trim($PONO1) != trim($PONO)) {
+ echo "";
}
}
- ?>
-
-
-
-
-
-
-
- select Material Code
-
-
-
-
-
-
-
-
-
-
-
- Material Code
-
-
-
-
-
-
-
-
- UOM
-
-
-
-
-
-
- Quantity
-
-
-
-
-
-
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
-
-
-
-
-
- Asset Department
-
-
-
-
-
-
-
-
-
- Purchase Date
-
-
-
-
-
-
-
- Supplier Name
-
-
-
-
-
-
-
- Delivery Date
-
-
-
-
-
- Date Of Commission
-
-
-
-
-
-
-
-
-
-
-
- Asset Value
-
-
-
-
-
-
-
- Asset Status
-
-
-
-
-
+ } ?>
-
-
-
-
- Remarks
-
-
-
-
-
-
-
- > IsActive
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ConfigValue . "\">" . $SID->ConfigValue . "";
+ }
+ } ?>
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+
+
+
+
+ Cancel
+
+
+
-
-
-
-
-
- getFlashdata('error');
- if($error)
- {
- ?>
-
-
- getFlashdata('error'); ?>
-
-
- getFlashdata('success');
- if($success)
- {
- ?>
-
-
- getFlashdata('success'); ?>
-
-
-
-
-
- listErrors('', ' '); ?>
+
-
-
-
+
+
-
\ No newline at end of file
diff --git a/app/Views/editRawmaterial.php b/app/Views/editRawmaterial.php
index cd94a13e..2d67a260 100644
--- a/app/Views/editRawmaterial.php
+++ b/app/Views/editRawmaterial.php
@@ -100,233 +100,187 @@ if ($total <= $reorder) {
}
-
-
-
-
-
-
-
-
-
-
- Edit Material - Details
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- *
-
-
-
-
-
-
-
-
-
- *
-
-
-
-
-
-
-
-
-
-
-
-
- *
-
-
-
-
-
-
-
- *
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ Edit Material - Details
+
+
+
+
+ Back
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- } else {
- ?>
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+
-
-
-
-
-
- 'Date','value' => set_value('Date',$date), 'class' => 'form-control','readonly'=>'true', 'onkeypress'=>'return false;');
-
- $data = array('name' => 'Date', 'id' => 'Date', 'value' => set_value('Date', $date), 'class' => 'form-control', 'onkeypress' => 'return false;');
-
- echo form_input($data);
- ?>
-
-
-
-
- 'Date', 'id' => 'Date', 'class' => 'form-control', 'onkeypress' => 'return false;');
- echo form_input($data);
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/Views/editasset.php b/app/Views/editasset.php
index bc2facae..e2f0bef5 100644
--- a/app/Views/editasset.php
+++ b/app/Views/editasset.php
@@ -101,293 +101,185 @@ if(!empty($assetList))
?>
-
-
-
-
- = 'Edit Asset - ' .$AssetCode; ?> Details
-
-
-
-
-
- Back
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Asset Name*
-
-
-
-
-
-
-
-
-
- Asset Description*
-
-
-
-
-
-
-
-
- Asset User*
-
-
-
-
-
-
-
-
- Asset Location*
-
-
-
-
-
-
-
-
-
-
-
- Purchase Order Number*
-
-
-
- PONO;
- if(trim($PONO1) != trim($PONO))
- {
- if ($_POST['PONO'] == $PONO1)
- {
-
- echo "";
- }
- else
- {
- echo "";
- }
- }
- }
- }
- ?>
-
-
-
-
-
-
-
- select Material Code
-
-
-
-
-
-
-
-
-
-
-
- Material Code
-
-
-
-
-
-
-
-
- UOM
-
-
-
-
-
-
- Quantity
-
-
-
-
-
-
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
-
-
-
-
-
- Asset Department
-
-
-
-
-
-
-
-
-
- Purchase Date
-
-
-
-
-
-
-
- Supplier Name
-
-
-
-
-
-
-
- Delivery Date
-
-
-
-
-
- Date Of Commission
-
-
-
-
-
-
-
-
-
-
-
- Asset Value
-
-
-
-
-
-
-
- Asset Status
-
-
-
-
-
-
-
-
-
-
- Remarks
-
-
-
-
-
-
-
- > IsActive
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ = 'Edit Asset - ' . $AssetCode; ?> Details
+
-
-
-
- getFlashdata('error');
- if($error)
- {
- ?>
-
-
- getFlashdata('error'); ?>
-
-
- getFlashdata('success');
- if($success)
- {
- ?>
-
-
- getFlashdata('success'); ?>
-
-
-
-
-
- listErrors('', ' '); ?>
+
+ Back
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cancel
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ else
+ return false;
+ }
-
+
+
\ No newline at end of file
+
+ });
+
+
+ function validate() {
+ if ($("option:selected", $("#ApprovedBy")).val() == '-1') {
+ alert('Please Select Approver Names');
+ return false;
+ } else {
+ return true;
+ }
+
+ }
+
\ No newline at end of file
diff --git a/app/Views/editdepartment.php b/app/Views/editdepartment.php
index 58001612..bc4b347c 100644
--- a/app/Views/editdepartment.php
+++ b/app/Views/editdepartment.php
@@ -82,6 +82,9 @@ if(!empty($department))
color:#00c0ef ! important;
} */
+ legend {
+ margin-left: 0% !important;
+ }
.pad{
padding-bottom:1%;
}
@@ -90,117 +93,96 @@ if(!empty($department))
color:red; background-color:#fff;
}
-
-
-
-
- Edit Department - Details
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/Views/expense_list.php b/app/Views/expense_list.php
new file mode 100644
index 00000000..2c21c86e
--- /dev/null
+++ b/app/Views/expense_list.php
@@ -0,0 +1,345 @@
+
+
+
+
+
+
+
+
+
+
+ Expense List
+
+
+
+ Add New Expense
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Created Date
+ Supplier Name
+ Cost
+ GST
+ Total
+ Status
+ payment_method
+ Action
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/Views/includes/new_footer.php b/app/Views/includes/new_footer.php
index 6d10bcf1..027f1622 100644
--- a/app/Views/includes/new_footer.php
+++ b/app/Views/includes/new_footer.php
@@ -63,6 +63,7 @@
+