<?php 
session_name('CAKEPHP'); session_start();
$PageSecurity = 11;
include('includes/session.inc');
//include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
include("includes/function_lib.php");
include('CRM/functions.php');
$SUB=substr($_REQUEST['EMPName'],0,3);
$SQL=DB_query("SELECT * FROM empmaster WHERE CompanyId='".$_SESSION['ACGCompanyId']."' And emp_site='".$_REQUEST['branch']."'",$db);
if(DB_num_rows($SQL)>0)
{

}
else
{
	$finalCode=$SUB.'-'.'0001';
}
?>

<input type="text" name="emp_code" id="emp_code" value="<?php echo $finalCode;?>" size="30" tabindex="4"/>