<? 
session_start();
include("functions/conexion.php");
include("functions/divs.php");
include ("graphs/src/jpgraph.php");
include ("graphs/src/jpgraph_bar.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Main Page</title>
<meta name="Description" content="Trade" />
<meta name="Keywords" content="Trade" />
<meta http-equiv="Content-Type" content="text/html" />
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="Virtual Trade RSS" href="http://localhost/functions/rss.php" />
</head>

<body>

<div id="title">
	<div id="header">
	<img src="images/money.png" alt="Money" align="left"/>
	</div>
	<div id="virtualtrade">
	<h1>      
    	<a href="index.php"><img src="images/title.png" alt="Virtual Trade"/></a>
    </h1>
	</div>
	<div id="signin">
	<?
	if(isset($_SESSION['login'])) {
		echo "<a href='/infouser.php'>".$_SESSION['login']."</a>";
		echo "&nbsp;&nbsp;";
		echo "<a href='/functions/logout.php'>Sign out</a>";
	}
	else{
	?>
	<a href="/register.php">Register</a>
	<a href="/loginindex.php">Sign in</a>
	<?
	}
	?>
	<br/>
	</div>
</div>

<div id="top">
<div id="userinfo">
	<?php 
	if(isset($_SESSION['login'])) 
		printuser();

	if (!isset($_SESSION['login'])){
		printlogin();
	}

	
	?>
</div>
	
	
	<div id="pricestocks">
	<?php
	pricestocks();
	?>
	</div>  
 
</div>

<div id="down"> 

<?
if(isset($_SESSION['login'])){
?>
	<div id="sellbuyuser">
	<?
	printsellbuyuser();
	?>
	<a href="functions/generatepdftables.php">Generate PDF with your information</a>
	<br/><br/>
	<a href="/functions/logout.php">Logout</a>
	</div>
	<div id="sellbuy">
		<div id="sell">
		<?
 		printsells();
		?>
		<div id="buy2">
				<a href="buyuser.php">Buy in your choice</a>
		</div>
		</div>

		<div id="buy">
		<?
 		printbuys();
		?>
		</div>
		<?
		if (isset($_SESSION['login'])){
		?>
			
		<?
		}
		?>
	</div>
<?
}
?>
</div>
  
  
</body>
</html>
