<?
ob_start();
session_start();
if(isset($_SESSION['ses_name']))
{
$user=$_SESSION['ses_name'];
}else{
header("location:index.php");
}
$tyrenum_veh='';$client_main='';
$cclient_name='';$rproduct_client_code='';
include("include/config.php");
require_once "include/Database_functions.php";
require_once("include/resize_class.php");
require_once("include/resize_galary.php");
$sqlObj=new sqlclass();

function resize_image($size_w,$size_h,$fullpath,$thumbfile,$replace,$ch_w,$ch_h)
{
	if($replace==1)
		$thumbfile=$fullpath;
	$max_wt=$ch_w;
	$max_ht=$ch_h;
	if($size_w > $max_wt || $size_h > $max_ht)
	{
		$width_ratio  = ($size_w / $max_wt);
		$height_ratio = ($size_h  / $max_ht);
		if($width_ratio >=$height_ratio) 
		{
		   $ratio = $width_ratio;
		}
		else
		{
		   $ratio = $height_ratio;
		}
		$new_wt  = ($size_w / $ratio);
		$new_ht   = ($size_h  / $ratio);
	} 
	else
	{
		$new_wt  = $size_w ;#$max_wt;
		$new_ht   = $size_h; #$max_ht;
	}
	//header("Content-Type: image/jpeg");
	$src=@imagecreatefromjpeg($fullpath);
	$thumb=@imagecreatetruecolor($new_wt,$new_ht);
	@imagecopyresampled($thumb,$src,0,0,0,0,$new_wt,$new_ht,$size_w,$size_h );
	@imagejpeg($thumb,$thumbfile);
	@imagedestroy($src);
	@imagedestroy($thumb);
}

$rproduct_name='';$rproduct_category='';$employee_id='';
	

