<?php 
	/*
		UserPie Version: 1.0
		http://userpie.com
		

	*/
	require_once("models/config.php");
	if(isUserLoggedIn()) { 
		
	}else{
		header("Location: index.php"); die(); 
	}	
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ingram Connect | <?php echo $websiteName; ?> </title>
<?php require_once("head_inc.php"); ?>



</head>
<body>
<?php require_once("navbar.php"); ?>
	<div id="content">
		<div class="container">
			<div class="row-fluid">
				<div class="span3" id="navbar">
					<h1>DigiByte</h1>
					<p>Bienvenido <strong><?php echo $loggedInUser->display_username; ?></strong></p>
					<nav>
						<ul class="nav nav-pills nav-stacked">
							<li><a href="userpage.php">Inventario</a></li>
							<li><a href="userpage-categorias.php">Categorias</a></li>
							<li><a href="userpage-marcas.php">Marcas</a></li>
							<li class="active"><a href="userpage-ordenes.php">Ordenes</a></li>
						</ul>
					</nav>
				</div>
				<div class="span9">
					
			        
					<?php
						include("cosas/db.php");		
						$rs = $link->query("select * from ingram_orders"); 									
						$num = $rs->num_rows;
			        ?>
<?php
				if($num>0)
				{
					echo "<table class=\"table\">
					<caption>$num ordenes</caption>
					<thead>
						<tr>
							<th>DigiByte P.O.</th>
							<th>INGRAM P.O.</th>
							<th>FECHA</th>
						</tr>
					</thead>
					<tbody>";
					while($orden = $rs->fetch_array())
					{
						echo "<tr>
							<td>".$orden["orden"]."</td>
							<td>".$orden["ingram"]."</td>							
							<td>".$orden["fecha_alta"]."</td>
						</tr>";														
					}
					echo "</tbody></table>";
				}
				else
				{
					echo "<div class=\"error\"><p>no se encontraron ordenes</p></div>";
				}

	        ?>  			        
				</div>
			</div>			
		</div>
	</div>
</body>
</html>


