<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../jscript/jquery.1.4.2.js"></script>
<script language="javascript" src="../jscript/calendar.js"></script>

<?php
include('../include/session.php');
require_once('../include/tc_calendar.php');
$today = date("Y-m-d");
$edit_date = date("Y-m-d");
$edit_date = strtotime($edit_date);
$d = date("d", $edit_date ) ;
$m = date("m", $edit_date ) ;
$y = date("Y", $edit_date ) ;

$page = $_GET['page'];
	
if ($page=='register') {
$reference='store_register.php?store_item_id=';	
//$page_name='Leave records.';
$table_name = $_SESSION['db_prefix']."_store_items";
$itemQuery = "SELECT store_item_id, item_name, register FROM $table_name  WHERE register = 'yes' ";
$itemResult = execsql($itemQuery);
$itemNum = mysql_num_rows($itemResult);
	$w = 0;
	$arrId4 = array ();
	$arrName4 = array ();
	while ($w < $itemNum) {
		$arrId4[$w] = mysql_result($itemResult, $w, 'store_item_id');
		$arrName4[$w] = mysql_result($itemResult, $w, 'item_name');
		$w++;
	}
}
?>
</head>

<body>
<?php
include ("../navigation/header.php");
$page_name = "Stores-main";
include ("../navigation/access.php");
if ($permission_num==1) {
	include ("../navigation/store_sidebar.php");
?>
<div class="main_frame">
<div class="page_head_frame">
        <table width="630" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="385"><label class="label_page_head">Select </label></td>
            <td align="right">&nbsp;</td>
          </tr>
        </table>
      </div>
       <br />
<br /><br />
<br />
<br />
<br />

<div class="page_middle_frame"><br />

<?php 
if ($page=='register') { ?>
<div class="page_inside_frame">
  <label class="label_std" style="font-size:16px;">Registered items in store.</label>
  <br />
  <br />
  <form action="" method="get">
  
    <label class="label_std"> Select registered item: &nbsp;&nbsp;</label>
    <select name="emp_no_select" autofocus class="select200" id="emp_no_select" onchange="window.location.href= this.form.emp_no_select.options[this.form.emp_no_select.selectedIndex].value"> 
      <option value=" " selected="selected" >&nbsp;</option>
      <?php
    	for ($j = 0; $j < count($arrId4); $j++) {
			echo "<option value=".$reference.$arrId4[$j].">".$arrName4[$j]."</option>";	
		}
     ?>
    </select>
  
    <br>
    <br>
    <div align="left">
<img src="../images/info_green.png" width="16" height="16">
<label class="label_info">Note: only items which are registered are in this list.</label>          
</div>
  </form>
 </div>
<?php } ?>


    
</div>
</div>
<?php include ('../navigation/side_bar.php'); ?>


<?php } else {
    $_SESSION['denied_return'] = "store/store_main.php?date=";	
    include ("../navigation/store_sidebar.php");?>
    <?php include ('../navigation/side_bar.php'); ?>
	<body onLoad="accessdenied(); return false">	
	</body>
<?php }
?>

</body>
</html>