diff --git a/.gitignore b/.gitignore index f7d2f266..1e09723b 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# Ignore Composer files +vendor +composer.lock + + # Ignore PHPStorm files /.idea/* *.sublime-* @@ -52,7 +57,6 @@ Desktop.ini *.mov *.wmv -# Don't save phpunit under version control. # Ignore PHPUnit files phpunit phpunit*.xml @@ -111,9 +115,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..33bc631f 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,17 @@ $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->post('editExpense', 'Expense::editExpense'); +$routes->post('getExpenseDetails', 'Expense::getExpenseDetails'); +$routes->get('uploads/(:any)', 'Expense::downloads/$1'); +$routes->post('deleteFile', 'Expense::deleteFile'); +$routes->get('downloadFile/(:any)', 'Expense::downloads/$1'); + + // 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/Employeedetails.php b/app/Controllers/Employeedetails.php index 77791d58..33c68cc4 100644 --- a/app/Controllers/Employeedetails.php +++ b/app/Controllers/Employeedetails.php @@ -203,36 +203,7 @@ class Employeedetails extends BaseController function AddNewEmployee() { - $validation = \Config\Services::validation(); - - - - - - // $this->validator->setRules([ - // 'ContactNumber'=> 'trim|required|min_length[10]|max_length[10]', - // 'emailid'=> 'trim|required|valid_email', - // 'gender'=> 'callback_Gender_validate', - // 'MartialStatus'=> 'callback_Martial_validate', - // 'bloodgroup'=>'callback_Blood_validate', - // 'emergencycontactnumber'=> 'trim|required|min_length[10]|max_length[10]', - // 'desigination'=> 'callback_Des_validate', - // 'departmentname'=> 'callback_Dep_validate', - // 'eduqualifaction'=> 'callback_select_validate', - // 'referrercontno'=> 'trim|min_length[10]|max_length[10]', - // 'aadharno'=> 'trim|min_length[14]|max_length[14]', - // 'panno'=> 'trim|min_length[10]|max_length[10]', - // 'passportno'=> 'trim|min_length[9]|max_length[9]', - // 'accountno'=> 'trim|min_length[10]|max_length[20]', - // 'pfno'=> 'trim|min_length[22]|max_length[22]', - // 'esino'=> 'trim|min_length[10]|max_length[10]']); - - // if ($this->validator->run() == FALSE) { - // $this->addemployee(); - // //echo 'Validate method called'; - // } else { - //echo 'Validate not method called'; $photo = $this->request->getFile('photo'); $Picture = ""; if ($photo->isValid() && !$photo->hasMoved()) { @@ -371,15 +342,11 @@ class Employeedetails extends BaseController $Basic_Pay = $this->request->getPost('Basic_Pay'); $HRA_Rate = $this->request->getPost('HRA_Rate'); $HRA_Amount = $this->request->getPost('HRA_Amount'); - - $Allowances = $this->request->getPost('Allowances'); $PF_Rate = $this->request->getPost('PF_Rate'); $ESI_Rate = $this->request->getPost('ESI_Rate'); - $Food_Allowances = $this->request->getPost('Food_Allowances'); - $Incentives = $this->request->getPost('Incentives'); $CreateBy = $this->session->get('userId'); - $emppay = array('EmpID' => $EmpID, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'Allowances' => $Allowances, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Food_Allowances' => $Food_Allowances, 'Incentives' => $Incentives, 'Created_By' => $CreateBy); + $emppay = array('EmpID' => $EmpID, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Created_By' => $CreateBy); $this->emppaydate_model->addNewemppay($emppay); @@ -803,34 +770,21 @@ class Employeedetails extends BaseController $Basic_Pay = $this->request->getPost('Basic_Pay'); $HRA_Rate = $this->request->getPost('HRA_Rate'); $HRA_Amount = $this->request->getPost('HRA_Amount'); - $Allowances = $this->request->getPost('Allowances'); $PF_Rate = $this->request->getPost('PF_Rate'); $ESI_Rate = $this->request->getPost('ESI_Rate'); - $Food_Allowances = $this->request->getPost('Food_Allowances'); - $Incentives = $this->request->getPost('Incentives'); $CreateBy = $this->session->get('userId'); - $emppay = array('EmpID' => $EmpId, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'Allowances' => $Allowances, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Food_Allowances' => $Food_Allowances, 'Incentives' => $Incentives, 'Created_By' => $CreateBy); + $emppay = array('EmpID' => $EmpId, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Created_By' => $CreateBy); $empPayUpdate = $this->emppaydate_model->editemppay($emppay); if ($result + $empPayUpdate > 0) { - - - // $this->session->set_flashdata('Success', $EmpId.'Employee Updated successfully!'); $this->session->setFlashdata('success', 'You Have Successfully updated the Employee Record!'); - // echo ""; - } else { - - // $this->session->set_flashdata('Error', $EmpId . 'Employee details not saved'); $this->session->setFlashdata('error', 'Record Not Updated!'); - // echo ""; - } return redirect()->route('employeeListing'); - // redirect('employeeListing'); - // } + } function exportemployee() diff --git a/app/Controllers/Emppaydate.php b/app/Controllers/Emppaydate.php index f07b98f9..98423449 100644 --- a/app/Controllers/Emppaydate.php +++ b/app/Controllers/Emppaydate.php @@ -56,13 +56,9 @@ class Emppaydate extends BaseController */ function emppayListing() { - - - $data['userRecords'] = $this->emppaydate_model->emppayListing(); - - $this->global['pageTitle'] = 'Employee Pay List'; - + + $this->global['pageTitle'] = 'Employee Loan List'; $this->loadViews("emppayListing", $this->global, $data, NULL); } @@ -71,12 +67,8 @@ class Emppaydate extends BaseController */ function addemppaydate() { - $q = "addemppaydate"; - - - $result['empdetails'] = $this->payroll_model->getEmpID($q); - - + + $result['empdetails'] = $this->payroll_model->getEmpID(); $this->global['pageTitle'] = 'Add Employee Pay'; @@ -88,71 +80,29 @@ class Emppaydate extends BaseController { - helper('form'); //$this->load->library('form_validation'); - $EmpID = $this->request->getPost('EmpID'); - // $this->validator->setRules([ - // 'ContactNumber'=> 'trim|required|min_length[10]|max_length[10]', - // 'EmpID'=> 'trim|required', - // 'HRA_Rate'=> 'trim|required', - // 'HRA_Amount'=> 'trim|required', - // 'Basic_Pay'=> 'trim|required', - // 'Total_salary'=> 'trim|required', - // 'Allowances'=> 'trim|required', - // 'PF_Rate'=> 'trim|required', - // 'ESI_Rate'=> 'trim|required', - // 'Food_Allowances'=> 'trim|required', - // 'Incentives'=> 'trim|required']); - - - - // if ($this->validator->run() == FALSE || $EmpID == -1) { - // $this->addemppaydate(); - // } else { + + + $EmpID = $this->request->getPost('EmpID'); - $Total_Salary = $this->request->getPost('Total_salary'); - $Basic_Pay = $this->request->getPost('Basic_Pay'); - $HRA_Rate = $this->request->getPost('HRA_Rate'); - $HRA_Amount = $this->request->getPost('HRA_Amount'); - - $Allowances = $this->request->getPost('Allowances'); - $PF_Rate = $this->request->getPost('PF_Rate'); - $ESI_Rate = $this->request->getPost('ESI_Rate'); - $Food_Allowances = $this->request->getPost('Food_Allowances'); - $Incentives = $this->request->getPost('Incentives'); - $Loan_Amount = $this->request->getPost('Loan_Amount'); $Load_Issued_date = $this->request->getPost('loan_issued_date'); - if (!empty($Load_Issued_date)) { - $Load_Issued_date = $Load_Issued_date = format_date($Load_Issued_date); - } else { - $Load_Issued_date = null; - } + if (!empty($Load_Issued_date)) { $Load_Issued_date = format_date($Load_Issued_date); } else { $Load_Issued_date = null; } $Due_Amount = $this->request->getPost('monthly_due'); $Due_Started = $this->request->getPost('due_started'); - if (!empty($Due_Started)) { - $Due_Started = $Due_Started = format_date($Due_Started); - } else { - $Due_Started = null; - } - - + if (!empty($Due_Started)) {$Due_Started = format_date($Due_Started);} else { $Due_Started = null; } $No_Of_Dues = $this->request->getPost('no_of_due'); $Paid_due = $this->request->getPost('paid_due'); $Remaining_Due = $this->request->getPost('remaining_due'); $Paid_Amount = $this->request->getPost('Paid_Amount'); - - - $CreateBy = $this->session->get('userId'); - $chked = $this->request->getPost('is_Active'); - $IsActive = '1'; + - $emppay = array('EmpID' => $EmpID, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'Allowances' => $Allowances, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Food_Allowances' => $Food_Allowances, 'Incentives' => $Incentives, 'Created_By' => $CreateBy); + $loandetails = array('EmpID' => $EmpID, 'Loan_Amount' => $Loan_Amount, 'Loan_Issued_Date' => $Load_Issued_date, 'Monthly_Due' => $Due_Amount, 'Due_Start_Date' => $Due_Started, 'No_of_Dues' => $No_Of_Dues, 'Paid_Due' => $Paid_due, 'Remaining_Due' => $Remaining_Due, 'Paid_Amount' => $Paid_Amount, 'is_Active' => 1, 'Created_By' => $CreateBy); - $result = $this->emppaydate_model->addNewemppay($emppay); + if ($Loan_Amount != 0) { $result2 = $this->emppaydate_model->addLoanInfo($loandetails, 'add'); if ($result2 > 0) { @@ -161,17 +111,8 @@ class Emppaydate extends BaseController echo ""; } } - if ($result > 0) { - echo ""; - } else { - echo ""; - - } + - //} - // } } /** @@ -197,72 +138,26 @@ class Emppaydate extends BaseController { - helper('form'); //$this->load->library('form_validation'); - - $Pay_Data_ID = $this->request->getPost('Pay_Data_ID'); - - //'Pay_Data_ID'=>'trim|required'; - // $this->validator->setRules([ - // 'EmpID'=> 'trim|required', - // 'Total_Salary'=> 'trim|required', - // 'Basic_Pay'=> 'trim|required', - // 'HRA_Rate'=> 'trim|required', - // 'Allowances'=> 'trim|required', - // 'PF_Rate'=> 'trim|required', - // 'ESI_Rate'=> 'trim|required', - // 'Food_Allowances'=> 'trim|required', - // 'Incentives'=> 'trim|required']); - - // if ($this->validator->run() == FALSE) { - - // $this->editOldemppay($Pay_Data_ID); - // } else { - - $Pay_Data_ID = $this->request->getPost('Pay_Data_ID'); $EmpID = $this->request->getPost('EmpID'); - $TotalSalary = $this->request->getPost('Total_Salary'); - $Basic_Pay = $this->request->getPost('Basic_Pay'); - $HRA_Rate = $this->request->getPost('HRA_Rate'); - $HRA_Amount = $this->request->getPost('HRA_Amount'); - - $Allowances = $this->request->getPost('Allowances'); - $PF_Rate = $this->request->getPost('PF_Rate'); - $ESI_Rate = $this->request->getPost('ESI_Rate'); $loan_ID = $this->request->getPost('loanid'); $Loan_Amount = $this->request->getPost('Loan_Amount'); $Load_Issued_date = $this->request->getPost('loan_issued_date'); - if (!empty($Load_Issued_date)) { - $Load_Issued_date = format_date($Load_Issued_date); - } else { - $Load_Issued_date = null; - } - - + if (!empty($Load_Issued_date)) {$Load_Issued_date = format_date($Load_Issued_date);} else { $Load_Issued_date = null; } $Due_Amount = $this->request->getPost('monthly_due'); $Due_Started = $this->request->getPost('due_started'); - if (!empty($Due_Started)) { - $Due_Started = format_date($Due_Started); - } else { - $Due_Started = null; - } - - - //echo $Load_Issued_date. "-" . $Due_Started;die(); + if (!empty($Due_Started)) {$Due_Started = format_date($Due_Started); } else { $Due_Started = null; } $No_Of_Dues = $this->request->getPost('no_of_due'); $Paid_due = $this->request->getPost('paid_due'); $Remaining_Due = $this->request->getPost('remaining_due'); $Paid_Amount = $this->request->getPost('Paid_Amount'); - $is_Active = $this->request->getPost('is_Active'); $Last_Mod_By = $this->session->get('userId'); - $Last_Mod_Time = date('d-m-Y h:i:sa'); - $Food_Allowances = $this->request->getPost('Food_Allowances'); - $Incentives = $this->request->getPost('Incentives'); + - $emppay = array('Pay_Data_ID' => $Pay_Data_ID, 'EmpID' => $EmpID, 'TotalSalary' => $TotalSalary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'Allowances' => $Allowances, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Food_Allowances' => $Food_Allowances, 'Incentives' => $Incentives, 'Last_Mod_By' => $Last_Mod_By); + $loandetails = array('Loan_ID' => $loan_ID, 'EmpID' => $EmpID, 'Loan_Amount' => $Loan_Amount, 'Loan_Issued_Date' => $Load_Issued_date, 'Monthly_Due' => $Due_Amount, 'Due_Start_Date' => $Due_Started, 'No_of_Dues' => $No_Of_Dues, 'Paid_Due' => $Paid_due, 'Remaining_Due' => $Remaining_Due, 'Paid_Amount' => $Paid_Amount, 'is_Active' => 1, 'Last_Mod_By' => $Last_Mod_By); @@ -284,18 +179,8 @@ class Emppaydate extends BaseController } - $result = $this->emppaydate_model->editemppay($emppay); - if ($result == true) { - echo ""; - } else { - echo ""; - - } + - // redirect('emppaydate/emppayListing'); - // } } diff --git a/app/Controllers/Expense.php b/app/Controllers/Expense.php new file mode 100644 index 00000000..64c0d7ab --- /dev/null +++ b/app/Controllers/Expense.php @@ -0,0 +1,170 @@ +expense_model = new Expense_model(); + $this->supplier_model = new Supplier_model(); + $this->session = session(); + helper('form'); + $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'; + $this->loadViews("expense_list", $this->global, $data, NULL); + } + + public function addExpense() + { + $file = $this->request->getFile('transporterfile'); + $fileName = ''; + if ($file->isValid() && !$file->hasMoved()) { + $fileName = $file->getRandomName(); + $file->move(WRITEPATH . 'uploads', $fileName); + } + + $status = $this->request->getPost('status'); + $paymentMethod = $status === 'Paid' ? $this->request->getPost('payment_method') : 0; + + $data = [ + 'transporter_file' => $fileName, + 'supplier_id' => $this->request->getPost('supplierid'), + 'remarks' => $this->request->getPost('remarks'), + 'cost' => $this->request->getPost('cost'), + 'gst' => $this->request->getPost('gst'), + 'total' => (int)$this->request->getPost('gst') + (int)$this->request->getPost('cost'), + 'status' => $status, + 'payment_method' => $paymentMethod + ]; + + $insert_id = $this->expense_model->insertExpense($data); + if ($insert_id) { + return json_encode('true'); + } else { + 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 editExpense() + { + $id = $this->request->getPost('id'); + $file = $this->request->getFile('transporterfile'); + $fileName = ''; + + if ($file->isValid() && !$file->hasMoved()) { + $fileName = $file->getRandomName(); + $file->move(WRITEPATH . 'uploads', $fileName); + } else { + $fileName = $this->request->getPost('existing_file'); // Use existing file if no new file is uploaded + } + + $status = $this->request->getPost('status'); + $paymentMethod = $status === 'Paid' ? $this->request->getPost('payment_method') : 0; + + $data = [ + 'supplier_id' => $this->request->getPost('supplierid'), + 'remarks' => $this->request->getPost('remarks'), + 'cost' => $this->request->getPost('cost'), + 'gst' => $this->request->getPost('gst'), + 'total' => (int)$this->request->getPost('gst') + (int)$this->request->getPost('cost'), + 'status' => $status, + 'payment_method' => $paymentMethod + ]; + if(!empty($fileName)){ + $data['transporter_file'] = $fileName; + } + $data['payment_method'] = $this->request->getPost('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']); + } + } + + + public function downloads($filename) + { + $path = WRITEPATH . 'uploads/' . $filename; + if (file_exists($path)) { + return $this->response->download($path, null); + } else { + throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound('File not found'); + } + } + + + public function deleteFile() + { + $fileName = $this->request->getPost('file_name'); + $expenseId = $this->request->getPost('expense_id'); + + if ($fileName && $expenseId) { + // Construct the file path + $path = WRITEPATH . 'uploads/' . $fileName; + + // Begin transaction + $db = \Config\Database::connect(); + $db->transBegin(); + + try { + // Delete the file from the folder + if (file_exists($path)) { + if (!unlink($path)) { + throw new \Exception('Unable to delete file from the folder.'); + } + } + + // Update the database to set transporter_file to null + $this->expense_model->deleteFile($expenseId); + + // Commit transaction + $db->transCommit(); + echo json_encode(['success' => true]); + } catch (\Exception $e) { + // Rollback transaction + $db->transRollback(); + echo json_encode(['success' => false, 'message' => $e->getMessage()]); + } + } else { + echo json_encode(['success' => false, 'message' => 'Invalid parameters.']); + } + } + + + +} diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index 74deebd1..5379ee31 100644 --- a/app/Controllers/Monthlypay.php +++ b/app/Controllers/Monthlypay.php @@ -138,6 +138,7 @@ class Monthlypay extends BaseController } $begin->modify('+1 day'); } + // dd( $sundayarray); $noofsundays = count($sundayarray); $publicholidaysarray = $this->monthlypay_model->getPublicHoldays($current); @@ -150,6 +151,7 @@ class Monthlypay extends BaseController $data['datefordropdown'] = $current; $data['attendance'] = $this->monthlypay_model->monthlyAttendance($current); $data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string); + $this->global['pageTitle'] = 'Monthly Attendance'; $this->loadViews("attendance", $this->global, $data, NULL); } @@ -264,6 +266,7 @@ class Monthlypay extends BaseController $paidleave = $data['Paid Leave']; $daysworked = $data['Days Worked']; $absent = $data['Absent']; + $sundayCount = $data['Total Sunday']; $monthattendance = array( 'Month_Year' => $Month_Year, 'NoofDays' => $NoofDays, 'EmpID' => $EmpID, 'WH1' => $W1H, 'OT1' => $W1OT, 'WH2' => $W2H, 'OT2' => $W2OT, 'WH3' => $W3H, 'OT3' => $W3OT, @@ -272,7 +275,7 @@ class Monthlypay extends BaseController 'WH17' => $W17H, 'OT17' => $W17OT, 'WH18' => $W18H, 'OT18' => $W18OT, 'WH19' => $W19H, 'OT19' => $W19OT, 'WH20' => $W20H, 'OT20' => $W20OT, 'WH21' => $W21H, 'OT21' => $W21OT, 'WH22' => $W22H, 'OT22' => $W22OT, 'WH23' => $W23H, 'OT23' => $W23OT, 'WH24' => $W24H, 'OT24' => $W24OT, 'WH25' => $W25H, 'OT25' => $W25OT, 'WH26' => $W26H, 'OT26' => $W26OT, 'WH27' => $W27H, 'OT27' => $W27OT, 'WH28' => $W28H, 'OT28' => $W28OT, 'WH29' => $W29H, 'OT29' => $W29OT, 'WH30' => $W30H, 'OT30' => $W30OT, 'WH31' => $W31H, 'OT31' => $W31OT, 'Total_WHrs' => $totalworkinghrs, 'Total_OTHrs' => $totalothrs, 'Paid_Leave' => $paidleave, - 'Days_Worked' => $daysworked, 'Absent' => $absent, 'Created_by' => $CreateBy + 'Days_Worked' => $daysworked, 'Absent' => $absent, 'sunday_count' => $sundayCount , 'Created_by' => $CreateBy ); diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index 2ed1cc87..1090edb5 100644 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -504,15 +504,16 @@ class Payslip extends BaseController public function monthlyInputs() { $current = date("m-Y"); - // echo $current; + + $data['month'] = $this->monthlypay_model->monthlyListing($current); - // $data['fresh'] = $this-> monthlypay_model->getEmpPayDetails($current); $data['dropdownvalue'] = $current; $data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current); - // dd($data['fresh']); + $employeeSalary = []; - - + $esi = []; + $pf = []; + $ot = []; foreach ($data['fresh'] as $value) { @@ -520,34 +521,25 @@ class Payslip extends BaseController $HRA_Amount = $value->HRA_Amount; $Basic_Pay = $value->Basic_Pay; $TotalSalary = $value->TotalSalary; - $Food_Allowances = $value->Food_Allowances; $Days_worked = $value->Days_worked; // working day - $LOP_Days = $value->LOP_Days; // not working day + $Sunday = $value->sunday_count; // Sunday count + $LOP_Days = $value->NoofDays - ($Days_worked + $Sunday); // not working day $Paid_leave = $value->Paid_leave; // leave day $OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours $Monthly_Due = $value->Monthly_Due; // AUTO LOAN DUE - $Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE - - $MasterIncentives = $value->MasterIncentives; //Master values get - // echo 'master'.$MasterIncentives; - - $due_start_date = $value->DueDate; $paydate = $current; //From POST parm + $pmonth = substr($paydate, 0, 2); $pyear = substr($paydate, -4); - $pday = cal_days_in_month(CAL_GREGORIAN, $pmonth, $pyear); $paymonth = $pyear . '-' . $pmonth . '-' . $pday; + $Loan_amount = $value->Loan_Amount; $Paid_Amount = $value->Paid_Amount; - - $Balance_Amount = $Loan_amount - $Paid_Amount; - - $loan = 0; if ($Loan_Recovered == 'NA') { $loan = 0.00; @@ -563,89 +555,76 @@ class Payslip extends BaseController if ($Monthly_Due > $Balance_Amount) { - - // current= Balance_Amount - autoLoan; - //alert('hi'); $loan = $Balance_Amount; } - - - - - $Allowances = $value->Allowances; - $HRA_Rate = $value->HRA_Rate; + $PF_Rate = $value->PF_Rate; $ESI_Rate = $value->ESI_Rate; - $MonthIncentive = $value->MonthlyIncentives; //t_monthly_pay_inputs,for change month + + - $Incentive = 0; + - if (empty($MonthIncentive)) { - - $Incentive = $MasterIncentives; - } else { - $Incentive = $MonthIncentive; - } - // echo $Incentive; - - - - $daySalarys = $Days_worked + $Paid_leave; - - //echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary)); - //$Allowances = $allowances * $values; - $dayFood_Allowance = $Food_Allowances * $Days_worked; - - $daySalary = $Basic_Pay / $NoofDays; - /**per day salary working hour**/ - //echo $daySalary.'
'; + $totalDaysWorked = ($Days_worked + $Sunday) + $Paid_leave; + $dayBasic = $Basic_Pay / $NoofDays; $dayHra = $HRA_Amount / $NoofDays; - /** per day hra amount **/ - //echo $dayHra.'
'; + $onehoursSalary = ($dayBasic + $dayHra) / 8; - $onehoursSalary = ($daySalary + $dayHra) / 8; /**one hour salay ot calculation**/ if ($OT_Hrs_Worked != 0) { $totSalayOT = $OT_Hrs_Worked * $onehoursSalary; } else { $totSalayOT = 0; } - $currentDaySalary = $daySalary * $daySalarys; - /** current day salary working days calculation**/ - - - $currentDayHra = $dayHra * $daySalarys; - /** total working days hra calculations**/ - // echo $currentDayHra.'
'; - $currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT; - /** current date pf calculation**/ - if ($TotalSalary <= 20000) { - - $esiAmount = $currentDatePF * $ESI_Rate / 100; - /** esiamount not elgiable for 20000 **/ - } else { - $esiAmount = 0; + + + //current day basic and hra salary + if ($value->is_management_team == 1) + { + $currentDayBasic = $dayBasic * $NoofDays; + $currentDayHra = $dayHra * $NoofDays; + } else { + $currentDayBasic = $dayBasic * $totalDaysWorked; + $currentDayHra = $dayHra * $totalDaysWorked; } - $pfAmount = $currentDaySalary * $PF_Rate / 100; + + + + + if ($value->esi_applicable == 1) { $esiAmount = $currentDayBasic * $ESI_Rate / 100; } else { $esiAmount = 0; } + if ($value->pf_applicable == 1) { $pfAmount = $currentDayBasic * $PF_Rate / 100; } else { $pfAmount = 0; } + /** pf amount per day**/ //echo $totalothour;die; - $empSalaryAdd = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentive; + $empSalaryAdd = $currentDayBasic + $currentDayHra + $totSalayOT; + $empSalarySub = $esiAmount + $pfAmount + $loan; - + $salaryInCurrentday = $empSalaryAdd - $empSalarySub; - + // echo $esiAmount .'
'; + // echo $pfAmount .'
'; + // echo $loan .'
'; + // echo $empSalarySub .'
'; + // echo $empSalaryAdd .'
'; + // echo $salaryInCurrentday .'
'; + // die; $employeeSalary[] = round($salaryInCurrentday); + $esi[] = number_format($esiAmount,2); + $pf[] = number_format($pfAmount,2); + $ot[] = number_format($totSalayOT,2); } $data['empSalary'] = $employeeSalary; - - - //echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die; + $data['esi'] = $esi; + $data['pf'] = $pf; + $data['over_time'] = $ot; + +// dd($data); $this->global['pageTitle'] = 'Payroll Monthly Inputs'; $this->loadViews("monthlypayinputs", $this->global, $data, NULL); } @@ -657,30 +636,29 @@ class Payslip extends BaseController $current = $this->request->getPost('monthyear'); $data['month'] = $this->monthlypay_model->monthlyListing($current); - //print_r($data['month']); $data['dropdownvalue'] = $current; $data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current); - - // dd($data['fresh']); + //dd($data['fresh']); + $employeeSalary = []; - - + $esi = []; + $pf = []; + $ot = []; foreach ($data['fresh'] as $value) { - //print_r($value); - //die(); $NoofDays = $value->NoofDays; //Month day 30,31,28 $HRA_Amount = $value->HRA_Amount; $Basic_Pay = $value->Basic_Pay; $TotalSalary = $value->TotalSalary; - $Food_Allowances = $value->Food_Allowances; $Days_worked = $value->Days_worked; // working day - $LOP_Days = $value->LOP_Days; // not working day + $Sunday = $value->sunday_count; // Sunday count + $LOP_Days = $value->NoofDays - ($Days_worked + $Sunday); // not working day $Paid_leave = $value->Paid_leave; // leave day $OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours $Monthly_Due = $value->Monthly_Due; // AUTO LOAN DUE + $Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE $due_start_date = $value->DueDate; $paydate = $current; //From POST parm @@ -693,18 +671,10 @@ class Payslip extends BaseController $pday = cal_days_in_month(CAL_GREGORIAN, $pmonth, $pyear); $paymonth = $pyear . '-' . $pmonth . '-' . $pday; - $Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE - - $MasterIncentives = $value->MasterIncentives; //Master values get - // echo 'master'.$MasterIncentives; $Loan_amount = $value->Loan_Amount; $Paid_Amount = $value->Paid_Amount; - - $Balance_Amount = $Loan_amount - $Paid_Amount; - - $loan = 0; if ($Loan_Recovered == 'NA') { $loan = 0.00; @@ -713,7 +683,6 @@ class Payslip extends BaseController $loan = $Monthly_Due; } } else if ($Loan_Recovered >= 0.00) { - if (strtotime($due_start_date) <= strtotime($paymonth)) { $loan = $Loan_Recovered; } @@ -721,87 +690,75 @@ class Payslip extends BaseController if ($Monthly_Due > $Balance_Amount) { - - // current= Balance_Amount - autoLoan; - //alert('hi'); $loan = $Balance_Amount; } - - - - - $Allowances = $value->Allowances; - $HRA_Rate = $value->HRA_Rate; $PF_Rate = $value->PF_Rate; $ESI_Rate = $value->ESI_Rate; - $MonthIncentive = $value->MonthlyIncentives; //t_monthly_pay_inputs,for change month + + - $Incentive = 0; + - if (empty($MonthIncentive)) { - - $Incentive = $MasterIncentives; - } else { - $Incentive = $MonthIncentive; - } - // echo $Incentive; - - - - $daySalarys = $Days_worked + $Paid_leave; - - //echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary)); - //$Allowances = $allowances * $values; - $dayFood_Allowance = $Food_Allowances * $Days_worked; - - $daySalary = $Basic_Pay / $NoofDays; - /**per day salary working hour**/ - //echo $daySalary.'
'; + $totalDaysWorked = ($Days_worked + $Sunday) + $Paid_leave; + $dayBasic = $Basic_Pay / $NoofDays; $dayHra = $HRA_Amount / $NoofDays; - /** per day hra amount **/ - //echo $dayHra.'
'; + $onehoursSalary = ($dayBasic + $dayHra) / 8; - $onehoursSalary = ($daySalary + $dayHra) / 8; /**one hour salay ot calculation**/ if ($OT_Hrs_Worked != 0) { $totSalayOT = $OT_Hrs_Worked * $onehoursSalary; } else { $totSalayOT = 0; } - $currentDaySalary = $daySalary * $daySalarys; - /** current day salary working days calculation**/ - - - $currentDayHra = $dayHra * $daySalarys; - /** total working days hra calculations**/ - // echo $currentDayHra.'
'; - $currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT; - /** current date pf calculation**/ - if ($TotalSalary <= 20000) { - - $esiAmount = $currentDatePF * $ESI_Rate / 100; - /** esiamount not elgiable for 20000 **/ - } else { - $esiAmount = 0; + + + //current day basic and hra salary + if ($value->is_management_team == 1) + { + $currentDayBasic = $dayBasic * $NoofDays; + $currentDayHra = $dayHra * $NoofDays; + } else { + $currentDayBasic = $dayBasic * $totalDaysWorked; + $currentDayHra = $dayHra * $totalDaysWorked; } - $pfAmount = $currentDaySalary * $PF_Rate / 100; + + + + //$totalSalary = $currentDayBasic + $currentDayHra + $totSalayOT; + + + if ($value->esi_applicable == 1) { $esiAmount = $currentDayBasic * $ESI_Rate / 100; } else { $esiAmount = 0;} + if ($value->pf_applicable == 1) { $pfAmount = $currentDayBasic * $PF_Rate / 100; } else { $pfAmount = 0;} + /** pf amount per day**/ //echo $totalothour;die; - $empSalaryAdd = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentive; + $empSalaryAdd = $currentDayBasic + $currentDayHra + $totSalayOT; $empSalarySub = $esiAmount + $pfAmount + $loan; - $salaryInCurrentday = $empSalaryAdd - $empSalarySub; + // echo $esiAmount .'
'; + // echo $pfAmount .'
'; + // echo $loan .'
'; + // echo $empSalarySub .'
'; + // echo $empSalaryAdd .'
'; + // echo $salaryInCurrentday .'
'; + // die; $employeeSalary[] = round($salaryInCurrentday); + $esi[] = number_format($esiAmount,2); + $pf[] = number_format($pfAmount,2); + $ot[] = number_format($totSalayOT,2); } $data['empSalary'] = $employeeSalary; - + $data['esi'] = $esi; + $data['pf'] = $pf; + $data['over_time'] = $ot; + // dd($data); //echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die; $this->global['pageTitle'] = 'Payroll Monthly Inputs'; $this->loadViews("monthlypayinputs", $this->global, $data, NULL); @@ -847,9 +804,9 @@ class Payslip extends BaseController $ErrorFlag = 0; - $Emp = $j['Employee']; + - $EmpID = substr($Emp, 0, 4); + $EmpID = $j['Emp ID']; //$Name = $j['Employee Name']; //echo $EmpID; die; @@ -858,10 +815,10 @@ class Payslip extends BaseController $LOP_Days = $j['LOP Days']; $Paid_leave = $j['Paid Leave']; $OT_Hrs_Worked = $j['OT Hrs']; - $Loan_Recovered = $j['Manual Loan Due ₹']; - $Incentives = $j['Incentives in ₹']; + $Loan_Recovered = $j['Auto Loan Due ₹']; + // $Incentives = $j['Incentives in ₹']; $Festival_Bonus = $j['Festival Bonus in ₹']; - $Other_Deductions = $j['Other Deductions in ₹']; + $Other_Deductions = $j['TDS Deductions in ₹']; $Estimate = $j['Estimate in ₹']; $Created_By = $this->session->get('userId'); @@ -906,11 +863,11 @@ class Payslip extends BaseController } } - $Incentives_first = explode(".", $Incentives); - if (!is_numeric($Incentives) || (strlen((string)$Incentives)) > 8 || (strlen((string)$Incentives_first[0])) > 5) { - //echo $EmpID . "-Loan Recoverd Invalid Data!"; - $ErrorFlag++; - } + // $Incentives_first = explode(".", $Incentives); + // if (!is_numeric($Incentives) || (strlen((string)$Incentives)) > 8 || (strlen((string)$Incentives_first[0])) > 5) { + // //echo $EmpID . "-Loan Recoverd Invalid Data!"; + // $ErrorFlag++; + // } $Festivalbonus_first = explode(".", $Festival_Bonus); if (!is_numeric($Festival_Bonus) || (strlen((string)$Festival_Bonus)) > 8 || (strlen((string)$Festivalbonus_first[0])) > 5) { @@ -944,29 +901,24 @@ class Payslip extends BaseController foreach ($json as $index => $j) { - $Emp = $j['Employee']; - - // $EmpID = substr($Emp, 0, 4); - $parts = explode("-", $Emp); - $EmpID = $parts[0]; - - //$Name = $j['Employee']; - + + + $EmpID = $j['Emp ID']; $DaysWorked = $j['Days Worked']; - $LOP_Days = $j['LOP Days']; - $Paid_leave = $j['Paid Leave']; - $OT_Hrs_Worked = $j['OT Hrs']; - $Loan_Recovered = isset($j['Manual Loan Due ₹']) ? $j['Manual Loan Due ₹'] : 0.00; - if (is_string($Loan_Recovered)) { - $Loan_Recovered = strtoupper($Loan_Recovered); - } - $Incentives = isset($j['Incentives in ₹']) ? $j['Incentives in ₹'] : 0.00 ; + $LOP_Days = isset($j['LOP Days']) ? $j['LOP Days'] : 0.00; + $Paid_leave = isset($j['Paid Leave']) ? $j['Paid Leave'] : 0.00; + $OT_Hrs_Worked = isset($j['OT Hrs']) ? $j['OT Hrs'] : 0.00; + $Loan_Recovered = isset($j['Auto Loan Due ₹']) ? $j['Auto Loan Due ₹'] : 0.00; + // if (is_string($Loan_Recovered)) { + // $Loan_Recovered = strtoupper($Loan_Recovered); + // } + // $Incentives = isset($j['Incentives in ₹']) ? $j['Incentives in ₹'] : 0.00 ; $Festival_Bonus = isset($j['Festival Bonus in ₹']) ? $j['Festival Bonus in ₹'] : 0.00; - $Other_Deductions = isset($j['Other Deductions in ₹']) ? $j['Other Deductions in ₹'] : 0.00; + $tds_Deductions = isset($j['TDS Deductions in ₹']) ? $j['TDS Deductions in ₹'] : 0.00; $Estimate = isset($j['Estimate in ₹']) ? $j['Estimate in ₹'] : 0.00; $Created_By = $this->session->get('userId'); - $monthlypaydata = array('Month_Year' => $month, 'EmpID' => $EmpID, 'Days_worked' => $DaysWorked, 'LOP_Days' => $LOP_Days, 'Paid_leave' => $Paid_leave, 'OT_Hrs_Worked' => $OT_Hrs_Worked, 'Loan_Recovered' => $Loan_Recovered, 'Incentives' => $Incentives, 'Festival_Bonus' => $Festival_Bonus, 'Other_Deductions' => $Other_Deductions, 'Estimate' => $Estimate, 'Created_By' => $Created_By); + $monthlypaydata = array('Month_Year' => $month, 'EmpID' => $EmpID, 'Days_worked' => $DaysWorked, 'LOP_Days' => $LOP_Days, 'Paid_leave' => $Paid_leave, 'OT_Hrs_Worked' => $OT_Hrs_Worked, 'Festival_Bonus' => $Festival_Bonus, 'Other_Deductions' => $tds_Deductions, 'Estimate' => $Estimate, 'Created_By' => $Created_By ,'Loan_Recovered'=>$Loan_Recovered); // print_r($monthlypaydata); die; $result = $this->monthlypay_model->saveMonthlyData_model($monthlypaydata); $total = $total + $result; @@ -1016,8 +968,6 @@ class Payslip extends BaseController $Data['Payon'] = $this->payroll_model->getPayOn(); - - $this->global['pageTitle'] = 'Payroll Generater'; $this->loadViews("payslipgenerate", $this->global, $Data, NULL); @@ -1038,6 +988,7 @@ class Payslip extends BaseController $id = $this->request->getPost('id1'); $result = $this->payroll_model->getEmployeelist2($id); + $HTML = ""; if (count($result) > 0) { 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/Emppaydate_model.php b/app/Models/Emppaydate_model.php index 33968517..17bdf4ba 100644 --- a/app/Models/Emppaydate_model.php +++ b/app/Models/Emppaydate_model.php @@ -15,11 +15,12 @@ class Emppaydate_model extends Model */ function emppayListing() { - $builder = $this->db->table('t_emp_pay_data') - ->select('t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.LastName') - ->join('t_employee_details','t_emp_pay_data.EmpID=t_employee_details.EmpID'); + $builder = $this->db->table('t_loan_master') + ->select('t_loan_master.*,t_emp_pay_data.*,t_employee_details.FirstName') + ->join('t_employee_details','t_loan_master.EmpID = t_employee_details.EmpID','LEFT') + ->join('t_emp_pay_data','t_loan_master.EmpID = t_emp_pay_data.EmpID','LEFT'); $query =$builder->get(); - $result = $query->getResult(); + $result = $query->getResult(); return $result; } diff --git a/app/Models/Expense_model.php b/app/Models/Expense_model.php new file mode 100644 index 00000000..24c0a807 --- /dev/null +++ b/app/Models/Expense_model.php @@ -0,0 +1,45 @@ +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 + } + + + public function deleteFile($expenseId) + { + // Update the database to set transporter_file to null + return $this->update($expenseId, ['transporter_file' => null]); + } +} +?> diff --git a/app/Models/Monthlypay_model.php b/app/Models/Monthlypay_model.php index eb6c48b7..98c3665a 100644 --- a/app/Models/Monthlypay_model.php +++ b/app/Models/Monthlypay_model.php @@ -100,7 +100,7 @@ class Monthlypay_model extends Model //echo $lastdate; //left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and month(t_payroll.PayOn) = month(?) and year(t_payroll.PayOn) = year(?) - $sql = "select t_emp_pay_data.EmpID, t_emp_pay_data.Incentives as MasterIncentives,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.LastName,t_employee_details.DateofJoining,t_employee_details.Designation,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Key,t_monthly_pay_inputs.Incentives as MonthlyIncentives,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount + $sql = "select t_emp_pay_data.EmpID,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Key,t_monthly_pay_inputs.Incentives as MonthlyIncentives,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount from t_emp_pay_data left join t_employee_details on t_employee_details.EmpID = t_emp_pay_data.EmpID left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and t_payroll.PayOn = ? @@ -206,7 +206,7 @@ class Monthlypay_model extends Model $count = $res[0]['count']; } -// print_r($data);die; + if ($count == 0) { $builder = $this->db->table('t_monthly_pay_inputs'); diff --git a/app/Models/Payroll_model.php b/app/Models/Payroll_model.php index 2dc9f207..84001a78 100644 --- a/app/Models/Payroll_model.php +++ b/app/Models/Payroll_model.php @@ -373,14 +373,12 @@ class Payroll_model extends Model $this->db->table('t_payroll')->delete(['PayOn' => $PayOn]); } - function getEmpID($q = '') + function getEmpID() { $builder = $this->db->table('t_employee_details') ->select('EmpID,FirstName,LastName'); - if ($q == "addemppaydate") { - $builder->where('EmpID NOT IN (SELECT EmpID from t_emp_pay_data)', NULL, FALSE); - } + $query = $builder->get(); return $query->getResult(); } diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index b9898986..a0f828cf 100644 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -1654,18 +1654,16 @@ QuantityRejected,ROUND(Quantity-ReceivedQuantity)as PendingQty,Per, { $subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.Per,LineItem.ServiceMaterialDescription,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, -Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,Tax.*, - ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,Tax.FreightType,Tax.NoOfTrip,Tax.FreightValue,Tax.AfterFreightValue,POMast.CurrencyType, - - Req.CostCenterCode,Dept.DepartmentName FROM t_purchaseorder_lineitem LineItem - join t_purchaseorder_master POMast on POMast.PONO = LineItem.PONO -join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode - - join t_import_tax Tax on Tax.LineItemNo = LineItem.LineItemNo - join t_requestion_master Req on Req.ReqNo = LineItem.ReqNo -left join t_employee_details emp on Req.Requestedby = emp.EmpID - - join t_departmentdetails Dept on Req.RequestedDept = Dept.DEPCode where LineItem.PONO =?'; + Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,Tax.*, + ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,Tax.FreightType,Tax.NoOfTrip,Tax.FreightValue,Tax.AfterFreightValue,POMast.CurrencyType, + + Req.CostCenterCode,Dept.DepartmentName FROM t_purchaseorder_lineitem LineItem + join t_purchaseorder_master POMast on POMast.PONO = LineItem.PONO + join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode + left join t_import_tax Tax on Tax.LineItemNo = LineItem.LineItemNo + join t_requestion_master Req on Req.ReqNo = LineItem.ReqNo + left join t_employee_details emp on Req.Requestedby = emp.EmpID + left join t_departmentdetails Dept on Req.RequestedDept = Dept.DEPCode where LineItem.PONO =?'; //print_r($subQuery); $query = $this->db->query($subQuery, array($PONO)); @@ -1720,7 +1718,7 @@ left join t_employee_details emp on Req.Requestedby = emp.EmpID Req.CostCenterCode,Dept.DepartmentName FROM t_purchaseorder_lineitem LineItem join t_purchaseorder_master POMast on POMast.PONO = LineItem.PONO join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode - join t_service_tax ServiceTax on ServiceTax.LineItemNo = LineItem.LineItemNo + left join t_service_tax ServiceTax on ServiceTax.LineItemNo = LineItem.LineItemNo join t_requestion_master Req on Req.ReqNo = LineItem.ReqNo join t_employee_details emp on Req.Requestedby = emp.EmpID 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/addEmployee.php b/app/Views/addEmployee.php index 50ae509a..bfd19d4a 100644 --- a/app/Views/addEmployee.php +++ b/app/Views/addEmployee.php @@ -394,7 +394,7 @@ function onlyAlphabets(evt) { function validatePF() { - var regpf = /^([a-zA-Z]){5}([0-9]){17}$/; + var regpf = /^\d{12}$/; var PF = $('#pfno').val(); @@ -465,7 +465,7 @@ legend {
- Back + Back
@@ -906,44 +906,7 @@ legend { -
-
-
- Allowances - -
-
-
-
- Food Allowances(Per Day) - - -
-
- -
-
- Incentives - - -
-
-
-
@@ -1005,8 +968,8 @@ legend {
diff --git a/app/Views/addSupplier.php b/app/Views/addSupplier.php index 78900c1f..d92f3f0c 100644 --- a/app/Views/addSupplier.php +++ b/app/Views/addSupplier.php @@ -46,7 +46,7 @@
-   Back + Back
@@ -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 @@
-
-
- -
-
-
- - EmpID; - // if ($_POST['EmpList'] == $EmpID) { - // echo ""; - // } else{ - echo ""; - // } + // if ($_POST['EmpList'] == $EmpID) { + // echo ""; + // } else{ + echo ""; + // } } } ?> - +
-
- +
+
-
- +
+
- - + +
-
-
-
- - -
-
- - +
+
+
+ +
-
+
+ + +
+
- + if (!empty($roles)) { + foreach ($roles as $rl) { + ?> - - +
- + if (!empty($departments)) { + foreach ($departments as $dt) { + ?> - - +
-
+
+
+ +
- -
-
- - + +
-
- - +
+ +
- -
- -
-
-
- - -
-
- + +
+ +
+
+
+ + +
+
+ +
+
+ getFlashdata('listErrors'); + if ($listErrors) { + ?> +
+
+
+ + getFlashdata('listErrors'); ?> +
- getFlashdata('listErrors'); - if($listErrors) - { - ?> -
-
-
- - getFlashdata('listErrors'); ?> -
-
-
- - -
- getFlashdata('error'); - if($error) - { - ?> -
- - getFlashdata('error'); ?> -
- - - getFlashdata('success'); - if($success) - { - ?> -
- - getFlashdata('success'); ?> -
- - + +
-
- - - - - + 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..67086ce0 100644 --- a/app/Views/addasset.php +++ b/app/Views/addasset.php @@ -1,95 +1,93 @@
-
- -
- -
-
-
-

Add Asset Details

-
-
-
-   Back -
-
- -
-
-
-
-
-
-
+
+ +
+ +
+
+
+

Add Asset Details

+
+
+
+ Back +
+
+ +
+
+
+
+
+
+
-
- -
-
+
+ +
+
- +
- +
- +
- +
-
-
-
- - + + PONO; + + // if ($_POST['PONO'] == $PONO) + // { + // echo ""; + // } + // else + // { + echo ""; + // } + } } - } - ?> - + ?> +
-
- +
+
- +
- +
- +
@@ -99,355 +97,337 @@
- - + +
- +
- +
- +
- -
+ +
- + ConfigValue; - // if ($_POST['AssetStatus'] == $AssetValue) - // { - // echo ""; - // } - // else - // { - echo ""; - // } + // if ($_POST['AssetStatus'] == $AssetValue) + // { + // echo ""; + // } + // else + // { + echo ""; + // } } } - + ?> - +
- +
- > + >
-
-
-
+
+
+
-
-
- -
-
- 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..45db9225 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); - ?> -
-
- -
-
- - - - - - - - +
+ +
+
+
+

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.NOConfiguration ValueAction
+ + + + + + + + - + -
S.NOConfiguration ValueAction
- -
+ +
-
- - -
-
-
- -
-
-
+
+
+ + +
+ +
+ +
+
+ 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..40a585da 100644 --- a/app/Views/adddepartment.php +++ b/app/Views/adddepartment.php @@ -20,7 +20,7 @@
-   Back + Back
diff --git a/app/Views/addemppaydate.php b/app/Views/addemppaydate.php index 09e0fcf3..835df076 100644 --- a/app/Views/addemppaydate.php +++ b/app/Views/addemppaydate.php @@ -1,25 +1,30 @@ @@ -27,293 +32,151 @@ $("#due_started").datepicker({
-

Add Employee Pay

+
+

Add Employee Pay

+
- +
-
- Back -
-
+
+ Back +
+
- - + +
- + - -
- + + +
-
- Pay Details -
-
- - - - - + + + + + +
+ Loan Details +
+ +
+
- Employee ID* + Employee ID + *
- - 'Select Employee'); if(!empty($empdetails)){ - foreach($empdetails as $emp){ $EmpID=$emp->EmpID; - $Employee+= array($EmpID => $emp->EmpID . "-" . $emp->FirstName . "-" . $emp->LastName); - // $Employee = array_merge($Employee,$Employee1); + $Employee+= array($EmpID => $emp->EmpID . "-" . $emp->FirstName); + } } - //$data=array('name'=>'EmpID','value'=>$Employee,'id'=>'EmpID','class' => 'form-control'); + $js = array('id'=> 'emp'); - echo form_dropdown('EmpID', $Employee,set_value('EmpID'),'class="form-control"',$js); - //echo form_dropdown($data); - - ?> -
+ echo form_dropdown('EmpID', $Employee,set_value('EmpID'),'class="form-control"',$js); + + ?> +
-
-
- Total Salary* -
- 'Total_salary','id' => 'Total_salary','value' => set_value('Total_salary'),'pattern' => '([0-9]{1,8}([.][0-9]{1,2})?)', 'class' => 'form-control num', 'style'=>'text-transform:uppercase;','title' => 'Enter Valid Total salary Amount,Minimum Four Digit Positive Number','onchange'=>'calculalteHRA();'); - echo form_input($data); - ?> -
-
-
-
-
- Basic Pay* -
- 'Basic_Pay','id' => 'Basic_Pay','value' => set_value('Basic_Pay'),'pattern' => '[0-9]{4,6}', 'class' => 'form-control num', 'style'=>'text-transform:uppercase;','title' => 'Enter Valid Basic Pay Amount,Minimum Four Digit Positive Number','readonly'=>'readonly'); - echo form_input($data); - ?> -
-
-
-
-
- HRA Rate(%)* - -
- 'HRA_Rate','id'=>'HRA_Rate','value' => set_value('HRA_Rate'), 'class' => 'form-control num','style'=>'text-transform:uppercase;','pattern'=>'([0-9]{1,2}([.][0-9]{1,2})?)', 'title'=>'Enter the Valid HRA Rate,Minimum 1 digit,Maximum 2 digit','onfocusout'=>'validateHRA();','onchange'=>'calculalteHRA();'); - echo form_input($data); - ?> -
-
-
- - -
- -
- - -
-
- HRA Amount* - -
- 'HRA_Amount','id'=>'HRA_Amount','value' => set_value('HRA_Amount'), 'class' => 'form-control num','style'=>'text-transform:uppercase;','readonly'=>'readonly'); - echo form_input($data); - ?> -
-
-
- - -
-
- Allowances* -
- 'Allowances','value' => set_value('Allowances'), 'class' => 'form-control num' ,'style'=>'text-transform:uppercase;','pattern'=>'([0-9]{1,5}([.][0-9]{1,2})?)','title'=>'Enter the Valid Allowances,Minimum 1 digit , Maximum 5 digit '); - echo form_input($data); - ?> -
-
-
- -
-
- PF Rate(%)* - -
- 'PF_Rate','value' => set_value('PF_Rate'),'class' => 'form-control num' ,'style'=>'text-transform:uppercase;','pattern'=>'([0-9]{1,2}([.][0-9]{1,2})?)', 'title'=>'Enter the valid PF Rate,Minimum 1 digit,Maximum 2 digit'); - echo form_input($data); - ?> -
-
-
- -
-
- ESI Rate(%)* -
- 'ESI_Rate','value' => set_value('ESI_Rate'), 'class' => 'form-control num' ,'style'=>'text-transform:uppercase;','pattern'=>'([0-9]{1,2}([.][0-9]{1,2})?)','title'=>'Enter the Valid ESI Rate,Minimum 1 digit,Maximum 2 digit'); - echo form_input($data); - ?> -
-
-
- -
- -
- - - - -
-
- Food Allowances(Per Day)* -
- 'Food_Allowances','value' => set_value('Food_Allowances'), 'class' => 'form-control num','pattern'=>'([0-9]{1,3}([.][0-9]{1,2})?)','onfocusout'=>'validateFood();', 'title'=>'Enter the Valid Food Allowances,Minimun 1 Digit,Maximum 3 Digit'); - echo form_input($data); - ?> -
-
-
- -
-
- Incentives* -
- 'Incentives','value' => set_value('Incentives'), 'class' => 'form-control num' ,'style'=>'text-transform:uppercase;','pattern'=>'([0-9]{1,5}([.][0-9]{1,2})?)','title'=>'Enter the Valid Allowances,Minimum 1 digit , Maximum 5 digit '); - echo form_input($data); - ?> -
-
-
-
- - - - - - - - - - -
- Loan Details -
- -
- Loan Amount - -
+ Loan Amount + +
- - - -
-
-
- Loan Issue(d) Date - -
-
-
- + +
- Monthly Due - -
+ Loan Issue(d) Date + +
-
+ + +
- Due Started - -
+ Monthly Due + +
-
+
- No Of Due(s) - -
+ Due Started + +
-
+
- Paid Amount - -
+ No Of Due(s) + +
- - +
+
+
+ Paid Amount + +
+
- - - + + +
+ + +
- - + + - +
@@ -325,7 +188,7 @@ $("#due_started").datepicker({ ?>
- getFlashdata('error'); ?> + getFlashdata('error'); ?>
getFlashdata('success'); ?>
- +
- listErrors('
', '
'); ?>
+ listErrors('
', '
'); ?> +
- + - - - + + + + - - - - + \ No newline at end of file diff --git a/app/Views/assetListing.php b/app/Views/assetListing.php index 60c106aa..53194795 100644 --- a/app/Views/assetListing.php +++ b/app/Views/assetListing.php @@ -69,14 +69,7 @@
- - - - - - - -
+ diff --git a/app/Views/attendance.php b/app/Views/attendance.php index 768ef067..7d56a4da 100644 --- a/app/Views/attendance.php +++ b/app/Views/attendance.php @@ -329,6 +329,7 @@ $currentday = date('d'); + @@ -391,6 +392,7 @@ $currentday = date('d'); + @@ -428,29 +430,28 @@ $currentday = date('d'); //alert(s); if(s == 0){ - resetFinalValues(); + + resetFinalValues(); var Totalnoofdays = ; var alldata = $("#attendance").tableToJSON(); - // alert(JSON.stringify(alldata)); alldata=JSON.stringify(alldata); - // alert(alldata); var month = $('#month').val(); var currentmonth = month.substr(0,3); var currentyear = month.substr(4,4); - // alert(currentyear); + var montharray = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; - var currentmonth = jQuery.inArray(currentmonth,montharray);//!== -1 - currentmonth++; + var currentmonth = jQuery.inArray(currentmonth,montharray);//!== -1 + currentmonth++; - //alert(currentmonth); - var currentdate = '01-'+currentmonth+'-'+currentyear; + + var currentdate = '01-'+currentmonth+'-'+currentyear; var totaldata = 0; $('.content').loader('show'); $.ajax({ - data:{param1:alldata,param2:currentdate,param3:Totalnoofdays}, + data:{param1:alldata,param2:currentdate,param3:Totalnoofdays}, //dataType:"json", type:"POST", url:"monthlypay/saveAttendance", @@ -643,11 +644,13 @@ function myFunction(p,i,v) var totalworkingHrs=0; + var sundayWorkingHr=0; var totalOTHrs = 0; var paidleave = 0; var totalDaysWorked=0; var absent = 0; var sundays = ; + var sundaysArray = ; var publicholidays = ; var totaldays = ; @@ -681,12 +684,30 @@ function myFunction(p,i,v) var str1 = str.substr(-1); var str2 = str.substr(-2); var str3 = str.substr(-3); + + + if(str1 == 'W') { - var current = value.textContent == '' ? 0:parseFloat(value.textContent); - totalworkingHrs += current; + sundayValidation = false; + let dateInt = +str3.replace(/\D/g, ''); + sundaysArray.forEach(element => { + if(+element == dateInt){ + sundayValidation = true; + var current = value.textContent == '' ? 0:parseFloat(value.textContent); + sundayWorkingHr += current; + + } + }); + + if(sundayValidation == false){ + var current = value.textContent == '' ? 0:parseFloat(value.textContent); + totalworkingHrs += current; + } + if(current == 0){absent++;} + } else { @@ -702,28 +723,29 @@ function myFunction(p,i,v) // break; }); - + // if(paidleave == 1 ) // { // absent = 0; // alert('if'); // } - // if(paidleave == 0) - // { - // absent = 0; - // alert('else if'); - // } - // else - // { - // // absent = paidleave-0; - // // paidleave = 0; - // absent = paidleave; - // paidleave = 0; - // alert('else'); - // } + // if(paidleave == 0) + // { + // absent = 0; + // alert('else if'); + // } + // else + // { + // // absent = paidleave-0; + // // paidleave = 0; + // absent = paidleave; + // paidleave = 0; + // alert('else'); + // } + TotalOT = totalOTHrs + sundayWorkingHr; document.getElementById(totalhrsid).textContent = parseFloat(totalworkingHrs).toFixed(2);// == ''?0:parseFloat(totalworkingHrs)); - document.getElementById(totalothrsid).textContent = parseFloat(totalOTHrs).toFixed(2);// == ''?0:parseFloat(totalOTHrs)); + document.getElementById(totalothrsid).textContent = parseFloat(TotalOT).toFixed(2);// == ''?0:parseFloat(totalOTHrs)); document.getElementById(paidleaveid).textContent = parseFloat(paidleave).toFixed(2); document.getElementById(daysworkedid).textContent = parseFloat((totalworkingHrs/8)).toFixed(2); document.getElementById(absentid).textContent = parseFloat(absent).toFixed(2); 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() {
-   Back + Back
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 @@
-
-
-
-
- - - +
+
+
+ + + + - - + + - - -
- -
-
Paid Leave Days Worked AbsentTotal Sunday
Paid_Leave)){echo number_format($a->Paid_Leave,2,'.','.');}else{echo "0.00";}?> Days_Worked)){echo $a->Days_Worked;}else{echo "0.00";}?> Absent)){echo $a->Absent;}else{echo "0.00";}?>
- - - - - - - - - - - - - CreatedDate)) == "30-11--0001") { - $cdate = '00-00-0000'; - } else { - $cdate = date('d-m-Y', strtotime($record->CreatedDate)); - } ?> - - - - - + + +
+ +
+
Create DateConfiguration IDConfiguration NameDescriptionAction
Config_ID ?>ConfigName ?>Comments ?>
+ + + + + + + + + + + + + CreatedDate)) == "30-11--0001") { + $cdate = '00-00-0000'; + } else { + $cdate = date('d-m-Y', strtotime($record->CreatedDate)); + } ?> + + + + + - + - + - - - -
Create DateConfiguration IDConfiguration NameDescriptionAction
Config_ID ?>ConfigName ?>Comments ?>     - -     + +
-
- - - - - - + + + + + + + + + + + @@ -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/editEmployee.php b/app/Views/editEmployee.php index 85145b28..4826c3d1 100644 --- a/app/Views/editEmployee.php +++ b/app/Views/editEmployee.php @@ -494,7 +494,7 @@ function validateESI() { } function validatePF() { - var regpf = /^([a-zA-Z]){5}([0-9]){17}?$/; + var regpf = /^\d{12}$/; var PF = $('#pfno').val(); @@ -1198,47 +1198,6 @@ legend { -
-
-
- Allowances - -
-
- -
-
- Food Allowances(Per Day) - - -
-
- -
-
- Incentives - - -
-
-
-
-
@@ -1307,8 +1266,8 @@ legend { value="" onchange="validatePF();" class="form-control" style="text-transform:uppercase" - pattern="([a-zA-Z]){5}([0-9]){17}" - title=" 5 Character and 17 Digit number (ex:ABCDE12345678901234567)" + pattern="\d{12}" + title="12 Digit number" onkeypress="return alpha(event);">
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 Details
-

- -

- -
- -
-
- -
- - - -
-
- - - -
-
-
-
-
- - +
+
+ +
+ +
+
+
+

Edit User 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)) { + 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 -
-
-
- - +
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+
+ > + +
+
+
+
+
+ + 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/editOldemppay.php b/app/Views/editOldemppay.php index ca07d088..c6f39ee9 100644 --- a/app/Views/editOldemppay.php +++ b/app/Views/editOldemppay.php @@ -145,7 +145,7 @@ if(!empty($emppay))

-
Edit Salary Payment Details
+
Edit Loan Details

@@ -165,15 +165,15 @@ if(!empty($emppay))
-
- Pay Details + + +
+ Loan Details
-
+ +
- - - - +
@@ -182,117 +182,6 @@ if(!empty($emppay))
- -
-
-
- Employee Name - -
-
-
- -
-
-
- Total Salary* - -
-
-
-
-
-
- Basic Pay* - -
-
-
-
- - -
-
-
-
- HRA_Rate(%)* - -
-
-
-
-
-
- HRA_Amount* - -
-
-
- - -
-
-
- Allowances* - -
-
-
-
-
-
- PF_Rate(%)* - -
-
-
- - -
- - - - -
- - - - - -
-
-
- ESI_Rate(%)* - -
-
-
- -
-
-
- Food Allowances(Per Day)* - -
-
-
- - -
-
-
- Incentives* - -
-
-
-
- -
- Loan Details -
- -
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

+
+
+ +
+ -
-
-
- - -
-
- -
-
- - -
+
+
+
+
+ +
+ +
+
+
+
+
+ + +
+
+
+
+ + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
-
- +
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ - } 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)) ?> -
- -
-

