diff --git a/application/controllers/emppaydate.php b/application/controllers/emppaydate.php index 9de145b1..a60df687 100755 --- a/application/controllers/emppaydate.php +++ b/application/controllers/emppaydate.php @@ -110,34 +110,26 @@ class emppaydate extends BaseController $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'); + $Food_Allowances=$this->input->post('Food_Allowances'); + + $Loan_Amount=$this->input->post('Loan_Amount'); + $Load_Issued_date=$this->input->post('loan_issued_date'); + $Load_Issued_date=$this->getDateformat2($Load_Issued_date); + $Due_Amount=$this->input->post('monthly_due'); + $Due_Started=$this->input->post('due_started'); + $Due_Started=$this->getDateformat2($Due_Started); + $No_Of_Dues=$this->input->post('no_of_due'); + $Paid_due=$this->input->post('paid_due'); + $Remaining_Due=$this->input->post('remaining_due'); + $Paid_Amount=$this->input->post('Paid_Amount'); + //$All = $this->input->post('All'); $CreateBy = $this->session->userdata ( 'userId' ); $chked = $this->input->post('is_Active'); $IsActive = '1'; - - // if(EmpID == -1) - // { - // // $this->session->set_flashdata('success', 'New Asset created successfully'); - - // redirect('emppaydate/addemppaydate','refresh'); - // echo ""; - // } - - //else{ - //$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - //$createddt = $dt->format('Y-m-d H:i:s'); - - // $emppayExists = $this->emppaydate_model->( $emppay); - // Becasue of done cool thinfg of it. - - // $emppay = array(); - - - $emppay = array('EmpID'=>$EmpID,'TotalSalary'=>$Total_Salary,'Basic_Pay'=>$Basic_Pay,'HRA_Rate'=>$HRA_Rate,'HRA_Amount'=>$HRA_Amount, 'OT_Rate'=>$OT_Rate, 'Allowances'=>$Allowances, 'PF_Rate'=>$PF_Rate, 'ESI_Rate'=>$ESI_Rate ,'Food_Allowances'=>$Food_Allowances,'is_Active'=>$IsActive,'Created_By'=>$CreateBy); + $emppay = array('EmpID'=>$EmpID,'TotalSalary'=>$Total_Salary,'Basic_Pay'=>$Basic_Pay,'HRA_Rate'=>$HRA_Rate,'HRA_Amount'=>$HRA_Amount, 'OT_Rate'=>$OT_Rate, 'Allowances'=>$Allowances, 'PF_Rate'=>$PF_Rate, 'ESI_Rate'=>$ESI_Rate ,'Food_Allowances'=>$Food_Allowances,'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'=>$IsActive,'Created_By'=>$CreateBy); // print_r($emppay);die(); $result = $this->emppaydate_model->addNewemppay($emppay); @@ -198,7 +190,8 @@ class emppaydate extends BaseController $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'); - + + @@ -222,9 +215,20 @@ class emppaydate extends BaseController $Allowances=$this->input->post('Allowances'); $PF_Rate=$this->input->post('PF_Rate'); $ESI_Rate=$this->input->post('ESI_Rate'); + $Loan_Amount=$this->input->post('Loan_Amount'); + $Load_Issued_date=$this->input->post('loan_issued_date'); + $Load_Issued_date=$this->getDateformat2($Load_Issued_date); + $Due_Amount=$this->input->post('monthly_due'); + $Due_Started=$this->input->post('due_started'); + $Due_Started=$this->getDateformat2($Due_Started); + //echo $Load_Issued_date. "-" . $Due_Started;die(); + $No_Of_Dues=$this->input->post('no_of_due'); + $Paid_due=$this->input->post('paid_due'); + $Remaining_Due=$this->input->post('remaining_due'); + $Paid_Amount=$this->input->post('Paid_Amount'); $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'); + $Last_Mod_By=$this->session->userdata('userId'); + $Last_Mod_Time=date('d-m-Y h:i:sa'); $Food_Allowances=$this->input->post('Food_Allowances'); $chked = $this->input->post('is_Active'); @@ -242,9 +246,9 @@ class emppaydate extends BaseController $emppaydatas = array(); - $emppaydatas = array('Pay_Data_ID'=>$Pay_Data_ID, 'EmpID'=>$EmpID,'TotalSalary'=>$TotalSalary,'Basic_Pay'=>$Basic_Pay, 'HRA_Rate'=>$HRA_Rate,'HRA_Amount'=>$HRA_Amount,'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); - - + + $emppaydatas = array('Pay_Data_ID'=>$Pay_Data_ID,'EmpID'=>$EmpID,'TotalSalary'=>$TotalSalary,'Basic_Pay'=>$Basic_Pay,'HRA_Rate'=>$HRA_Rate,'HRA_Amount'=>$HRA_Amount, 'OT_Rate'=>$OT_Rate, 'Allowances'=>$Allowances, 'PF_Rate'=>$PF_Rate, 'ESI_Rate'=>$ESI_Rate ,'Food_Allowances'=>$Food_Allowances,'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'=>$IsActive,'Last_Mod_By'=>$Last_Mod_By,'Last_Mod_Time'=>$Last_Mod_Time); + // print_r($emppaydatas);die(); $result = $this->emppaydate_model->editemppay($emppaydatas); @@ -404,6 +408,23 @@ class emppaydate extends BaseController $this->loadViews("404", $this->global, NULL, NULL); } + function getDateformat2($Val) + { + $date = new DateTime($Val,new DateTimeZone('Asia/Kolkata')); + + $retDate = $date->format('d-m-Y'); + + return $retDate; + } + + function getDateformat($Val) + { + $date = new DateTime($Val,new DateTimeZone('Asia/Kolkata')); + + $retDate = $date->format('Y-m-d H:i:s'); + + return $retDate; + } } ?> \ No newline at end of file diff --git a/application/controllers/monthlypay.php b/application/controllers/monthlypay.php index ce596775..e975ae11 100755 --- a/application/controllers/monthlypay.php +++ b/application/controllers/monthlypay.php @@ -172,7 +172,7 @@ class monthlypay extends BaseController $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('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'); diff --git a/application/models/emppaydate_model.php b/application/models/emppaydate_model.php index 94f8312a..786d30b8 100755 --- a/application/models/emppaydate_model.php +++ b/application/models/emppaydate_model.php @@ -25,7 +25,11 @@ class emppaydate_model extends CI_Model OR PF_Rate LIKE '%".$searchText."%' OR ESI_Rate LIKE '%".$searchText."%' OR is_Active LIKE '%".$searchText."%' - OR Food_Allowances LIKE '%".$searchText."%' + OR Loan_Amount LIKE '%".$searchText."%' + OR Loan_Issued_Date LIKE '%".$searchText."%' + OR Monthly_Due LIKE '%".$searchText."%' + OR Monthly_Due LIKE '%".$searchText."%' + OR Due_Start_Date LIKE '%".$searchText."%' )"; $this->db->where($likeCriteria); @@ -61,6 +65,11 @@ class emppaydate_model extends CI_Model OR ESI_Rate LIKE '%".$searchText."%' OR is_Active LIKE '%".$searchText."%' OR Food_Allowances LIKE '%".$searchText."%' + OR Loan_Amount LIKE '%".$searchText."%' + OR Loan_Issued_Date LIKE '%".$searchText."%' + OR Monthly_Due LIKE '%".$searchText."%' + OR Monthly_Due LIKE '%".$searchText."%' + OR Due_Start_Date LIKE '%".$searchText."%' )"; $this->db->where($likeCriteria); @@ -95,7 +104,8 @@ class emppaydate_model extends CI_Model //$this->db->where('roleId !=', 1); $this->db->where('Pay_Data_ID', $paydataid); $query = $this->db->get(); - +//print_r($query->result()); +//die(); return $query->result(); } @@ -104,6 +114,8 @@ class emppaydate_model extends CI_Model { $paydateid=$emppaydatas['Pay_Data_ID']; + //echo $paydateid; + //print_r($emppaydatas);die(); $this->db->where('Pay_Data_ID' ,$paydateid); $this->db->update('T_Emp_Pay_Data',$emppaydatas); diff --git a/application/views/addemppaydate.php b/application/views/addemppaydate.php index 7fab5c43..45481923 100755 --- a/application/views/addemppaydate.php +++ b/application/views/addemppaydate.php @@ -1,5 +1,22 @@ + + @@ -30,6 +47,9 @@
+
+ Pay Details +
+
+ Loan Details +
+ +
+ +
+
+
+ + + Loan Amount + +
+
+
+ + + + +
+
+
+ Loan Issue(d) Date: + +
+
+
+ + +
+
+
+ Monthly Due(s): + +
+
+
+
+
+
+ Due Started: + +
+
+
+
+
+
+ No Of Due(s): + +
+
+
+
+
+
+ Paid Amount: + +
+
+
+ + +
@@ -320,7 +421,7 @@ if(!empty($emppay))
- + + \ No newline at end of file diff --git a/application/views/editOldmonthly.php b/application/views/editOldmonthly.php index 36dc2c88..35e6c809 100755 --- a/application/views/editOldmonthly.php +++ b/application/views/editOldmonthly.php @@ -239,23 +239,8 @@ function validateAll(){
- - -
-
-
- Loan Balance: - -
-
-
- - - - - -
-
+ +
Incentives: @@ -263,6 +248,23 @@ function validateAll(){
+ + + +
+ + + + +
+
diff --git a/application/views/emppayListing.php b/application/views/emppayListing.php index 69b8b636..96845f28 100755 --- a/application/views/emppayListing.php +++ b/application/views/emppayListing.php @@ -61,10 +61,10 @@ Pay_Data_ID ?> EmpID ?> - TotalSalary ?> + TotalSalary,0,'',''); ?> Basic_Pay ?> HRA_Rate ?> - HRA_Amount ?> + HRA_Amount,0,'',''); ?> OT_Rate ?> Allowances ?> PF_Rate ?> diff --git a/application/views/monthlyListing.php b/application/views/monthlyListing.php index 7c0b0900..351ac1de 100755 --- a/application/views/monthlyListing.php +++ b/application/views/monthlyListing.php @@ -52,7 +52,7 @@ speed:500 LOP Days OT Hours Worked Loan Recovered - Loan Balance + Incentives Other Deductions Edit @@ -72,7 +72,7 @@ speed:500 LOP_Days ?> OT_Hrs_Worked ?> Loan_Recovered ?> - Loan_Balance ?> + Incentives ?> Other_Deductions ?>