<!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" />

<!--reference to main.css removed-->
<?php
include ("../navigation/header.php");
$page_name = "Stores-main";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/store_sidebar.php");

$receive_id = $_GET['receive_id'];
?>
</head>
<?php

	
$table_name1 = $_SESSION['db_prefix']."_store_receive";
$receive_query = "SELECT * FROM $table_name1 WHERE receive_id ='".$receive_id."' ";
$receive_result = mySQL_query($receive_query);
$receive_num = mysql_num_rows($receive_result);	

$a0 = mysql_result($receive_result, 0, "store_item_id");
$a1 = mysql_result($receive_result, 0, "supplier_id");
$a2 = mysql_result($receive_result, 0, "delivery_note");
$a3 = mysql_result($receive_result, 0, "quantity");
$a4 = mysql_result($receive_result, 0, "price");
$a5 = mysql_result($receive_result, 0, "date");
$a6 = mysql_result($receive_result, 0, "sub_cat");



$table_name2 = $_SESSION['db_prefix']."_store_items";
$item_query = "SELECT * FROM $table_name2 WHERE store_item_id = '".$a0."' " ;
$item_result = execsql($item_query);
$a0a = mysql_result($item_result, 0, "item_name");

$b2 = mysql_result($item_result, 0, "item_name");
$b3 = mysql_result($item_result, 0, "subCategory");
$b4 = mysql_result($item_result, 0, "location");
$b5 = mysql_result($item_result, 0, "quantity");
$b6 = mysql_result($item_result, 0, "minimumStock");
$b7 = mysql_result($item_result, 0, "price");
	
	$itemTT =
		   "<img src=../images/view.png  width=20 height=16><table id=table_tool_tip width=250 ><tr><td  width=75>Item name:</td><td width=175>".$b2."</td></tr><tr><td>Category</td><td>".$b3."</td></tr><tr><td>Location</td><td>".$b4."</td></tr><tr><td>stock qty</td><td>".$b5."</td></tr><tr><td>Min. stock</td><td>".$b6."</td></tr><tr><td>Price</td><td>".$b7."</td></tr></table><br><b>Click for details</b>";

$table_name3 = $_SESSION['db_prefix']."_suppliers";
$suppliers_query = "SELECT account_name FROM $table_name3 WHERE supplier_id = '".$a1."' " ;
$suppliers_result = execsql($suppliers_query);
$a1a = mysql_result($suppliers_result, 0, "account_name");
?>
<script type="text/javascript" src="../jscript/tablesort.js"></script>

<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />
<body>
<?php include ('../include/tooltip.php'); ?>

<div class="main_frame">
  <table id="tableMain" > <!--begin of tableMain-->
    <tr>
      <td width="600" height="62" valign="top" ><div class="page_head_frame">
        
        <table width="683" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><label class="label_page_head">Received store item:&nbsp;&nbsp;<?php echo $a0a ?></label>&nbsp;&nbsp;&nbsp;<a href="store_item_display.php?store_item_id=<?php echo $a0 ?> " onMouseover="ddrivetip('<?php echo $itemTT ?>', 260)"; onMouseout="hideddrivetip()">   <img src="../images/view.png" width="20" height="16">&nbsp;&nbsp;</a></td>
            </tr>
        </table>
      </div>
        <br />

<br /></td> <!--center of tableMain-->
</tr>
<tr>
<td height="93"> <!--center of tableMain-->
<div class="page_middle_frame">
<div align="left">Item details:</div>
  <table width="683" id="table_details_display">
    <tr>
      <td width="139" height="25">Item:</td>
      <td width="103"><b><?php echo $a0a ?></b></td>
      <td colspan="3">&nbsp;</td>
      </tr>
    <tr>
      <td height="25">Quantity received:</td>
      <td><b><?php echo $a3?></b></td>
      <td width="48">&nbsp;</td>
      <td width="117">Date received:</td>
      <td><?php  echo date("d-m-Y", strtotime($a5)) ?></td>
      </tr>
  </table>
</div>
</td>
</tr>
<tr>
<td>
<div class="page_middle_frame">
<div align="left">Supplier details:</div>
  <table width="680" id="table_details_display">
    <tr>
      <td width="139" height="25">Supplier:</td>
      <td width="529"><b><?php echo $a1a?></b></td>
      </tr>
    <tr>
      <td height="25">Invoice/ del. note:</td>
      <td><b><?php echo $a2?></b></td>
      </tr>
  </table>
</div>

</td>
</tr>
<tr>
<td >&nbsp;</td>
</tr>
</table>  <!--end of tableMain-->
  
</div>
</body>
<?php } else { 
    $_SESSION['denied_return'] = "store/store_main.php";	?>
<body onLoad="accessdenied(); return false">
</body>
<?php }
?>
<?php include ('../navigation/side_bar.php'); ?>