<?php 
if(isset($_REQUEST['Search']))
{
	if($_FILES['attach']['name']!=''){
		$_REQUEST['hr_applcnt_rgstn']['attach_file']=$_FILES['attach']['name'];
		move_uploaded_file($_FILES['attach']['tmp_name'], "uploaded_docs/".$_FILES["attach"]["name"]);
	}

$_REQUEST['hr_applcnt_rgstn']['dob']=ConvertSQLDate($_REQUEST['hr_applcnt_rgstn']['dob']);
$_REQUEST['hr_applcnt_rgstn']['CompanyId']=$_SESSION['ACGCompanyId'];
$_REQUEST['hr_applcnt_rgstn']['created_by']=$_SESSION['UserID'];
$_REQUEST['hr_applcnt_rgstn']['created_date']=date('Y-m-d');        

//$sql= $s->insertRecord('hr_applcnt_rgstn',$_REQUEST['hr_applcnt_rgstn'])  ;
	 $condd="id='".$_REQUEST['vacid']."'";
 $s->RecordEdit('hr_applcnt_rgstn',$_REQUEST['hr_applcnt_rgstn'],$condd); 



//$s->RecordInsert('hr_applcnt_rgstn', $_REQUEST['hr_applcnt_rgstn']);
/*$last=DB_Last_Insert_ID($db,'hr_applcnt_rgstn',$ErrMsg);*/
for($t=0;$t<count($_REQUEST['ref_name']);$t++)
{
	if($_REQUEST['ref_id'][$t]=='')
	{	
	$data['hr_applcnt_rgstn_id']=$_REQUEST['vacid'];
	$data['name']=$_REQUEST['ref_name'][$t];
	$data['email']=$_REQUEST['ref_email1'][$t];
	$data['off_email']=$_REQUEST['ref_email2'][$t];
	$data['phone']=$_REQUEST['ref_phone'][$t];
	$data['mobile']=$_REQUEST['ref_mobile'][$t];
	$data['aknowledge_date']=date('Y-m-d');
	$data['aknowledge_created']=$_SESSION['UserID'];
	$s->RecordInsert('hr_applcnt_rgstn_ref',$data);
    }
  else 
  {

	$data['name']=$_REQUEST['ref_name'][$t];
	$data['email']=$_REQUEST['ref_email1'][$t];
	$data['off_email']=$_REQUEST['ref_email2'][$t];
	$data['phone']=$_REQUEST['ref_phone'][$t];
	$data['mobile']=$_REQUEST['ref_mobile'][$t];
	$data['aknowledge_date']=date('Y-m-d');
	$data['aknowledge_created']=$_SESSION['UserID'];
	$cond1="id='".$_REQUEST['ref_id'][$t]."'";
	$s->RecordEdit('hr_applcnt_rgstn_ref',$data,$cond1);
  }

 }

 
$condition="hr_applcnt_rgstn_id='".$_REQUEST['vacid']."'";
$s->DeleteRecord(hr_applcnt_rgstn_experience,$condition);
 for($k=0;$k<count($_REQUEST['company']);$k++)
			{
				$dataEmpSal['hr_applcnt_rgstn_id']=$_REQUEST['vacid'];
				$dataEmpSal['company_name']=$_REQUEST['company'][$k];
				$dataEmpSal['from_date']=ConvertSQLDate($_REQUEST['frm_date'][$k]);
				$dataEmpSal['to_date']=ConvertSQLDate($_REQUEST['to_date'][$k]);
				$dataEmpSal['ctc']=$_REQUEST['ctc'][$k];
				$dataEmpSal['salary_dtls']=$_REQUEST['salary_dtls'][$k];
				$s->RecordInsert('hr_applcnt_rgstn_experience',$dataEmpSal);
			}

	

$s->pageLocation("index.php?route=HRModule/Master/application_registrartion_index".$rurl);
}

	$condition="id='".$_REQUEST['vacid']."'";
	$allready=$s->GetRecord('hr_applcnt_rgstn',$condition);
	$Select=DB_query($allready,$db);
	$RData=DB_fetch_array($Select);
	
	//echo  $condition1="hr_applcnt_rgstn_id='".$_REQUEST['vacid']."'";
	//echo $allready1=$s->GetRecord('hr_applcnt_rgstn_ref',$condition1);
	//$Select1=DB_query($allready1,$db);
	//$RData1=DB_fetch_array($Select1);
	//print_r($RData1);

	
//$SQL=DB_query("SELECT id,first_name,middle_name,last_name,created_date,dob,department,designation,total_experience FROM hr_applcnt_rgstn where  companyid='".$_SESSION['ACGCompanyId']."' and id= '".$_REQUEST['vacid']."'",$db);


?>

<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div"> 
<form action="" enctype="multipart/form-data" method="post"  onsubmit="return validation()" name="myform" >
<h1>Applicant Registration</h1>

<h3><strong>Application Details</strong></h3>

