bankdetails added in company screen and modified in employee details

This commit is contained in:
venbatechnologies@gmail.com 2017-10-26 19:54:39 +05:30
parent 5cf33d7c88
commit 042c60b853
7 changed files with 580 additions and 89 deletions

View File

@ -39,11 +39,50 @@ class companycontroller extends BaseController
$data['userRecords'] = $this->companydetailsmodel->companylisting(); $data['userRecords'] = $this->companydetailsmodel->companylisting();
$data['payment'] = $this->companydetailsmodel->getPaymentTerms(); $data['payment'] = $this->companydetailsmodel->getPaymentTerms();
$data['filenames']=$this->companydetailsmodel->filelist(); $data['filenames']=$this->companydetailsmodel->filelist();
$data['bankdetails']=$this->companydetailsmodel->getBankDetails();
//$data['filetype']=$this->companydetailsmodel->getfilename(); //$data['filetype']=$this->companydetailsmodel->getfilename();
$data['filetype']=$this->companydetailsmodel->getfilename(); $data['filetype']=$this->companydetailsmodel->getfilename();
$this->loadViews("companyview", $this->global,$data, NULL); $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(){ function companyadd(){
$this->global['pageTitle'] = 'Siddharth : Company Details'; $this->global['pageTitle'] = 'Siddharth : Company Details';
@ -268,7 +307,6 @@ class companycontroller extends BaseController
if($result > 0) if($result > 0)
{ {
// $this->session->set_flashdata('Success', $EmpId.'Employee Updated successfully!');
echo "<script>alert('You Have Successfully updated the company Record!');</script>"; echo "<script>alert('You Have Successfully updated the company Record!');</script>";
redirect('companyview','refresh'); redirect('companyview','refresh');

View File

@ -35,7 +35,12 @@ class employeedetails extends BaseController
*/ */
function employeeListing() function employeeListing()
{ {
if($this->isAdmin() == TRUE)
{
$this->loadThis();
}
else
{
$this->load->model('employeedetails_model'); $this->load->model('employeedetails_model');
@ -45,7 +50,8 @@ class employeedetails extends BaseController
$this->global['pageTitle'] = 'Siddharth : Employee Listing'; $this->global['pageTitle'] = 'Siddharth : Employee Listing';
$this->loadViews("employeeListing", $this->global, $data, NULL); $this->loadViews("employeeListing", $this->global, $data, NULL);
} }
}
/* /*
Validation for Gender status Dropdown Validation for Gender status Dropdown
*/ */
@ -196,7 +202,12 @@ class employeedetails extends BaseController
function AddNewEmployee() function AddNewEmployee()
{ {
if($this->isAdmin() == TRUE)
{
$this->loadThis();
}
else
{
$this->load->library('form_validation'); $this->load->library('form_validation');
$this->form_validation->set_rules('ContactNumber', 'ContactNumber', 'trim|required|min_length[10]|max_length[10]'); $this->form_validation->set_rules('ContactNumber', 'ContactNumber', 'trim|required|min_length[10]|max_length[10]');
@ -336,7 +347,7 @@ echo "<script>alert('New Employee Created successfully!');</script>";redirect('e
echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','refresh'); echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','refresh');
} }
}
} }
} }
@ -367,7 +378,12 @@ echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','
* This function is used to load the add new Employee form with dropdown values */ * This function is used to load the add new Employee form with dropdown values */
function addemployee() function addemployee()
{ {
if($this->isAdmin() == TRUE)
{
$this->loadThis();
}
else
{
$this->load->model('employeedetails_model'); $this->load->model('employeedetails_model');
$GenderConfigID = 'C013'; $GenderConfigID = 'C013';
$MartialConfigID = 'C012'; $MartialConfigID = 'C012';
@ -377,6 +393,7 @@ echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','
$data['Gender'] = $this->employeedetails_model->getConfigValue($GenderConfigID); $data['Gender'] = $this->employeedetails_model->getConfigValue($GenderConfigID);
$data['Martial'] = $this->employeedetails_model->getConfigValue($MartialConfigID); $data['Martial'] = $this->employeedetails_model->getConfigValue($MartialConfigID);
$data['bankdetails']=$this->employeedetails_model->getBankDetails();
$data['Qualification'] = $this->employeedetails_model->getConfigValue($QualificationConfigID); $data['Qualification'] = $this->employeedetails_model->getConfigValue($QualificationConfigID);
$data['Designation'] = $this->employeedetails_model->getConfigValue($DesignationConfigID); $data['Designation'] = $this->employeedetails_model->getConfigValue($DesignationConfigID);
$data['BloodGroup'] = $this->employeedetails_model->getConfigValue($BloodGroupConfigID); $data['BloodGroup'] = $this->employeedetails_model->getConfigValue($BloodGroupConfigID);
@ -384,7 +401,7 @@ echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','
$data['Department'] = $this->employeedetails_model->getDepartment(); $data['Department'] = $this->employeedetails_model->getDepartment();
$this->global['pageTitle'] = 'Siddharth : Add New Employee'; $this->global['pageTitle'] = 'Siddharth : Add New Employee';
$this->loadViews("addemployee", $this->global, $data, NULL); $this->loadViews("addemployee", $this->global, $data, NULL);
}
} }
/** /**
* This function is used to check whether the Employee is existing in the database or not */ * This function is used to check whether the Employee is existing in the database or not */
@ -502,7 +519,12 @@ echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','
function ViewEmployee($EmpNO='') function ViewEmployee($EmpNO='')
{ {
if($this->isAdmin() == TRUE)
{
$this->loadThis();
}
else
{
if($EmpNO == '') if($EmpNO == '')
{ {
$EmpID = $_GET['EmpID']; $EmpID = $_GET['EmpID'];
@ -524,14 +546,14 @@ echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','
$data['QualificationList'] = $this->employeedetails_model->getConfigValue($QualificationConfigID); $data['QualificationList'] = $this->employeedetails_model->getConfigValue($QualificationConfigID);
$data['DesignationList'] = $this->employeedetails_model->getConfigValue($DesignationConfigID); $data['DesignationList'] = $this->employeedetails_model->getConfigValue($DesignationConfigID);
$data['BloodGroupList'] = $this->employeedetails_model->getConfigValue($BloodGroupConfigID); $data['BloodGroupList'] = $this->employeedetails_model->getConfigValue($BloodGroupConfigID);
$data['bankdetails']=$this->employeedetails_model->getBankDetails();
$data['DepartmentList'] = $this->employeedetails_model->getDepartment(); $data['DepartmentList'] = $this->employeedetails_model->getDepartment();
$data['EmpDetails'] = $this->employeedetails_model->viewemployee($EmpID); $data['EmpDetails'] = $this->employeedetails_model->viewemployee($EmpID);
$this->global['pageTitle'] = 'Siddharth : View Employee'; $this->global['pageTitle'] = 'Siddharth : View Employee';
$this->loadViews("editEmployee", $this->global, $data, NULL); $this->loadViews("editEmployee", $this->global, $data, NULL);
}
} }
/* To Check the email exists in the database or not for the employee*/ /* To Check the email exists in the database or not for the employee*/
function checkMailEmp() function checkMailEmp()
@ -555,7 +577,12 @@ echo "<script>alert('Record Not Saved!');</script>";redirect('employeeListing','
/* To Update the employee details*/ /* To Update the employee details*/
function UpdateEmployee() function UpdateEmployee()
{ {
if($this->isAdmin() == TRUE)
{
$this->loadThis();
}
else
{
$EmpId = $this->input->post('employeeid'); $EmpId = $this->input->post('employeeid');
$this->load->library('form_validation'); $this->load->library('form_validation');
//$mail = $this->this->.post('emailid'); //$mail = $this->this->.post('emailid');
@ -732,7 +759,7 @@ echo "<script>alert('Record Not Updated!');</script>"; redirect('employeeListin
} }
// redirect('employeeListing'); // redirect('employeeListing');
}
} }
} }