-
Details
-

- -

-
-
- Back -
-
-
- -
- - -
- - - -
- -
-
- -
-
-
- - Asset Name* - - - - -
-
-
-
- - Asset Description* - - -
- -
-
-
- - Asset User* - - -
- -
-
-
- - Asset Location* - - -
- -
- -
-
-
-
- - Purchase Order Number* - - -
-
-
-
-
- - 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 -
-
-
- - - +
+
+ +
+ +
+
+
+

Details

+
- -
-
- getFlashdata('error'); - if($error) - { - ?> -
- - getFlashdata('error'); ?> -
- - getFlashdata('success'); - if($success) - { - ?> -
- - getFlashdata('success'); ?> -
- - -
-
- listErrors('
', '
'); ?>
+
-
-
-
- -
+ +
+
+
+
+
+
+
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ 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
-

- -

- -
-
- -
- - - -
- - - - -
-
-

-
- - - Department Information -
- Department Code - -
-
- Department Name* - - -
- -
- Head Department - -
-
-
- Is Active
- > +
+
+ +
+ +
+
+
+

Edit Department - Details

+
+
+
+   Back +
+
+ +
+
+
+
+ +
+ + Department Information +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+
+ > +
+
+
+ + +
+
+
+ +
+
+ getFlashdata('error'); + if ($error) { ?> +
+ + getFlashdata('error'); ?> +
+ getFlashdata('success'); + if ($success) { ?> +
+ + getFlashdata('success'); ?> +
+ +
- -
-
-
- - -
+
+
+
-
-
- -
-
- - - -
-
-
- getFlashdata('error'); - if($error) - { - ?> -
- - getFlashdata('error'); ?> -
- - getFlashdata('success'); - if($success) - { - ?> -
- - getFlashdata('success'); ?> -
- - -
-
- listErrors('
', '
'); ?>
-
-
-
-
- + +
+
diff --git a/app/Views/editrequisitionform.php b/app/Views/editrequisitionform.php index 9f02ab4d..45f098d3 100644 --- a/app/Views/editrequisitionform.php +++ b/app/Views/editrequisitionform.php @@ -34,6 +34,19 @@ if (!empty($ReqPOType)) { $strReqPOType = $ReqPOType; } ?> + + + + + + +
+
+ +
+ +
+
+
+
+

Expense List

+
+
+ +
+
+
+
+
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Created DateSupplier NameGSTCostTotalStatusPayment MethodAction
+ + + + + + +
+
+
+
+
+
+
+
+
+ + + + + + + + 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 @@ + - - - - - - + + + + + + + + - + + \ No newline at end of file diff --git a/app/Views/login_old.php b/app/Views/login_old.php new file mode 100644 index 00000000..2bec265a --- /dev/null +++ b/app/Views/login_old.php @@ -0,0 +1,112 @@ + + + + + Resico (India) Pvt Ltd | Admin System Log in + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ © Resico +
+ + + + + + + + + diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index 15dad917..ee47922a 100644 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -35,51 +35,50 @@ ?> - - - - + -$('html').bind('keypress', function(e) -{ - //alert('Key Pressed'); - if(e.keyCode == 13) - { - return false; - } + - - - -
- -
-

-
Employee Monthly Payment Listing
-

-
-
- - -
-
-
-
- -
- -

The Red highlighted Employee have loan to pay. Put 'NA' for Skip Current Month Loan Due.

-
-
-
- -
- +
+ +
+

+
Employee Monthly Payment Listing
+

+
+
+ + +
+
+
+
+ +
+ +

The Red highlighted Employee have loan + to pay. Put 'NA' for Skip Current + Month Loan Due.

+
+
+
+ + +
+ -
-
-
-
- -
-
-
- - - - - - - - - - - +
+
+
+
+ + +
+
-
+
+
S.NoEmployee Days WorkedLOP DaysPaid LeaveOT HrsAuto Loan Due ₹
+ + - - - - - + + + + + + + + + + - + + + + + + + + + + + - - - - - - Auto Loan Due ₹ + + + + + + + + + + + + + $record) { - //echo 'PAY'.$record->Key; - $index++; - - if(in_array($record->EmpID,$testarray)) - { - $index--; - - - } - else{ - - - array_push($testarray,$record->EmpID); - - - + $index++; + if(in_array($record->EmpID,$testarray)) { $index--; }else{ array_push($testarray,$record->EmpID); ?> - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - -
Manual Loan Due ₹Incentives in ₹Other Deductions in ₹Festival Bonus in ₹S.NoEmp ID Employee DOJDesignationTotal DaysDays WorkedLOP DaysPaid LeaveOT HrsEstimate in ₹Basic SalaryPre Day SalaryWorked SalaryPre hr SalaryEarned SalaryBasic Salary(0.7)HRA Salary(0.3)Gross SalaryESIPFOver Time
TDS Deductions in ₹Festival Bonus in ₹Estimate in ₹
EmpID ."-".$record->FirstName ."". $record->LastName ?>
+ EmpID ; ?>FirstName; ?> + DateofJoining); + $newDateFormat = $date->format('d-m-Y'); + echo $newDateFormat; + ?> + Designation; ?>NoofDays; ?>Key)){echo "contenteditable='false';"; } ?> + Key)){?> title="Payslip Calculated" + style="text-align:right;color:blue;" + style="text-align:right;" > + Days_worked)){echo $record->Days_worked+$record->sunday_count;}else{echo "0.00";}?> + Key)){echo "contenteditable='false';"; } ?> + Key)){?> title="Payslip Calculated" + style="text-align:right;color:blue;" + style="text-align:right;" > + LOP_Days)){echo $record->LOP_Days;}else{echo "0.00";}?> + Key)){echo "contenteditable='false';"; } ?> + Key)){?> title="Payslip Calculated" + style="text-align:right;color:blue;" + style="text-align:right;" > + Paid_leave)){echo number_format($record->Paid_leave,2,'.','');}else { echo number_format(0.00,2,'.','');} ?> + Key)){echo "contenteditable='false';"; } ?> + Key)){?> title="Payslip Calculated" + style="text-align:right;color:blue;" + style="text-align:right;" > + OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?> + Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Days_worked)){echo $record->Days_worked;}else{echo "0.00";}?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >LOP_Days)){echo $record->LOP_Days;}else{echo "0.00";}?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Paid_leave)){echo number_format($record->Paid_leave,2,'.','');}else { echo number_format(0.00,2,'.','');} ?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Monthly_Due)){echo $record->Monthly_Due; $totalmonthloan []=$record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?>Key) && !empty($record->Loan_ID)){ echo "contenteditable='true'; style='background-color:#ffcccc;text-align:right' title='Loan Pending'"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" > - - Loan_Recovered)) - {if(is_numeric($record->Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.',''); $totalmanualoan[] = $record->Loan_Recovered;}else {echo $record->Loan_Recovered; $totalmanualoan[] = $record->Loan_Recovered;}}else{echo number_format(0.00,2,'.','');} ?> + TotalSalary; ?> + TotalSalary / $record->NoofDays; echo number_format($perDaySalary, 2); ?> + + Days_worked+$record->sunday_count); echo number_format($workedSalary, 2); ?> + + + + + + + + Key)){echo "contenteditable='true';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" > - - - MonthlyIncentives)){echo $record->MonthlyIncentives; $totalinst [] = $record->MonthlyIncentives;}else {echo $record->MasterIncentives; $totalinst [] = $record->MasterIncentives;} - - ?> - - - - Key)){echo "contenteditable='true';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Other_Deductions)){echo $record->Other_Deductions;$totalotherDet [] = $record->Other_Deductions;}else{ echo number_format(0.00,2,'.','');} ?>Key)){echo "contenteditable='true';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Festival_Bonus)){echo $record->Festival_Bonus;$totalfestival [] = $record->Festival_Bonus;}else{ echo number_format(0.00,2,'.','');;} ?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"> Estimate)){echo $record->Estimate; $estTotal [] = $record->Estimate; }else { echo $empSalary[$i]; $estTotal [] = $empSalary[$i]; -}?>Key)){echo "contenteditable='false';"; } ?> + Key)){?> title="Payslip Calculated" + style="text-align:right;color:blue;" + style="text-align:right;" > + Monthly_Due)){echo $record->Monthly_Due; $totalmonthloan []=$record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?> +
Key)){echo "contenteditable='true';"; } ?> + Key)){?> title="Payslip Calculated" + style="text-align:right;color:blue;" + style="text-align:right;" > + + Other_Deductions)){echo $record->Other_Deductions;$totalotherDet [] = $record->Other_Deductions;}else{ echo number_format(0.00,2,'.','');} ?> + Key)){echo "contenteditable='true';"; } ?> + Key)){?> title="Payslip Calculated" + style="text-align:right;color:blue;" + style="text-align:right;" > + Festival_Bonus)){echo $record->Festival_Bonus;$totalfestival [] = $record->Festival_Bonus;}else{ echo number_format(0.00,2,'.','');;} ?> + Key)){echo "contenteditable='false';"; } ?> + Key)){?> title="Payslip Calculated" + style="text-align:right;color:blue;" > + Estimate)){ + echo $record->Estimate; $estTotal [] = $record->Estimate; + }else { + echo $empSalary[$i]; $estTotal [] = $empSalary[$i]; + } + ?> +
Total
+ -

 

