<?php
session_start();
ob_start();

require("includes/config.php");
require("includes/dbcon.php");
if($_SESSION['uid']==""){	
	header("location:index.php");
	exit();
}
$enrollee_id=$_SESSION['uid'];
$officerId=$_REQUEST['oId'];
$_SESSION['officerId'] = $officerId;

$activeQuery = mysql_query("select activFlag from enrollee where enrollee_id=".$enrollee_id);
$activeValue = mysql_fetch_array($activeQuery);
if( $enrollee_id !="" && $officerId !="")
{
	$insert_EnrolleeEo_sql="insert into enrollee_eo set 
							enrollee_id =".$enrollee_id.", 
							eo_id=".$officerId;	
	mysql_query($insert_EnrolleeEo_sql);	
		 
	$update_enrollee_sql="update enrollee SET activFlag=1";
	$update_enrollee_sql .= " WHERE enrollee_id=".$enrollee_id;	
	//print $update_enrollee_sql;
	$rs=mysql_query($update_enrollee_sql) or die(mysql_error());		
	header("location:getDocs.php");	
}
ob_end_flush();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="./style/design.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
.style1 {font-size: 0.8em}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Final Page</title>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td align="center" valign="top">

<?php
include_once("includes/header.php");
?>
			<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">	 
				 <tr>
				   <td width="30%" valign="top">
					<div class="bodySubHeader">
					<span class="bsht03">Final Step</span>		
					</div>
					</td>
				 </tr> 
			</table>
			<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="DarkLightBox">	 
			 <tr>
			   <td height="30" align="center" valign="top" colspan="8" class="ErrorMessage"><strong><?=$err_msg?></strong></td>	   
			 </tr> 
			</table>
		</td>
	</tr>
</table>
</body>
</html>