View File

@ -110,10 +110,56 @@ class companydetailsmodel extends CI_Model
} }
//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;
}
}
} }
?> ?>

View File

@ -186,6 +186,16 @@ function getEmployeeCount( )
return $query->result(); 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(){ function export_excel(){
$this->db->select(' det.*,Dep.DepartmentName as DepartmentName,det.firstname,emp1.firstname as UpdatedByName,emp1.firstname as CreatedByName'); $this->db->select(' det.*,Dep.DepartmentName as DepartmentName,det.firstname,emp1.firstname as UpdatedByName,emp1.firstname as CreatedByName');

View File

@ -1,11 +1,12 @@
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
// $("#gender").select2(); $("#gender").select2();
// $("#bloodgroup").select2(); $("#bloodgroup").select2();
// $("#MartialStatus").select2(); $("#MartialStatus").select2();
// $("#desigination").select2(); $("#desigination").select2();
// $("#departmentname").select2(); $("#departmentname").select2();
// $("#eduqualifaction").select2(); $("#eduqualifaction").select2();
$("#bankbranchname").select2();
document.getElementById('aadharno').addEventListener('input', function (e) { document.getElementById('aadharno').addEventListener('input', function (e) {
e.target.value = e.target.value.replace(/[^\d]/g, '').replace(/(.{4})/g, '$1 ').trim(); e.target.value = e.target.value.replace(/[^\d]/g, '').replace(/(.{4})/g, '$1 ').trim();
@ -691,21 +692,38 @@ function validateESI() {
</div> </div>
</div> </div>
<legend>Bank Details</legend> <legend>Bank Details</legend>
<!-- Text input--> <!-- Text input-->
<div class="col-md-12 pad"> <div class="col-md-12 pad">
<div class="col-md-3"><span>Bank Name</span>
<select type="text" id="bankbranchname" name="bankbranchname" class="form-control select2">
<option value="">Select Bank Name</option>
<?php
if(!empty($bankdetails))
{
foreach ($bankdetails as $bank)
{
?>
<option value="<?php echo $bank->Bank_name ?>"><?php echo $bank->Bank_name ?></option>
<?php
}
}
?>
</select>
<!-- <input type="text" id="bankbranchname" onkeypress="return alpha(event);" maxlength="200" name="bankbranchname" class="form-control"> -->
</div>
<div class="col-md-3"><span>Account Number</span> <div class="col-md-3"><span>Account Number</span>
<input type="text" id="accountno" onkeypress="return isNumberKey(event)" maxlength="20" name="accountno" class="form-control"> <input type="text" id="accountno" onkeypress="return isNumberKey(event)" maxlength="20" name="accountno" class="form-control">
</div> </div>
<div class="col-md-3"><span>IFSC Code</span> <div class="col-md-3"><span>IFSC Code</span>
<input type="text" id="ifsccode" onkeypress="return alpha(event);" style="text-transform: uppercase" name="ifsccode" maxlength="12" class="form-control"> <input type="text" id="ifsccode" onkeypress="return alpha(event);" style="text-transform: uppercase" name="ifsccode" maxlength="12" class="form-control" readonly>
</div> </div>
<div class="col-md-3"><span>Bank Branch Name</span> <div class="col-md-3"><span>Bank Address</span>
<input type="text" id="bankbranchname" onkeypress="return alpha(event);" maxlength="200" name="bankbranchname" class="form-control"> <input type="text" id="bankaddress" maxlength="200" name="bankaddress" class="form-control" readonly>
</div>
<div class="col-md-3"><span>Bank Address</span>
<input type="text" id="bankaddress" maxlength="200" name="bankaddress" class="form-control">
</div> </div>
</div> </div>
@ -1080,4 +1098,30 @@ function Validate()
}); });
$('#bankbranchname').change(function()
{
var bank = $('#bankbranchname').val();
if (bank != '-1' )
{
var y = <?php echo json_encode($bankdetails, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) {
if(bank == obj.Bank_name)
{
$("#ifsccode").val(obj.IFSC);
$("#bankaddress").val(obj.Address);
}
});
}
});
</script> </script>

View File

@ -33,6 +33,10 @@ $ID='';
$filedescription1=''; $filedescription1='';
$financialstart=''; $financialstart='';
$financialend=''; $financialend='';
$bankname='';
$bankifsc='';
$bankaddress='';
$bank_isactive = 1 ;
//print_r($userRecords);die(); //print_r($userRecords);die();
if(!empty($userRecords)) if(!empty($userRecords))
{ {
@ -108,7 +112,29 @@ if(!empty($filenames))
$createdDate=$uf->createdDate; $createdDate=$uf->createdDate;
} }
} }
// if(!empty($bankdetails))
// {
// //print_r($bankdetails);
// foreach ($bankdetails as $bd)
// {
// $bankname=$bd->Bank_name;
// $bankifsc=$bd->IFSC;
// $bankaddress=$bd->Address;
// }
// }
?> ?>
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
<script>
$(document).ready(function(){
$("#PaymentTerms").select2();
$("#filedescription").select2();
});
</script>
<script> <script>
function readURL(input,num) { function readURL(input,num) {
@ -604,6 +630,85 @@ function ValidateUA() {
<!-- </div> --> <!-- </div> -->
</div> </div>
<!--bank details-->
<legend>Bank Details</legend>
<div class="col-md-12">
<div class="col-md-3"><span>Bank Name</span>
<input type="text" id="BankName" name="BankName" maxlength="500" class="form-control" value="<?php echo $bankname;?>">
</div>
<div class="col-md-3"><span>IFSC</span>
<input type="text" id="IFSC" name="IFSC" maxlength="500" class="form-control" value="<?php echo $bankifsc;?>">
</div>
<div class="col-md-3"><span>Bank Address</span>
<input type="text" id="BankAddress" name="BankAddress" maxlength="500" class="form-control" value="<?php echo $bankaddress;?>">
</div>
<input type="hidden" id="BankState" name="BankState" class="form-control" value="Yes">
<div class="col-md-3" style="padding: 19px;">
<!-- <div class="col-md-6"><span>State</span><div>padding: 49px
<input type="radio" name="Bankstate" id="Bankstate" value="1" checked> Active<br>
<input type="radio" name="Bankstate" id="Bankstate" value="0">InActive<br></div>
</div>
<div class="col-md-6">-->
<a class="btn btn-primary font Add" ID="Add"> &nbsp;&nbsp;<span class="bold">Add/Update Bank Detail</span></a>&nbsp;&nbsp;&nbsp;&nbsp;
<!-- </div> -->
</div>
</div>
<br>
<div class="col-xs-12 pad" style="padding: 0px 30px 0px 30px;">
<table id="banktable" class="table" border="1px black" style="font-size:12px;border-collapse: collapse;">
<thead style="border: 1px solid black;">
<tr>
<th>BankName</th>
<th>IFSC</th>
<th>BankAddress</th>
<th>IsActive</th>
<!-- <th>Action</th> -->
</tr>
</thead>
<!-- <tbody> -->
<tbody id="databaseAppend">
<?php if(!empty($bankdetails))
{
foreach ($bankdetails as $uf)
{
?>
<tr>
<td style="width: 15%;"><?php echo $uf->Bank_name ?></td>
<td style="width: 10%;" contenteditable='true'><?php echo $uf->IFSC ?></td>
<td style="width: 66%;" contenteditable='true'><?php echo $uf->Address ?></a></td>
<td style="width: 10%;" contenteditable='true'>
<?php if($uf->Is_Active == 1 )
{
echo 'Yes';
}
else
{
echo 'No';
}
?>
</td>
</tr>
<?php
}
}
?>
</tbody>
<tbody id="addAppend">
</tbody>
</table>
</div>
<br> <br>
<br> <br>
@ -885,3 +990,111 @@ if ( $('#companywebsite').val().length < 1 )
}); });
</script> </script>
<script type="text/html" id="addList">
<tr id="<%=index%>">
<td style="width: 15%;" align="left"><%=BankName%></td>
<td style="width: 10%;" align="left" contenteditable="true"><%=IFSC%></td>
<td style="width: 66%;" align="left" contenteditable="true"><%=BankAddress%></td>
<td style="width: 10%;" align="left" contenteditable="true"><%=IsActive%></td>
</tr>
</script>
<script>
var index = '1';
$('.Add').click(function(){
//alert("addonclick");
var temp = index;
var bankname = $('#BankName').val();
var ifsccode = $('#IFSC').val();
var bankaddress = $('#BankAddress').val();
var isactive = $('#BankState').val();
// var isactive = <?php echo $bank_isactive ?>;
//alert(isactive);
if(bankname != '' || ifsccode != '' || bankaddress != '' )
{
//alert('both insert and update operation evaluated');
if(bankname == ''){
$("#BankName").focus();
return false;
}
else if (ifsccode == ''){
$('#IFSC').focus();
return false;
}
else if (bankaddress == ''){
$('#BankAddress').focus();
return false;
}
else{
//alert(isactive);
var template = jQuery("#addList").html();
index = parseInt(index)+1;
$('#addAppend').append(_.template(template,{index:temp,BankName:bankname,IFSC:ifsccode,BankAddress:bankaddress,IsActive:isactive}));
var tablevalue = $('#banktable').tableToJSON(); // Convert the table into a javascript object
var value = JSON.stringify(tablevalue);
//if(bankname != '' || ifsccode != '' || bankaddress != '' )
//{
$('#content').loader('show');
$.ajax({
data:{id:value},
type:"POST",
url:"<?php echo base_url() ?>companycontroller/bankdtl",
success:function(data){
$('#content').loader('hide');
//alert(data);
}//success function closed
});//ajax function closed
//}//if closed
}//else part closed
$('#BankName').val('');
$('#IFSC').val('');
$('#BankAddress').val('');
}//if closed
else {
//alert('updated operation only evaluated');
var tablevalue = $('#banktable').tableToJSON(); // Convert the table into a javascript object
var value = JSON.stringify(tablevalue);
//alert(value);
$('#content').loader('show');
$.ajax({
data:{id:value},
type:"POST",
url:"<?php echo base_url() ?>companycontroller/bankdtl",
success:function(data){
$('#content').loader('hide');
// alert(data);
}//success function closed
});//ajax function closed
}//else closed
});//add click function closed
</script>