$tablename='cf_employee';
            
		 $pdate=date("Y-m-d");
		 	
			if(isset($_POST['first_name'])){
			$first_name=addslashes($_POST['first_name']);
			}
						
			if(isset($_POST['last_name'])){
			$last_name=addslashes($_POST['last_name']);
			}
			
			if(isset($_POST['dob'])){
			$dob=addslashes($_POST['dob']);
			$dob=date(('Y-m-d'),strtotime($_POST['dob']));
			}	
			
			if(isset($_POST['doj'])){
			$doj=addslashes($_POST['doj']);
			$doj=date(('Y-m-d'),strtotime($_POST['doj']));
			}
			
			if(isset($_POST['sex'])){
			$sex=addslashes($_POST['sex']);
			}
			
						
			if(isset($_POST['branch_name'])){
			$branch_name=addslashes($_POST['branch_name']);
			}
			
			if(isset($_POST['mobile_no'])){
			$mobile_no=addslashes($_POST['mobile_no']);
			}
			
			if(isset($_POST['landline_no'])){
			$landline_no=addslashes($_POST['landline_no']);
			}
			
			if(isset($_POST['email_add'])){
			$email_add=addslashes($_POST['email_add']);
			}
			
			if(isset($_POST['address1'])){
			$address1=addslashes($_POST['address1']);
			}
			
			if(isset($_POST['provlog'])){
			$provlog=addslashes($_POST['provlog']);
			}
						
			if(isset($_POST['branch_id'])){
			$branchids=addslashes($_POST['branch_id']);
			}
			
			if(isset($_POST['depart_id'])){
			$departid=addslashes($_POST['depart_id']);
			}
			
			if(isset($_POST['desig_id'])){
			$desigids=addslashes($_POST['desig_id']);
			}
			
			if(isset($_POST['imm_supr'])){
			$imm_supr=addslashes($_POST['imm_supr']);
			}
			
			if(isset($_POST['acc_name'])){
			$acc_name=addslashes($_POST['acc_name']);
			}
			
			if(isset($_POST['bank_name'])){
			$bank_name=addslashes($_POST['bank_name']);
			}
			
			if(isset($_POST['acc_no'])){
			$acc_no=addslashes($_POST['acc_no']);
			}
			
			if(isset($_POST['bank_add'])){
			$bank_add=addslashes($_POST['bank_add']);
			}
			
			if(isset($_POST['ifsc'])){
			$ifsc=addslashes($_POST['ifsc']);
			}
			
			if(isset($_POST['level'])){
			$level=addslashes($_POST['level']);
			}
			
			if(isset($_POST['course'])){
			$course=addslashes($_POST['course']);
			}			
			
			if(isset($_POST['radio_eng1'])){
			$radio_eng1=addslashes($_POST['radio_eng1']);
			}
			
			if(isset($_POST['radio_eng2'])){
			$radio_eng2=addslashes($_POST['radio_eng2']);
			}
			
			if(isset($_POST['radio_eng3'])){
			$radio_eng3=addslashes($_POST['radio_eng3']);
			}
			
			if(isset($_POST['radio_mal1'])){
			$radio_mal1=addslashes($_POST['radio_mal1']);
			}
			
			if(isset($_POST['radio_mal2'])){
			$radio_mal2=addslashes($_POST['radio_mal2']);
			}
			
			if(isset($_POST['radio_mal3'])){
			$radio_mal3=addslashes($_POST['radio_mal3']);
			}

			if(isset($_POST['radio_tam1'])){
			$radio_tam1=addslashes($_POST['radio_tam1']);
			}
			
			if(isset($_POST['radio_tam2'])){
			$radio_tam2=addslashes($_POST['radio_tam2']);
			}
			
			if(isset($_POST['radio_tam3'])){
			$radio_tam3=addslashes($_POST['radio_tam3']);
			}
			
			if(isset($_POST['radio_hin1'])){
			$radio_hin1=addslashes($_POST['radio_hin1']);
			}
			
			if(isset($_POST['radio_hin2'])){
			$radio_hin2=addslashes($_POST['radio_hin2']);
			}
			
			if(isset($_POST['radio_hin3'])){
			$radio_hin3=addslashes($_POST['radio_hin3']);
			}
			
			
			if(isset($_POST['save'])){	
			
			$obj = new Resize();
			if($_FILES['filex']['name'][0]!="") 
				{
				// ---------- MULTIPLE UPLOADS ----------
			
				// as it is multiple uploads, we will parse the $_FILES array to reorganize it into $files
				$files = array();
				
				foreach ($_FILES['filex'] as $k => $l) {
					foreach ($l as $i => $v) {
						if (!array_key_exists($i, $files)) 
							$files[$i] = array();
						$files[$i][$k] = $v;
					}
				}
				$destFolder = '';
				$destFolder = 'doc_files/';
			
			  
				$i = 1;
			   foreach ($files as $file) {
					$srcFile = $file['tmp_name'];
					$imgArr = explode('.',$file['name']);
					$fileName = $imgArr[0];
					$ext = $imgArr[count($imgArr) - 1];
					$micriTime = uniqid("");
					$destFile = $destFolder."/" . $fileName.'.'.$ext;
					
					if(move_uploaded_file($srcFile,$destFile)){
					/************************************/
					 $destFile1 = $destFolder."/thumb_" . $fileName.'.'.$ext;
											$size=@getimagesize($destFile);
											$size_w=$size[0];
											$size_h=$size[1];
											$thumb_sze_hgt=240;
											$thumb_sze_wid=240;
											//----------------------------------------------------------------//
											if($size_w > $thumb_sze_wid && $size_h > $thumb_sze_hgt)
												{
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->resize($thumb_sze_wid, $thumb_sze_hgt);
													$image_thump->save($destFile1);
												}
															
											if($size_w > $thumb_sze_wid && $size_h <= $thumb_sze_hgt)
												{
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->resizeToWidth($thumb_sze_wid);
													$image_thump->save($destFile1);
												}
											if($size_w <= $thumb_sze_wid && $size_h > $thumb_sze_hgt)
												{
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->resizeToHeight($thumb_sze_hgt);
													$image_thump->save($destFile1);
												}
												if($size_w <= $thumb_sze_wid && $size_h <= $thumb_sze_hgt)
												{
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													//$image_thump->resizeToHeight(51);
													$image_thump->save($destFile1);
												}
										
											
											
											
												 $docname = $fileName.'.'.$ext; 
										
					}
			
					
					
					$i++;
					}
			
				}
				
			if($_FILES['filer']['name'][0]!="") 
				{
				// ---------- MULTIPLE UPLOADS ----------
			
				// as it is multiple uploads, we will parse the $_FILES array to reorganize it into $files
				$files = array();
				
				foreach ($_FILES['filer'] as $k => $l) {
					foreach ($l as $i => $v) {
						if (!array_key_exists($i, $files)) 
							$files[$i] = array();
						$files[$i][$k] = $v;
					}
				}
				$destFolder = '';
				$destFolder = 'resume_files/';
			
			  
				$i = 1;
			   foreach ($files as $file) {
					$srcFile = $file['tmp_name'];
					$imgArr = explode('.',$file['name']);
					$fileName = $imgArr[0];
					$ext = $imgArr[count($imgArr) - 1];
					$micriTime = uniqid("");
					$destFile = $destFolder."/" . $fileName.'_'.$micriTime.'.'.$ext;
					
					if(move_uploaded_file($srcFile,$destFile)){
					/************************************/
					 $destFile1 = $destFolder."/thumb_" . $fileName.'_'.$micriTime.'.'.$ext;
											$size=@getimagesize($destFile);
											$size_w=$size[0];
											$size_h=$size[1];
											$thumb_sze_hgt=240;
											$thumb_sze_wid=240;
											//----------------------------------------------------------------//
											if($size_w > $thumb_sze_wid && $size_h > $thumb_sze_hgt)
												{
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->resize($thumb_sze_wid, $thumb_sze_hgt);
													$image_thump->save($destFile1);
												}
															
											if($size_w > $thumb_sze_wid && $size_h <= $thumb_sze_hgt)
												{
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->resizeToWidth($thumb_sze_wid);
													$image_thump->save($destFile1);
												}
											if($size_w <= $thumb_sze_wid && $size_h > $thumb_sze_hgt)
												{
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->resizeToHeight($thumb_sze_hgt);
													$image_thump->save($destFile1);
												}
												if($size_w <= $thumb_sze_wid && $size_h <= $thumb_sze_hgt)
												{
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													//$image_thump->resizeToHeight(51);
													$image_thump->save($destFile1);
												}
										
											
											$lar_wid=500;
											$lar_hgt=500;
											if($size_w > $lar_wid && $size_h > $lar_hgt)
												{
												/*$destFiles = $destFolder."/original_" . $fileName.'_'.$micriTime.'.'.$ext;
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->resize(800, 600);
													$image_thump->save($destFiles);
													*/
													$destFiles = $destFolder."/original_" . $fileName.'_'.$micriTime.'.'.$ext;
													//$imagePath1	=   $destFiles;
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->save($destFiles);
													//resizeimagewdthhegt($imagePath1,800,600);
													resize_image($size_w,$size_h,$destFile,$destFiles,0,$lar_wid,$lar_hgt);
												}
												if($size_w <= $lar_wid && $size_h > $lar_hgt)
												{
												$destFiles = $destFolder."/original_" . $fileName.'_'.$micriTime.'.'.$ext;
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->save($destFiles);
													//resizeimagewdthhegt($imagePath1,800,600);
													resize_image($size_w,$size_h,$destFile,$destFiles,0,$lar_wid,$lar_hgt);
												}
												if($size_w > $lar_wid && $size_h <= $lar_hgt)
												{
												$destFiles = $destFolder."/original_" . $fileName.'_'.$micriTime.'.'.$ext;
													$imagePath1	=   $destFiles;
													$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->save($destFiles);
													//resizeimagewdthhegt($imagePath1,800,600);
													resize_image($size_w,$size_h,$destFile,$destFiles,0,$lar_wid,$lar_hgt);
												}
												if($size_w <= $lar_wid && $size_h <= $lar_hgt)
												{
												$destFiles = $destFolder."/original_" . $fileName.'_'.$micriTime.'.'.$ext;
												$image_thump = new SimpleImage();
													$image_thump->load($destFile);
													$image_thump->save($destFiles);
													//resize_image($size_w,$size_h,$destFile,$destFiles,1,800,600);
												}
											
												 $resumename = $fileName.'_'.$micriTime.'.'.$ext; 
										
					}
			
					
					
					$i++;
					}
			
				}
			
			$rempid = $_REQUEST['empid'];		
				
			$sqlObj->tablename=$tablename;
			
			$sqlObj->fieldname='(e_fname,e_lname,e_dob,e_doj,e_gender,e_mob,e_landline,e_mail,e_add,e_login,branchid,departid,desigid,imm_supr,user_type,status,acc_name,acc_no,bank_name,bank_address,IFSC,doc_name,resume_name,e_qualification,e_course,e_eng_rd,e_eng_wt,e_eng_sp,e_mal_rd,e_mal_wt,e_mal_sp,e_tam_rd,e_tam_wt,e_tam_sp,e_hin_rd,e_hin_wt,e_hin_sp)';
			$sqlObj->fieldvalue='"'.$first_name.'","'.$last_name.'","'.$dob.'","'.$doj.'","'.$sex.'","'.$mobile_no.'","'.$landline_no.'","'.$email_add.'","'.$address1.'","'.$provlog.'","'.$branchids.'","'.$departid.'","'.$desigids.'","'.$imm_supr.'","Subadmin","1","'.$acc_name.'","'.$bank_name.'","'.$acc_no.'","'.$bank_add.'","'.$ifsc.'","'.$docname.'","'.$resumename.'","'.$level.'","'.$course.'","'.$radio_eng1.'","'.$radio_eng2.'","'.$radio_eng3.'","'.$radio_mal1.'","'.$radio_mal2.'","'.$radio_mal3.'","'.$radio_tam1.'","'.$radio_tam2.'","'.$radio_tam3.'","'.$radio_hin1.'","'.$radio_hin2.'","'.$radio_hin3.'"';
			if($rempid==""){
			 echo $qsy= "insert into ".$tablename.$sqlObj->fieldname." values(".$sqlObj->fieldvalue.")";
			 $CreateClient 	= mysql_query($qsy);
			$lastid = mysql_insert_id();
			$ledgername=$first_name.'_(Employee)-'.$lastid;
			
			mysql_query("insert into cf_ledger (ledgername,ledgertype,empid,groupid) values('$ledgername','employeeledger','$lastid','13')");
			}else{
			$updata="e_fname='".$first_name."',e_lname='".$last_name."',e_dob='".$dob."',e_doj='".$doj."',e_gender='".$sex."',e_mob='".$mobile_no."',e_landline='".$landline_no."',e_mail='".$email_add."',e_add='".$address1."',e_login='".$provlog."',branchid='".$branchids."',departid='".$departid."',desigid='".$desigids."',imm_supr='".$imm_supr."',acc_name='".$acc_name."',acc_no='".$acc_no."',bank_name='".$bank_name."',bank_address='".$bank_add."',IFSC='".$ifsc."',e_qualification='".$level."',e_course='".$course."',e_eng_rd='".$radio_eng1."',e_eng_wt='".$radio_eng2."',e_eng_sp='".$radio_eng3."',e_mal_rd='".$radio_mal1."',e_mal_wt='".$radio_mal2."',e_mal_sp='".$radio_mal3."',e_tam_rd='".$radio_tam1."',e_tam_wt='".$radio_tam2."',e_tam_sp='".$radio_tam3."',e_hin_rd='".$radio_hin1."',e_hin_wt='".$radio_hin2."',e_hin_sp='".$radio_hin3."'";
			$qsy= "update ".$tablename." set ".$updata." where e_id='".$rempid."'";
			$CreateClient 	= mysql_query($qsy);
			
			//$ledgername=$first_name.'_(Employee)-'.$rempid;
			//mysql_query("insert into cf_ledger (ledgername,ledgertype,empid,groupid) values('$ledgername','employeeledger','$rempid','13')");
									
			}
			
			header("location:employee-list.php?msg=You Have Successfully Saved");
			
		}