<table width="100%" border="0" cellpadding="3" cellspacing="0">
	<tr class="row1">
	<td width="13%"><strong>Designation</strong></td>
	<td width="20%"><input type="text"  readonly value="<?php  echo $sitename=$s->GetFieldValue('desigmaster',"id='".$RData['designation']."'",'designame'); 
	//echo $_REQUEST['design'];
	 ?>">		<input type="hidden" name="hr_applcnt_rgstn[designation]"  value="<?php echo $RData['designation']; ?>" />
	</td>
	<td width="13%"><strong>Department</strong></td>
	<td width="20%"><input type="text" readonly value="<?php   echo $sitename1=$s->GetFieldValue('deptmaster',"id='".$RData['department']."'",'deptname'); ?>" >
		<input type="hidden" name="hr_applcnt_rgstn[department]" value="<?php echo $RData['department']; ?>" >
		<input type="hidden" name="hr_applcnt_rgstn[hr_job_created_id]" value="<?php echo $RData['hr_job_created_id']; ?>" >		
	</td>
	<td colspan="2">&nbsp;</td>
	</tr>
	</table>
	<br>
<h3><strong>General Details</strong></h3>
 	
	<table width="100%" border="0" cellpadding="3" cellspacing="0">
	<tr class="row1">
	<td width="13%"><strong>First Name</strong></td>
	<td width="20%"><input type="text"  id="fname" name="hr_applcnt_rgstn[first_name]" value="<?php echo $RData['first_name']; ?>" ></td>
	<td width="13%"><strong>Middle Name</strong></td>
	<td width="20%"><input type="text"  name="hr_applcnt_rgstn[middle_name]"  value="<?php echo $RData['middle_name']; ?>"></td>
	<td width="13%"><strong>Last Name</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[last_name]"  value="<?php echo $RData['last_name']; ?>"></td>
</tr>
<tr class="row1">
	<td><strong>Date of Birth</strong></td>
	<td><input type="text"  id ="dob" name="hr_applcnt_rgstn[dob]" value="<?php echo ConvertSQLDate($RData['dob']); ?>" style="width:50%;" class="datepicker"> &nbsp;<strong>Age</strong> <input type="text"  name="age"  id ="age"  onclick='javascript:getAge();' style="width:20%;"></td>
	<td><strong>Birth Place</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[birth_place]"  value="<?php echo $RData['birth_place']; ?>"></td>
	<td><strong>Sex</strong></td>
    <td>Male: <input type="radio" name="hr_applcnt_rgstn[gender]" value="m" <?php if($RData['gender']=='m'){ echo "checked"; } ?> > &nbsp;Female: <input type="radio" name="hr_applcnt_rgstn[gender]" value="f"  <?php if($RData['gender']=='f'){ echo "checked"; } ?>></td>
</tr>
<tr class="row1">
	<td><strong>Religion</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[religion]"  value="<?php echo $RData['religion']; ?>" ></td>
	<td><strong>Marital Status</strong></td>
	<td><select name="hr_applcnt_rgstn[marital_status]" >
	<option>--Select--</option>
	<option value="m" <?php if($RData['marital_status']=='m'){ echo "selected";} ?>>Married</option>
        <option value="u" <?php if($RData['marital_status']=='u'){ echo "selected";} ?>>UnMarried</option>
	</select></td>
	<td><strong>Dependent</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[dependent]"  value="<?php echo $RData['dependent']; ?>" ></td>
</tr>
<tr class="row1">
	<td><strong>Father's Name</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[father_name]" value="<?php echo $RData['father_name']; ?>"></td>
	<td><strong>Occupation</strong></td>
	<td><select name="hr_applcnt_rgstn[occupation]" >
	<option>--Select--</option>
	<option value="service" <?php if($RData['occupation']=='service'){ echo "selected";} ?>>Service</option>
        <option value="business" <?php if($RData['occupation']=='business'){ echo "selected";} ?>>Business</option>
	</select></td>
	<td><strong>Location</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[location]"  value="<?php echo $RData['location']; ?>" ></td>
</tr>
<tr class="row1">
	<td><strong>Mother's Name</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[mother_name]" value="<?php echo $RData['mother_name']; ?>"></td>
	<td><strong>Occupation</strong></td>
	<td><select name="hr_applcnt_rgstn[mother_occupation]"   >
	<option>--Select--</option>
	<option value="service" <?php if($RData['mother_occupation']=='service'){ echo "selected";} ?>>Service</option>
        <option value="business"  <?php if($RData['mother_occupation']=='service'){ echo "selected";} ?>>Business</option>
	</select></td>
	<td><strong>Location</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[mother_location]" value="<?php echo $RData['mother_location']; ?>"  ></td>
</tr>
</table>
<br>
<h3><strong>Contact Details</strong></h3>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
	<tr class="row1">
	<td width="13%"><strong>Mobile No.1</strong></td>
	<td width="20%"><input type="text" id="mobile1" name="hr_applcnt_rgstn[mobile1]"  onkeypress="return isNumberKey(event)"  value="<?php echo $RData['mobile1']; ?>"></td>
	<td width="13%"><strong>Email ID 1</strong></td>
	<td width="20%"><input type="text" id="email1" name="hr_applcnt_rgstn[email1]"  value="<?php echo $RData['email1']; ?>"></td>
	<td width="13%"><strong>Phone No.1</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[phone1]"   onkeypress="return isNumberKey(event)" value="<?php echo $RData['phone1']; ?>" ></td>
