<?php
	include_once 'includes/constants.php';
	include_once 'includes/processes.php';
	$Process = new Login_Process;
	
	
	 
	if(isset($_REQUEST['eid'])) {
		$con = mysqli_connect(DBHOST,DBUSER,DBPASS,DBNAME);
		 
		$id = $_REQUEST['eid'];
		  
		$query = "SELECT passport FROM bj_employees WHERE id = '$id'";
		  
		$result = mysqli_query($con,$query); 
		  
      	list($content) = mysqli_fetch_array($result);
		  
		$s = strlen($content);
 
		header("Content-length: $s");
		header("Content-type: images/JPEG");
		  
		print $content;
		  
		mysql_close();		  
	}

?>
