<?php
session_start();
$username = $_SESSION['staff'];

include ("connect.php");

if($_SESSION['staff']!= null)
{
?>
	
<html>
<head>
<title>Daily Bookstore - Management System</title>
<!--include css file-->
<link href="bookstaff.css" rel="stylesheet" type="text/css"/>
</head>

<body>

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

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

<div id="mainpage">
<table width="90%">
<tr>
<td width="15%" valign="top">
<fieldset>
<legend><img src="Picture/salary.gif" width="30" height="30">Salary</legend>
<table>
<td valign="top">
<a href="salarylist.php"><img src="Picture/salary.gif" width="30" height="30" alt="EPF"><a href="salarylist.php">Salary List</a><br/>
<br/>
<a href="addsalary.php"><img src="Picture/addsalary.jpg" width="30" height="30" alt="EPF"><a href="addsalary.php">Add Salary</a><br/>
<br/>
<a href="editepf.php"><img src="Picture/epf.gif" width="30" height="30" alt="EPF"><a href="editepf.php">EPF</a><br/>
<br/>
<a href="socsolist.php"><img src="Picture/socso.gif" width="30" height="30" alt="Socso"><a href="socsolist.php">Socso</a><br/>
</td>
</tr>
</table>
</fieldset>
</td>

<td width="75%">
<?php
include ("connect.php");
	$result = mysql_query("SELECT * FROM socso ORDER BY start");
	
	$num_results = mysql_num_rows($result);
echo "<div id='mainpage'>";
echo "<table border='1' cellspacing='0' cellpadding='5' bordercolor='white' align='center' width='60%'>";
echo "<caption><img src='Picture/socso.gif' width='30' height='30' />Daily Bookstore Management System - Socso List	</caption>";
echo "<div>";
echo "<tr bgcolor='gray' style='color:lightblue'>";
echo "<td width='40'>Salary</td>";
echo "<td width='40'>Staff Socso</td>";
echo "<td width='40'>Owner Socso</td>";
echo "</tr>";

	
	
for ($i=0; $i <$num_results; $i++)
{
	$row = mysql_fetch_array($result);
	echo "<tr>";
	echo "<td>RM".$row["start"]." < RM".$row["end"]."</td>";
	echo "<td>RM";
	printf("%10.2f",$row["staffsyer"]);
	echo "</td>";
	echo "<td>RM";
	printf("%10.2f",$row["ownersyer"]);
	echo "</td>";
	echo "</tr>";
}

echo "<tr>";
echo "<td><a href='editsocso.php'>Edit</a></td>";
echo "</tr>";

echo "</table>";
echo "</div>";

echo "<hr/>";
$db = mysql_close();
?>


</td>
</table>

</body>
</html>
<?php
}else{
	echo "<script language='javascript'>alert ('Please login.')</script>";
	echo "<script language='javascript'>window.location='index.php'</script>";
}
?>