Payroll Module

This commit is contained in:
velz2020 2017-05-30 16:14:09 +05:30
parent 92e57c6c05
commit 87aaf0b457
15 changed files with 1931 additions and 283 deletions

View File

@ -69,6 +69,12 @@ $route['assetListing/(:num)'] = "assetdetails/assetListing/$1";
$route['employeeListing'] = 'employeedetails/employeeListing';
$route['employeeListing/(:num)'] = "employeedetails/employeeListing/$1";
$route['monthlyListings'] = 'monthlypay/monthlyListing';
$route['monthlyListings/(:num)'] = "monthlypay/monthlyListing/$1";
$route['emppayListings'] = 'emppaydate/emppayListing';
$route['emppayListings/(:num)'] = 'emppaydate/emppayListing/$1';
@ -143,7 +149,9 @@ $route['checkEmailExists'] = "user/checkEmailExists";
$route['forgotPassword'] = "login/forgotPassword";
$route['ExcelUpload'] = "payslip/viewUpload";
$route['ExcelUpload2'] = "payslip/viewUpload2";
$route['FileUpload'] = "payslip/uploadExcel";
$route['FileUpload2'] = "payslip/uploadExcel2";
$route['PrintPdf'] = "payslip/PrintPdf";
$route['ViewPay'] = "payslip/viewGenerator";

View File

@ -17,117 +17,242 @@ class emppaydate extends BaseController
public function __construct()
{
parent::__construct();
//$this->load->model('');
$this->load->model('emppaydate_model');
$this->load->library('session');
$this->load->library('form_validation');
$this->load->library('form_validation');
//$this->load->library('pagination');
$this->isLoggedIn();
}
/**
* This function used to load the first screen of the user
*/
public function index()
{
$this->global['pageTitle'] = 'Siddharth : Cost';
$this->global['pageTitle'] = 'Siddharth : Employee Pay Details';
$this->loadViews("emppaydate", $this->global);
$this->loadViews("emppayListing", $this->global);
}
/**
* This function is used to load the Cost list
* This function is used to load the payment list for a employee.
*/
/*function monthlypayListing()
function emppayListing()
{
$this->load->model('emppaydate_model');
$searchText = $this->input->post('searchText');
$data['searchText'] = $searchText;
$data['searchText'] = $searchText;
$this->load->library('pagination');
$count = $this->emppaydate_model->CostListingCount($searchText);
$count = $this->emppaydate_model->emppayListingCount($searchText);
$returns = $this->paginationCompress ( "monthlypayListing/", $count, 5 );
$returns = $this->paginationCompress ( "emppayListing", $count ,5);
$data['userRecords'] = $this->emppaydate_model->monthlypayListing($searchText, $returns["page"], $returns["segment"]);
//print_r( $data) ;
$this->global['pageTitle'] = 'Siddharth : montlypay List';
$data['userRecords'] = $this->emppaydate_model->emppayListing($searchText, $returns["page"], $returns["segment"]);
$this->loadViews("emppaydateListing", $this->global, $data, NULL);
$this->global['pageTitle'] = 'Siddharth : Employee Pay List';
$this->loadViews("emppayListing", $this->global, $data, NULL);
}
/**
* This function is used to load the add new cost Center */
* This function is used to load the add new payment for an employee.
*/
function addemppaydate()
{
$this->load->model('payroll_model');
$result['empdetails'] = $this->payroll_model->getEmpID();
//$data['emp_id'] = $this->monthlypay_model->getmonthlypay();
$this->global['pageTitle'] = 'siddharth : Add Monthly Pay';
$this->global['pageTitle'] = 'Siddharth : Add Employee Pay';
$this->loadViews("addemppaydate", $this->global);
$this->loadViews("addemppaydate", $this->global,$result);
}
/*
function addNewmonthly()
}
function addNewemppay()
{
$this->form_validation->set_rules('pay_data_id','Pay_Data_ID','trim|required');
$this->form_validation->set_rules('emp_id','emp_id','trim|required');
$this->form_validation->set_rules('basic_Pay','basic_Pay','trim|required');
$this->form_validation->set_rules('hra_rate','hra_rate','trim|required');
//$this->form_validation->set_rules('Pay_Data_ID','Pay_Data_ID','trim|required');
$this->form_validation->set_rules('EmpID','EmpID','trim|required');
$this->form_validation->set_rules('Basic_Pay','Basic_Pay','trim|required');
$this->form_validation->set_rules('HRA_Rate','HRA_Rate','trim|required');
$this->form_validation->set_rules('OT_Rate','OT_Rate','trim|required');
$this->form_validation->set_rules('allowances','allowances','trim|required');
$this->form_validation->set_rules('Allowances','Allowances','trim|required');
$this->form_validation->set_rules('PF_Rate','PF_Rate','trim|required');
$this->form_validation->set_rules('ESI_Rate','ESI_Rate','trim|required');
$this->form_validation->set_rules('All','All','trim|required');
$this->form_validation->set_rules('ESI_Rate','ESI_Rate','trim|required');
$this->form_validation->set_rules('Food_Allowances','Food_Allowances','trim|requried');
if($this->form_validation->run() == FALSE)
{
$this->addmonthly();
$this->addemppaydate();
}
else
{
$pay_data_id = $this->input->post('pay_data_id');
$emp_id = $this->input->post('emp_id');
$LOP_days = $this->input->post('basic_Pay');
$basic_Pay = $this->input->post('hra_rate');
$OT_Rate = $this->input->post('OT_Rate');
$allowances = $this->input->post('allowances');
$PF_Rate = $this->input->post('PF_Rate');
$ESI_Rate = $this->input->post('ESI_Rate');
$All = $this->input->post('All');
$Pay_Data_ID=$this->input->post('Pay_Data_ID');
$EmpID = $this->input->post('EmpID');
$Basic_Pay=$this->input->post('Basic_Pay');
$HRA_Rate=$this->input->post('HRA_Rate');
$OT_Rate=$this->input->post('OT_Rate');
$Allowances=$this->input->post('Allowances');
$PF_Rate=$this->input->post('PF_Rate');
$ESI_Rate=$this->input->post('ESI_Rate');
$Food_Allowances=$this->input->post('Food_Allowances');
//$All = $this->input->post('All');
$CreateBy = $this->session->userdata ( 'userId' );
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$emppayExists = $this->emppaydate_model->checkemppayExists( $emppay);
if(count($emppay) == 0)
{
$emppay = array('pay_data_id'=>$pay_data_id, 'emp_id'=>$emp_id,'basic_Pay'=>$basic_Pay,'hra_rate'=>$hra_rate,'OT_Rate'=>$OT_Rate,'allowances'=>$allowances,'PF_Rate'=>$PF_Rate,'ESI_Rate'=>$ESI_Rate,'All'=>$All,'CreatedBy'=>$CreateBy,'createdDate'=>$createddt);
$this->monthlypay_model->addNewcost($Cost);
}
Print_r('Successfully Created Monthly pay details');
$chked = $this->input->post('is_Active');
$IsActive = '1';
//$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
//$createddt = $dt->format('Y-m-d H:i:s');
// $emppayExists = $this->emppaydate_model->( $emppay);
$emppay = array();
$emppay = array('EmpID'=>$EmpID, 'Basic_Pay'=>$Basic_Pay, 'HRA_Rate'=>$HRA_Rate, 'OT_Rate'=>$OT_Rate, 'Allowances'=>$Allowances, 'PF_Rate'=>$PF_Rate, 'ESI_Rate'=>$ESI_Rate ,'Food_Allowances'=>$Food_Allowances,'is_Active'=>$IsActive,'Created_By'=>$CreateBy);
//print_r($monthdata);
$result = $this->emppaydate_model->addNewemppay($emppay);
if($result > 0)
{
// $this->session->set_flashdata('success', 'New Asset created successfully');
redirect('emppaydate/emppayListing','refresh');
echo "<script>alert('Employee Pay List Created successfully!');</script>";
}
else
{
redirect('emppaydate/emppayListing','refresh');
echo "<script>alert('Employee Pay List Not Created!');</script>";
}
}
}
/**
/**
* This function is used for editing purpose and it has oldest values only.
*/
function editOldemppay($paydataid= NULL)
{
$data['emppay'] = $this->emppaydate_model->getUserInfo($paydataid);
// print_r($data);
//$data['monthly_pay_inputs'] = $this->monthlylisting_model->getUserInfo($employeeid);
$this->global['pageTitle'] = 'Siddharth : Edit Employee Pay Monthly Details ';
$this->loadViews("editOldemppay", $this->global, $data,NULL);
}
/**
* This function is used for stored new values after editing.
*/
function editemppay()
{
$this->load->library('form_validation');
$Pay_Data_ID= $this->input->post('Pay_Data_ID');
$this->form_validation->set_rules('Pay_Data_ID','Pay_Data_ID','trim|required');
$this->form_validation->set_rules('EmpID','EmpID','trim|required');
$this->form_validation->set_rules('Basic_Pay','Basic_Pay','trim|required');
$this->form_validation->set_rules('HRA_Rate','HRA_Rate','trim|required');
$this->form_validation->set_rules('OT_Rate','OT_Rate','trim|required');
$this->form_validation->set_rules('Allowances','Allowances','trim|required');
$this->form_validation->set_rules('PF_Rate','PF_Rate','trim|required');
$this->form_validation->set_rules('ESI_Rate','ESI_Rate','trim|required');
$this->form_validation->set_rules('Food_Allowances','Food_Allowances','trim|requried');
if($this->form_validation->run() == FALSE)
{
$this->editOldemppay();
}
else
{
$Pay_Data_ID=$this->input->post('Pay_Data_ID');
$EmpID = $this->input->post('EmpID');
$Basic_Pay=$this->input->post('Basic_Pay');
$HRA_Rate=$this->input->post('HRA_Rate');
$OT_Rate=$this->input->post('OT_Rate');
$Allowances=$this->input->post('Allowances');
$PF_Rate=$this->input->post('PF_Rate');
$ESI_Rate=$this->input->post('ESI_Rate');
$is_Active=$this->input->post('is_Active');
$Last_Mod_By=$this->input->post('Last_Mod_By');
$Last_Mod_Time=$this->input->post('Last_Mod_Time');
$Food_Allowances=$this->input->post('Food_Allowances');
$chked = $this->input->post('is_Active');
if( $chked != '')
{
$IsActive = '1';
}
else
{
$IsActive = '0';
}
$emppaydatas = array();
$emppaydatas = array('Pay_Data_ID'=>$Pay_Data_ID, 'EmpID'=>$EmpID, 'Basic_Pay'=>$Basic_Pay, 'HRA_Rate'=>$HRA_Rate, 'OT_Rate'=>$OT_Rate, 'Allowances'=>$Allowances, 'PF_Rate'=>$PF_Rate, 'ESI_Rate'=>$ESI_Rate,'Food_Allowances'=>$Food_Allowances, 'Last_Mod_By'=>$Last_Mod_By, 'Last_Mod_Time'=>$Last_Mod_Time, 'is_Active'=>$IsActive);
$result = $this->emppaydate_model->editemppay($emppaydatas);
if($result == true)
{
$this->session->set_flashdata('success', 'updated successfully');
}
else
{
$this->session->set_flashdata('error', 'updation failed');
}
redirect('emppaydate/emppayListing');
}
}
/**
* This function is used load user edit information
* @param number $userId : Optional : This is user id
*/

