<?php
/* $Revision: 1.20 $ */
$PageSecurity = 2;
if (empty($_GET['identifier'])) {
			 $identifier=date('U');
		} else {
			$identifier=$_GET['identifier'];
		}
		
include('includes/session.inc');

$title = _('Search Store ');

include('includes/header.inc');


/*if(isset($_POST['Submit']))
{
if($_POST['itmcode'] !='')
{
$itemcode = $_POST['itmcode'];

$Sql = "Select stockid, maincategoryid, categoryid, description, longdescription, units from stockmaster Where description Like '%$itemcode%' || stockid Like '%$itemcode%'";
$ErrMsg = _('Query Fail !') . '. ' . _('The error says');
$Result = DB_query($Sql,$db,$ErrMsg);
}
}
else
{*/
$Sql = "select * from storetype";
$ErrMsg = _('Query Fail!') . '. ' . _('The error says');
$Result = DB_query($Sql,$db,$ErrMsg);

?>
<form action="" method="post">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><div align="center"><b><?php echo $title; ?></b></div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="24%">&nbsp;</td>
    <td width="11%">Store </td>
    <td width="19%"><input name="store" type="text" id="store" /></td>
    <td width="46%"><input type="submit" name="Submit" value="Search " /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="#CCCCCC">
        <td width="4%" >&nbsp;</td>
        <td width="100%" align="center"> Store</td>
        
      </tr>
	  <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
	  <?php   
	  
	  $counter = $_REQUEST['rowcount'];
	  $ct = explode("_",$counter);
	  while($myrow =DB_fetch_array($Result))
	  {  
	  $ct=1;
	 ?>
	  <tr>
        <td>&nbsp;</td>
        <td><A HREF="javascript:loadValue('<?php echo $myrow['StoreName']; ?>')"><?php echo $myrow['StoreName'];?></A></td>
      </tr>
	  <?php } ?>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
    </table></td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

</form>
<script>

function loadValue(i)
{
	
	
	window.opener.document.getElementById('storecode').value = i;
	
	window.close();
	
	//window.opener.document.getElementById('StockID').value = i;
	//window.close();
}
</script>
<?
 
include('includes/footer.inc');
?>