</tr>
<tr class="row1">
    <td><strong>Mobile No.2</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[mobile2]"  onkeypress="return isNumberKey(event)"  value="<?php echo $RData['mobile2']; ?>"></td>
	<td><strong>Email ID 2</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[email2]" value="<?php echo $RData['email2']; ?>" ></td>
	<td><strong>Phone No.2</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[phone2]" value="<?php echo $RData['phone2']; ?>" ></td>
</tr>
</table>
<br>
<h3><strong>Reference Details 1</strong></h3>
<table width="100%" border="1" cellpadding="3" cellspacing="0" style="border:#808080 1px solid;">
	<tr>
      <th><strong>Name</strong></th>
      <th width="12%"><strong>Mobile No.</strong></th>
      <th width="24%"><strong>Personal Email ID </strong></th>
      <th width="24%"><strong>Office Email ID </strong></th>
      <th width="12%"><strong>Phone No.</strong></th>
	</tr>
	<?php $SQL=DB_query("SELECT * FROM hr_applcnt_rgstn_ref where hr_applcnt_rgstn_id= '".$_REQUEST['vacid']."' order by id asc limit 0,1",$db);
		if(DB_num_rows($SQL)>0){
		while($GetRec=DB_fetch_array($SQL)) {?>	
	<tr class="row1">
	<td><input type="hidden" name="ref_id[]" value="<?php echo $GetRec['id'];?>" >
		<input type="text" name="ref_name[]" value="<?php echo $GetRec['name'];?>" ></td>
	<td><input type="text" name="ref_mobile[]"  onkeypress="return isNumberKey(event)"  value="<?php echo $GetRec['mobile'];?>" ></td>
	<td><input type="text" name="ref_email1[]" value="<?php echo $GetRec['email'];?>" >
	</td>
	<td><input type="text" name="ref_email2[]" value="<?php echo $GetRec['off_email'];?>" ></td>
	<td><input type="text" name="ref_phone[]"  onkeypress="return isNumberKey(event)"  value="<?php echo $GetRec['phone'];?>" ></td>
</tr>
<?php } } else { ?>

<tr>
	<td><input type="hidden" name="ref_id[]" value="" >
		<input type="text" name="ref_name[]" value="<?php echo $GetRec['name'];?>" ></td>
	<td><input type="text" name="ref_mobile[]"   onkeypress="return isNumberKey(event)"  value="<?php echo $GetRec['mobile'];?>" ></td>
	<td><input type="text" name="ref_email1[]" value="<?php echo $GetRec['email'];?>" >
	<td><input type="text" name="ref_email2[]" value="<?php echo $GetRec['off_email'];?>" ></td>
	<td><input type="text" name="ref_phone[]"  onkeypress="return isNumberKey(event)"  value="<?php echo $GetRec['phone'];?>" ></td>
</tr>

<?php } ?>
		
					<?php $SQL1=DB_query("SELECT * FROM hr_applcnt_rgstn_ref where hr_applcnt_rgstn_id= '".$_REQUEST['vacid']."' order by id asc limit 1,1",$db);
					if(DB_num_rows($SQL1)>0){
		while($GetRec1=DB_fetch_array($SQL1)) {?>	
					
					<tr>
					<td><input type="hidden" name="ref_id[]" value="<?php echo $GetRec1['id'];?>" >
						<input type="text" name="ref_name[]" value="<?php echo $GetRec1['name'];?>" ></td>
					<td><input type="text" name="ref_mobile[]"   onkeypress="return isNumberKey(event)" value="<?php echo $GetRec1['mobile'];?>" ></td>
					<td><input type="text" name="ref_email1[]"  value="<?php echo $GetRec1['email'];?>" ></td>
					<td><input type="text" name="ref_email2[]" value="<?php echo $GetRec1['off_email'];?>" ></td>	
					<td><input type="text" name="ref_phone[]"  onkeypress="return isNumberKey(event)" value="<?php echo $GetRec1['phone'];?>" ></td>
				</tr>
				<?php } } else {?>
					<tr>
					<td><input type="hidden" name="ref_id[]" value="" >
						<input type="text" name="ref_name[]" value="<?php echo $GetRec1['name'];?>" ></td>
					<td><input type="text" name="ref_mobile[]"  onkeypress="return isNumberKey(event)"  value="<?php echo $GetRec1['mobile'];?>" ></td>
					<td><input type="text" name="ref_email1[]"  value="<?php echo $GetRec1['email'];?>" ></td>
					<td><input type="text" name="ref_email2[]" value="<?php echo $GetRec1['off_email'];?>" ></td>	
					<td><input type="text" name="ref_phone[]"  onkeypress="return isNumberKey(event)"  value="<?php echo $GetRec1['phone'];?>" ></td>
				</tr>
				<?php } ?>