$efname='';
$elname='';
$edob='';
$edoj='';
$emob='';
$elandline='';
$email='';
$eadd='';	
$egender='';	
$elogin='';	
$rbrchid='';
$rdepartsid='';
$rdesignation_id='';
$accname='';
$accno='';
$bankname='';
$bankaddress='';
$IFSC='';
$equalification='';
$ecourse='';

$eng_rd='';
$eng_wt='';
$eng_sp='';
$mal_rd='';
$mal_wt='';
$mal_sp='';

$tam_rd='';
$tam_wt='';
$tam_sp='';
$hin_rd='';
$hin_wt='';
$hin_sp='';

if(isset($_REQUEST['empid'])){
	$empid=mysql_escape_string($_REQUEST['empid']);
	$rqry="SELECT *  FROM cf_employee where e_id='".$empid."'";
	
	$sqry=mysql_query($rqry);
	if($sqry && mysql_num_rows($sqry)>0)
	{
		while($sobj=mysql_fetch_object($sqry))
		{
			$efname=$sobj->e_fname;
			$elname=$sobj->e_lname;
			$edob=date(('d-m-Y'),strtotime($sobj->e_dob));		
			$edoj=date(('d-m-Y'),strtotime($sobj->e_doj));
			$emob=$sobj->e_mob;
			$elandline=$sobj->e_landline;
			$egender=$sobj->e_gender;
			$email=$sobj->e_mail;
			$eadd=$sobj->e_add;
			$elogin=$sobj->e_login;
			$rbrchid=$sobj->branchid;
			$rdepartsid=$sobj->departid;
			$rdesignation_id=$sobj->desigid;
			$employee_id=$sobj->imm_supr;
			
			$accname=$sobj->acc_name;
			$accno=$sobj->acc_no;
			$bankname=$sobj->bank_name;
			$bankaddress=$sobj->bank_address;
			$IFSC=$sobj->IFSC;
			
			$doc_image1=$sobj->doc_name;
			$resume_image1=$sobj->resume_name;
			
			$equalification=$sobj->e_qualification;
			$ecourse=$sobj->e_course;
			
			$eng_rd=$sobj->e_eng_rd;
			$eng_wt=$sobj->e_eng_wt;
			$eng_sp=$sobj->e_eng_sp;
			$mal_rd=$sobj->e_mal_rd;
			$mal_wt=$sobj->e_mal_wt;
			$mal_sp=$sobj->e_mal_sp;
			
			$tam_rd=$sobj->e_tam_rd;
			$tam_wt=$sobj->e_tam_wt;
			$tam_sp=$sobj->e_tam_sp;
			$hin_rd=$sobj->e_hin_rd;
			$hin_wt=$sobj->e_hin_wt;
			$hin_sp=$sobj->e_hin_sp;
		}
		}
	}
	
			
		
					

