<?
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}

include("../opendb.php");
?>

<head>
<style>
body,td{font-family:'arial narrow';letter-spacing:1;}
tr{background-color:e3ecd2}
th{background-color:c1d799}
.mnu{margin-left:5}
body{BACKGROUND-COLOR:fcfff1}
</style>
<script>
function chkey(abc)
{
 yy=abc.value
 if(yy.indexOf('  ')>-1) 
  {
    alert('Multiple space is not allowed');
    abc.value='';
  }
 if(yy.indexOf("'")>-1) 
  {
    alert("\' is not allowed");
    abc.value='';
  }
 if(yy.indexOf("&")>-1) 
  {
    alert("& is not allowed");
    abc.value='';
  }

}

 function valid()
  {
     if(document.f1.empname.value.length<=0)
     {
       alert('Invalid Employee name');
       return false;
     }
     if(document.f1.quali1.selectedIndex<=0)
     {
       alert('Invalid Qualification');
       return false;
     }
     if(document.f1.mstatus.selectedIndex<=0)
     {
       alert('Invalid Marital status');
       return false;
     }

   }
</script>
</head>


<center>
<form action='svnewemp.php' name=f1 method='post' onSubmit="return valid()">
<table>
<th colspan=6 bgcolor="#C1D799">NEW EMPLOYEE MASTER</th>
<tr><td>Trainee </td><td><select name='trainee'>
<option>No</option>
<option>Yes</option>
</select>
</td>
<td colspan=2>Select ESI Group </td><td><select name='grp'>
<?
 $tbl='esipfgrp'.$brcode;
$re=mysqli_query($db,"select * from $tbl order by grp")or die(mysqli_error());
while($row=mysqli_fetch_array($re))
{
 print "\n<option>$row[0]</option>";
}
?>
</select></td></tr>

</tr>
<tr><td>Division</td><td colspan=5>
<select name='divi'>
<?
$re=mysqli_query($db,"select * from divmast where brcode='$brcode'");
while($ro=mysqli_fetch_array($re))
{
 print "\n<option>$ro[divname]</option>";
}
?>
</select>
Branch <select name='br'>
<?
$re=mysqli_query($db,"select * from br_master where brcode='$brcode'");
while($ro=mysqli_fetch_array($re))
{
 print "\n<option>$ro[brname]</option>";
}
?>
</select>
Department <select name='dept'>

<?
$re=mysqli_query($db,"select * from deptmast where brcode='$brcode' order by deptname");
while($ro=mysqli_fetch_array($re))
{
 print "\n<option>$ro[deptname]</option>";
}
?>
</select>
</td></tr>
<tr><td>
Emp ID </td><td> <input type=text name='empid'></td>
<td colspan=3><font color='red'>Loss of Pay <input type=checkbox name='lop' checked value='y'>
Inc in Pay Roll <select name='apinpay'><option>Y</option><option>N</option></select>
</td>
</tr>

<tr><td><font color='dark brown'>Emp Name</td><td><input type=text name='empname' size=40 onKeyDown=chkey(this)></td>
    <td>Sex </td><td colspan=2><select name='sex'><option value='M'>Male</option><option value='F'>Female</option></select></td></tr>
<tr>
    <td colspan=2>Dob dd<input type=text name='d' size=2>
			      mm<input type=text name='m' size=2>
			      yy<input type=text name='y' size=4></td>
<td colspan=3>Dob Actual dd<input type=text name='dac' size=2>
			      mm<input type=text name='mac' size=2>
			      yy<input type=text name='yac' size=4></td></td>
</tr>

<tr><td>Fathers Name</td><td><input type=text name='faname' size=40></td>
    <td colspan="2">Permanent Address </td>
    <td colspan="2"><textarea rows="1" cols="25" name="peraddr"></textarea></td>
</tr>

<tr><td>Present Address</td><td><textarea rows="1" cols="39" name="praddr"></textarea></td>
    <td colspan="2"> Designation </td>
    <td colspan="2"><input type=text name='design' size=25></td>