<?php $SQL2=DB_query("SELECT * FROM hr_applcnt_rgstn_ref where hr_applcnt_rgstn_id= '".$_REQUEST['vacid']."' order by id asc limit 2,1",$db);
	if(DB_num_rows($SQL2)>0){
		while($GetRec2=DB_fetch_array($SQL2)) {?>
<tr>
					<td><input type="hidden" name="ref_id[]" value="<?php echo $GetRec2['id'];?>" >
						<input type="text" name="ref_name[]" value="<?php echo $GetRec2['name'];?>" ></td>
					<td><input type="text" name="ref_mobile[]"  onkeypress="return isNumberKey(event)"  value="<?php echo $GetRec2['mobile'];?>" ></td>
					<td><input type="text" name="ref_email1[]"  value="<?php echo $GetRec2['email'];?>" ></td>
					<td><input type="text" name="ref_email2[]" value="<?php echo $GetRec2['off_email'];?>" ></td>	
					<td><input type="text" name="ref_phone[]"  onkeypress="return isNumberKey(event)"  value="<?php echo $GetRec2['phone'];?>" ></td>
				</tr>
<?php } } else { ?>
				<tr>
					<td> <input type="hidden" name="ref_id[]" value="" >
						<input type="text" name="ref_name[]" value="<?php echo $GetRec2['name'];?>" ></td>
					<td><input type="text" name="ref_mobile[]" value="<?php echo $GetRec2['mobile'];?>" ></td>
					<td><input type="text" name="ref_email1[]"  value="<?php echo $GetRec2['email'];?>" ></td>					
					<td><input type="text" name="ref_email2[]" value="<?php echo $GetRec2['off_email'];?>" ></td>	
					<td><input type="text" name="ref_phone[]"  onkeypress="return isNumberKey(event)"  value="<?php echo $GetRec2['phone'];?>" ></td>
				</tr>
<?php } ?>
</table>

<br>
<h3><strong>Address Details&nbsp;&nbsp;(if both are same then check)</strong>&nbsp;&nbsp;<input type="checkbox" id='add_check' onclick='javascript:copy_address(this);' ></h3>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
	<tr class="row1">
	<td><strong>Present Address</strong></td>
	<td colspan="3"><textarea name="hr_applcnt_rgstn[present_address]"  id='present_address' rows="3"><?php echo $RData['present_address'];?></textarea></td>
	<td><strong>City</strong></td>
	<td>
	<select name='hr_applcnt_rgstn[city]' id='city' onchange="get_state_country(this.value)" >
	<option value="">--Select--</option>
 <?php $city="select * from city_master";
                  $cityRes=DB_query($city,$db); 
                  while($cityRow=DB_fetch_array($cityRes)){?>?>
                  <option value="<?php echo $cityRow['id'];?>" <?php if($RData['city']==$cityRow['id']){ echo "selected";} ?>><?php echo $cityRow['city']; ?></option>
                <?php } ?>

	</select></td>
</tr>
<tr class="row1">
	<td width="13%"><strong>State</strong></td>
	<td width="20%"><input type="text" name='hr_applcnt_rgstn[state]' value="<?php echo $RData['state'] ?>" id='state' ></td>
	<td width="13%"><strong>Country</strong></td>
	<td width="20%"><input type="text" name='hr_applcnt_rgstn[country]' value="<?php echo $RData['country'] ?>" id='country' ></td>
	<td width="13%"><strong>Pin code</strong></td>
	<td><input type="text" name='hr_applcnt_rgstn[pincode]' value="<?php echo $RData['pincode'] ?>" id='pincode' ></td>
</tr>
<tr class="row1">
	<td><strong>Permanent Address</strong></td>
	<td colspan="3"><textarea rows="3" id='prmnt_address' name='hr_applcnt_rgstn[prmnt_address]'><?php echo $RData['prmnt_address'];?></textarea></td>
	<td><strong>City</strong></td>
	<td>
	<select name='hr_applcnt_rgstn[city2]' id='city2' onchange="get_state_country1(this.value)" >
	<option>--Select--</option>
	<?php $city="select * from city_master";
                  $cityRes=DB_query($city,$db); 
                  while($cityRow=DB_fetch_array($cityRes)){?>?>
                  <option value="<?php echo $cityRow['id'];?>" <?php if($RData['city2']==$cityRow['id']){ echo "selected";} ?>><?php echo $cityRow['city']; ?></option>
                <?php } ?>

	</select></td>
</tr>
<tr class="row1">
	<td><strong>State</strong></td>
	<td><input type="text" name='hr_applcnt_rgstn[state2]' value="<?php echo $RData['state2'] ?>" id='state2' ></td>
	<td><strong>Country	</strong></td>
	<td><input type="text" name='hr_applcnt_rgstn[country2]' value="<?php echo $RData['country2'] ?>"  id='country2'></td>
	<td><strong>Pin code</strong></td>
	<td><input type="text" name='hr_applcnt_rgstn[pincode2]'  value="<?php echo $RData['pincode2'] ?>"id='pincode2' ></td>