?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OIL FILL</title>
<link href="css/styles.css" rel="stylesheet"  />
<link type="text/css" href="css_date/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
<script type="text/javascript" src="scripts_date/jquery.js"></script>
<script type="text/javascript" src="scripts_date/jquery-calendar-1.7.2.js"></script>
<script src="js/addmoretown.js"></script>



<script type="text/javascript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


</script>

<script type='text/javascript'>
	
function validationprod()
{

	if(document.prodfrmname.first_name.value=='')
	{
		alert("Enter First Name");
		document.prodfrmname.first_name.focus();
		return false;
	}
	if(document.prodfrmname.last_name.value=='')
	{
		alert("Enter Last Name");
		document.prodfrmname.last_name.focus();
		return false;
	}
	
	if(document.prodfrmname.branch_id.value=='')
	{
		alert("Enter Branch Name");
		document.prodfrmname.branch_id.focus();
		return false;
	}
	
	if(document.prodfrmname.depart_id.value=='')
	{
		alert("Enter Department Name");
		document.prodfrmname.depart_id.focus();
		return false;
	}
	
	if(document.prodfrmname.address1.value=='')
	{
		alert("Enter address");
		document.prodfrmname.address1.focus();
		return false;
	}
	
	
}
//--client code dropdown


$(document).ready(function(){
$('#dob').datepicker({
showOn: 'both',
buttonImage: 'icons_date/calendar.gif',
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
dateFormat: 'dd-mm-yy'
});
});

