<?php
include("../include/session.php");
if( !$session->isAdmin() && !$session->isRadstoneReceptionUser() && !$session->isRadstoneStoreUser() ){
	//header("Location: ../Store/storeMenu.php");?>
<script language="javascript" type="text/javascript">
        <!--
		  window.location="denied.php";
        -->
       </script>
<?php 
}else{
	include("../storeHeader.php");
		
		
		
	$listQuery =  "SELECT * FROM rad_suppliers ORDER BY account_name ";
	$listResult = mySQL_query($listQuery) or die ("Error in query:   $listQuery . * ". mySQL_error());
	$i = 0;
	$num = mysql_num_rows($listResult);
	
?>
<script type="text/javascript" src="../css/tablesort.js"></script>
<link href="../css/main.css" rel="stylesheet" type="text/css" />


<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<table id="tableMain" width="595">
  <!--begin of tableMain-->
  <tr>
    <td ><div class="headerbox2"><b>Supplier list</b></div>
      <br />
      <p class="main" >suppliers as per : <b><?php echo date("d-m-Y");?></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        Number in list: <b><?php echo $num;?></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input name="button3" type="button" class="linkbutton" id="button3" onclick="MM_goToURL('parent','supplierWiz0.php');return document.MM_returnValue" value="New Account" />
    </p><br />

    </td>
    <!--center of tableMain-->
  </tr>
  <tr>
    <td><!--center of tableMain-->
      <table id="tableList" class="sortable-onload-1 rowstyle-alt no-arrow "  >
        <thead>
          <tr>
            <th width="66" class="sortable-text">Acc No</th>
            <th width="157" class="sortable-text">Suppliers  Name </th>
            <th width="128" class="sortable-text">Contact</th>
            <th width="140" class="sortable-text">Phone - Cell</th>
            <th width="86" class="sortable-text">Place</th>
          </tr>
        </thead>
        <tbody>
          <?php 
	while ($i < $num) {
	    $b0 = mysql_result($listResult, $i, "account_no");
		$b1 = mysql_result($listResult, $i, "account_name");
	    $b2 = mysql_result($listResult, $i, "contact1");
	    $b3 = mysql_result($listResult, $i, "phone");
		$b4 = mysql_result($listResult, $i, "cell1");
		$b5 = mysql_result($listResult, $i, "account_no");
		$b6 = mysql_result($listResult, $i, "post_place");
		
	?>
          <tr  onmouseover="this.style.cursor='pointer'" onclick="MM_goToURL('parent','displaySupplier.php?account_no=<?php echo $b0 ?>');return document.MM_returnValue" >
            <td>
              <?php  echo $b0 ?>
            </a></td>
            <td><?php echo $b1?></td>
            <td><?php echo $b2?></td>
            <td><?php echo $b3 . "<br>" . $b4 ?></td>
            <td><?php echo $b6?></td>
          </tr>
          <?php 
	$i++;
	}
	?>
        </tbody>
      </table>
      <br /></td>
  </tr>
</table>
<!--end of tableMain-->
End of list.
<?php
	}
	include("../footer.php");

?>
