<?php
ob_start();
$PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
include('includes/SQL_CommonFunctions.inc');
$x = $_REQUEST['site'];

		$activityCodeRow=DB_fetch_array(DB_query("select Max(id) as ActivityId from sub_activity_defination",$db));   
		$ActivityId=$activityCodeRow['ActivityId'];
		$prefix=strtoupper(substr($x,0,2));
		if($activityCodeRow['ActivityId']=='')
		{
		$postfix="-001";
		
		}
		else
		{
		$postfix=str_pad($activityCodeRow['ActivityId'],3,"0",STR_PAD_LEFT);
		$postfix="-".$postfix;
		}
		$ActivituCode=$prefix.$postfix;
?>
<input type="text" name="sub_activity_defination[activity_code]" id="group_code"  size="30" readonly style="width:200px;" value="<?php echo $ActivituCode; ?>"/>