<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--reference to main.css removed-->
<?php
include ("../navigation/header.php");
$page_name = "Sales-main";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/store_sidebar.php");

$table_name2 = $_SESSION['db_prefix']."_suppliers";
$customer_query = "SELECT supplier_id, account_name, post_address, post_place, contact1, cell1, email1, phone, credit_cash FROM $table_name2 ";
$customer_result = mySQL_query($customer_query);
$customer_num = mysql_num_rows($customer_result);	

?>

<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />
<link rel="stylesheet" type="text/css" href="../css/scroll_table.css" />

<!--jscript-->
<script language="JavaScript" src="../jscript/go_to_url.js"  type="text/javascript"></script> 
<script language="JavaScript" src="../jscript/tooltip.js"  type="text/javascript"></script>
<script type="text/javascript" language="javascript" src="../jscript/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('#scroll_table').dataTable( {
					"sScrollY": "500px",
					"bPaginate": false,
					"bScrollCollapse": true,
					"aaSorting": [[ 0, "asc" ]],
					"aoColumns": [
								{"bSortable": true},
                             	{"bSortable": true},
								{"bSortable": true},
								{"bSortable": true},
								{"bSortable": true},
								{"bSortable": true}
								
								 ]
				} );
			} );
		</script> 

</head>
<body>
<div class="main_frame">
  <table id="tableMain" >
    <!--begin of tableMain-->
    <tr>
      <td width="590" height="73" valign="top" ><div class="page_head_frame">
          <table width="590" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="385"><label class="label_page_head">Accounts</label></td>
              <td width="253">&nbsp;</td>
              <td width="171" align="right">&nbsp;</td>
            </tr>
          </table>
        </div></td>
      <!--center of tableMain--> 
    </tr>
    <tr>
      <td><!--center of tableMain-->
        
        <div class="page_middle_frame">
          <table width="690" id="scroll_table" class="data_display">
            <thead>
            <tr>
              <th >Company</th>
              <th >Postal Address</th>
              <th >Phone</th>
              <th >Contact</th>
              <th >Cell</th>
              <th >e-mail</th>
            </tr>
            </thead>
            <?php 
$i=0;
while ($i<$customer_num) {
	$a =  mysql_result($customer_result, $i, "supplier_id");
	$a0 = mysql_result($customer_result, $i, "account_name");
	$a1 = mysql_result($customer_result, $i, "post_address");
	$a3 = mysql_result($customer_result, $i, "post_place");
	$a5 = mysql_result($customer_result, $i, "phone");
	$a6 = mysql_result($customer_result, $i, "credit_cash");
	$a8 = mysql_result($customer_result, $i, "contact1");
	$a9 = mysql_result($customer_result, $i, "cell1");
	$a10 = mysql_result($customer_result, $i, "email1");
	
	$customerTT = "<label class=tip_click_label>Click for details</label>";
	?>
            <tr>
              <td width="141" align="left" valign="top"><a href="../store/supplier_details.php?supplier_id=<?php echo $a?>" onMouseover="ddrivetip('<?php echo $customerTT ?>  ', 100)"; onMouseout="hideddrivetip()"><?php echo $a0 ?></a></td>
              <td width="113" align="left" valign="top"><?php echo $a1?><br />
                <?php echo $a3 ?></td>
              <td width="68" align="left" valign="top"><?php echo $a5 ?></td>
              <td width="66" align="left" valign="top"><?php echo $a8 ?></td>
              <td width="70" align="left" valign="top"><?php echo $a9 ?></td>
              <td width="174" align="left" valign="top"><?php echo $a10 ?></td>
            </tr>
            <?php
  $i++;
}
?>
          </table>
          <div align="left">
            <label class="label_end">end of list</label>
          </div>
        </div></td>
    </tr>
  </table>
  <!--end of tableMain--> 
  
</div>
<?php include ('../navigation/side_bar.php'); ?>
</body>
<?php } else {
$_SESSION['denied_return'] = $_SESSION['location'];	
include ("../navigation/sales_sidebar.php");?>
<body onLoad="accessdenied(); return false">
</body>
<?php }
?>
</html>