View File

@ -14,74 +14,80 @@ class monthlypay extends BaseController
/**
* This is default constructor of the class
*/
public function __construct()
public function __construct()
{
parent::__construct();
//$this->load->model('monthlypay_model');
$this->load->library('session');
$this->load->library('form_validation');
// $this->load->library('pagination');
$this->load->model('monthlypay_model');
$this->load->library('session');
$this->load->library('form_validation');
// $this->load->library('pagination');
$this->isLoggedIn();
}
/**
/**
* This function used to load the first screen of the user
*/
public function index()
public function index()
{
$this->global['pageTitle'] = 'Siddharth : monthlypay';
$this->global['pageTitle'] = 'Siddharth : Monthly Pay Details';
$this->loadviews('addmonthly',$this->global);
$this->loadviews('monthlyListing',$this->global);
}
/**
* This function is used to load the Cost list
/**
* This function is used to load the monthly list
*/
/*function monthlypayListing()
function monthlyListing()
{
$this->load->model('monthlypay_model');
$searchText = $this->input->post('searchText');
$data['searchText'] = $searchText;
$data['searchText'] = $searchText;
$this->load->library('pagination');
$count = $this->monthlpay_model->CostListingCount($searchText);
$count = $this->monthlypay_model->monthlyListingCount($searchText);
$returns = $this->paginationCompress ( "monthlypayListing/", $count, 5 );
$returns = $this->paginationCompress ( "monthlyListing", $count ,5);
$data['userRecords'] = $this->monthlypay_model->monthlypayListing($searchText, $returns["page"], $returns["segment"]);
//print_r( $data) ;
$this->global['pageTitle'] = 'Siddharth : montlypay List';
$data['userRecords'] = $this->monthlypay_model->monthlyListing($searchText, $returns["page"], $returns["segment"]);
$this->loadViews("monthlypayListing", $this->global, $data, NULL);
}*/
/**
* This function is used to load the add new cost Center */
$this->global['pageTitle'] = 'Siddharth : Monthly Pay List';
$this->loadViews("monthlyListing", $this->global, $data, NULL);
}
/**
* This function is used to load the filtering monthly list
*/
/**
* This function is used to load the add new monthlypay
*/
function addmonthly()
{
//$data['emp_id'] = $this->monthlypay_model->getmonthlypay();
//$data['emp_id'] = $this->monthlypay_model->getmonthlypay();
$this->global['pageTitle'] = 'siddharth : Add Monthly Pay';
$this->loadviews('addmontly',$this->global, NULL);
$this->loadviews('addMontly',$this->global, NULL);
}
/*
}
function addNewmonthly()
{
$this->form_validation->set_rules('month_year','month_year','trim|required');
$this->form_validation->set_rules('emp_id','emp_id','trim|required');
$this->form_validation->set_rules('Month_Year','month_year','trim|required');
$this->form_validation->set_rules('EmpID','emp_id','trim|required');
$this->form_validation->set_rules('LOP_days','LOP_days','trim|required');
$this->form_validation->set_rules('OT_Hrs_Worked','OT_Hrs_Worked','trim|required');
$this->form_validation->set_rules('Loan_Recovered','Loan_Recovered','trim|required');
@ -105,154 +111,124 @@ class monthlypay extends BaseController
$Other_Deductions = $this->input->post('Other_Deductions');
$CreateBy = $this->session->userdata ( 'userId' );
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$monthlypayExists = $this->monthlypay_model->checkmonthlypayExists( $monthlypay);
if(count($CodeExists) == 0)
{
$montlypay = array('month_year'=>$month_year, 'emp_id'=>$emp_id,'LOP_days'=>$LOP_days,'OT_Hrs_Worked'=>$Loan_Recovered,'Loan_Balance'=>$Loan_Balance,'Incentives'=>$Incentives,'Other_Deductions'=>$Other_Deductions,'CreatedBy'=>$CreateBy,'createdDate'=>$createddt);
$this->monthlypay_model->addNewmonthly($monthlypay);
}
Print_r('Successfully Created Monthly pay details');
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s');
$monthlypayExists = $this->monthlypay_model->checkmonthlypayExists( $monthlypay);
if(count($CodeExists) == 0)
{
$montlypay = array('month_year'=>$month_year, 'emp_id'=>$emp_id,'LOP_days'=>$LOP_days,'OT_Hrs_Worked'=>$Loan_Recovered,'Loan_Balance'=>$Loan_Balance,'Incentives'=>$Incentives,'Other_Deductions'=>$Other_Deductions,'CreatedBy'=>$CreateBy,'createdDate'=>$createddt);
$this->monthlypay_model->addNewmonthly($monthlypay);
}
Print_r('Successfully Created Monthly pay details');
}
}
/**
* This function is used load user edit information
* @param number $userId : Optional : This is user id
/**
* This function is used for editing purpose and it has oldest values.
*/
/*function editOldcost($CostCode = NULL)
function editOldmonthly($EmpID='',$month_year='')
{
if($CostCode == '')
{
$CostCenterID = $_GET['CostCode'];
}
else
{
$CostCenterID = $CostCode; }
/*if($employeeid == null)
{
redirect('monthlypay/monthlyListing');
}*/
$data['CostMaster'] = $this->costcenter_model->GetCostCenterMaster($CostCenterID);
$data['CostDepts'] = $this->costcenter_model->GetCostCenterDepartment($CostCenterID);
$data['CostBudget'] = $this->costcenter_model->GetCostCenterBudget($CostCenterID);
// $data['DeptList'] = $this->costcenter_model->GetDepartmentNotinCostCenter($CostCenterID);
$this->global['pageTitle'] = 'Siddharth : Edit Cost';
$data['monthly'] = $this->monthlypay_model->getUserInfo($EmpID,$month_year);
//$data['monthly_pay_inputs'] = $this->monthlylisting_model->getUserInfo($employeeid);
$this->global['pageTitle'] = 'Siddharth : Edit Monthly Listing';
$this->loadViews("editOldcost", $this->global, $data,NULL);
$this->loadViews("editOldmonthly", $this->global, $data,NULL);
}
function ech()
{
echo $this->input->post('CostCentreID');
echo $this->input->post('CostName');
echo $this->input->post('Description');
}
/**
* This function is used to edit the user information
function editcost()
/**
* This function is used for stored new values after editing.
*/
function editmonthly()
{
$this->load->library('form_validation');
$CostCenterID = $this->input->post('CostCentreID');
$this->form_validation->set_rules('CostName','Cost Name','trim|required|');
$this->form_validation->set_rules('Description','Description','trim|required|');
$EmpID= $this->input->post('EmpID');
$month_year = $this->input->post('Month_Year');
$this->form_validation->set_rules('Month_Year','month_year','trim|required');
$this->form_validation->set_rules('EmpID','EmpID','trim|required');
$this->form_validation->set_rules('LOP_Days','LOP_Days','trim|required');
$this->form_validation->set_rules('OT_Hrs_Worked','OT_Hrs_Worked','trim|required');
$this->form_validation->set_rules('Loan_Recovered','Loan_Recovered','trim|required');
$this->form_validation->set_rules('Loan_Balance','Loan_Balance','trim|required');
$this->form_validation->set_rules('Incentives','Incentives','trim|required');
$this->form_validation->set_rules('Other_Deductions','Other_Deductions','trim|required');
if($this->form_validation->run() == FALSE)
{
$this->editcost($CostCenterID);
$this->editOldmonthly($EmpID,$month_year);
}
else
{
$CostCenterID = $this->input->post('CostCentreID');
$CostName = ucwords(strtolower($this->input->post('CostName')));
$Description = $this->input->post('Description');
//$this->costcenter_model->editcost($Cost);
$cost = array();
$month_year = $this->input->post('Month_Year');
$EmpID = $this->input->post('EmpID');
$LOP_Days =$this->input->post('LOP_Days');
$OT_Hrs_Worked = $this->input->post('OT_Hrs_Worked');
$Loan_Recovered = $this->input->post('Loan_Recovered');
$Loan_Balance = $this->input->post('Loan_Balance');
$Incentives = $this->input->post('Incentives');
$Other_Deductions = $this->input->post('Other_Deductions');
$LastModBy = $this->session->userdata ( 'userId' );
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$LastModTime = $dt->format('Y-m-d H:i:s');
$Cost = array('CostCentreID'=>$CostCenterID,'CostName'=>$CostName, 'Description'=>$Description,'createdDate'=>date('Y-m-d H:i:sa'));
$result = $this->costcenter_model->editcost($Cost, $CostCenterID);
$monthdata = array();
$monthdata = array('Month_Year'=>$month_year,'EmpID'=>$EmpID,'LOP_Days'=>$LOP_Days,'OT_Hrs_Worked'=>$OT_Hrs_Worked,'Loan_Recovered'=>$Loan_Recovered,'Loan_Balance'=>$Loan_Balance,'Incentives'=>$Incentives,'Other_Deductions'=>$Other_Deductions,'Last_Mod_By'=>$LastModBy,'Last_Mod_Time'=>$LastModTime);
$result = $this->monthlypay_model->editmonth($monthdata,$EmpID);
if($result == true)
{
$this->session->set_flashdata('success', 'Cost updated successfully');
$this->session->set_flashdata('success', 'updated successfully');
}
else
{
$this->session->set_flashdata('error', 'Cost updation failed');
$this->session->set_flashdata('error', 'updation failed');
}
redirect('costListing');
}
//echo success;
redirect('monthlyListings');
}
}
function viewcost($CostCenterID = NULL)
{
if($CostCenterID == null)
{
redirect('costListing');
}
$data['Cost'] = $this->costcenter_model->getuserinfo($CostCenterID);
//$data['users'] = $this->purchaseorder_model->getusers();
$this->global['pageTitle'] = 'Siddharth : View Cost';
$this->loadViews("viewcost", $this->global, $data,NULL);
}
/**
* This function is used to delete the user using userId
* @return boolean $result : TRUE / FALSE
function deletecost()
{
if($this->isAdmin() == TRUE)
{
echo(json_encode(array('status'=>'access')));
}
else
{
$CostCenterID = $this->input->Costst('CostCentreID');
$cost = array('CreateDate'=>date('Y-m-d H:i:sa'));
$result = $this->costcenter_model->deletecost($Cost, $CostCenterID);
if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }
else { echo(json_encode(array('status'=>FALSE))); }
}
}
*/
function pageNotFound()
{

View File

@ -21,6 +21,21 @@ class payslip extends BaseController
$this->load->library('form_validation');
$this->isLoggedIn();
}
/**
* This function used to call stored procedure named with final_payroll_data()
*/
public function callsp(){
$payon = $this->input->post('payon');
$employee = $this->input->post('employee');
$result = $this->payroll_model->model_sp($payon,$employee);
return TRUE;
//$this->db->call_function('model_sp');
}
/**
* This function used to load the first screen of the user
*/
@ -32,6 +47,18 @@ class payslip extends BaseController
$this->loadViews("payslipupload", $this->global, null , NULL);
}
/**
* This function used to load the first screen of the user
*/
public function viewUpload2()
{
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2';
$this->loadViews("payslipupload2", $this->global, null , NULL);
}
/**
* This function used to load the first screen of the user
@ -40,7 +67,7 @@ class payslip extends BaseController
{
//echo 'inside funtion';
$Data['Payon'] = $this->payroll_model->getPayOn();
$Data['Emplist'] = $this->payroll_model->getEmployeelist();
//$Data['Emplist'] = $this->payroll_model->getEmployeelist();
$this->global['pageTitle'] = 'Siddharth : Payroll Generater';
@ -66,15 +93,18 @@ class payslip extends BaseController
function getEmployee()
{
$id = $this->input->post('id');
$id = $this->input->post('id1');
$result = $this->payroll_model->getEmployeelist($id );
$result = $this->payroll_model->getEmployeelist2($id );
$HTML="";
if($result->num_rows() > 0){
foreach($result->result() as $list){
$HTML.="<option value='".$list->EmpId."'>".$list->EmpId."-".$list->Fname."</option>";
$HTML.="<option value='".$list->EmpId."'>".$list->EmpId."-".$list->Fname."</option>";
}
}
echo $HTML;
@ -325,6 +355,190 @@ function getEmployee()
}
}
/**
* This function used to upload the Excel file Details2
*/
function uploadExcel2(){
$PayrollFileName = '';
//Check whether user upload picture
if(!empty($_FILES['userfile']['name']))
{
//echo 'inside if';
$pathinfo = pathinfo($_FILES['userfile']['name']);
$config['upload_path'] = 'uploads/files/';
$config['allowed_types'] = 'xls|xlsx|csv';
$config['file_name'] = $_FILES['userfile']['name'];
$config['overwrite'] = true;
//Load upload library and initialize configuration
$this->load->library('upload',$config);
$this->upload->initialize($config);
if (($pathinfo['extension'] == 'xlsx' || $pathinfo['extension'] == 'xls')
&& $_FILES['userfile']['size'] > 0 )
{
if($this->upload->do_upload('userfile'))
{
$uploadData = $this->upload->data();
$PayrollFileName = $uploadData['file_name'];
}
else
{
$error = array('error' => $this->upload->display_errors());
$PayrollFileName = '';
}
$inputFileName = $_FILES['userfile']['tmp_name'];
require_once APPPATH .'third_party/PHPExcel/IOFactory.php';
$objTpl = PHPExcel_IOFactory::load($inputFileName);
$sheet = $objTpl->getActiveSheet(0) ;//->toArray(null, NULL, True, True);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();
$x = 8;
$month=$this->input->post('mon');
$year=$this->input->post('yr');
$PayOn= $month . "-" . $year;
$createdby = $this->session->userdata ( 'userId' );
if($month=='01' || $month=='03' || $month=='05' || $month=='07' || $month=='08' || $month=='10' || $month=='12')
{
$Totaldays = 31;
}
else if($month=='04' || $month=='06' || $month=='09' || $month=='11'){
$Totaldays = 30;
}
else{
$Totaldays = 28;
}
// $Totaldays = 0;
//echo $highestRow;
$FileDetails = array('PayOn'=>$PayOn,'TotalNoofDays'=>$Totaldays,'FileName'=> $config['file_name'],'CreatedBy'=>$createdby);
$result = $this->payroll_model->UploadFileName($FileDetails);
$fail=0;
$success=0;
for($x=8;$x<=$highestRow;$x++){
$EmpId = $sheet->getCell('A'.$x)->getValue();
//echo $EmpId;
$FileDataExists = $this->payroll_model->checkFileDetailsExists2($PayOn,$EmpId);
//echo $FileExists;
//die();
//echo $FileDataExists;
//die();
if ($FileDataExists=='' || $FileDataExists==0)
{
//$FileDetails = array('PayOn'=>$PayOn,'TotalNoofDays'=>$Totaldays,'FileName'=>$PayrollFileName,'CreatedBy'=>$createdby);
// $result = $this->payroll_model->UploadFileName($FileDetails);
//for($x=8; $x <= $highestRow; $x++)
//{
$EmpId = $sheet->getCell('A'.$x)->getValue();
$LOPDays = $sheet->getCell('B'.$x)->getValue();
$OTHoursWorked =$sheet->getCell('C'.$x)->getValue();
$loanRecovered=$sheet->getCell('D'.$x)->getValue();
$loanBalance=$sheet->getCell('E'.$x)->getValue();
$Incentive =$sheet->getCell('F'.$x)->getValue();
$Other_Deductions =$sheet->getCell('G'.$x)->getValue();
if( $EmpId != '')
{
$FileData = array('Month_Year'=>$PayOn,'EmpID'=>$EmpId,'LOP_Days'=>$LOPDays,'OT_Hrs_Worked'=>$OTHoursWorked,'Loan_Recovered'=>$loanRecovered,'Loan_Balance'=>$loanBalance,'Incentives'=>$Incentive,'Other_Deductions'=>$Other_Deductions,'Created_By'=>$createdby,'Created_Time'=>date("Y-m-d h:i:sa"));
$result = $this->payroll_model->UploadFileData2($FileData);
$success++;
}
// $data['Success'] = "<script>alert('File Uploaded Successfully!');</script>";
// $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
// $this->loadViews("payslipupload2", $this->global, $data , NULL);
}
else{
$fail++;
// $data['Fail'] = "<script>alert('Duplicate Data Found!');</script>";
// $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
// $this->loadViews("payslipupload2", $this->global, $data , NULL);
}
} //End of For Loop
// echo $success;
//echo $fail;
//$data['success'] = "<script>alert($fail + 'Duplicate Data Found!');</script>";
echo "<script> alert($success +' Data Uploaded sucessfully and ' + $fail + ' Duplicate Data Found'); </script>";
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
$this->loadViews("payslipupload2", $this->global , NULL);
//redirect('monthlyListings');
} else
{
$data['Fail'] = "<script>alert('Please select valid Excel file to Upload!');</script>";
//echo "<script>alert('Please select valid Excel file to Upload!');</script>";
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2';
//$this->loadViews("payslipupload2", $this->global, $data , NULL);
}
}
else
{
$data['Fail'] = "<script>alert('Please select Excel file to Upload!');</script>";
//echo "<script>alert('Please select Excel file to Upload!');</script>";
$PayrollFileName = '';
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2';
$this->loadViews("payslipupload2", $this->global, NULL , NULL);
}
}
function updatepayroll()
{

View File

@ -0,0 +1,125 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class emppaydate_model extends CI_Model
{
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
* @return number $count : This is row count
*/
function emppayListingCount($searchText = ''){
$this->db->select('*');
$this->db->from('T_Emp_Pay_Data');
if(!empty($searchText)) {
$likeCriteria = "(Pay_Data_ID LIKE '%".$searchText."%'
OR EmpID LIKE '%".$searchText."%'
OR Basic_Pay LIKE '%".$searchText."%'
OR HRA_Rate LIKE '%".$searchText."%'
OR OT_Rate LIKE '%".$searchText."%'
OR Allowances LIKE '%".$searchText."%'
OR PF_Rate LIKE '%".$searchText."%'
OR ESI_Rate LIKE '%".$searchText."%'
OR is_Active LIKE '%".$searchText."%'
OR Food_Allowances LIKE '%".$searchText."%'
)";
$this->db->where($likeCriteria);
}
//$this->db->where('BaseT.userId !=', 1);
$query = $this->db->get();
return count($query->result());
}
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
* @param number $page : This is pagination offset
* @param number $segment : This is pagination limit
* @return array $result : This is result
*/
function emppayListing($searchText = '', $page, $segment)
{
$this->db->select('*');
$this->db->from('T_Emp_Pay_Data');
if(!empty($searchText)) {
$likeCriteria = "(Pay_Data_ID LIKE '%".$searchText."%'
OR EmpID LIKE '%".$searchText."%'
OR Basic_Pay LIKE '%".$searchText."%'
OR HRA_Rate LIKE '%".$searchText."%'
OR OT_Rate LIKE '%".$searchText."%'
OR Allowances LIKE '%".$searchText."%'
OR PF_Rate LIKE '%".$searchText."%'
OR ESI_Rate LIKE '%".$searchText."%'
OR is_Active LIKE '%".$searchText."%'
OR Food_Allowances LIKE '%".$searchText."%'
)";
$this->db->where($likeCriteria);
}
$this->db->limit($page, $segment);
$query = $this->db->get();
$result = $query->result();
return $result;
}
function addNewemppay($emppay)
{
$this->db->trans_start();
$this->db->insert('T_Emp_Pay_Data', $emppay);
$paydataid = $this->db->insert_id();
$this->db->trans_complete();
return $emppay;
}
function getUserInfo($paydataid)
{
$this->db->select();
$this->db->from('T_Emp_Pay_Data');
//$this->db->where('isDeleted', 0);
//$this->db->where('roleId !=', 1);
$this->db->where('Pay_Data_ID', $paydataid);
$query = $this->db->get();
return $query->result();
}
function editemppay($emppaydatas)
{
$paydateid=$emppaydatas['Pay_Data_ID'];
$this->db->where('Pay_Data_ID' ,$paydateid);
$this->db->update('T_Emp_Pay_Data',$emppaydatas);
return TRUE;
}
function viewemppay($emppaydata, $paydateid)
{
$this->db->where('Pay_Data_ID', $paydateid);
$this->db->update('T_Emp_Pay_Data', $emppaydata);
return TRUE;
}
}
?>

