<?php 
if(isset($_REQUEST['Search']))
{
$_REQUEST['hr_applcnt_rgstn']['attach_file']=$_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');        
move_uploaded_file($_FILES['attach']['tmp_name'], "uploaded_docs/".$_FILES["attach"]["name"]);
$sql= $s->insertRecord('hr_applcnt_rgstn',$_REQUEST['hr_applcnt_rgstn'])  ; 
DB_query($sql,$db);
$s->pageLocation("index.php?route=HRModule/application_registrartion_index".$rurl);
}

?>

<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div"> 
<h1><strong>Applicant Registration</strong></h1>
<form action="" enctype="multipart/form-data" method="post" name="myform" >
<h3><strong>General Details</strong></h3>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr class="row1">
    <td width="13%" style="text-align:right;"><strong>First Name</strong></td>
	<td width="20%"><input type="text" name="hr_applcnt_rgstn[first_name]" style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>Middle Name</strong></td>
	<td width="20%"><input type="text" name="hr_applcnt_rgstn[middle_name]" style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>Last Name</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[last_name]" style="width:98%;" /></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Date of Birth</strong></td>
	<td><input type="text"  name="hr_applcnt_rgstn[dob]" style="width:98%;" class="datepicker"/></td>
	<td style="text-align:right;"><strong>Birth Place</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[birth_place]" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Sex</strong></td>
    <td>Male: <input type="radio" name="hr_applcnt_rgstn[gender]" value="m" >&nbsp;Female: <input type="radio" name="hr_applcnt_rgstn[gender]" value="f" ></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Religion</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[religion]" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Marital Status</strong></td>
	<td><select name="hr_applcnt_rgstn[marital_status]" style="width:98%;">
	<option>--Select--</option>
	<option value="m">Married</option>
        <option value="u">UnMarried</option>
	</select></td>
	<td style="text-align:right;"><strong>Dependent</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[dependent]" style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Father's Name</strong></td>
	<td><input type="text" style="width:98%;" name="hr_applcnt_rgstn[father_name]"/></td>
	<td style="text-align:right;"><strong>Occupation</strong></td>
	<td><select name="hr_applcnt_rgstn[occupation]" style="width:98%;">
	<option>--Select--</option>
	<option value="service">Service</option>
        <option value="business">Business</option>
	</select></td>
	<td style="text-align:right;"><strong>Location</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[location]" style="width:98%;"/></td>
	</tr>
</table>

<br />
<h3><strong>Contact Details</strong></h3>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr class="row1">
	<td width="13%" style="text-align:right;"><strong>Mobile No.1</strong></td>
	<td width="20%"><input type="text" name="hr_applcnt_rgstn[mobile1]" style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>Email ID 1</strong></td>
	<td width="20%"><input type="text" name="hr_applcnt_rgstn[email1]" style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>Phone No.1</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[phone1]" style="width:98%;"/></td>
</tr>
<tr class="row1">
    <td style="text-align:right;"><strong>Mobile No.2</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[mobile2]" style="width:98%;"/></td>    
	<td style="text-align:right;"><strong>Email ID 2</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[email2]" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Phone No.2</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[phone2]" style="width:98%;"/></td>
</tr>
</table>

<br />
<h3><strong>Address Details</strong></h3>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr class="row1">
<td colspan="6" valign="top" class="tabledata">(if both are same then check)&nbsp;&nbsp;<input type="checkbox" id='add_check' onclick='javascript:copy_address(this);'></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Present Address</strong></td>
	<td colspan="3"><textarea name="hr_applcnt_rgstn[present_address]"  id='present_address' rows="3" style="width:99%; height:60px;"></textarea></td>
	<td style="text-align:right;"><strong>City</strong></td>
	<td><select name='hr_applcnt_rgstn[city]' id='city' style="width:98%;">
	<option>--Select--</option>
	<option value='Noida'>Noida</option>
	</select></td>
</tr>
<tr class="row1">
	<td width="13%" style="text-align:right;"><strong>State</strong></td>
	<td width="20%"><input type="text" name='hr_applcnt_rgstn[state]' id='state' style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>Country</strong></td>
	<td width="20%"><input type="text" name='hr_applcnt_rgstn[country]' id='country' style="width:98%;"/></td>
	<td width="12%" style="text-align:right;"><strong>Pin code</strong></td>
	<td><input type="text" name='hr_applcnt_rgstn[pincode]' id='pincode' style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Permanent Address</strong></td>
	<td colspan="3"><textarea rows="3" id='prmnt_address' name='hr_applcnt_rgstn[prmnt_address]' style="width:99%; height:60px;"></textarea></td>
	<td style="text-align:right;"><strong>City</strong></td>
	<td><select name='hr_applcnt_rgstn[city2]' id='city2' style="width:98%;">
	<option>--Select--</option>
	<option value='Noida'>Noida</option>
	</select></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>State</strong></td>
	<td><input type="text" name='hr_applcnt_rgstn[state2]' id='state2' style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Country</strong></td>
	<td><input type="text" name='hr_applcnt_rgstn[country2]'  id='country2'style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Pin code</strong></td>
	<td><input type="text" name='hr_applcnt_rgstn[pincode2]' id='pincode2' style="width:98%;"/></td>