</tr>
<tr>
<td colspan=6>Phone Res. <input type=text name='resph'> Mob <input type=text name='mob'>
Email <input type=text name='email' size=30>
</tr>
<tr>
<tH colspan=12 align=center> ICE FILE DETAILS</TD>
<TR><TD colspan=12 align=center>
   <table  cellspacing=1 cellpadding=1 bgcolor=red>
	<tr bgcolor='ivory'><td align=center>Name</td><td align=center>Relationship</td><td align=center>Address & Email</td><td align=center>Phone</td><td align=center>Mobile</td></tr>
	<tr><td><input type=text name='icename1'></td>
	    <td><input type=text name='icerel1'>	</td>
	    <td><textarea name='iceaddr1' cols=25></textarea></td>
	    <td><input type=text name='icephone1' size=15></td>
	    <td><input type=text name='icemob1' size=15>	</td>
	</TR>
	<tr><td><input type=text name='icename2'></td>
	    <td><input type=text name='icerel2'>	</td>
	    <td><textarea name='iceaddr2' cols=25></textarea></td>
	    <td><input type=text name='icephone2' size=15></td>
	    <td><input type=text name='icemob2' size=15>	</td>
	</TR>


</table>
</tr>
<tH colspan=12 align=center> OTHER DETAILS</TD>
<tr><td>Date of Join</td><td>dd<input type=text name='dj' size=2>
			      mm<input type=text name='mj' size=2>
			      yy<input type=text name='yj' size=4></td>
    <td colspan="2"> Probation End Date&nbsp; </td>
    <td colspan="2">dd<input type=text name='pd' size=2>
			      mm<input type=text name='pm' size=2>
			      yy<input type=text name='py' size=4></td>
</tr>

<tr><td>Date of Confirmation</td><td>dd<input type=text name='cd' size=2>
			      mm<input type=text name='cm' size=2>
			      yy<input type=text name='cy' size=4></td>
    <td colspan="2"> Date of Retirement </td>
    <td colspan="2">dd<input type=text name='rd' size=2>
			      mm<input type=text name='rm' size=2>
			      yy<input type=text name='ry' size=4></td>
</tr>

<tr><td colspan="6">ESI No &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=text name='esi' size=22> PF No <input type=text name='pf' size=22>
PAN No. <input type=text name='pan'>
</td>
</tr>

<tr><td>Blood Group</td><td><select name='bgrp' size="1">
        <OPTION></OPTION>  
	<option>A+</option>
          <option>A-</option>
          <option>B+</option>
          <option>B-</option>
          <option>AB+</option>
          <option>AB-</option>
          <option>O+</option>
          <option>O-</option>
        </select> 
  </td>
    <td>EmType</td><td><select name='emtype' size="1">
        <option>Normal</option>
          <option>Secondary</option>
                  </select> 
  </td>
    <td>Increment Month</td><td><select name='incmon' size="1">
        <OPTION></OPTION>  
	<option>1</option>
          <option>2</option>
          <option>3</option>
          <option>4</option>
          <option>5</option>
          <option>6</option>
          <option>7</option>
          <option>8</option>
          <option>9</option>
          <option>10</option>
          <option>11</option>
          <option>12</option>

        </select> 
  </td>
</tr>

<tr><td colspan=10 bgcolor='white'><center><font color=red>All dates in yyyy-mm-dd format only</font></td> </tr>
<tr><td>Driving Licence M/C</td><td colspan="5"><font color="#999999">&nbsp;
        License
        No&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Date of
        Expiry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Type</font><font color="#C0C0C0"><br>
        </font><input type=text name=drvno1 size="23">&nbsp;&nbsp; <input type=text name=drvdate1 size="19"  title='Year-Month-Date format'>&nbsp;
        <select name='drvtype1' onChange="getPin()" size="1">
          	<option>None</option>          
		<option>Learning</option>
          <option>Two wheeler</option>
          <option>Three wheeler</option>
          <option>Four wheeler</option>
          <option>HMV</option>
          <option>International</option>
          <option>LMV</option>

          <?include("opendb.php");
  $i=1;
    $re=mysqli_query($db,"select * from area where state='$state'");
   while($row=mysqli_fetch_row($re))
   {
     print "\n";
     print "\n<script> pin[$i]='".trim($row[2])."'; </script>";
     $i++;
   }
 ?></select> </td>
</tr>
<tr>
  <td>Driving Licence LMV</td><td colspan="5"><font color="#999999">&nbsp;
        License
        No&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Date of
        Expiry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Type</font><font color="#C0C0C0"><br>
        </font><input type=text name=drvno2 size="23">&nbsp;&nbsp; <input type=text name=drvdate2 size="19">&nbsp;
        <select name='drvtype2' onChange="getPin()" size="1">
	<option>None</option>          
	<option>Learning</option>
          <option>Two wheeler</option>
          <option>Three wheeler</option>
          <option>Four wheeler</option>
          <option>HMV</option>
          <option>International</option>
	<option>LMV</option>
          <?include("opendb.php");
  $i=1;
    $re=mysqli_query($db,"select * from area where state='$state'");
   while($row=mysqli_fetch_row($re))
   {
     print "\n";
     print "\n<script> pin[$i]='".trim($row[2])."'; </script>";
     $i++;
   }
 ?></select> </td>
