<?
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
include("../opendb.php");
$code=substr($empname,0,3).date("my").substr(time(),7,3);
$empcode=str_replace(' ','-',$code);


$dob=$y.'-'.$m.'-'.$d;
$doj=$yj.'-'.$mj.'-'.$dj;
$probdate=$py.'-'.$pm.'-'.$pd;
$doconf=$cy.'-'.$cm.'-'.$cd;
$doret=$ry.'-'.$rm.'-'.$rd;
$domarg=$marry.'-'.$marrm.'-'.$marrd;
$dobactual=$yac.'-'.$mac.'-'.$dac;
$dobw=$wy.'-'.$wm.'-'.$wd;
$dobc1=$cy1.'-'.$cm1.'-'.$cd1;
$dobc2=$cy2.'-'.$cm2.'-'.$cd2;
$dobc3=$cy3.'-'.$cm3.'-'.$cd3;


$sql="insert into empmaster values('$empcode','$brcode','$divi','$empname',"
." '$sex','$dob','$faname','$peraddr','$praddr', '$design','$doj','$probdate','$doconf'"
.",'$doret','$esi', '$pf','$bgrp','$drvno1','$drvdate1','$drvtype1', '$drvno2',".
"'$drvdate2','$drvtype2', '$drvno3','$drvdate3','$drvtype3','$insurname1','$insurdate1',"
."'$insurtype1', '$insurname2','$insurdate2','$insurtype2','$insurname3','$insurdate3',"
."'$insurtype3','$insurname4','$insurdate4', '$insurtype4','$quali1','$course1',"

."'$sub1','$mark1','$quali2','$course2','$sub2','$mark2','$quali3','$course3','$sub3',"
."'$mark3','$quali4','$course4','$sub4', '$mark4','$mstatus','$domarg','$nom',"
."'$nof','$resph', '$mob','$email','$br','$remark','$dept','$empid','$dobactual',"

."'$icename1','$icerel1','$iceaddr1','$icephone1','$icemob1','$icename2',"

."'$icerel2','$iceaddr2','$icephone2','$icemob2', '$pan','$term_date','Active','$lop','$apinpay','$trainee','No','$grp','-','$emtype','$incmon','$wifename','$dobw','$dobc1','$dobc2','$dobc3','$childname1','$childname2','$childname3','$bnkac')";
mysqli_query($db,$sql) or die(mysqli_error($db));
print "Data has been added";
include("newemp.php");
 ?>