</tr>
</table>
<br>
<h3><strong>Experience Details</strong></h3>
<table width="100%" border="0" cellpadding="3" cellspacing="0" >
	<tr class="row1">
	<td ><strong>Total Experience</strong></td>
	<td><input type="text"   onkeypress="return isNumberKey(event)"  name='hr_applcnt_rgstn[total_experience]' id='total_experience'  value="<?php echo $RData['total_experience'] ?>" ></td>
	<td><strong>Total Company</strong></td>
			<?php $SQL4=DB_query("SELECT * FROM hr_applcnt_rgstn_experience where hr_applcnt_rgstn_id= '".$_REQUEST['vacid']."' order by id asc",$db);
			
		?>
	<td><input type="text"  onkeypress="return isNumberKey(event)"  id="totalcompany" value="<?php echo DB_num_rows($SQL4);?>" onkeyup="show_company(this.value)" ></td>
	<td colspan="6"></td>
	<!--<td><strong>Pin code</strong></td>
	<td><input type="text" ></td>-->
</tr>
</table>
<br>
<div id="c_show">
<table width="100%" border="1" cellpadding="3" cellspacing="0" style="border:#808080 1px solid;">
<tr>
	<th><strong>Company Name</strong></th>	
	<th width="8%"><strong>From Date</strong></th>
	<th width="8%"><strong>To Date</strong></th>
	<th width="12%"><strong>CTC</strong></th>
	<th width="12%"><strong>Salary Detail</strong></th>
</tr>
	<?php  while($GetRec4=DB_fetch_array($SQL4))  { ?>

<tr>	
	<td><input type="text" name="company[]" value="<?php echo $GetRec4['company_name']; ?>" ></td>	
	<td><input type="text" name="frm_date[]"  value="<?php echo $GetRec4['from_date']; ?>"  class="datepicker"></td>	
	<td><input type="text" name="to_date[]" value="<?php echo $GetRec4['to_date']; ?>"  class="datepicker"></td>	
	<td><input type="text" name="ctc[]" value="<?php echo $GetRec4['ctc']; ?>"   ></td>	
	<td><input type="text"  name="salary_dtls[]"  value="<?php echo $GetRec4['salary_dtls']; ?>" ></td>
</tr>
<?php } ?>
</table>
</div>

<h3><strong>Education Details</strong></h3>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
	<tr class="row1">
	<td width="13%"><strong>Doctorate/Phd.</strong></td>
	<td width="20%"><select  name="hr_applcnt_rgstn[other_master]" id="Doctorate">
			<option value="">Select</option>
			<option value="Ph.D/Doctorate" <?php if($RData['other_master']=='Ph.D/Doctorate'){ echo selected; } ?>>Ph.D/Doctorate</option>
			<option value="MPHIL" <?php if($RData['other_master']=='MPHIL'){ echo selected; } ?>>MPHIL</option>
			<option value="Other" <?php if($RData['other_master']=='Other'){ echo selected; } ?>>Other</option>
	</select>
   </td>
	<td width="13%"><strong>Collage/University</strong></td>
	<td width="20%"><input type="text" name="hr_applcnt_rgstn[other_collage]"  placeholder="Collage/University" value="<?php echo $RData['other_collage']; ?>" ></td>
	<td width="7%"><strong>%</strong></td>
	<td width="10%"><input type="text"  placeholder="mark"  id="other_collage" name="hr_applcnt_rgstn[other_master_number]"  value="<?php echo $RData['other_master_number']; ?>"></td>
	<td width="7%"><strong>Year </strong></td>
	<td><input type="text"   onkeypress="return isNumberKey(event)"  id="other_pass_year" name="hr_applcnt_rgstn[other_master_pass_year]" placeholder="Year"  value="<?php echo $RData['other_master_pass_year']; ?>"></td>
