diff --git a/application/controllers/companycontroller.php b/application/controllers/companycontroller.php index a875890a..45947063 100755 --- a/application/controllers/companycontroller.php +++ b/application/controllers/companycontroller.php @@ -39,10 +39,49 @@ class companycontroller extends BaseController $data['userRecords'] = $this->companydetailsmodel->companylisting(); $data['payment'] = $this->companydetailsmodel->getPaymentTerms(); $data['filenames']=$this->companydetailsmodel->filelist(); + $data['bankdetails']=$this->companydetailsmodel->getBankDetails(); //$data['filetype']=$this->companydetailsmodel->getfilename(); $data['filetype']=$this->companydetailsmodel->getfilename(); $this->loadViews("companyview", $this->global,$data, NULL); } + + /* this function used to add and update the bank details*/ + public function bankdtl() + { + + //$bankname = $this->input->post('id1'); + //$ifsccode = $this->input->post('id2'); + //$bankaddress = $this->input->post('id3'); + //$isactive = $this->input->post(''); + + $id = $this->input->post('id'); + $tablevalue = json_decode($id,true); + + foreach($tablevalue as $tv) + { + $bankname = $tv['BankName']; + $ifsccode = $tv['IFSC']; + $bankaddress = $tv['BankAddress']; + $bankstate = $tv['IsActive']; + if($bankstate == 'Yes') + { + $isactive = 1; + } + else{ + $isactive = 0; + } + + $Bank = array('Bank_name'=>$bankname,'IFSC'=>$ifsccode,'Address'=>$bankaddress,'Is_Active'=>$isactive); + $result = $this->companydetailsmodel->BankDetails($Bank); + + } + + //$Bank = array('Bank_name'=>$bankname,'IFSC'=>$ifsccode,'Address'=>$bankaddress); + //$result = $this->companydetailsmodel->AddBankDetails($Bank); + + + } + function companyadd(){ @@ -268,7 +307,6 @@ class companycontroller extends BaseController if($result > 0) { - // $this->session->set_flashdata('Success', $EmpId.'Employee Updated successfully!'); echo ""; redirect('companyview','refresh'); diff --git a/application/controllers/employeedetails.php b/application/controllers/employeedetails.php index e27ce458..27ece8a0 100755 --- a/application/controllers/employeedetails.php +++ b/application/controllers/employeedetails.php @@ -35,17 +35,23 @@ class employeedetails extends BaseController */ function employeeListing() { - + if($this->isAdmin() == TRUE) + { + $this->loadThis(); + } + else + { $this->load->model('employeedetails_model'); $data['userRecords'] = $this->employeedetails_model->employeeListing(); - + $this->global['pageTitle'] = 'Siddharth : Employee Listing'; $this->loadViews("employeeListing", $this->global, $data, NULL); - } + } + } /* Validation for Gender status Dropdown */ @@ -196,7 +202,12 @@ class employeedetails extends BaseController function AddNewEmployee() { - + if($this->isAdmin() == TRUE) + { + $this->loadThis(); + } + else + { $this->load->library('form_validation'); $this->form_validation->set_rules('ContactNumber', 'ContactNumber', 'trim|required|min_length[10]|max_length[10]'); @@ -336,7 +347,7 @@ echo "";redirect('e echo "";redirect('employeeListing','refresh'); } - + } } } @@ -367,7 +378,12 @@ echo "";redirect('employeeListing',' * This function is used to load the add new Employee form with dropdown values */ function addemployee() { - + if($this->isAdmin() == TRUE) + { + $this->loadThis(); + } + else + { $this->load->model('employeedetails_model'); $GenderConfigID = 'C013'; $MartialConfigID = 'C012'; @@ -377,6 +393,7 @@ echo "";redirect('employeeListing',' $data['Gender'] = $this->employeedetails_model->getConfigValue($GenderConfigID); $data['Martial'] = $this->employeedetails_model->getConfigValue($MartialConfigID); + $data['bankdetails']=$this->employeedetails_model->getBankDetails(); $data['Qualification'] = $this->employeedetails_model->getConfigValue($QualificationConfigID); $data['Designation'] = $this->employeedetails_model->getConfigValue($DesignationConfigID); $data['BloodGroup'] = $this->employeedetails_model->getConfigValue($BloodGroupConfigID); @@ -384,7 +401,7 @@ echo "";redirect('employeeListing',' $data['Department'] = $this->employeedetails_model->getDepartment(); $this->global['pageTitle'] = 'Siddharth : Add New Employee'; $this->loadViews("addemployee", $this->global, $data, NULL); - + } } /** * This function is used to check whether the Employee is existing in the database or not */ @@ -502,7 +519,12 @@ echo "";redirect('employeeListing',' function ViewEmployee($EmpNO='') { - + if($this->isAdmin() == TRUE) + { + $this->loadThis(); + } + else + { if($EmpNO == '') { $EmpID = $_GET['EmpID']; @@ -524,14 +546,14 @@ echo "";redirect('employeeListing',' $data['QualificationList'] = $this->employeedetails_model->getConfigValue($QualificationConfigID); $data['DesignationList'] = $this->employeedetails_model->getConfigValue($DesignationConfigID); $data['BloodGroupList'] = $this->employeedetails_model->getConfigValue($BloodGroupConfigID); - - $data['DepartmentList'] = $this->employeedetails_model->getDepartment(); + $data['bankdetails']=$this->employeedetails_model->getBankDetails(); + $data['DepartmentList'] = $this->employeedetails_model->getDepartment(); $data['EmpDetails'] = $this->employeedetails_model->viewemployee($EmpID); $this->global['pageTitle'] = 'Siddharth : View Employee'; $this->loadViews("editEmployee", $this->global, $data, NULL); - + } } /* To Check the email exists in the database or not for the employee*/ function checkMailEmp() @@ -555,7 +577,12 @@ echo "";redirect('employeeListing',' /* To Update the employee details*/ function UpdateEmployee() { - + if($this->isAdmin() == TRUE) + { + $this->loadThis(); + } + else + { $EmpId = $this->input->post('employeeid'); $this->load->library('form_validation'); //$mail = $this->this->.post('emailid'); @@ -732,7 +759,7 @@ echo ""; redirect('employeeListin } // redirect('employeeListing'); - + } } } diff --git a/application/models/companydetailsmodel.php b/application/models/companydetailsmodel.php index aead5c35..47235283 100755 --- a/application/models/companydetailsmodel.php +++ b/application/models/companydetailsmodel.php @@ -109,11 +109,57 @@ class companydetailsmodel extends CI_Model return $query->result(); } - - //display the name for createdby @companydetails// - + // for display the bankdetails// + function getBankDetails() + { + $this->db->select('*'); + $this->db->from('T_Bank_Details'); + $query = $this->db->get(); + $result = $query->result(); + return $result; + } + + // for add and update the bankdetails// + function BankDetails($Bank) + { + $bankname=$Bank['Bank_name']; + $bankifsc=$Bank['IFSC']; + $count=0; + + $this->db->select('count(*) as count'); + $this->db->from('T_Bank_Details'); + $this->db->where('Bank_name',$bankname); + $this->db->where('IFSC',$bankifsc); + + $isExits = $this->db->get(); + $res = $isExits->result_array(); + + + if(!empty($res)) + { + + $count = $res[0]['count']; + } -} + if($count == 0 ) + { + $i = $this->db->insert('T_Bank_Details', $Bank); + return $i; + + } + elseif($count == 1) + { + $this->db->where('Bank_name',$bankname); + $this->db->where('IFSC',$bankifsc); + $i = $this->db->update('T_Bank_Details',$Bank); + return $i; + + } + + } + +} + ?> \ No newline at end of file diff --git a/application/models/employeedetails_model.php b/application/models/employeedetails_model.php index 81900ab7..093c1555 100755 --- a/application/models/employeedetails_model.php +++ b/application/models/employeedetails_model.php @@ -186,6 +186,16 @@ function getEmployeeCount( ) return $query->result(); } + function getBankDetails() + { + $this->db->select('*'); + $this->db->from('T_Bank_Details'); + $query = $this->db->get(); + $result = $query->result(); + return $result; + + } + function export_excel(){ $this->db->select(' det.*,Dep.DepartmentName as DepartmentName,det.firstname,emp1.firstname as UpdatedByName,emp1.firstname as CreatedByName'); diff --git a/application/views/addemployee.php b/application/views/addemployee.php index df6bca39..213d95eb 100755 --- a/application/views/addemployee.php +++ b/application/views/addemployee.php @@ -1,11 +1,12 @@ \ No newline at end of file diff --git a/application/views/companyview.php b/application/views/companyview.php index d96a75af..536034e8 100755 --- a/application/views/companyview.php +++ b/application/views/companyview.php @@ -33,6 +33,10 @@ $ID=''; $filedescription1=''; $financialstart=''; $financialend=''; +$bankname=''; +$bankifsc=''; +$bankaddress=''; +$bank_isactive = 1 ; //print_r($userRecords);die(); if(!empty($userRecords)) { @@ -108,7 +112,29 @@ if(!empty($filenames)) $createdDate=$uf->createdDate; } } + +// if(!empty($bankdetails)) +// { +// //print_r($bankdetails); +// foreach ($bankdetails as $bd) +// { +// $bankname=$bd->Bank_name; +// $bankifsc=$bd->IFSC; +// $bankaddress=$bd->Address; +// } +// } + ?> + + + + + + + \ No newline at end of file diff --git a/application/views/editEmployee.php b/application/views/editEmployee.php index 9b4e59fa..389764d6 100755 --- a/application/views/editEmployee.php +++ b/application/views/editEmployee.php @@ -595,12 +595,13 @@ function ValidatePassport() } $(document).ready(function(){ - // $("#gender").select2(); - // $("#bloodgroup").select2(); - // $("#MartialStatus").select2(); - // $("#desigination").select2(); - // $("#departmentname").select2(); - // $("#eduqualifaction").select2(); + $("#gender").select2(); + $("#bloodgroup").select2(); + $("#MartialStatus").select2(); + $("#desigination").select2(); + $("#departmentname").select2(); + $("#eduqualifaction").select2(); + $("#bankbranchname").select2(); document.getElementById('aadharno').addEventListener('input', function (e) { e.target.value = e.target.value.replace(/[^\d]/g, '').replace(/(.{4})/g, '$1 ').trim(); }); @@ -733,12 +734,23 @@ function onlyAlphabets(evt) { { foreach ($GenderList as $rl) { - ?> - - ConfigValue; + if(trim($rl1) != trim($Gender)) + { + if ($_POST['Gender'] == $rl1) + { + + echo ""; + } + else + { + echo ""; + } + } + } } - } - ?> + ?> + @@ -755,16 +767,26 @@ function onlyAlphabets(evt) {
@@ -772,16 +794,26 @@ function onlyAlphabets(evt) {
@@ -848,16 +880,26 @@ function onlyAlphabets(evt) { @@ -865,16 +907,26 @@ function onlyAlphabets(evt) { @@ -892,17 +944,28 @@ function onlyAlphabets(evt) {
Qualification*
@@ -923,20 +986,47 @@ function onlyAlphabets(evt) {
+
Bank Name + + +
Account Number
IFSC Code - -
-
Bank Branch Name - +
Bank Address - +
+ ID Proof @@ -1134,4 +1224,27 @@ function onlyAlphabets(evt) { } }); + + $('#bankbranchname').change(function() +{ + + var bank = $('#bankbranchname').val(); + + if (bank != '-1' ) + { + + var y = ; + + $.each(y, function(idx, obj) { + + if(bank == obj.Bank_name) + { + $("#ifsccode").val(obj.IFSC); + $("#bankaddress").val(obj.Address); + + } + }); + } + + }); \ No newline at end of file