View File

@ -0,0 +1,123 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class monthlypay_model extends CI_Model
{
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
* @return number $count : This is row count
*/
function monthlyListingCount($searchText = ''){
$this->db->select('*');
$this->db->from('T_Monthly_Pay_Inputs');
if(!empty($searchText)) {
$likeCriteria = "(Month_Year LIKE '%".$searchText."%'
OR EmpID LIKE '%".$searchText."%'
OR LOP_Days LIKE '%".$searchText."%'
OR OT_Hrs_Worked LIKE '%".$searchText."%'
OR Loan_Recovered LIKE '%".$searchText."%'
OR Loan_Balance LIKE '%".$searchText."%'
OR Incentives LIKE '%".$searchText."%'
OR Other_Deductions LIKE '%".$searchText."%'
)";
$this->db->where($likeCriteria);
}
//$this->db->where('BaseT.userId !=', 1);
$query = $this->db->get();
return count($query->result());
}
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
* @param number $page : This is pagination offset
* @param number $segment : This is pagination limit
* @return array $result : This is result
*/
function monthlyListing($searchText = '', $page, $segment)
{
$this->db->select('*');
$this->db->from('T_Monthly_Pay_Inputs');
$this->db->order_by("Month_Year", "desc");
if(!empty($searchText)) {
$likeCriteria = "(Month_Year LIKE '%".$searchText."%'
OR EmpID LIKE '%".$searchText."%'
OR LOP_Days LIKE '%".$searchText."%'
OR OT_Hrs_Worked LIKE '%".$searchText."%'
OR Loan_Recovered LIKE '%".$searchText."%'
OR Loan_Balance LIKE '%".$searchText."%'
OR Incentives LIKE '%".$searchText."%'
OR Other_Deductions LIKE '%".$searchText."%'
)";
$this->db->where($likeCriteria);
}
$this->db->limit($page, $segment);
$query = $this->db->get();
$result = $query->result();
return $result;
}
function addNewmonthlisting($m_list)
{
$this->db->trans_start();
$this->db->insert('T_Monthly_Pay_Inputs', $asset);
$Asset_Code = $this->db->insert_id();
$this->db->trans_complete();
return $m_list;
}
function getUserInfo($EmpID,$month_year)
{
$this->db->select('Month_Year, EmpID, LOP_Days, OT_Hrs_Worked, Loan_Recovered, Loan_Balance, Incentives, Other_Deductions, Created_By, Created_Time, Last_Mod_By, Last_Mod_Time');
$this->db->from('T_Monthly_Pay_Inputs');
//$this->db->where('isDeleted', 0);
//$this->db->where('roleId !=', 1);
$this->db->where('EmpID', $EmpID);
$this->db->where('Month_Year', $month_year);
$query = $this->db->get();
return $query->result();
}
function editmonth($monthdata, $EmpID)
{
$monthyear=$monthdata['Month_Year'];
//$this->db->where('EmpID',$employeeid);
$this->db->where('EmpID' ,$EmpID);
//$this->db->where('Month_Year' ,$EmpID);
$this->db->where('Month_Year',$monthyear);
$this->db->update('T_Monthly_Pay_Inputs',$monthdata);
return TRUE;
}
function viewmonth($monthdata, $employeeid)
{
$this->db->order_by('Month_Year');
$this->db->where('EmpID', $employeeid);
$this->db->update('T_Monthly_Pay_Inputs', $monthdata);
return TRUE;
}
}
?>