</tr>
<tr class="row1">
	<td><strong>Post Graduate</strong></td>
	<td><select   name="hr_applcnt_rgstn[master]" id="master">
	<option value="">Select</option>
	<option value="CA" <?php if($RData['master']=='CA'){ echo "selected"; } ?> >CA</option>
	<option value="CS" <?php if($RData['master']=='CS'){ echo "selected"; } ?>>CS</option>
	<option value="ICWA" <?php if($RData['master']=='ICWA'){ echo "selected"; } ?>>ICWA</option>
	<option value="Integrated PG" <?php if($RData['master']=='Integrated PG'){ echo "selected"; } ?>>Integrated PG</option>
	<option value="LLM" <?php if($RData['master']=='LLM'){ echo "selected"; } ?>>LLM</option>
	<option value="M.A" <?php if($RData['master']=='M.A'){ echo "selected"; } ?>>M.A</option>
	<option value="M.Arch" <?php if($RData['master']=='M.Arch'){ echo "selected"; }?> >M.Arch</option>
	<option value="M.Com" <?php if($RData['master']=='M.Ed'){ echo "selected"; }?>>M.Com</option>
	<option value="M.Ed" <?php if($RData['master']=='M.Pharma'){ echo "selected"; }?>>M.Ed</option>
	<option value="M.Pharma" <?php if($RData['master']=='M.Pharma'){ echo "selected"; }?>>M.Pharma</option>
	<option value="M.Sc" <?php if($RData['master']=='M.Sc'){ echo "selected"; }?>>M.Sc</option>
	<option value="M.Tech" <?php if($RData['master']=='M.Tech'){ echo "selected"; }?>>M.Tech</option>
	<option value="MBA/PGDM" <?php if($RData['master']=='MBA/PGDM'){ echo "selected"; }?> >MBA/PGDM</option>
	<option value="MCA" <?php if($RData['master']=='MCA'){ echo "selected"; }?> >MCA</option>
	<option value="MS" <?php if($RData['master']=='MS'){ echo "selected"; }?>>MS</option>
	<option value="PG Diploma" <?php if($RData['master']=='PG Diploma'){ echo "selected"; }?>>PG Diploma</option>
	<option value="MVSC" <?php if($RData['master']=='MVSC'){ echo "selected"; }?>>MVSC</option>
	<option value="MCM" <?php if($RData['master']=='MCM'){ echo "selected"; }?>>MCM</option>
	<option value="Other" <?php if($RData['master']=='Other'){ echo "selected"; }?>>Other</option>
	</select></td>
	<td><strong>Collage/University</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[master_collage]" id="master_collage"  placeholder="Collage/University" value="<?php echo $RData['master_collage'];?>"></td>
	<td><strong>%</strong></td>
	<td><input type="text"   name="hr_applcnt_rgstn[master_number]" id="master_number" value="<?php echo $RData['master_number'];?>" placeholder="mark"></td>
	<td><strong>Year </strong></td>
	<td><input type="text"  onkeypress="return isNumberKey(event)"  value="<?php echo $RData['master_pass_year'];?>"   name="hr_applcnt_rgstn[master_pass_year]" id="master_pass_year"  placeholder="Year"></td>
</tr>
<tr class="row1">
	<td><strong>Graduate</strong></td>
	<td><select  name="hr_applcnt_rgstn[bachelor]" id="bachelor" >
		<?php $bachelor=$RData['bachelor'];?>
	<option value="Not Pursuing Graduation"<?php if($bachelor=="Not Pursuing Graduation"){ ?> selected="selected"; <?php }?>>Not Pursuing Graduation</option>
		  <option value="B.A"<?php if($bachelor=="B.A"){ ?> selected="selected"; <?php }?>>B.A</option>
		  <option value="B.Arch"<?php if($bachelor=="B.Arch"){ ?> selected="selected"; <?php }?>>B.Arch</option>
		  <option value="BCA"<?php if($bachelor=="BCA"){ ?> selected="selected"; <?php }?>>BCA</option>
		  <option value="B.B.A"<?php if($bachelor=="B.B.A"){ ?> selected="selected"; <?php }?>>B.B.A</option>
		  <option value="B.Com"<?php if($bachelor=="B.Com"){ ?> selected="selected"; <?php }?>>B.Com</option>
		  <option value="B.Ed"<?php if($bachelor=="B.Ed"){ ?> selected="selected"; <?php }?>>B.Ed</option>
		  <option value="BDS"<?php if($bachelor=="BDS"){ ?> selected="selected"; <?php }?>>BDS</option>
		  <option value="BHM"<?php if($bachelor=="BHM"){ ?> selected="selected"; <?php }?>>BHM</option>
		  <option value="B.Pharma"<?php if($bachelorr=="B.Pharma"){ ?> selected="selected"; <?php }?>>B.Pharma</option>
		  <option value="B.Sc"<?php if($bachelor=="B.Sc"){ ?> selected="selected"; <?php }?>>B.Sc</option>
		  <option value="B.Tech/B.E"<?php if($bachelor=="B.Tech/B.E"){ ?> selected="selected"; <?php }?>>B.Tech/B.E.</option>
		  <option value="LLB"<?php if($bachelor=="LLB"){ ?> selected="selected"; <?php }?>>LLB</option>
		  <option value="MBBS"<?php if($bachelor=="MBBS"){ ?> selected="selected"; <?php }?>>MBBS</option>
		  <option value="Diploma"<?php if($bachelor=="Diploma"){ ?> selected="selected"; <?php }?>>Diploma</option>
		  <option value="BVSC"<?php if($bachelor=="BVSC"){ ?> selected="selected"; <?php }?>>BVSC</option>
		<option value="Other" <?php if($bachelor=="Other"){ ?> selected="selected"; <?php }?>>Other</option>
	</select></td>    
    <td><strong>Collage/University</strong></td>
	<td><input type="text"   name="hr_applcnt_rgstn[bachelor_collage]" id="bachelor_collage" value="<?php echo $RData['bachelor_collage'];  ?>" placeholder="Collage/University"></td>
	<td><strong>%</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[bachelor_number]" id="bachelor_number" value="<?php echo $RData['bachelor_number'];  ?>" placeholder="mark"></td>
	<td><strong>Year </strong></td>
	<td><input type="text"  onkeypress="return isNumberKey(event)"  name="hr_applcnt_rgstn[bachelor_pass_year]" id="bachelor_pass_year" value="<?php echo $RData['bachelor_pass_year'];  ?>" placeholder="Year"></td>