-
-
- -
-
-
- + -
-
-
-
-
- - + \ No newline at end of file + \ No newline at end of file diff --git a/app/Views/requisitionform.php b/app/Views/requisitionform.php index 3bf4de3d..36f167e1 100644 --- a/app/Views/requisitionform.php +++ b/app/Views/requisitionform.php @@ -13,6 +13,19 @@ if (!empty($Emp)) { } } ?> +
diff --git a/app/Views/viewinwardgateregister.php b/app/Views/viewinwardgateregister.php index 86434473..0fa89a14 100644 --- a/app/Views/viewinwardgateregister.php +++ b/app/Views/viewinwardgateregister.php @@ -1,6 +1,6 @@ '; - break; - default: - $output .= $contents; - } - } - - // Don't pre-render on every dump - if (!$this->getForcePreRender()) { - self::$needs_pre_render = false; - } - } - - return $output.'
'; - } - - public function postRender(): string - { - if (self::$disable_utf8) { - return $this->utf8ToHtmlentity(parent::postRender()).'
'; - } - - return parent::postRender().'
'; - } - - public function ideLink(string $file, int $line): string - { - $path = $this->escape(Kint::shortenPath($file)).':'.$line; - $ideLink = Kint::getIdeLink($file, $line); - - if (!$ideLink) { - return $path; - } - - $class = ''; - - if (\preg_match('/https?:\\/\\//i', $ideLink)) { - $class = 'class="kint-ide-link" '; - } - - return ''.$path.''; - } - - public function escape(string $string, $encoding = false): string - { - if (false === $encoding) { - $encoding = BlobValue::detectEncoding($string); - } - - $original_encoding = $encoding; - - if (false === $encoding || 'ASCII' === $encoding) { - $encoding = 'UTF-8'; - } - - $string = \htmlspecialchars($string, ENT_NOQUOTES, $encoding); - - // this call converts all non-ASCII characters into numeirc htmlentities - if (\function_exists('mb_encode_numericentity') && 'ASCII' !== $original_encoding) { - $string = \mb_encode_numericentity($string, [0x80, 0xFFFF, 0, 0xFFFF], $encoding); - } - - return $string; - } - - protected function utf8ToHtmlentity(string $string): string - { - return \str_replace( - ['┌', '═', '┐', '│', '└', '─', '┘'], - ['┌', '═', '┐', '│', '└', '─', '┘'], - $string - ); - } - - protected static function renderJs(): string - { - return \file_get_contents(KINT_DIR.'/resources/compiled/shared.js').\file_get_contents(KINT_DIR.'/resources/compiled/plain.js'); - } - - protected static function renderCss(): string - { - if (\file_exists(KINT_DIR.'/resources/compiled/'.self::$theme)) { - return \file_get_contents(KINT_DIR.'/resources/compiled/'.self::$theme); - } - - return \file_get_contents(self::$theme); - } -} diff --git a/vendor/kint-php/kint/src/Renderer/RendererInterface.php b/vendor/kint-php/kint/src/Renderer/RendererInterface.php deleted file mode 100644 index 577e9df0..00000000 --- a/vendor/kint-php/kint/src/Renderer/RendererInterface.php +++ /dev/null @@ -1,57 +0,0 @@ -renderer = $r; - } - - /** - * @param string $content The replacement for the getValueShort contents - */ - public function renderLockedHeader(Value $o, string $content): string - { - $header = '
'; - - if (RichRenderer::$access_paths && $o->depth > 0 && $ap = $o->getAccessPath()) { - $header .= ''; - } - - $header .= ''; - - if (null !== ($s = $o->getModifiers())) { - $header .= ''.$s.' '; - } - - if (null !== ($s = $o->getName())) { - $header .= ''.$this->renderer->escape($s).' '; - - if ($s = $o->getOperator()) { - $header .= $this->renderer->escape($s, 'ASCII').' '; - } - } - - if (null !== ($s = $o->getType())) { - if (RichRenderer::$escape_types) { - $s = $this->renderer->escape($s); - } - - if ($o->reference) { - $s = '&'.$s; - } - - $header .= ''.$s.''; - - if ($o instanceof InstanceValue && isset($o->spl_object_id)) { - $header .= '#'.((int) $o->spl_object_id); - } - - $header .= ' '; - } - - if (null !== ($s = $o->getSize())) { - if (RichRenderer::$escape_types) { - $s = $this->renderer->escape($s); - } - $header .= '('.$s.') '; - } - - $header .= $content; - - if (!empty($ap)) { - $header .= '
'.$this->renderer->escape($ap).'
'; - } - - return $header.'
'; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/ArrayLimitPlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/ArrayLimitPlugin.php deleted file mode 100644 index 15220e5d..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/ArrayLimitPlugin.php +++ /dev/null @@ -1,38 +0,0 @@ -'.$this->renderLockedHeader($o, 'Array Limit').''; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/BinaryPlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/BinaryPlugin.php deleted file mode 100644 index 4cbce1ae..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/BinaryPlugin.php +++ /dev/null @@ -1,62 +0,0 @@ -contents)) { - return null; - } - - $out = '
';
-
-        $lines = \str_split($r->contents, self::$line_length);
-
-        foreach ($lines as $index => $line) {
-            $out .= \sprintf('%08X', $index * self::$line_length).":\t";
-
-            $chunks = \str_split(\str_pad(\bin2hex($line), 2 * self::$line_length, ' '), self::$chunk_length);
-
-            $out .= \implode(' ', $chunks);
-            $out .= "\t".\preg_replace('/[^\\x20-\\x7E]/', '.', $line)."\n";
-        }
-
-        $out .= '
'; - - return $out; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/BlacklistPlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/BlacklistPlugin.php deleted file mode 100644 index 78064a7a..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/BlacklistPlugin.php +++ /dev/null @@ -1,38 +0,0 @@ -'.$this->renderLockedHeader($o, 'Blacklisted').''; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/CallablePlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/CallablePlugin.php deleted file mode 100644 index 74438052..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/CallablePlugin.php +++ /dev/null @@ -1,130 +0,0 @@ -renderMethod($o); - } - - if ($o instanceof ClosureValue) { - return parent::renderValue($o); - } - - return null; - } - - protected function renderMethod(MethodValue $o): string - { - if (!empty(self::$method_cache[$o->owner_class][$o->name])) { - $children = self::$method_cache[$o->owner_class][$o->name]['children']; - - $header = $this->renderer->renderHeaderWrapper( - $o, - (bool) \strlen($children), - self::$method_cache[$o->owner_class][$o->name]['header'] - ); - - return '
'.$header.$children.'
'; - } - - $children = $this->renderer->renderChildren($o); - - $header = ''; - - if (null !== ($s = $o->getModifiers()) || $o->return_reference) { - $header .= ''.$s; - - if ($o->return_reference) { - if ($s) { - $header .= ' '; - } - $header .= $this->renderer->escape('&'); - } - - $header .= ' '; - } - - if (null !== ($s = $o->getName())) { - $function = $this->renderer->escape($s).'('.$this->renderer->escape($o->getParams()).')'; - - if (null !== ($url = $o->getPhpDocUrl())) { - $function = ''.$function.''; - } - - $header .= ''.$function.''; - } - - if (!empty($o->returntype)) { - $header .= ': '; - - if ($o->return_reference) { - $header .= $this->renderer->escape('&'); - } - - $header .= $this->renderer->escape($o->returntype).''; - } elseif ($o->docstring) { - if (\preg_match('/@return\\s+(.*)\\r?\\n/m', $o->docstring, $matches)) { - if (\trim($matches[1])) { - $header .= ': '.$this->renderer->escape(\trim($matches[1])).''; - } - } - } - - if (null !== ($s = $o->getValueShort())) { - if (RichRenderer::$strlen_max) { - $s = Utils::truncateString($s, RichRenderer::$strlen_max); - } - $header .= ' '.$this->renderer->escape($s); - } - - if (\strlen($o->owner_class) && \strlen($o->name)) { - self::$method_cache[$o->owner_class][$o->name] = [ - 'header' => $header, - 'children' => $children, - ]; - } - - $header = $this->renderer->renderHeaderWrapper($o, (bool) \strlen($children), $header); - - return '
'.$header.$children.'
'; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/ClosurePlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/ClosurePlugin.php deleted file mode 100644 index a2b5a7e0..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/ClosurePlugin.php +++ /dev/null @@ -1,64 +0,0 @@ -renderer->renderChildren($o); - - $header = ''; - - if (null !== ($s = $o->getModifiers())) { - $header .= ''.$s.' '; - } - - if (null !== ($s = $o->getName())) { - $header .= ''.$this->renderer->escape($s).'('.$this->renderer->escape($o->getParams()).') '; - } - - $header .= 'Closure'; - if (isset($o->spl_object_id)) { - $header .= '#'.((int) $o->spl_object_id); - } - $header .= ' '.$this->renderer->escape(Kint::shortenPath($o->filename)).':'.(int) $o->startline; - - $header = $this->renderer->renderHeaderWrapper($o, (bool) \strlen($children), $header); - - return '
'.$header.$children.'
'; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/ColorPlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/ColorPlugin.php deleted file mode 100644 index f1de5fe3..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/ColorPlugin.php +++ /dev/null @@ -1,102 +0,0 @@ -getRepresentation('color'); - - if (!$r instanceof ColorRepresentation) { - return null; - } - - $children = $this->renderer->renderChildren($o); - - $header = $this->renderer->renderHeader($o); - $header .= '
'; - - $header = $this->renderer->renderHeaderWrapper($o, (bool) \strlen($children), $header); - - return '
'.$header.$children.'
'; - } - - public function renderTab(Representation $r): ?string - { - if (!$r instanceof ColorRepresentation) { - return null; - } - - $out = ''; - - if ($color = $r->getColor(ColorRepresentation::COLOR_NAME)) { - $out .= ''.$color."\n"; - } - if ($color = $r->getColor(ColorRepresentation::COLOR_HEX_3)) { - $out .= ''.$color."\n"; - } - if ($color = $r->getColor(ColorRepresentation::COLOR_HEX_6)) { - $out .= ''.$color."\n"; - } - - if ($r->hasAlpha()) { - if ($color = $r->getColor(ColorRepresentation::COLOR_HEX_4)) { - $out .= ''.$color."\n"; - } - if ($color = $r->getColor(ColorRepresentation::COLOR_HEX_8)) { - $out .= ''.$color."\n"; - } - if ($color = $r->getColor(ColorRepresentation::COLOR_RGBA)) { - $out .= ''.$color."\n"; - } - if ($color = $r->getColor(ColorRepresentation::COLOR_HSLA)) { - $out .= ''.$color."\n"; - } - } else { - if ($color = $r->getColor(ColorRepresentation::COLOR_RGB)) { - $out .= ''.$color."\n"; - } - if ($color = $r->getColor(ColorRepresentation::COLOR_HSL)) { - $out .= ''.$color."\n"; - } - } - - if (!\strlen($out)) { - return null; - } - - return '
'.$out.'
'; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/DepthLimitPlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/DepthLimitPlugin.php deleted file mode 100644 index 3b73b6be..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/DepthLimitPlugin.php +++ /dev/null @@ -1,38 +0,0 @@ -'.$this->renderLockedHeader($o, 'Depth Limit').''; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/MethodDefinitionPlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/MethodDefinitionPlugin.php deleted file mode 100644 index f5ed37b6..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/MethodDefinitionPlugin.php +++ /dev/null @@ -1,76 +0,0 @@ -contents)) { - $docstring = []; - foreach (\explode("\n", $r->contents) as $line) { - $docstring[] = \trim($line); - } - - $docstring = $this->renderer->escape(\implode("\n", $docstring)); - } - - $addendum = []; - if (isset($r->class) && $r->inherited) { - $addendum[] = 'Inherited from '.$this->renderer->escape($r->class); - } - - if (isset($r->file, $r->line)) { - $addendum[] = 'Defined in '.$this->renderer->escape(Kint::shortenPath($r->file)).':'.((int) $r->line); - } - - if ($addendum) { - $addendum = ''.\implode("\n", $addendum).''; - - if (isset($docstring)) { - $docstring .= "\n\n".$addendum; - } else { - $docstring = $addendum; - } - } - - if (!isset($docstring)) { - return null; - } - - return '
'.$docstring.'
'; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/MicrotimePlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/MicrotimePlugin.php deleted file mode 100644 index 086e8144..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/MicrotimePlugin.php +++ /dev/null @@ -1,74 +0,0 @@ -getDateTime())) { - return null; - } - - $out = $dt->format('Y-m-d H:i:s.u'); - if (null !== $r->lap) { - $out .= '
SINCE LAST CALL: '.\round($r->lap, 4).'s.'; - } - if (null !== $r->total) { - $out .= '
SINCE START: '.\round($r->total, 4).'s.'; - } - if (null !== $r->avg) { - $out .= '
AVERAGE DURATION: '.\round($r->avg, 4).'s.'; - } - - $bytes = Utils::getHumanReadableBytes($r->mem); - $out .= '
MEMORY USAGE: '.$r->mem.' bytes ('.\round($bytes['value'], 3).' '.$bytes['unit'].')'; - $bytes = Utils::getHumanReadableBytes($r->mem_real); - $out .= ' (real '.\round($bytes['value'], 3).' '.$bytes['unit'].')'; - - $bytes = Utils::getHumanReadableBytes($r->mem_peak); - $out .= '
PEAK MEMORY USAGE: '.$r->mem_peak.' bytes ('.\round($bytes['value'], 3).' '.$bytes['unit'].')'; - $bytes = Utils::getHumanReadableBytes($r->mem_peak_real); - $out .= ' (real '.\round($bytes['value'], 3).' '.$bytes['unit'].')'; - - return '
'.$out.'
'; - } - - public static function renderJs(): string - { - if (\is_string($out = \file_get_contents(KINT_DIR.'/resources/compiled/microtime.js'))) { - return $out; - } - - return ''; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/PluginInterface.php b/vendor/kint-php/kint/src/Renderer/Rich/PluginInterface.php deleted file mode 100644 index bbdb8ac5..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/PluginInterface.php +++ /dev/null @@ -1,35 +0,0 @@ -'.$this->renderLockedHeader($o, 'Recursion').''; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/SimpleXMLElementPlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/SimpleXMLElementPlugin.php deleted file mode 100644 index 87d98707..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/SimpleXMLElementPlugin.php +++ /dev/null @@ -1,56 +0,0 @@ -isStringValue() || !empty($o->getRepresentation('attributes')->contents)) { - return null; - } - - $b = new BlobValue(); - $b->transplant($o); - $b->type = 'string'; - - $children = $this->renderer->renderChildren($b); - $header = $this->renderer->renderHeader($o); - $header = $this->renderer->renderHeaderWrapper($o, (bool) \strlen($children), $header); - - return '
'.$header.$children.'
'; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/SourcePlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/SourcePlugin.php deleted file mode 100644 index a02f7ec1..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/SourcePlugin.php +++ /dev/null @@ -1,83 +0,0 @@ -source)) { - return null; - } - - $source = $r->source; - - // Trim empty lines from the start and end of the source - foreach ($source as $linenum => $line) { - if (\strlen(\trim($line)) || $linenum === $r->line) { - break; - } - - unset($source[$linenum]); - } - - foreach (\array_reverse($source, true) as $linenum => $line) { - if (\strlen(\trim($line)) || $linenum === $r->line) { - break; - } - - unset($source[$linenum]); - } - - $output = ''; - - foreach ($source as $linenum => $line) { - if ($linenum === $r->line) { - $output .= '
'.$this->renderer->escape($line)."\n".'
'; - } else { - $output .= '
'.$this->renderer->escape($line)."\n".'
'; - } - } - - if ($output) { - \reset($source); - - $data = ''; - if ($r->showfilename) { - $data = ' data-kint-filename="'.$this->renderer->escape($r->filename).'"'; - } - - return '
'.$output.'
'; - } - - return null; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/TabPluginInterface.php b/vendor/kint-php/kint/src/Renderer/Rich/TabPluginInterface.php deleted file mode 100644 index fb310af5..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/TabPluginInterface.php +++ /dev/null @@ -1,35 +0,0 @@ -'; - - $firstrow = \reset($r->contents); - - foreach ($firstrow->value->contents as $field) { - $out .= ''; - } - - $out .= ''; - - foreach ($r->contents as $row) { - $out .= ''; - - foreach ($row->value->contents as $field) { - $out .= 'getType())) { - $type = $this->renderer->escape($s); - - if ($field->reference) { - $ref = '&'; - $type = $ref.$type; - } - - if (null !== ($s = $field->getSize())) { - $size .= ' ('.$this->renderer->escape($s).')'; - } - } - - if ($type) { - $out .= ' title="'.$type.$size.'"'; - } - - $out .= '>'; - - switch ($field->type) { - case 'boolean': - $out .= $field->value->contents ? ''.$ref.'true' : ''.$ref.'false'; - break; - case 'integer': - case 'double': - $out .= (string) $field->value->contents; - break; - case 'null': - $out .= ''.$ref.'null'; - break; - case 'string': - if ($field->encoding) { - $val = $field->value->contents; - if (RichRenderer::$strlen_max && self::$respect_str_length) { - $val = Utils::truncateString($val, RichRenderer::$strlen_max); - } - - $out .= $this->renderer->escape($val); - } else { - $out .= ''.$type.''; - } - break; - case 'array': - $out .= ''.$ref.'array'.$size; - break; - case 'object': - $out .= ''.$ref.$this->renderer->escape($field->classname).''.$size; - break; - case 'resource': - $out .= ''.$ref.'resource'; - break; - default: - $out .= ''.$ref.'unknown'; - break; - } - - if (\in_array('blacklist', $field->hints, true)) { - $out .= ' Blacklisted'; - } elseif (\in_array('recursion', $field->hints, true)) { - $out .= ' Recursion'; - } elseif (\in_array('depth_limit', $field->hints, true)) { - $out .= ' Depth Limit'; - } - - $out .= ''; - } - - $out .= ''; - } - - $out .= '
'; - if (null !== ($s = $field->getName())) { - $out .= $this->renderer->escape($s); - } - $out .= '
'; - if (null !== ($s = $row->getName())) { - $out .= $this->renderer->escape($s); - } - $out .= '
'; - - return $out; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/TimestampPlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/TimestampPlugin.php deleted file mode 100644 index 43abfb60..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/TimestampPlugin.php +++ /dev/null @@ -1,44 +0,0 @@ -contents)) { - return '
'.$dt->setTimeZone(new DateTimeZone('UTC'))->format('Y-m-d H:i:s T').'
'; - } - - return null; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/TraceFramePlugin.php b/vendor/kint-php/kint/src/Renderer/Rich/TraceFramePlugin.php deleted file mode 100644 index 147e2e31..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/TraceFramePlugin.php +++ /dev/null @@ -1,70 +0,0 @@ -trace['file']) && !empty($o->trace['line'])) { - $header = ''.$this->renderer->ideLink($o->trace['file'], (int) $o->trace['line']).' '; - } else { - $header = 'PHP internal call '; - } - - if ($o->trace['class']) { - $header .= $this->renderer->escape($o->trace['class'].$o->trace['type']); - } - - if (\is_string($o->trace['function'])) { - $function = $this->renderer->escape($o->trace['function'].'()'); - } else { - $function = $this->renderer->escape( - $o->trace['function']->getName().'('.$o->trace['function']->getParams().')' - ); - - if (null !== ($url = $o->trace['function']->getPhpDocUrl())) { - $function = ''.$function.''; - } - } - - $header .= ''.$function.''; - - $children = $this->renderer->renderChildren($o); - $header = $this->renderer->renderHeaderWrapper($o, (bool) \strlen($children), $header); - - return '
'.$header.$children.'
'; - } -} diff --git a/vendor/kint-php/kint/src/Renderer/Rich/ValuePluginInterface.php b/vendor/kint-php/kint/src/Renderer/Rich/ValuePluginInterface.php deleted file mode 100644 index 112a7f7d..00000000 --- a/vendor/kint-php/kint/src/Renderer/Rich/ValuePluginInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - Rich\ArrayLimitPlugin::class, - 'blacklist' => Rich\BlacklistPlugin::class, - 'callable' => Rich\CallablePlugin::class, - 'color' => Rich\ColorPlugin::class, - 'depth_limit' => Rich\DepthLimitPlugin::class, - 'recursion' => Rich\RecursionPlugin::class, - 'simplexml_element' => Rich\SimpleXMLElementPlugin::class, - 'trace_frame' => Rich\TraceFramePlugin::class, - ]; - - /** - * RichRenderer tab plugins should implement TabPluginInterface. - * - * @psalm-var PluginMap - */ - public static $tab_plugins = [ - 'binary' => Rich\BinaryPlugin::class, - 'color' => Rich\ColorPlugin::class, - 'method_definition' => Rich\MethodDefinitionPlugin::class, - 'microtime' => Rich\MicrotimePlugin::class, - 'source' => Rich\SourcePlugin::class, - 'table' => Rich\TablePlugin::class, - 'timestamp' => Rich\TimestampPlugin::class, - ]; - - public static $pre_render_sources = [ - 'script' => [ - [self::class, 'renderJs'], - [Rich\MicrotimePlugin::class, 'renderJs'], - ], - 'style' => [ - [self::class, 'renderCss'], - ], - 'raw' => [], - ]; - - /** - * Whether or not to render access paths. - * - * Access paths can become incredibly heavy with very deep and wide - * structures. Given mostly public variables it will typically make - * up one quarter of the output HTML size. - * - * If this is an unacceptably large amount and your browser is groaning - * under the weight of the access paths - your first order of buisiness - * should be to get a new browser. Failing that, use this to turn them off. - * - * @var bool - */ - public static $access_paths = true; - - /** - * The maximum length of a string before it is truncated. - * - * Falsey to disable - * - * @var int - */ - public static $strlen_max = 80; - - /** - * Path to the CSS file to load by default. - * - * @var string - */ - public static $theme = 'original.css'; - - /** - * Assume types and sizes don't need to be escaped. - * - * Turn this off if you use anything but ascii in your class names, - * but it'll cause a slowdown of around 10% - * - * @var bool - */ - public static $escape_types = false; - - /** - * Move all dumps to a folder at the bottom of the body. - * - * @var bool - */ - public static $folder = false; - - /** - * Sort mode for object properties. - * - * @var int - */ - public static $sort = self::SORT_NONE; - - /** - * Timestamp to print in footer in date() format. - * - * @var ?string - */ - public static $timestamp = null; - - public static $needs_pre_render = true; - public static $needs_folder_render = true; - - public static $always_pre_render = false; - - public static $js_nonce = null; - public static $css_nonce = null; - - protected $plugin_objs = []; - protected $expand = false; - protected $force_pre_render = false; - protected $use_folder = false; - - public function __construct() - { - $this->setUseFolder(self::$folder); - $this->setForcePreRender(self::$always_pre_render); - } - - public function setCallInfo(array $info): void - { - parent::setCallInfo($info); - - if (\in_array('!', $this->call_info['modifiers'], true)) { - $this->setExpand(true); - $this->setUseFolder(false); - } - - if (\in_array('@', $this->call_info['modifiers'], true)) { - $this->setForcePreRender(true); - } - } - - public function setStatics(array $statics): void - { - parent::setStatics($statics); - - if (!empty($statics['expanded'])) { - $this->setExpand(true); - } - - if (!empty($statics['return'])) { - $this->setForcePreRender(true); - } - } - - public function setExpand(bool $expand): void - { - $this->expand = $expand; - } - - public function getExpand(): bool - { - return $this->expand; - } - - public function setForcePreRender(bool $force_pre_render): void - { - $this->force_pre_render = $force_pre_render; - } - - public function getForcePreRender(): bool - { - return $this->force_pre_render; - } - - public function setUseFolder(bool $use_folder): void - { - $this->use_folder = $use_folder; - } - - public function getUseFolder(): bool - { - return $this->use_folder; - } - - public function shouldPreRender(): bool - { - return $this->getForcePreRender() || self::$needs_pre_render; - } - - public function shouldFolderRender(): bool - { - return $this->getUseFolder() && ($this->getForcePreRender() || self::$needs_folder_render); - } - - public function render(Value $o): string - { - if (($plugin = $this->getPlugin(self::$value_plugins, $o->hints)) && $plugin instanceof ValuePluginInterface) { - $output = $plugin->renderValue($o); - if (null !== $output && \strlen($output)) { - return $output; - } - } - - $children = $this->renderChildren($o); - $header = $this->renderHeaderWrapper($o, (bool) \strlen($children), $this->renderHeader($o)); - - return '
'.$header.$children.'
'; - } - - public function renderNothing(): string - { - return '
No argument
'; - } - - public function renderHeaderWrapper(Value $o, bool $has_children, string $contents): string - { - $out = 'getExpand()) { - $out .= ' kint-show'; - } - - $out .= '"'; - } - - $out .= '>'; - - if (self::$access_paths && $o->depth > 0 && ($ap = $o->getAccessPath())) { - $out .= ''; - } - - if ($has_children) { - $out .= ''; - - if (0 === $o->depth) { - $out .= ''; - $out .= ''; - } - - $out .= ''; - } - - $out .= $contents; - - if (!empty($ap)) { - $out .= '
'.$this->escape($ap).'
'; - } - - return $out.''; - } - - public function renderHeader(Value $o): string - { - $output = ''; - - if (null !== ($s = $o->getModifiers())) { - $output .= ''.$s.' '; - } - - if (null !== ($s = $o->getName())) { - $output .= ''.$this->escape($s).' '; - - if ($s = $o->getOperator()) { - $output .= $this->escape($s, 'ASCII').' '; - } - } - - if (null !== ($s = $o->getType())) { - if (self::$escape_types) { - $s = $this->escape($s); - } - - if ($o->reference) { - $s = '&'.$s; - } - - $output .= ''.$s.''; - - if ($o instanceof InstanceValue && isset($o->spl_object_id)) { - $output .= '#'.((int) $o->spl_object_id); - } - - $output .= ' '; - } - - if (null !== ($s = $o->getSize())) { - if (self::$escape_types) { - $s = $this->escape($s); - } - $output .= '('.$s.') '; - } - - if (null !== ($s = $o->getValueShort())) { - $s = \preg_replace('/\\s+/', ' ', $s); - - if (self::$strlen_max) { - $s = Utils::truncateString($s, self::$strlen_max); - } - - $output .= $this->escape($s); - } - - return \trim($output); - } - - public function renderChildren(Value $o): string - { - $contents = []; - $tabs = []; - - foreach ($o->getRepresentations() as $rep) { - $result = $this->renderTab($o, $rep); - if (\strlen($result)) { - $contents[] = $result; - $tabs[] = $rep; - } - } - - if (empty($tabs)) { - return ''; - } - - $output = '
'; - - if (1 === \count($tabs) && $tabs[0]->labelIsImplicit()) { - $output .= \reset($contents); - } else { - $output .= '
    '; - - foreach ($tabs as $i => $tab) { - if (0 === $i) { - $output .= '
  • '; - } else { - $output .= '
  • '; - } - - $output .= $this->escape($tab->getLabel()).'
  • '; - } - - $output .= '
    '; - - foreach ($contents as $i => $tab) { - if (0 === $i) { - $output .= '
  • '; - } else { - $output .= '
  • '; - } - - $output .= $tab.'
  • '; - } - - $output .= '
'; - } - - return $output.'
'; - } - - public function preRender(): string - { - $output = ''; - - if ($this->shouldPreRender()) { - foreach (self::$pre_render_sources as $type => $values) { - $contents = ''; - foreach ($values as $v) { - $contents .= \call_user_func($v, $this); - } - - if (!\strlen($contents)) { - continue; - } - - switch ($type) { - case 'script': - $output .= '