View File

@ -595,12 +595,13 @@ function ValidatePassport()
} }
$(document).ready(function(){ $(document).ready(function(){
// $("#gender").select2(); $("#gender").select2();
// $("#bloodgroup").select2(); $("#bloodgroup").select2();
// $("#MartialStatus").select2(); $("#MartialStatus").select2();
// $("#desigination").select2(); $("#desigination").select2();
// $("#departmentname").select2(); $("#departmentname").select2();
// $("#eduqualifaction").select2(); $("#eduqualifaction").select2();
$("#bankbranchname").select2();
document.getElementById('aadharno').addEventListener('input', function (e) { document.getElementById('aadharno').addEventListener('input', function (e) {
e.target.value = e.target.value.replace(/[^\d]/g, '').replace(/(.{4})/g, '$1 ').trim(); 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) foreach ($GenderList as $rl)
{ {
?> $rl1 = $rl->ConfigValue;
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option> if(trim($rl1) != trim($Gender))
<?php {
if ($_POST['Gender'] == $rl1)
{
echo "<option value=\"".$rl1."\" selected=\"selected\">". $rl->ConfigValue."</option>";
}
else
{
echo "<option value=\"".$rl1."\">". $rl->ConfigValue ."</option>";
}
}
}
} }
} ?>
?>
</select> </select>
</div> </div>
</div> </div>
@ -755,16 +767,26 @@ function onlyAlphabets(evt) {
<select id="bloodgroup" name="bloodgroup" required class="form-control select2"> <select id="bloodgroup" name="bloodgroup" required class="form-control select2">
<option value="<?php echo $BloodGroup ; ?>"><?php echo $BloodGroup ?></option> <option value="<?php echo $BloodGroup ; ?>"><?php echo $BloodGroup ?></option>
<?php <?php
if(!empty($BloodGroupList)) if(!empty($BloodGroupList))
{
foreach ($BloodGroupList as $rl)
{ {
?> foreach ($BloodGroupList as $rl)
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option> {
<?php $rl1 = $rl->ConfigValue;
if(trim($rl1) != trim($BloodGroup))
{
if ($_POST['BloodGroup'] == $rl1)
{
echo "<option value=\"".$rl1."\" selected=\"selected\">". $rl->ConfigValue."</option>";
}
else
{
echo "<option value=\"".$rl1."\">". $rl->ConfigValue ."</option>";
}
}
}
} }
} ?>
?>
</select> </select>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
@ -772,16 +794,26 @@ function onlyAlphabets(evt) {
<select id="MartialStatus" name="MartialStatus" type="text" required placeholder="Marital status" class="form-control select2"> <select id="MartialStatus" name="MartialStatus" type="text" required placeholder="Marital status" class="form-control select2">
<option value="<?php echo $MartialStatus?>"><?php echo $MartialStatus; ?></option> <option value="<?php echo $MartialStatus?>"><?php echo $MartialStatus; ?></option>
<?php <?php
if(!empty($MartialList)) if(!empty($MartialList))
{
foreach ($MartialList as $rl)
{ {
?> foreach ($MartialList as $rl)
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option> {
<?php $rl1 = $rl->ConfigValue;
if(trim($rl1) != trim($MartialStatus))
{
if ($_POST['MartialStatus'] == $rl1)
{
echo "<option value=\"".$rl1."\" selected=\"selected\">". $rl->ConfigValue."</option>";
}
else
{
echo "<option value=\"".$rl1."\">". $rl->ConfigValue ."</option>";
}
}
}
} }
} ?>
?>
</select> </select>
</div> </div>
</div> </div>
@ -848,16 +880,26 @@ function onlyAlphabets(evt) {
<select type="text" id="desigination" name="desigination" required class="form-control select2"> <select type="text" id="desigination" name="desigination" required class="form-control select2">
<option value="<?php echo $Designation ; ?>"><?php echo $Designation; ?></option> <option value="<?php echo $Designation ; ?>"><?php echo $Designation; ?></option>
<?php <?php
if(!empty($DesignationList)) if(!empty($DesignationList))
{
foreach ($DesignationList as $rl)
{ {
?> foreach ($DesignationList as $rl)
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option> {
<?php $rl1 = $rl->ConfigValue;
if(trim($rl1) != trim($Designation))
{
if ($_POST['Designation'] == $rl1)
{
echo "<option value=\"".$rl1."\" selected=\"selected\">". $rl->ConfigValue."</option>";
}
else
{
echo "<option value=\"".$rl1."\">". $rl->ConfigValue ."</option>";
}
}
}
} }
} ?>
?>
</select> </select>
</div> </div>
@ -865,16 +907,26 @@ function onlyAlphabets(evt) {
<select type="text" id="departmentname" name="departmentname" required class="form-control select2"> <select type="text" id="departmentname" name="departmentname" required class="form-control select2">
<option value="<?php echo $Departmentcode; ?>"><?php echo $Departmentcode." - ".$DepartmentName ;?></option> <option value="<?php echo $Departmentcode; ?>"><?php echo $Departmentcode." - ".$DepartmentName ;?></option>
<?php <?php
if(!empty($DepartmentList)) if(!empty($DepartmentList))
{
foreach ($DepartmentList as $rl)
{ {
?> foreach ($DepartmentList as $rl)
<option value="<?php echo $rl->DEPCode ?>"><?php echo $rl->DEPCode." - " .$rl->DepartmentName ?></option> {
<?php $rl1 = $rl->DEPCode;
if(trim($rl1) != trim($Departmentcode))
{
if ($_POST['Departmentcode'] == $rl1)
{
echo "<option value=\"".$rl1."\" selected=\"selected\">". $rl->DEPCode." - " .$rl->DepartmentName."</option>";
}
else
{
echo "<option value=\"".$rl1."\">". $rl->DEPCode." - " .$rl->DepartmentName ."</option>";
}
}
}
} }
} ?>
?>
</select> </select>
</div> </div>
@ -892,17 +944,28 @@ function onlyAlphabets(evt) {
<div class="col-md-3"><span>Qualification</span><span class="badge">*</span> <div class="col-md-3"><span>Qualification</span><span class="badge">*</span>
<select type="text" id="eduqualifaction" name="eduqualifaction" required class="form-control select2"> <select type="text" id="eduqualifaction" name="eduqualifaction" required class="form-control select2">
<option value="<?php echo $Edu_Qualification; ?>"><?php echo $Edu_Qualification ; ?></option> <option value="<?php echo $Edu_Qualification; ?>"><?php echo $Edu_Qualification ; ?></option>
<?php <?php
if(!empty($QualificationList)) if(!empty($QualificationList))
{
foreach ($QualificationList as $rl)
{ {
?> foreach ($QualificationList as $rl)
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option> {
<?php $rl1 = $rl->ConfigValue;
if(trim($rl1) != trim($Edu_Qualification))
{
if ($_POST['Edu_Qualification'] == $rl1)
{
echo "<option value=\"".$rl1."\" selected=\"selected\">". $rl->ConfigValue."</option>";
}
else
{
echo "<option value=\"".$rl1."\">". $rl->ConfigValue ."</option>";
}
}
}
} }
} ?>
?>
</select> </select>
</div> </div>
@ -923,21 +986,48 @@ function onlyAlphabets(evt) {
<div class="form-group"> <div class="form-group">
<div class="col-md-12 pad"> <div class="col-md-12 pad">
<div class="col-md-3"><span>Bank Name</span>
<!-- <input type="text" id="bankbranchname" onkeypress="return alpha(event);" maxlength="200" name="bankbranchname" placeholder="Bank Branch Name" class="form-control" value="<?php echo $BankBranchName ; ?>"> -->
<select type="text" id="bankbranchname" name="bankbranchname" class="form-control select2">
<option value="<?php echo $BankBranchName ; ?>"><?php echo $BankBranchName ; ?></option>
<?php
if(!empty($bankdetails))
{
foreach ($bankdetails as $bank)
{
$bank1 = $bank->Bank_name;
if(trim($bank1) != trim($BankBranchName))
{
if ($_POST['BankBranchName'] == $bank1)
{
echo "<option value=\"".$bank1."\" selected=\"selected\">". $bank->Bank_name."</option>";
}
else
{
echo "<option value=\"".$bank1."\">". $bank->Bank_name ."</option>";
}
}
}
}
?>
</select>
</div>
<div class="col-md-3"><span>Account Number</span> <div class="col-md-3"><span>Account Number</span>
<input type="text" id="accountno" maxlength="20" name="accountno" placeholder="Account Number" class="form-control" value="<?php echo $BankAccountNo; ?>" onkeypress="return isNumberKey(event)"> <input type="text" id="accountno" maxlength="20" name="accountno" placeholder="Account Number" class="form-control" value="<?php echo $BankAccountNo; ?>" onkeypress="return isNumberKey(event)">
</div> </div>
<div class="col-md-3"><span>IFSC Code</span> <div class="col-md-3"><span>IFSC Code</span>
<input type="text" id="ifsccode" onkeypress="return alpha(event);" style="text-transform: uppercase" name="ifsccode" placeholder="IFSC Code" maxlength="12" class="form-control" value="<?php echo $IFSCCode ; ?>"> <input type="text" id="ifsccode" name="ifsccode" placeholder="IFSC Code" class="form-control" value="<?php echo $IFSCCode ; ?>" readonly>
</div>
<div class="col-md-3"><span>Bank Branch Name</span>
<input type="text" id="bankbranchname" onkeypress="return alpha(event);" maxlength="200" name="bankbranchname" placeholder="Bank Branch Name" class="form-control" value="<?php echo $BankBranchName ; ?>">
</div> </div>
<div class="col-md-3"><span>Bank Address</span> <div class="col-md-3"><span>Bank Address</span>
<input type="text" id="bankaddress" maxlength="200" name="bankaddress" placeholder="Bank Address" class="form-control" value="<?php echo $BankAddress ; ?>"> <input type="text" id="bankaddress" name="bankaddress" placeholder="Bank Address" class="form-control" value="<?php echo $BankAddress ; ?>" readonly>
</div> </div>
</div> </div>
</div> </div>
<legend>ID Proof</legend> <legend>ID Proof</legend>
<!-- Text input--> <!-- Text input-->
@ -1134,4 +1224,27 @@ function onlyAlphabets(evt) {
} }
}); });
$('#bankbranchname').change(function()
{
var bank = $('#bankbranchname').val();
if (bank != '-1' )
{
var y = <?php echo json_encode($bankdetails, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) {
if(bank == obj.Bank_name)
{
$("#ifsccode").val(obj.IFSC);
$("#bankaddress").val(obj.Address);
}
});
}
});
</script> </script>