<?php

include("config.inc.php");

session_start();


$connection = mysql_connect($config['dbServer'],$config['dbUser'],$config['dbPass']) or die("Could not connect to DB");
mysql_select_db($HTTP_SESSION_VARS['dbName'],$connection) or die("Could not find DB");


$queryLogo = " Select Project_Picture as ProjectLogo From Project Where Project_Code = '".$ProjectCode."'";
$resultLogo = mysql_query($queryLogo,$connection) or die(mysql_error());
while($rowLogo = mysql_fetch_array($resultLogo,MYSQL_ASSOC)){
	$ProjectLogo = $rowLogo['ProjectLogo'];
} 
//echo $queryLogo; exit;
if (empty($ProjectLogo)) {
	$queryLogo = " Select Company_Logo as ProjectLogo From Setup "; 
	$resultLogo = mysql_query($queryLogo,$connection) or die(mysql_error());


	while($rowLogo = mysql_fetch_array($resultLogo,MYSQL_ASSOC)){
		$ProjectLogo = $rowLogo['ProjectLogo'];
	} 
}

header('Content-type: image/jpeg');
header('Content-type: image/bmp');

echo $ProjectLogo;




?> 