</tr>
<tr class="row1">
	<td><strong>Intermediate</strong></td>
	<td><input type="checkbox" name="hr_applcnt_rgstn[intermediate]" id="intermediate" <?php if($RData['intermediate']=='true'){echo "checked";}?> value="true" /></td>
	<td><strong>Collage/University</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[intermediate_collage]" id="intermediate_collage" placeholder="Collage/University" value="<?php echo $RData['intermediate_collage'];  ?>" ></td>
	<td><strong>%</strong></td>
	<td><input type="text"    name="hr_applcnt_rgstn[intermediate_number]" id="intermediate_number" placeholder="mark" value="<?php echo $RData['intermediate_number'];  ?>"></td>
	<td><strong>Year </strong></td>
	<td><input type="text"  onkeypress="return isNumberKey(event)"   name="hr_applcnt_rgstn[intermediate_year]" id="intermediate_year" placeholder="Year" value="<?php echo $RData['intermediate_year'];  ?>"></td>
</tr>
<tr class="row1">
	<td><strong>High School</strong></td>
	<td><input type="checkbox"  name="hr_applcnt_rgstn[tenth]" id="tenth" value="true"  <?php if($RData['tenth']=='true'){echo "checked";}?> /></td>
	<td><strong>Collage/University</strong></td>
	<td><input type="text"   name="hr_applcnt_rgstn[tenth_collage]" id="tenth_collage" placeholder="Collage/University"  value="<?php echo $RData['tenth_collage'];  ?>"></td>
	<td><strong>%</strong></td>
	<td><input type="text"  onkeypress="return isNumber(event)" name="hr_applcnt_rgstn[tenth_number]" id="tenth_number" value="<?php echo $RData['tenth_number'];  ?>"   placeholder="mark"></td>
	<td><strong>Year </strong></td>
	<td><input type="text"  onkeypress="return isNumberKey(event)"  name="hr_applcnt_rgstn[tenth_year]" value="<?php echo $RData['tenth_year'];  ?>" id="tenth_year"  placeholder="Year"></td>
</tr>
</table>
<br>
<h3><strong>Other Education Details</strong></h3>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
	<tr class="row1">
	<td width="13%"><strong>Certificate 1</strong></td>
	<td width="20%"><input type="text"  name="hr_applcnt_rgstn[course1]"  value="<?php echo $RData['course1'];  ?>" id="course1"></td>
	<td width="13%"><strong>Collage/University</strong></td>
	<td width="20%"><input type="text"  name="hr_applcnt_rgstn[course1_collage]" id="course1_collage" value="<?php echo $RData['course1_collage'];  ?>"></td>
	<td width="7%"><strong>%/Grade</strong></td>
	<td width="10%"><input type="text"  name="hr_applcnt_rgstn[course1_number]" id="course1_number" value="<?php echo $RData['course1_number'];  ?>"></td>
	<td width="7%"><strong>Duration</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[course1_duration]" id="course1_duration" value="<?php echo $RData['course1_duration'];  ?>"></td>
</tr>
<tr class="row1">
	<td><strong>Certificate 2</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[course2]" id="course2" value="<?php echo $RData['course2'];  ?>" ></td>
	<td><strong>Collage/University</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[course2_collage]" id="course2_collage" value="<?php echo $RData['course2_collage']; ?>"></td>
	<td><strong>%/Grade</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[course2_number]" id="course2_number" value="<?php echo $RData['course2_number']; ?>"></td>
	<td><strong>Duration</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[course2_duration]" id="course2_duration" value="<?php echo $RData['course2_duration']; ?>"></td>
</tr>
<tr class="row1">
	<td><strong>Certificate 3</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[course3]" id="course3" value="<?php echo $RData['course3']; ?>" ></td>
	<td><strong>Collage/University</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[course3_collage]" id="course3_collage" value="<?php echo $RData['course3_collage']; ?>"></td>
	<td><strong>%/Grade</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[course3_number]" id="course3_number" value="<?php echo $RData['course3_number']; ?>"></td>
	<td><strong>Duration</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[course3_duration]" id="course3_duration" value="<?php echo $RData['course3_duration']; ?>" ></td>
</tr>
<tr class="row1">
	<td><strong>Key Skill</strong></td>
	<td colspan="7"><textarea rows="3" name="hr_applcnt_rgstn[key_skill]" ><?php echo $RData['key_skill']; ?></textarea></td>
</tr>
</table>
<br>
<h3><strong>Attachment Details</strong></h3>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
	<tr class="row1">
	<td width="13%"><strong>Document</strong></td>
	<td width="35%"><input type="file" name='attach' value="<?php echo $RData['attach_file']; ?>" placeholder="<?php echo $RData['attach_file']; ?>"> <?php echo $RData['attach_file']; ?></td>
	<td><textarea rows="3" name="hr_applcnt_rgstn[document]" ><?php echo $RData['document']; ?></textarea></td>
	</tr>
	<tr class="row1">
	<td style="text-align:center;" colspan="3"><input name="Search" type="submit" class="search"  value="Save"/></td>
</tr>
</table>

</form>
	
</div></div>

