<?php
session_start();
$username = $_SESSION['staff'];
	
if($_POST["Back"] == "Back"){
	echo "<script language='javascript'>window.location='giftlist.php'</script>";
}
if($_SESSION['staff']!= null)
{
?>
	
<html>
<head>
<title>Daily Bookstore - Management System</title>
<!--include css file-->
<link href="bookstaff.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="calendar.js"></script>
<script type="text/javascript" src="calendar-setup.js"></script>
<script type="text/javascript" src="calendar-en.js"></script>
<style type="text/css"> @import url("calendar-win2k-cold-1.css"); </style>
<script language="Javascript">
	function showPreview(ele)
	{
		document.addbook.imgAvatar.src=ele.value;
	}
</script>
</head>
</head>

<body>

<?php
include ("stafffunctionbar.php");
?>

<center>
<h2>Daily Bookstore Management - Gift</h2>
</center>

<div id="mainpage">
<?php
include("bookfunction.php")
?>
</fieldset>
</td>

<td width="75%">
<center>
<form name="addbook" method="post" enctype="multipart/form-data">
<fieldset style="width:80%">
<legend><img src="Picture/add.gif" width="30" height="30">Gift Data</legend>

<table align="center">

<?php
include("connect.php");
$giftname=$_GET['giftname'];
$result = mysql_query("SELECT * FROM gift WHERE giftname = '$giftname'");


$row = mysql_fetch_array($result);

echo "<tr>";
echo "<td width='200' rowspan='5'><img id='imgAvatar' img src='$row[giftimage]' width='200' height='200'></td>";
echo "<td>Gift Name: </td>";
echo "<td><input type='hidden' name='giftname' value='$row[giftname]'>$row[giftname]</td>";

echo "</td>";
echo "</tr>";

echo "<tr>";
echo "<td>Gift Quantity: </td>";
echo "<td>$row[giftquantity]</td>";
echo "</tr>";

echo "<tr>";
echo "<td>Redeem Point: </td>";
echo "<td>$row[redeempoint] Points</td>";
echo "</tr>";

echo "<tr>";
echo "<td colspan='4' align='center'><input type='submit' name='Back' value='Back'></td>";
echo "</tr>";
echo "</table>";
?>
</fieldset>
</form>
</center>
</body>
</html>
<?php
}else{
	echo "<script language='javascript'>alert ('Please login.')</script>";
	echo "<script language='javascript'>window.location='index.php'</script>";
}
?>