</tr>
</table>

<br />
<h3><strong>Experience Details</strong></h3>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr class="row1">
	<td width="13%" style="text-align:right;"><strong>Total Experience</strong></td>
	<td width="20%"><input type="text" style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>Total Company</strong></td>
	<td width="20%"><input type="text" style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>Pin code</strong></td>
	<td><input type="text" style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Company Name</strong></td>
	<td><input type="text" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>From Date</strong></td>
	<td><input type="text" style="width:98%;" class="datepicker"/></td>
	<td style="text-align:right;"><strong>To Date</strong></td>
	<td><input type="text" style="width:98%;" class="datepicker"/></td>
</tr>
</table>

<br />
<h3><strong>Education Details</strong></h3>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr class="row1">
	<td width="13%" style="text-align:right;"><strong>Doctorate/Phd.</strong></td>
	<td width="20%"><select style="width:98%;">
	<option>--Select--</option>
	<option>--Select--</option>
	</select></td>
	<td width="13%" style="text-align:right;"><strong>%</strong></td>
	<td width="20%"><input type="text" style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>Year</strong></td>
	<td><input type="text" style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Post Graduate</strong></td>
	<td><select style="width:98%;">
	<option>--Select--</option>
	<option>--Select--</option>
	</select></td>
	<td style="text-align:right;"><strong>%</strong></td>
	<td><input type="text" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Year</strong></td>
	<td><input type="text" style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Graduate</strong></td>
	<td><select style="width:98%;">
	<option>--Select--</option>
	<option>--Select--</option>
	</select></td>
	<td style="text-align:right;"><strong>%</strong></td>
	<td><input type="text" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Year</strong></td>
	<td><input type="text" style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Intermediate</strong></td>
	<td><select style="width:98%;">
	<option>--Select--</option>
	<option>--Select--</option>
	</select></td>
	<td style="text-align:right;"><strong>%</strong></td>
	<td><input type="text" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Year</strong></td>
	<td><input type="text" style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>High School</strong></td>
	<td><select style="width:98%;">
	<option>--Select--</option>
	<option>--Select--</option>
	</select></td>
	<td style="text-align:right;"><strong>%</strong></td>
	<td><input type="text" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Year</strong></td>
	<td><input type="text" style="width:98%;"/></td>
</tr>
</table>

<br />
<h3><strong>Other Education Details</strong></h3>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr class="row1">
	<td width="13%" style="text-align:right;"><strong>Certificate 1</strong></td>
	<td width="20%"><input type="text" style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>%/Grade</strong></td>
	<td width="20%"><input type="text" style="width:98%;"/></td>
	<td width="13%" style="text-align:right;"><strong>Time Frame</strong></td>
	<td><input type="text" style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Certificate 2</strong></td>
	<td><input type="text" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>%/Grade</strong></td>
	<td><input type="text" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Time Frame</strong></td>
	<td><input type="text" style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Certificate 3</strong></td>
	<td><input type="text" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>%/Grade</strong></td>
	<td><input type="text" style="width:98%;"/></td>
	<td style="text-align:right;"><strong>Time Frame</strong></td>
	<td><input type="text" style="width:98%;"/></td>
</tr>
<tr class="row1">
	<td style="text-align:right;"><strong>Key Skill</strong></td>
	<td colspan="5"><textarea rows="3" name="hr_applcnt_rgstn[key_skill]" style="width:99%; height:60px;"></textarea></td>
	</tr>
</table>

<br />
<h3><strong>Attachment Details</strong></h3>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr class="row1">
	<td width="13%" style="text-align:right;"><strong>Document</strong></td>
	<td width="20%"><input type="file" name='attach' style="width:98%;"/></td>
	<td colspan="4"><textarea rows="3" name="hr_applcnt_rgstn[document]" style="width:98%; height:60px;"></textarea></td>
	</tr>
</table>

<br />
<h3><strong>Application Details</strong></h3>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr class="row1">
	<td width="15%" style="text-align:right;"><strong>Designation</strong></td>
	<td width="35%"><input type="text" name="hr_applcnt_rgstn[designation]" style="width:98%;"/></td>
	<td width="15%" style="text-align:right;"><strong>Department</strong></td>
	<td><input type="text" name="hr_applcnt_rgstn[department]" style="width:98%;"/></td>
</tr>
</table>

<p align="center"><input name="Search" type="submit" class="search" value="Save"/></p>
</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);  

        }
}
</script>
 