<?php
include("../include/session.php");
if(!$session->isRadstoneStoreUser() && !$session->isAdmin() && !$session->isRadstoneReceptionUser()){
	header("Location: ../Store/storeMenu.php");
}else{
	
	include("../storeHeader.php");
//	include("../include/db.php");
	?>



<?php
$productId = mysql_real_escape_string($_REQUEST['productId']);
$query = "SELECT * FROM products WHERE productId ='".$productId."'";
$result = execsql($query);


	$f1=mysql_result($result,0,"productName");
	$f2=mysql_result($result,0,"suppliersName");
	$f3=mysql_result($result,0,"category");
	$f4=mysql_result($result,0,"subCategory");
	$f5=mysql_result($result,0,"unit");
	$f6=mysql_result($result,0,"returnable");
	if($f6 < 1){$returnable = "No";}else{$returnable="Yes";}
	$f7=mysql_result($result,0,"quantity");
	$f8=mysql_result($result,0,"price");
	$f9=mysql_result($result,0,"depreciation");
	$f10=mysql_result($result,0,"date");
	$f11=mysql_result($result, 0, "productId");
	$f12=mysql_result($result, 0, "shelf");
	$f13=mysql_result($result, 0, "minimumStock");
	$f14=mysql_result($result, 0, "productSpecs");

if ($f3=="Tiles and Accessories") {
	$link="showAllProducts.php?cat=Tiles and Accessories&productSelect=All&colorSelect=All&date=0"; }
if ($f3=="Direct Materials") {
	$link="showAllProductsAll.php?searchText=All&CategorySelect=Direct Materials&subCatSelect=&date=0"; }
if ($f3=="Store Item") {
	$link="showAllProductsAll.php?searchText=All&CategorySelect=Store Item&subCatSelect=$f4&date=0"; }
	
	
if ($f3=="Tiles and Accessories") {
    $link2="stockMovement.php?monthdisplay=0&cat=Store Item&productIdSelect=$productId&date=0" ; }
else {
	$link2="stockMovement.php?productIdSelect=$productId&date=0" ;
}
?>

<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<link href="../css/main.css" rel="stylesheet" type="text/css" />

 
<style type="text/css">
<!--
#tableMain tr td #coloredContainer table {
	color: #CEE0FD;
}
-->
</style>
<div class="pageheading">
	Stock Item Details
	</div>
<table id="tableMain" width="595"> <!--begin of tableMain-->
    <tr>
      <td valign="top" >
	<div  id="coloredContainer">
	<b>
	<font size="3">
	<?php echo $f1?>
	</font></b>
    <div align="right">
	<?php if ($f3=="Tiles and Accessories") { ?>
	<input name="button4" type="button" class="linkbutton" id="button4" onclick="MM_goToURL('parent','deliveriesTiles.php?productId=<?php echo $productId ?>&date=0');return document.MM_returnValue" value="Deliveries" />
	<?php } else { ?>
    <input name="button5" type="button" class="linkbutton" id="button5" onclick="MM_goToURL('parent','issuedReport.php?productId=<?php echo $productId ?>&date=0');return document.MM_returnValue" value="Issues" />
    <?php } ?>
    </div>
	</div>
<br />

<table width="590" align="center"  id="tablePlain">
      <tr>
        <td width="121">Product Id:</td>
        <td width="94">
          <?php echo $f11?>
        </td>
        <td width="81">Product Name:</td>
        <td width="165"><?php echo $f1; ?></td>
      </tr>
      <tr>
        <td>Shelf Number:</td>
        <td>
          <?php echo $f12?>
          </td>
        <td>Suppliers Name:</td>
        <td><?php echo $f2; ?></td>
      </tr>
      <tr>
        <td>Category:</td>
        <td><?php echo $f3; ?></td>
        <td>Sub-Category:</td>
        <td><?php echo $f4; ?></td>
      </tr>
      <tr>
        <td>Unit:</td>
        <td><?php echo $f5; ?></td>
        <td>Returnable:</td>
        <td><?php echo $returnable; ?></td>
      </tr>
      <tr>
        <td>Quantity in stock: </td>
        <td><?php echo number_format($f7); ?></td>
        <td>Minimum Stock:</td>
        <td>
        <?php echo number_format($f13)?>
        </td>
      </tr>
      <tr>
        <td>Price per:</td>
        <td><?php echo $f8; ?></td>
        <td>Depreciation over years:</td>
        <td><?php echo $f9; ?></td>
      </tr>
      <tr>
        <td>Date:</td>
        <td><?php echo date("d-m-Y", strtotime($f10 )); ?></td>
        <td>&nbsp;</td>
        <td></td>
      </tr>
      <tr>
        <td>Product specifiations</td>
        <td colspan="2"><?php echo $f14; ?></td>
        <td align="right">&nbsp;</td>
        </tr>
    </table>
	<p><br />
	  <br />
	  <br />
	  <br />
	  <br />
	  <br />
	  <br />
	  <br />
	  <br />
      <br />
      
	 
    </p>
    </td>
</tr>
</table><!--end of tableMain-->
<?php 
include("../footer.php");
}
?>
