<?php 
// Connect to the MySQL database  
include "storescripts/connect_to_mysql.php";
//Run a select query to get my letest 6 item
$dynamicList = "";
$sql = mysql_query("SELECT * FROM products ORDER BY id DESC LIMIT 12");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
	while($row = mysql_fetch_array($sql)){ 
             $id = $row["id"];
			 $product_name = $row["product_name"];
			 $price = $row["price"];
			 $date_added = strftime("%b %d, %Y", strtotime($row["date_added"]));
			 $dynamicList .= '<div  style="height:230px; padding-left:10px; float:left; ">
        <ul style="list-style-type:none; padding: 1px ">
          <li><a href="product.php?id=' . $id . '"><img style="border:#00000 0px solid;" src="inventory_images/' . $id . '.jpg" alt="' . $product_name . '" width="175" height="175" border="0" /></a></li>
          <li><div align="center">' . $product_name . '</div><div align="center">
            $'. $price .'</li>
        </ul>
      </div>';
    }
} else {

	$dynamicList="We have no products listed in our store yet";
}
mysql_close();
?>
<?php include_once("templet_header.php"); ?>
<!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" />
<meta name="keywords" content="adaestore, ADAESTORE, product, category, nokia, samsung, cameras" />
<meta name="description" content="adaestore, ADAESTORE, product, category, nokia, samsung, cameras" />
<title>ADA Home Page</title>
<link rel ="stylesheet" href="style/style.css" type="text/css" media="screen" />
<style type="text/css">
<!--
a:visited {

	color: #88B01E;
	text-decoration: none;
}
a:hover {
	color: #ADDC32;
	text-decoration: none;
}
a:active {
	color: #95C121;
	text-decoration: none;
}
.style2 {color: #95C121}

-->
</style>
</head>

<body>
<p>
  <?php ?>
</p>
<div align="center" id="mainWrapper">
  <div id="pageContent">
    <table width="100%" border="0" bordercolor="#000000">
      <tr>
        <td width="15%" height="52" valign="top"><p>
          <?php include_once("left.php");?>
        </p></td>
        <td width="72%" valign="top">
        
        <div style="margin:10px;text-align:left;"><?php echo $dynamicList; ?></div>
        </td>
        <td width="13%" valign="top"><?php include_once("right.php");?>
          <div align="left"></div></td>
      </tr>
    </table>
    <p><br/>
    </p>
  </div>
</div>
<div class="footer">
  <p>&nbsp;</p>
  <p>
    <?php include_once("templet_footer.php"); ?>
  </p>
</div>
</body>
</html>