View File

@ -15,6 +15,19 @@ class Payroll_model extends CI_Model
$Payon = $this->db->affected_rows();
return $Payon;
}
function model_sp($payon,$employee){
//echo "<script>alert('mod');</script>";
//echo "highlight_file(filename)";
//die();
$this->db->query("call final_payroll_data('".$payon."','".$employee."')") or die(mysql_error());
//$result->next_result()
return TRUE;
}
/**
* This function is used to update the File details in which is already exists in the database
@ -46,6 +59,29 @@ class Payroll_model extends CI_Model
return $query->result();
}
}
function checkFileDetailsExists2($PayOn,$EmpId)
{
//echo $EmpId;
//die();
$this->db->select('Month_Year','EmpID');
$this->db->from('T_Monthly_Pay_Inputs');
$this->db->where('EmpID',$EmpId);
$this->db->where('Month_Year',$PayOn);
$query = $this->db->get();
// print_r($this->db->last_query());
if ($query->num_rows > 0) {
//echo "success";
//return $query->result();
return TRUE;
}
else{
//echo "fail";
return FALSE;
}
}
/**
* This function is used to insert the File data in database
* @FileDetails array : This will have the set of value which we need to insert into database
@ -59,6 +95,15 @@ class Payroll_model extends CI_Model
//print_r($this->db->last_query());
return $Payon;
}
function UploadFileData2($FileData)
{
$this->db->insert('T_Monthly_Pay_Inputs', $FileData);
$Payon = $this->db->affected_rows();
//print_r($this->db->last_query());
return $Payon;
}
/**
* This function is used to update the File details in which is already exists in the database
@ -107,7 +152,7 @@ class Payroll_model extends CI_Model
*/
function getPayOn()
{
$this->db->select('PayOn');
$this->db->select('DISTINCT(PayOn)');
$this->db->from('T_Payroll_File');
$query = $this->db->get();
return $query->result();
@ -131,6 +176,22 @@ class Payroll_model extends CI_Model
$query = $this->db->get();
return $query;
}
function getEmployeelist2($Payon ='')
{
$this->db->select('Pay.EmpID as EmpId,Emp.FirstName as Fname,Emp.LastName as Lname');
$this->db->from('T_Monthly_Pay_Inputs Pay');
$this->db->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID');
if($Payon != '')
{
$this->db->where('Pay.Month_Year', $Payon);
}
$this->db->order_by("Pay.EmpID", "asc");
$query = $this->db->get();
return $query;
}
/* *//**
* This function is used to get the PayOn details from T_Payroll_File
@ -163,5 +224,13 @@ class Payroll_model extends CI_Model
$this->db->delete('T_Payroll');
}
function getEmpID()
{
$this->db->select('EmpID,FirstName,LastName');
$this->db->from('T_Employee_Details');
$query = $this->db->get();
return $query->result();
}
}
?>

View File

@ -2,72 +2,83 @@
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Employee Salary Details</center>
<center>Employee Salary Payment Details</center>
</h1>
</section>
<section class="content">
<div style="text-align:right;">
<a href="<?php echo base_url() ?>" class="btn btn-info" value="Back">Back</a>
<a href="<?php base_url() ?>emppayListings" class="btn btn-info" value="Back"/>Back</a>
</div>
<br>
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- general form elements -->
<div class="box box-primary">
<!-- form start -->
<!-- form start -->
<form role="form" id="addemppaydate" action="<?php echo base_url() ?>emppaydate/addNewemppay" method="post" >
<div class="box-body">
<div class="row">
<div class="col-md-4">
<div class="row">
<!--<div class="col-md-4">
<div class="form-group">
<label for="Pay_Data_ID">Pay Data ID:</label><font color="Red">*</font>
<div class="form-group">
<?php
$data = array('name' => 'pay_data_id','value' => set_value('pay_data_id'), 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;');
$data = array('name' => 'Pay_Data_ID','value' => set_value('Pay_Data_ID'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;');
echo form_input($data);
?>
</div>
</div>
</div>
</div>-->
<div class="col-md-4">
<div class="form-group">
<label for="EmpID">EmpID</label><font color="Red">*</font>
<label for="EmpID">Employee ID:</label><font color="Red">*</font>
<div class="form-group">
<?php
$Employee = array("-1"=>'Select Employee');
echo form_dropdown('empID', $Employee,set_value('empID'),'id="empID"' ,'class="form-control"');
<?php
$Employee = array("-1"=>'Select Employee');
?>
</div>
if(!empty($empdetails)){
foreach($empdetails as $emp){
$empID=$emp->EmpID;
$Employee+= array($empID => $emp->EmpID . "-" . $emp->FirstName . "-" . $emp->LastName);
// $Employee = array_merge($Employee,$Employee1);
}
}
echo form_dropdown('EmpID', $Employee,set_value('EmpID'),'id="empID"' ,'class="form-control"');
?>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="Basic_Pay">Basic Pay</label><font color="Red">*</font>
<label for="Basic_Pay">Basic Pay:</label><font color="Red">*</font>
<div class="form-group">
<?php
$data = array('name' => 'basic_Pay','value' => set_value('basic_pay'), 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;');
$data = array('name' => 'Basic_Pay','value' => set_value('Basic_Pay'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
@ -75,20 +86,21 @@ echo form_dropdown('empID', $Employee,set_value('empID'),'id="empID"' ,'class="f
<div class="form-group">
<?php
$data = array('name' => 'hra_rate','value' => set_value('hra_rate'), 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;');
$data = array('name' => 'HRA_Rate','value' => set_value('HRA_Rate'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;');
echo form_input($data);
?>
</div>
</div>
</div>
</div><!--row completed div-->
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="OT_Rate">OT Rate:</label><font color="Red">*</font>
<div class="form-group">
<?php
$data = array('name' => 'OT_Rate','value' => set_value('OT_Rate'), 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;');
$data = array('name' => 'OT_Rate','value' => set_value('OT_Rate'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;');
echo form_input($data);
?>
</div>
@ -99,15 +111,15 @@ echo form_dropdown('empID', $Employee,set_value('empID'),'id="empID"' ,'class="f
<label for="Allowances">Allowances:</label><font color="Red">*</font>
<div class="form-group">
<?php
$data = array('name' => 'allowances','value' => set_value('allowances'), 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;');
$data = array('name' => 'Allowances','value' => set_value('Allowances'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
@ -115,46 +127,86 @@ echo form_dropdown('empID', $Employee,set_value('empID'),'id="empID"' ,'class="f
<div class="form-group">
<?php
$data = array('name' => 'PF_Rate','value' => set_value('PF_Rate'), 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;');
$data = array('name' => 'PF_Rate','value' => set_value('PF_Rate'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;');
echo form_input($data);
?>
</div>
</div>
</div>
</div><!--row completed div-->
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="ESI_Rate">ESI Rate</label><font color="Red">*</font>
<label for="ESI_Rate">ESI Rate:</label><font color="Red">*</font>
<div class="form-group">
<?php
$data = array('name' => 'ESI_Rate','value' => set_value('ESI_Rate'), 'class' => 'form-control' ,'required' => 'true','style'=>'text-transform:uppercase;');
$data = array('name' => 'ESI_Rate','value' => set_value('ESI_Rate'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="col-md-2">
<!--for food allowances-->
<div class="col-md-4">
<div class="form-group">
<input type="checkbox" name="All"> Select All<br>
<label for="Food_Allowances">Food Allowances:</label>
<div class="form-group">
<?php
$data = array('name' => 'Food_Allowances','value' => set_value('Food_Allowances'), 'class' => 'form-control');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div id="content">
<div class="box-footer" style="text-align:right">
</div><!--row completed div-->
<div class="box-footer" style="text-align:right">
<input type="submit" class="btn btn-info" value="Submit" />
<input type="reset" class="btn btn-info" value="Cancel" />
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<input type="reset" class="btn btn-info" value="Reset" />
</div>
</div><!-- /.box-body -->
</form><!-- form closed -->
</div><!-- -->
</div><!-- -->
<div class="col-md-4">
<?php
$this->load->helper('form');
$error = $this->session->flashdata('error');
if($error)
{
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php } ?>
<?php
$success = $this->session->flashdata('success');
if($success)
{
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('success'); ?>
</div>
<?php } ?>
<div class="row">
<div class="col-md-12">
<?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
</div>
</div>
</div>
</div> <!-- first row closed-->
</section>
</div><!--content-wrapper closed-->
<script src="<?php echo base_url(); ?>assets/js/addUser.js" type="text/javascript"></script>

View File

@ -0,0 +1,298 @@
<?php
$Pay_Data_ID='';
$EmpID='';
$Basic_Pay='';
$HRA_Rate='';
$OT_Rate='';
$Allowances='';
$PF_Rate='';
$ESI_Rate='';
$is_Active='';
$Food_Allowances='';
$Created_By='';
$Created_Time='';
$Last_Mod_By='';
$Last_Mod_Time='';
if(!empty($emppay))
{
foreach ($emppay as $ep)
{
$Pay_Data_ID=$ep->Pay_Data_ID;
$EmpID=$ep->EmpID;
$Basic_Pay=$ep->Basic_Pay;
$HRA_Rate=$ep->HRA_Rate;
$OT_Rate=$ep->OT_Rate;
$Allowances=$ep->Allowances;
$PF_Rate=$ep->PF_Rate;
$ESI_Rate=$ep->ESI_Rate;
$is_Active=$ep->is_Active;
$Food_Allowances=$ep->Food_Allowances;
$Created_By=$ep->Created_By;
$Created_Time=$ep->Created_Time;
$Last_Mod_By=$ep->Last_Mod_By;
$Last_Mod_Time=$ep->Last_Mod_Time;
}
}
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<!--title-->
<center>Edit Salary Payment Details</center>
</h1>
</section>
<section class="content">
<div style="text-align:right;">
<a href="<?php echo base_url() ?>emppayListings" class="btn btn-info" value="Back">Back</a>
</div>
<br/>
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- general form elements -->
<div class="box box-primary">
<!-- form start-->
<form role="form" id="edit" action="<?php echo base_url() ?>emppaydate/editemppay" method="post">
<div class="box-body">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="Pay_Data_ID">Pay Data ID</span>
<input type="text" class="form-control" readonly id="Pay_Data_ID" name="Pay_Data_ID" value="<?php echo $Pay_Data_ID; ?>">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="EmpID">Employee ID:</span>
<input type="text" class="form-control" readonly id="EmployeeID" name="EmpID" value="<?php echo $EmpID; ?>">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Basic Pay:</span>
<input type="text" class="form-control requried" id="Basic_Pay" name="Basic_Pay" value="<?php echo $Basic_Pay; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="HRA_Rate">HRA_Rate:</span>
<input type="text" class="form-control required" id="HRA_Rate" name="HRA_Rate" value="<?php echo $HRA_Rate; ?>">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="OT_Rate">OT_Rate:</span>
<input type="text" class="form-control required" id="OT_Rate" name="OT_Rate" value="<?php echo $OT_Rate; ?>">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="Allowances">Allowances:</span>
<input type="text" class="form-control required" id="Allowances" name="Allowances" value="<?php echo $Allowances; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="PF_Rate">PF_Rate:</span>
<input type="text" class="form-control required" id="PF_Rate" name="PF_Rate" value="<?php echo $PF_Rate; ?>">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="ESI_Rate">ESI_Rate:</span>
<input type="text" class="form-control required" id="ESI_Rate" name="ESI_Rate" value="<?php echo $ESI_Rate; ?>">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for ="Food_Allowances">Food Allowances:</span>
<input type="text" class="form-control" id="Food_Allowances" name="Food_Allowances" value="<?php echo $Food_Allowances; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<!--<span for ="CreatedBy">Created By:</span>-->
<input type="hidden" class="form-control required" id="CreatedBy" name="CreatedBy" value="<?php echo $Created_By; ?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<!--<span for ="Created_Time">Created Time:</span>-->
<input type="hidden" class="form-control required" id="Created_Time" name="Created_Time" value="<?php echo $Created_Time; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<!--<span for ="Last_Mod_By">Last Modified By:</span>-->
<input type="hidden" class="form-control required" id="LastModifiedBy" name="LastModifiedBy" value="<?php echo $name; ?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<!--<span for ="Last_Mod_Time">Last Modified Time:</span>-->
<input type="hidden" class="form-control required" id="Last Modified Time" name="Last Modified Time" value="<?php echo $Last_Mod_Time; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="offset col-md-7">
<div class="form-group">
<input type="checkbox" name="is_Active" />Active state<br>
</div>
</div>
</div>
</div><!--row completed div-->
<div id="content">
<div class="box-footer" style="text-align:right">
<input type="submit" class="btn btn-info" value="Submit"/>
<input type="reset" class="btn btn-info" value="Reset" />
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</section>
</div>
<div class="col-md-4">
<?php
$this->load->helper('form');
$error = $this->session->flashdata('error');
if($error)
{
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php } ?>
<?php
$success = $this->session->flashdata('success');
if($success)
{
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('success'); ?>
</div>
<?php } ?>
<div class="row">
<div class="col-md-12">
<?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
</div>
</div>
</div>
</section>
</div>
<script src="<?php echo base_url(); ?>assets/js/editUser.js" type="text/javascript"></script>

View File

@ -0,0 +1,259 @@
<?php
$Month_Year='';
$EmpID='';
$LOP_Days='';
$OT_Hrs_Worked='';
$Loan_Recovered='';
$Loan_Balance='';
$Incentives='';
$Other_Deductions='';
$Created_By='';
$Created_Time='';
$Last_Mod_By='';
$Last_Mod_Time='';
if(!empty($monthly))
{
foreach ($monthly as $mpi)
{
$Month_Year=$mpi->Month_Year;
$EmpID= $mpi->EmpID;
$LOP_Days=$mpi->LOP_Days;
$OT_Hrs_Worked=$mpi->OT_Hrs_Worked;
$Loan_Recovered=$mpi->Loan_Recovered;
$Loan_Balance=$mpi->Loan_Balance;
$Incentives=$mpi->Incentives;
$Other_Deductions=$mpi->Other_Deductions;
$Created_By=$mpi->Created_By;
$Created_Time=$mpi->Created_Time;
$Last_Mod_By=$mpi->Last_Mod_By;
$Last_Mod_Time=$mpi->Last_Mod_Time;
}
}
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<!--title-->
<center>Edit Monthly Payment Details</center>
</h1>
</section>
<section class="content">
<div style="text-align:right;">
<a href="<?php echo base_url() ?>monthlyListings" class="btn btn-info" value="Back">Back</a>
</div>
<br/>
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- general form elements -->
<div class="box box-primary">
<!-- form start-->
<form role="form" id="edit" action="<?php echo base_url() ?>monthlypay/editmonthly" method="post">
<div class="box-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="month_year">Month Year:</span>
<input type="text" class="form-control" readonly id="MonthYear" name="Month_Year" value="<?php echo $Month_Year;?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="EmpID">Employee ID:</span>
<input type="text" class="form-control" readonly id="EmployeeID" name="EmpID" value="<?php echo $EmpID; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="LOP_Days">LOP Days:</span>
<input type="text" class="form-control requried" id="LOPDays" name="LOP_Days" value="<?php echo $LOP_Days; ?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="OT_Hrs_Worked">OverTime Hours Worked:</span>
<input type="text" class="form-control required" id="OT_Hrs_Worked" name="OT_Hrs_Worked" value="<?php echo $OT_Hrs_Worked; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="Loan_Recovered">Loan Recovered:</span>
<input type="text" class="form-control required" id="Loan_Recovered" name="Loan_Recovered" value="<?php echo $Loan_Recovered; ?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="Loan_Balance">Loan Balance:</span>
<input type="text" class="form-control required" id="Loan_Balance" name="Loan_Balance" value="<?php echo $Loan_Balance; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="Incentives">Incentives:</span>
<input type="text" class="form-control required" id="Incentives" name="Incentives" value="<?php echo $Incentives; ?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="Other_Deductions">Other Deductions:</span>
<input type="text" class="form-control required" id="Other_Deductions" name="Other_Deductions" value="<?php echo $Other_Deductions; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<input type="hidden" class="form-control required" id="CreatedBy" name="CreatedBy" value="<?php echo $Created_By; ?>">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<input type="hidden" class="form-control required" id="Created_Time" name="Created_Time" value="<?php echo $Created_Time; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<!--<input type="hidden" class="form-control required" id="LastModifiedBy" name="LastModifiedBy" value="<?php echo $name; ?>">-->
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<input type="hidden" class="form-control required" id="Last Modified Time" name="Last Modified Time" value="<?php echo $Last_Mod_Time; ?>">
</div>
</div>
</div>
</div>
<div id="content">
<div class="box-footer" style="text-align:right">
<input type="submit" class="btn btn-info" value="Submit"/>
<input type="reset" class="btn btn-info" value="Reset" />
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</section>
</div>
<div class="col-md-4">
<?php
$this->load->helper('form');
$error = $this->session->flashdata('error');
if($error)
{
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php } ?>
<?php
$success = $this->session->flashdata('success');
if($success)
{
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('success'); ?>
</div>
<?php } ?>
<div class="row">
<div class="col-md-12">
<?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
</div>
</div>
</div>
</section>
</div>
<script src="<?php echo base_url(); ?>assets/js/editUser.js" type="text/javascript"></script>

View File

@ -0,0 +1,106 @@
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Employee Salary Details</center>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-xs-12 text-right">
<div class="form-group">
<a class="btn btn-primary" href="<?php echo base_url(); ?>emppaydate/addemppaydate">Add New Employee Pay List</a>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<div class="box-tools">
<form action="<?php echo base_url() ?>emppaydate/emppayListing" method="POST" id="searchList">
<div class="input-group">
<input type="text" name="searchText" value="<?php echo $searchText; ?>" class="form-control input-sm pull-right" style="width: 150px;" placeholder="Search"/>
<div class="input-group-btn">
<button class="btn btn-sm btn-default searchList"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
</div>
</div><!-- /.box-header -->
<div class="box-body table-responsive no-padding" >
<table id="datatable" class="table table-hover tableSorter" >
<tr bgcolor="steelblue">
<th>Pay Data ID</th>
<th>Employee ID</th>
<th>Basic Pay</th>
<th>HRA Rate</th>
<th>OT Rate</th>
<th>Allowances</th>
<th>PF Rate</th>
<th>ESI Rate</th>
<th>Food Allowances</th>
<th>Is Active</th>
<th>Edit</th>
</tr>
<?php
if(!empty($userRecords))
{
foreach($userRecords as $record)
{
?>
<tr>
<td><?php echo $record->Pay_Data_ID ?></td>
<td><?php echo $record->EmpID ?></td>
<td><?php echo $record->Basic_Pay ?></td>
<td><?php echo $record->HRA_Rate ?></td>
<td><?php echo $record->OT_Rate ?></td>
<td><?php echo $record->Allowances ?></td>
<td><?php echo $record->PF_Rate ?></td>
<td><?php echo $record->ESI_Rate ?></td>
<td><?php echo $record->Food_Allowances ?></td>
<td><?php echo $record->is_Active ? 'Yes' : 'No'?></td>
<td>
<a href="<?php echo base_url().'emppaydate/editOldemppay/'.$record->Pay_Data_ID; ?>"><i class="btn btn-info">EDIT</i></a>
</td>
</tr>
<?php
}
}
?>
</table>
</div><!-- /.box-body -->
<div class="box-footer clearfix">
<?php echo $this->pagination->create_links(); ?>
</div>
</div><!-- /.box -->
</div>
</div>
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('ul.pagination li a').click(function (e) {
e.preventDefault();
var link = jQuery(this).get(0).href;
var value = link.substring(link.lastIndexOf('/') + 1);
jQuery("#searchList").attr("action", baseURL + "emppayListings/" + value);
jQuery("#searchList").submit();
});
});
</script>

View File

@ -343,6 +343,12 @@
<span>Upload Salary</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>ExcelUpload2">
<i class="fa fa-upload"></i>
<span>Monthly Salary Inputs</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>ViewPay">
<i class="fa fa-money"></i>
@ -355,12 +361,12 @@
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>emppaydate/addemppaydate" >
<a href="<?php echo base_url(); ?>emppayListings" >
<i class="fa fa-dashboard"></i> <span>Emploee Salary Details</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>monthlypay/addmonthly" >
<a href="<?php echo base_url(); ?>monthlyListings" >
<i class="fa fa-dashboard"></i> <span>Employee Monthly Payment</span>
</a>
</li>

View File

@ -0,0 +1,112 @@
<script>
$(document).ready(function() {
$('table').tableSort( {
animation :'slide',
speed:500
} );
});
</script>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Employee Monthly Payment Listing</center>
</h1>
</section>
<section class="content">
<!-- <div class="row">
<div class="col-xs-12 text-right">
<div class="form-group">
<a class="btn btn-primary" href="<?php echo base_url(); ?>monthlypay/addmonthly">Add New Monthly List</a>
</div>
</div>
</div>-->
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<!--<center><h3 class="box-title">-->
<div class="box-tools">
<!-- <form action="<?php echo base_url() ?>assetListing" method="POST" id="searchList">-->
<form action="<?php echo base_url() ?>monthlypay/monthlyListing" method="POST" id="searchList">
<div class="input-group">
<input type="text" name="searchText" value="<?php echo $searchText; ?>" class="form-control input-sm pull-right" style="width: 150px;" placeholder="Search"/>
<div class="input-group-btn">
<button class="btn btn-sm btn-default searchList"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
</div><!--</h3></center>-->
</div><!-- /.box-header -->
<div class="box-body table-responsive no-padding tableSorter">
<table class="table table-hover">
<tr bgcolor="steelblue">
<th>Month Year</th>
<th>Employee Id</th>
<th>LOP Days</th>
<th>OT Hours Worked</th>
<th>Loan Recovered</th>
<th>Loan Balance</th>
<th>Incentives</th>
<th>Other Deductions</th>
<th>Edit</th>
</tr>
<?php
if(!empty($userRecords))
{
foreach($userRecords as $record)
{
?>
<tr>
<td><?php echo $record->Month_Year ?></td>
<td><?php echo $record->EmpID ?></td>
<td><?php echo $record->LOP_Days ?></td>
<td><?php echo $record->OT_Hrs_Worked ?></td>
<td><?php echo $record->Loan_Recovered ?></td>
<td><?php echo $record->Loan_Balance ?></td>
<td><?php echo $record->Incentives ?></td>
<td><?php echo $record->Other_Deductions ?></td>
<td>
<a href="<?php echo base_url().'monthlypay/editOldmonthly/'.$record->EmpID.'/'.$record->Month_Year;?>"><i class="btn btn-info">EDIT</i></a>
</td>
</tr>
<?php
}
}
?>
</table>
</div><!-- /.box-body -->
<div class="box-footer clearfix">
<?php echo $this->pagination->create_links(); ?>
</div>
</div><!-- /.box -->
</div>
</div>
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('ul.pagination li a').click(function (e) {
e.preventDefault();
var link = jQuery(this).get(0).href;
var value = link.substring(link.lastIndexOf('/') + 1);
jQuery("#searchList").attr("action", baseURL + "monthlyListings/" + value);
jQuery("#searchList").submit();
});
});
</script>

View File

@ -3,6 +3,8 @@
<script>
$(function() {
@ -24,7 +26,7 @@ $(function() {
});
$('#PayOn').change(function() {
$('#PayOn').change(function(){
var id = $('#PayOn').val();
if(id != '-1')
@ -32,14 +34,14 @@ $(function() {
$('#content').loader('show');
$.ajax({
data:{id:id},
data:{id1:id},
type:"POST",
url:"<?php echo base_url();?>payslip/getEmployee",
success:function(result) {
if(result)
{
$("#Employee").empty();
$("#Employee").empty();
$('#content').loader('hide');
$("#Employee").append(result);
@ -56,9 +58,87 @@ $("#Employee").empty();
});
$("#Calculate").click(function(){
var count=0;
var payon = $('#PayOn').val();
var employee = $('#Employee').val();
// alert(payon+employee);
if(payon != '-1' && employee !='-1')
{
var check = $('#All').is(":checked");
if(check){
//alert(check);
$('#Employee').find('option').each(function() {
//alert($(this).val());
count++;
//AJAX STARTED
var employee=$(this).val();
$.ajax({
data:{payon:payon,employee:employee},
type:"POST",
url:"<?php echo base_url();?>payslip/callsp",
success:function(result){
$('#content').loader('hide');
//alert("Procedure Called Sucessfully!");
}
});
//AJAX ENDED
});
alert(count + " Employees Salary Added Successfully!");
} // else for select all not selected
else{
$('#content').loader('show');
$.ajax({
data:{payon:payon,employee:employee},
type:"POST",
url:"<?php echo base_url();?>payslip/callsp",
success:function(result) {
$('#content').loader('hide');
alert("Employees Salary Added Successfully!");
}
});
}// else for select all not selected
}// check payon select/not selected
else
{
alert('Please select the PayOn');
return false;
}
});
});
});
</script>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
@ -114,7 +194,10 @@ $("#Employee").empty();
</div>
<div class="col-md-4 col-md-offset-6" align = "right">
<input type="submit" class="btn btn-info" value="Generate" />
<input type="button" class="btn btn-info" id="Calculate" value="Calculate Pay"/>
<input type="submit" class="btn btn-info" id="Generate" value="Generate"/>
<a href="<?php echo base_url(); ?>payslip/updatepayroll" ><input type="submit" class="btn btn-info" value="Update" /></a>
</div>
@ -155,5 +238,4 @@ $("#Employee").empty();
</section>
</div>
</div>

View File

@ -0,0 +1,93 @@
<?php
if(isset($Success)){
echo $Success;
}
if(isset($Fail)){
echo $Fail;
}
?>
<script>
function readURL(input) {
$('#FileName').val(input.files[0].name);
}
</script>
<script>
function checkYearMonthAsEmpty()
{
if($("#mon").val() == "") {
alert("No Month Selected!");
}
if($("#yr").val() == "") {
alert("No Year Selected!");}
var m=$("#mon").val();
var y=$("#yr").val();
// alert(m+y);
}
</script>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - Monthly Pay Inputs Upload</center>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-md-8 col-md-offset-2" style="border:2px dotted;padding:2%;">
<form id="upload" action="<?php echo base_url() ?>FileUpload2" method="post" role="form" enctype="multipart/form-data"> <div class="col-md-5 col-md-offset-2">
<span for="FileName">File Name</span>
<input type="text" class="form-control required" id="FileName" name="FileName" readonly>
</div>
<div class="box-header">
<input type="file" accept=".xlsx" onchange="readURL(this);" id="userfile" name="userfile"/>
<label for="photo">Select Excel File to upload<br/>(only .xls)</label>
</div>
<div class="col-md-2 col-md-offset-2">
<span for="Month">Month</span>
<input class="date-own form-control" style="width: 100px;" type="text" id="mon" name="mon">
<script type="text/javascript">
$('.date-own').datepicker({
minViewMode: 1,
format: 'mm'
});
</script>
</div>
<div class="col-md-2 col-md-offset-0">
<span for="Year">Year</span>
<input style="width: 100px;" type="text" id="year" name="yr" readonly />
<script type="text/javascript">
var today= new Date();
var year=today.getFullYear();
document.getElementById("year").value = year; // $('.date-own').datepicker({
// //minViewMode: 2,
// format: 'yyyy'
// });
</script>
</div>
<br/>
<div class="col-md-1 col-md-offset-1">
<input type="submit" class="btn btn-info" value="upload" onmouseover="checkYearMonthAsEmpty();"/>
</div>
</div>
</div>
</section>
</div>