<script>
function copy_address(str)
{
   if($('#'+str.id).attr('checked')==true)
       {
            $("#present_address").attr('readonly','true')  ;
            $("#state").attr('readonly','true')  ;
            $("#country").attr('readonly','true')  ;
            $("#pincode").attr('readonly','true')  ;
            $("#city").attr('readonly','true')  ;
            $("#prmnt_address").val($("#present_address").val());
            $("#state2").val($("#state").val());
            $("#country2").val($("#country").val());
            $("#pincode2").val($("#pincode").val());
            $("#city2").val($("#city").val());   
       }
    else
        {
            
            $("#present_address").removeAttr('readonly')  ;
            $("#state").removeAttr('readonly')  ;
            $("#country").removeAttr('readonly')  ;
            $("#pincode").removeAttr('readonly')  ;
            $("#city").removeAttr('readonly')  ;
            $("#prmnt_address").val(null);
            $("#state2").val(null);
            $("#country2").val(null);
            $("#pincode2").val(null);
            $("#city2").val(null);  

        }
}



function getAge() {

	var birth1= $("#dob").val();
	//alert(birth);
	if(birth1!=''){
	var birth=new Date(birth1);
    var today = new Date();
    var nowyear = today.getFullYear();
    var nowmonth = today.getMonth();
    var nowday = today.getDate();
    //alert(nowyear);

    var birthyear = birth.getFullYear();
    var birthmonth = birth.getMonth();
    var birthday = birth.getDate();
    // alert(birthyear);
    var age = nowyear - birthyear;
    var age_month = nowmonth - birthmonth;
    var age_day = nowday - birthday;   
    // alert(age);
     $("#age").val(age);
 }

}

function show_company(str)
{

	var ajax;
    if(window.XMLHttpRequest)
    {
        ajax=new XMLHttpRequest();
    }
   else
    {
        ajax=new ActiveXObject("Microsoft.XMLHTTP");
    }
    ajax.onreadystatechange=function(){
        if(ajax.readyState==4 && ajax.status==200)
            {
                //alert(ajax.responseText);
               document.getElementById("c_show").innerHTML=ajax.responseText;
               $('.datepicker').removeClass('hasDatepicker').datepicker({ dateFormat: 'dd/mm/yy',changeMonth: true, changeYear: true,yearRange: '-80:+20'});
            }
    }
  
    ajax.open("POST","ajax_randon_company.php?str="+str,true);
    ajax.send();
}



function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57) )
            return false;
         else   
          return true;
      
      }
function isNumber(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode < 46 || charCode > 57)) {
        return false;
    }
    return true;
}


function validation(){

   if(document.getElementById("fname").value==''){
   	alert("Please Fill First Name");
   	document.getElementById("fname").focus();
   	return false;
   }
   
   if(document.getElementById("attach").value==''){
   	alert("Please Attach a document");
   	document.getElementById("attach").focus();
   	return false;  
   }
 /*
   if(document.getElementById("dob").value==''){
   	alert("Please Fill Date Of Birth");
   		document.getElementById("dob").focus();
   	return false;
   }
    if(document.getElementById("email1").value==''){
   	alert("Please Fill Email Id");
   	document.getElementById("email1").focus();
   	return false;
   }
    if(document.getElementById("mobile1").value==''){
   	alert("Please Fill mobile1");
   		document.getElementById("mobile1").focus();
   	return false;
   }
   if(document.getElementById("ref_name").value==''){
   	alert("Please Fill Reference Name");
   		document.getElementById("ref_name").focus();
   	return false;
   }
   if(document.getElementById("ref_mobile").value==''){
   	alert("Please Fill Mobile");
   		document.getElementById("ref_mobile").focus();
   	return false;
   }
   if(document.getElementById("ref_email1").value==''){
   	alert("Please Fill Personal Email");
   		document.getElementById("ref_email1").focus();
   	return false;
   }
    if(document.getElementById("ref_email2").value==''){
   	alert("Please Fill Office Email ID ");
   		document.getElementById("ref_email2").focus();
   	return false;
   }
   if(document.getElementById("ref_phone").value==''){
   	alert("Please Fill Office Phone");
   		document.getElementById("ref_phone").focus();
   	return false;
   }

*/
}

function get_state_country(str){
		//alert(str);
		if(str!=''){
	$.post('ajax_get_state_country1.php',{"id":str},function(data){
      if(data!='')
      {
        //alert(data);
        var arr = data.split('__');
         // var asd=$("#"+id).val('');
         $("#state").val(arr[0]);
         $("#country").val(arr[1]);
       //  alert(asd);
          //$(this).val(""); 
         return true;
      }
      
  });

}
}
function get_state_country1(str){
		//alert(str);
		if(str!=''){
	$.post('ajax_get_state_country1.php',{"id":str},function(data){
      if(data!='')
      {
        //alert(data);
        var arr = data.split('__');
         // var asd=$("#"+id).val('');
         $("#state2").val(arr[0]);
         $("#country2").val(arr[1]);
       //  alert(asd);
          //$(this).val(""); 
         return true;
      }
      
  });

}
}


</script>
 