</tr>
<tr>
  <td>Driving Licence HGMV</td><td colspan="5"><font color="#999999">&nbsp;
        License
        No&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Date of
        Expiry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Type</font><font color="#C0C0C0"><br>
        </font><input type=text name=drvno3 size="23">&nbsp;&nbsp; <input type=text name=drvdate3 size="19">&nbsp;
        <select name='drvtype3' onChange="getPin()" size="1">
          <option>None</option>          
	  <option>Learning</option>
          <option>Two wheeler</option>
          <option>Three wheeler</option>
          <option>Four wheeler</option>
          <option>HMV</option>
          <option>International</option>
<option>LMV</option>
          <?include("opendb.php");
  $i=1;
    $re=mysqli_query($db,"select * from area where state='$state'");
   while($row=mysqli_fetch_row($re))
   {
     print "\n";
     print "\n<script> pin[$i]='".trim($row[2])."'; </script>";
     $i++;
   }
 ?></select> </td>
</tr>

<tr><td>Insurance 1</td><td colspan="5"><font color="#999999">Name </font><font color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Date of Maturity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Type</font><font color="#C0C0C0"><br>
        </font><input type=text name=insurname1 size="23">&nbsp;&nbsp; <input type=text name=insurdate1 size="19">&nbsp;
        <select name='insurtype1'  size="1">
		  <option></option>
          <option>Life Insurance</option>
          <option>Mediclaim</option>
<option>Accident Policy</option>
          </select> </td>
</tr>
<tr>
  <td>Insurance 2</td><td colspan="5"><font color="#999999">Name </font><font color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Date of Maturity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Type</font><font color="#C0C0C0"><br>
        </font><input type=text name=insurname2 size="23">&nbsp;&nbsp; <input type=text name=insurdate2 size="19">&nbsp;
        <select name='insurtype2'  size="1">
		  <option></option>
          <option>Life Insurance</option>
          <option>Mediclaim</option>
<option>Accident Policy</option>
          </select> </td>
</tr>
<tr>
  <td>Insurance 3</td><td colspan="5"><font color="#999999">Name </font><font color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Date of Maturity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Type</font><font color="#C0C0C0"><br>
        </font><input type=text name=insurname3 size="23">&nbsp;&nbsp; <input type=text name=insurdate3 size="19">&nbsp;
        <select name='insurtype3'  size="1">
	  <option></option>
          <option>Life Insurance</option>
          <option>Mediclaim</option>
<option>Accident Policy</option>
          </select> </td>
</tr>
<tr>
  <td>Insurance 4</td><td colspan="5"><font color="#999999">Name </font><font color="#999999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Date of Maturity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        Type</font><font color="#C0C0C0"><br>
        </font><input type=text name=insurname4 size="23">&nbsp;&nbsp; <input type=text name=insurdate4 size="19">&nbsp;
        <select name='insurtype4' size="1">
		  <option></option>
          <option>Life Insurance</option>
          <option>Mediclaime</option>
<option>Accident Policy</option>
          </select> </td>
</tr>

<tr><td colspan="6" bgcolor="#C1D799"><b>QUALIFICATION</b></td>
</tr>

<tr><td colspan="6">
    <div align="center">
      <table border="0">
        <tr>
          <td align="center" bgcolor="#C1D799"><b>Qualification</b></td>
          <td align="center" bgcolor="#C1D799"><b>Course</b></td>
          <td align="center" bgcolor="#C1D799"><b>Subject</b></td>
          <td align="center" bgcolor="#C1D799"><b>%Marks</b></td>
        </tr>
        <tr>
          <td>
      <select name=quali1><option value="select">Select</option>
<option>S.S.L.C
<option>Pre-Degree
<option>B.A
<option>MBA
<option>BCA
<option>B.B.A
<option>B.Com
<option>M.Com
<option>BDS
<option>BHM
<option>KGCE
<option>B.Sc
<option>B.Tech/B.E.
<option>LLB
<option>ITI
<option>Diploma
<option>ITC

            </select></td>
          <td><input type=text name=course1 size="28"></td>
          <td><input type=text name=sub1 size="32"></td>
          <td><input type=text name=mark1 size="7"></td>
        </tr>
        <tr>
          <td>
      <select name=quali2 size="1"><option value="select" >Select</option>