$(document).ready(function(){
$('#doj').datepicker({
showOn: 'both',
buttonImage: 'icons_date/calendar.gif',
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
dateFormat: 'dd-mm-yy'
});
});

function showDesignation(str){
var xmlhttp;    
if (str=="")
  {
  document.getElementById("txtdesignationshow").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
	   document.getElementById("txtdesignationshow").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","desginationajax_show.php?str="+str,true);
xmlhttp.send();
}
</script>

<style>
.lableentrytext{
font-size: 12px;
color: #505050;
clear: both;
margin-bottom: 5px;
text-transform: capitalize;
}
.addimgs{
font-size: 12px;
color: #505050;
clear: both;
margin-bottom: 5px;
text-transform: capitalize;
cursor:hand;
cursor:pointer;
}
.addimgs a:hover{
color: #000;
}
.rimg{
font-size: 12px;
color: #505050;
clear: both;
margin-bottom: 5px;
text-transform: capitalize;
cursor:hand;
cursor:pointer;
}
.rimg a:hover{
color: #000;
}

</style>
</head>

<body>
<div class="wrapper">
  <div>
<?php 
	include("header.php");
?>
 
</div>
 
 
 <div class="tabbedArea">
  
  <div class="tabBody">
   <h1>Add Employee</h1>
   <form name="prodfrmname" method="post" action="" enctype="multipart/form-data">
    <div class="addEmp" style="margin-bottom:0px; border-bottom:0px solid;width:1000px;">
        <table width="70%" border="0" cellspacing="0" cellpadding="10">
          <tr>
            <td valign="top">
           
            <div class="form1">
            
           <div class="form1">
        	<p class="input1">First Name<span style="color:#FF3300">*</span></p><input type="text" name="first_name" id="first_name" class="input1 input3" value="<?=$efname?>" >
     	   </div>
            
           <div class="form1">
			<p class="input1">Last Name<span style="color:#FF3300">*</span></p>
			<input type="text" name="last_name" id="last_name" class="input1 input3" value="<?=$elname?>" >
     	  </div>
		  
		  <div class="form1">
              <p class="input1">Date of Birth</p>
              <input type="text" name="dob" id="dob" class="input1 input3" value="<?=$edob?>" >
         </div>  
             
         <div class="form1">
               <p class="input1">Date of Join</p>
               <input type="text" name="doj" id="doj" class="input1 input3" value="<?=$edoj?>" >
         </div>
             
         <div class="searchField">
             <p class="input1">Sex</p>
             <div class="box">
             <div>
             <input name="sex" type="radio" value="male" <?php if($egender == 'male'){?> checked <?php } ?> ><label>Male</label></div>
             <div><input name="sex" type="radio" value="female" <?php if($egender == 'female'){?> checked <?php } ?>  ><label>Female</label></div>
            </div>
          </div>
          
         <div>     
      			<p class="input1">Mobile No</p>
      			<input type="text" name="mobile_no" id="mobile_no" class="input1 input3" value="<?=$emob?>" >
     	 </div> 
           
          <div>     
      			<p class="input1">Email Address</p>
      			<input type="text" name="email_add" id="email_add" class="input1 input3" value="<?=$email?>" >
     	   </div> 
           
		 <div class="searchField">
			 <p class="input1">Provide Login</p>
		 <div class="box">
			 
		 <div><input name="provlog" type="radio" value="1" <?php if($elogin == '1'){?> checked <?php } ?>   ><label>Yes</label></div>
		 <div><input name="provlog" type="radio" value="0" <?php if($elogin == '0'){?> checked <?php } ?>   ><label>No</label></div>
		</div>
		</div>
           
	   <div>     
			<p class="input1">Address<span style="color:#FF3300">*</span></p><textarea name="address1" class="input1"><?=$eadd?></textarea>
	   </div>     
           
          </div>
        </td>
        
		<td valign="top">
		<div class="form1">
            		   
		   <div>     
      			<p class="input1">Branch Name</p>
                <select class="input1 input3" name="branch_id">
                     <option value="">Branch Name</option>
                         <?php 
                            $sq_branch="select * from cf_branch";
                            $arrbrch=mysql_query($sq_branch);
                            while($resbrh=mysql_fetch_array($arrbrch))
                            {
                        ?>
                            <option value="<?=$resbrh['branch_id']?>" <? if($resbrh['branch_id']==$rbrchid) {?>selected<? }?>><?=$resbrh['branch_name']?></option>
                        <?php
                                }
                     ?>
    			 </select>
     	   </div>
		   
		   <div>     
      			<p class="input1">Department Name</p>
                <select class="input1 input3" name="depart_id" onChange="showDesignation(this.value)">
                     <option value="">Department Name</option>
                         <?php 
                            $sq_depart="select * from cf_department";
                            $arr1=mysql_query($sq_depart);
                            while($resdepart=mysql_fetch_array($arr1))
                            {
                        ?>
                            <option value="<?=$resdepart['depart_id']?>" <? if($resdepart['depart_id']==$rdepartsid) {?>selected<? }?>><?=$resdepart['depart_name']?></option>
                        <?php
                                }
                     ?>
    			 </select>
     	   </div><p class="input1">Designation Name</p>
      
	 	   <div id="txtdesignationshow">   
      <div>     
      			
                <select class="input1 input3" name="desig_id">
                <? if(isset($rdesignation_id) && $rdesignation_id!=''){?>
                     <option value="">Designation Name</option>
                         <?php 
                            $sq_design="select * from cf_designation where departs_id = '$rdepartsid'";
                            $arrdesign=mysql_query($sq_design);
                            while($resdesg=mysql_fetch_array($arrdesign))
                            {
                        ?>
                            <option value="<?=$resdesg['desig_id']?>" <? if($resdesg['desig_id']==$rdesignation_id) {?>selected<? }?>><?=$resdesg['desig_name']?></option>
                        <?php
                                }}
								else
								{?>
								<option value="">Designation Name</option>
								<?								
								}
                     ?>
    			 </select>
     	   </div>        
     </div>
	 
           <p class="input1">Immediate Supervisor</p>
     
	       <div id="txtsupervisorshow">   
      <div>     
      			
                <select class="input1 input3" name="imm_supr">
                
                     <option value="">Imm Supervisor Name</option>
                         <?php 
                            $sq_emp="select * from cf_employee where 1";
                            $arremp=mysql_query($sq_emp);
                            while($resemp=mysql_fetch_array($arremp))
                            {
                        ?>
                            <option value="<?=$resemp['e_id']?>" <? if($resemp['e_id']==$employee_id) {?>selected<? }?>><?=$resemp['e_fname']?></option>
                        <?php
                                }
					
                     ?>
    			 </select>
     	   </div>        
     </div>
           
		   
		<div>     
      			<p class="input1">Document Upload<span style="color:#FF3300">*</span></p> 
                <input type="file" name="filex[]" id="filex" onChange="check_file()" />
                <input type="hidden" name="uval[]" id="uval[]2" value="1" />
                <input type="hidden" name="pid2" id="pid2" value="1" />
                
                <?php
										
					if(!empty($doc_image1))
					{
					$thumbloc1="doc_files/" . $doc_image1;
					?>
					<?php echo $doc_image1; ?>
				<?php }?>
     	</div> 
		
		<div>     
      			<p class="input1">Resume Upload<span style="color:#FF3300">*</span></p> 
                <input type="file" name="filer[]" id="filex" onChange="check_file()" />
                <input type="hidden" name="uval[]" id="uval[]2" value="1" />
                <input type="hidden" name="pid2" id="pid2" value="1" />
                
                <?php
										
					if(!empty($resume_image1))
					{
					$thumbloc2="resume_files/" . $resume_image1;
					?>
					<?php echo $resume_image1; ?>
				<?php }?>
     	</div>    
           
		 
		  <div>     
      			<table width="408" border="0" cellspacing="5" cellpadding="5">
  <tr>
    <td width="139" align="left" valign="middle" class="form-padd-01"><label for="label">Highest Level completed</label></td>
    <td width="234"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top"><span id="lblFName">
          <label>
		  <input name="level" type="radio" value="10th" id="level" <?php if($equalification == '10th'){?> checked <?php } ?>/>
          </label>
10th</span></td>
      </tr>
      <tr>
        <td align="left" valign="top"><span id="lblFName">
          <label>
          <input name="level" type="radio" value="plus2" id="level1" <?php if($equalification == 'plus2'){?> checked <?php } ?> />
          </label>
+2</span></td>
      </tr>
      <tr>
        <td align="left" valign="top"><span id="lblFName">
          <input name="level" type="radio" value="graduation" id="level4" <?php if($equalification == 'graduation'){?> checked <?php } ?> />
         Graduation</span></td>
</tr>
      <tr>
        <td align="left" valign="top"><span id="lblFName">
          <input name="level" type="radio" value="pg" id="level3" <?php if($equalification == 'pg'){?> checked <?php } ?> />
Post Graduation</span></td> 
</tr>
      
    </table></td>
  </tr>
</table>

 <div>     
      <p class="input1">Course</p>
      <input type="text" name="course" id="course" class="input1 input3" value="<?=$ecourse?>" >
 </div> 
           

<table width="100%" border="0" cellpadding="5" cellspacing="5">
  <tr>
    <td width="17%" align="left" valign="top">&nbsp;</td>
    <td width="12%" align="left" valign="top">Read</td>
    <td width="12%" align="left" valign="top">Write</td>
    <td width="36%" align="left" valign="top">Speak</td>
  </tr>
  <tr>
    <td align="left" valign="top">English</td>
    <td align="left" valign="top"><input type="checkbox" name="radio_eng1" id="radio_eng1" value="read" <?php if($eng_rd == 'read'){?> checked <?php } ?>/></td>
    <td align="left" valign="top"><input type="checkbox" name="radio_eng2" id="radio_eng2" value="write" <?php if($eng_wt == 'write'){?> checked <?php } ?>/></td>
    <td align="left" valign="top"><input type="checkbox" name="radio_eng3" id="radio_eng3" value="speak" <?php if($eng_sp == 'speak'){?> checked <?php } ?>/></td>
  </tr>
  <tr>
    <td align="left" valign="top">Hindi</td>
    <td align="left" valign="top"><input type="checkbox" name="radio_hin1" id="radio_hin1" value="read" <?php if($hin_rd == 'read'){?> checked <?php } ?>/></td>
    <td align="left" valign="top"><input type="checkbox" name="radio_hin2" id="radio_hin2" value="write" <?php if($hin_wt == 'write'){?> checked <?php } ?>/></td>
    <td align="left" valign="top"><input type="checkbox" name="radio_hin3" id="radio_hin3" value="speak" <?php if($hin_sp == 'speak'){?> checked <?php } ?>/></td>
  </tr>
  <tr>
    <td align="left" valign="top">Malayalam</td>
    <td align="left" valign="top"><input type="checkbox" name="radio_mal1" id="radio_mal1" value="read" <?php if($mal_rd == 'read'){?> checked <?php } ?>/></td>
    <td align="left" valign="top"><input type="checkbox" name="radio_mal2" id="radio_mal2" value="write" <?php if($mal_wt == 'write'){?> checked <?php } ?>/></td>
    <td align="left" valign="top"><input type="checkbox" name="radio_mal3" id="radio_mal3" value="speak" <?php if($mal_sp == 'speak'){?> checked <?php } ?>/></td>
  </tr>
  <tr>
    <td align="left" valign="top">Tamil</td>
    <td align="left" valign="top"><input type="checkbox" name="radio_tam1" id="radio_tam1" value="read" <?php if($tam_rd == 'read'){?> checked <?php } ?>/></td>
    <td align="left" valign="top"><input type="checkbox" name="radio_tam2" id="radio_tam2" value="write" <?php if($tam_wt == 'write'){?> checked <?php } ?>/></td>
    <td align="left" valign="top"><input type="checkbox" name="radio_tam3" id="radio_tam3" value="speak" <?php if($tam_sp == 'speak'){?> checked <?php } ?>/></td>
  </tr>
  <tr>
    <td align="left" valign="top">&nbsp;</td>
    <td align="left" valign="top">&nbsp;</td>
    <td align="left" valign="top">&nbsp;</td>
    <td align="left" valign="top">&nbsp;</td>
  </tr>
</table>
     	 </div>
          
         </div></td>
		 
		 <td valign="top">
		 <div class="form1">
             
          <div>     
      			<p class="input1">Account Name</p>
      			<input type="text" name="acc_name" id="acc_name" class="input1 input3" value="<?=$accname?>" >
     	 </div>
		 
		 <div>     
      			<p class="input1">Bank Name</p>
      			<input type="text" name="bank_name" id="bank_name" class="input1 input3" value="<?=$bankname?>" >
     	 </div> 
		 
		 <div>     
      			<p class="input1">Account Number</p>
      			<input type="text" name="acc_no" id="acc_no" class="input1 input3" value="<?=$accno?>" >
     	 </div> 
		 
		 <div>     
      			<p class="input1">Bank Address</p>
				<textarea name="bank_add" class="input1"><?=$bankaddress?></textarea>
      	 </div>
		 
		 <div>     
      			<p class="input1">IFSC Code</p>
      			<input type="text" name="ifsc" id="ifsc" class="input1 input3" value="<?=$IFSC?>" >
     	 </div>
          
         </div></td>
		 
          </tr>
           <tr>
         <td colspan="2"><div class="searchField1">
        <?php
	 	if(isset($_REQUEST['empid'])){
		$rbrchid = $_REQUEST['empid'];
	  ?><input name="brchid" type="hidden" value="<?=$rbrchid?>">  
	 
      <input name="save" type="submit" class="input1" value="Edit" onClick="return validationprod_1();"/>
      <?php }else { ?>   
     <input name="save" type="submit" class="input1" value="Save" onClick="return validationprod_1();"/>
	  
     <?php } ?>

         <input type="button" class="input1" value="Cancel" >
        </div>
        </td>
          </tr>
        </table>
 

<div class="mand"><p>Fields marked <span style="color:#FF3300">*</span> are Mandatory</p></div>
</div>
   </form>
   </div>
 </div>
 <div class="footer"><p>Powered by <a href="http://www.aadhocc.co.uk/" target="_blank">Aadhocc</a></p></div>
 
</div>
<div class="quicLInksCover">
  <?php 
	include("leftlink.php");
?>

</div>
</body>
</html>


		