<option>S.S.L.C
<option>Pre-Degree
<option>B.A
<option>MBA
<option>BCA
<option>B.B.A
<option>B.Com
<option>M.Com
<option>BDS
<option>BHM
<option>KGCE
<option>B.Sc
<option>B.Tech/B.E.
<option>LLB
<option>ITI
<option>Diploma
<option>ITC

            </select></td>
          <td><input type=text name=course2 size="28"></td>
          <td><input type=text name=sub2 size="32"></td>
          <td><input type=text name=mark2 size="7"></td>
        </tr>
        <tr>
          <td>
      <select name=quali3 size="1"><option value="select" >Select</option>
<option>S.S.L.C
<option>Pre-Degree
<option>B.A
<option>MBA
<option>BCA
<option>B.B.A
<option>B.Com
<option>M.Com
<option>BDS
<option>BHM
<option>KGCE
<option>B.Sc
<option>B.Tech/B.E.
<option>LLB
<option>ITI
<option>Diploma
<option>ITC

            </select></td>
          <td><input type=text name=course3 size="28"></td>
          <td><input type=text name=sub3 size="32"></td>
          <td><input type=text name=mark3 size="7"></td>
        </tr>
        <tr>
          <td>
      <select name=quali4 size="1"><option value="select" >Select</option>
<option>S.S.L.C
<option>Pre-Degree
<option>B.A
<option>MBA
<option>BCA
<option>B.B.A
<option>B.Com
<option>M.Com
<option>BDS
<option>BHM
<option>KGCE
<option>B.Sc
<option>B.Tech/B.E.
<option>LLB
<option>ITI
<option>Diploma
<option>ITC

            </select></td>
          <td><input type=text name=course4 size="28"></td>
          <td><input type=text name=sub4 size="32"></td>
          <td><input type=text name=mark4 size="7"></td>
        </tr>
      </table>
    </div>
  </td>
</tr>

<tr><td colspan="6" bgcolor="#C1D799"><b>FAMILY DETAILS&nbsp;</b></td>
</tr>

<tr><td><font color='dark brown'> Marital Status</td><td colspan="5"> <select name='mstatus' size="1">
          <option value="-1">Select</option>
          <option>Single</option>
          <option>Married</option>
          <option>Window</option>
          <option>Widower</option>
          <option>Divorcee</option>
        </select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>

<tr><td>Date of Marriage</td><td colspan="5">dd<input type=text name='marrd' size=2>
			      mm<input type=text name='marrm' size=2>
			      yy<input type=text name='marry' size=4></td>
</tr>

<tr><td> No of Children</td><td colspan="5"> Male <input type=text name='nom' size=2 onFocus=this.value=" ">&nbsp;&nbsp;
        Female <input type=text name='nof' size=2 onFocus=this.value=" ">
  </td>
</tr>
<tr><td><font color='dark brown'>Wife/Husband's Name</td><td><input type=text name='wifename' size=40 onKeyDown=chkey(this)></td>
    <td>BirthDate</td><td colspan=2>dd<input type=text name='wd' size=2>
			      mm<input type=text name='wm' size=2>
			      yy<input type=text name='wy' size=4></td></tr>
 
<tr><td><font color='dark brown'>Child Name 1</td><td><input type=text name='childname1' size=40 onKeyDown=chkey(this)></td>
    <td>BirthDate</td><td colspan=2>dd<input type=text name='cd1' size=2>
			      mm<input type=text name='cm1' size=2>
			      yy<input type=text name='cy1' size=4></td></tr>
 
<tr><td><font color='dark brown'>Child name 2</td><td><input type=text name='childname2' size=40 onKeyDown=chkey(this)></td>
    <td>BirthDate</td><td colspan=2>dd<input type=text name='cd2' size=2>
			      mm<input type=text name='cm2' size=2>
			      yy<input type=text name='cy2' size=4></td></tr>

<tr><td><font color='dark brown'>Child name 3</td><td><input type=text name='childname3' size=40 onKeyDown=chkey(this)></td>
    <td>BirthDate</td><td colspan=2>dd<input type=text name='cd3' size=2>
			      mm<input type=text name='cm3' size=2>
			      yy<input type=text name='cy3' size=4></td></tr>

<tr><td>Remark/ Experience </td><td colspan=13><textarea name='remark' cols=90 rows=2></textarea></td></tr>
<td colspan=13>Bank A/C No. <input type=text name='bnkac'> </tr>
<tr><td colspan=10 align=center><input type=submit value='Save'> 
<input type=button value='Cancel' onClick=document.location='blank.html'></td></tr>
</table>
</form>
</center>
