<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<?php
include ("../navigation/header.php");
$page_name = "Stores-main";
include ("../navigation/access.php");
?>

<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>
</head>
<?php
if ($permission_num==1) {
	include ("../navigation/store_sidebar.php");
	
$table_name = $_SESSION['db_prefix']."_customer";
$table_name2 = $_SESSION['db_prefix']."_customer";
$customer_query = "SELECT account_type, cust_id, comp_name, title, name_2 FROM $table_name2 ORDER BY comp_name ";
$customer_result = mySQL_query($customer_query);
$customer_num = mysql_num_rows($customer_result);
$cust_id = mysql_result($customer_result, 0, "cust_id"); 	

	$w = 0;
	$arrId4 = array ();
	$arrName4 = array ();
	while ($w < $customer_num) {
		$a1 = mysql_result($customer_result, $w, "account_type");
		if ($a1=="corporate") { 
				$arrName4[$w] = mysql_result($customer_result, $w, "comp_name"); 
		} 
		else {
				$arrName4[$w] = mysql_result($customer_result, $w, "comp_name").', '.mysql_result($customer_result, $w, 'name_2')." (".mysql_result($customer_result, $w, "title").')';
 		}
		$arrId4[$w] = mysql_result($customer_result, $w, 'cust_id');
		
		$w++;
	}
	
	
?>
<body>

<div class="main_frame">
<table width="630" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="52" colspan="4" align="left" valign="top"><div class="page_head_frame">
        <table width="630" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="385"><label class="label_page_head">Select sales reports</label></td>
            <td align="right">&nbsp;</td>
          </tr>
        </table>
      </div>
       <br />
<br /><br />
<br />
<br />
<br />

<div class="page_middle_frame">
<form action="" method="get" >
  Sales:<br />
  <div class="page_inside_frame">
    <input name="product_button" type="button" class="imagebutton" id="product_button" onclick="MM_goToURL('parent','sales_products.php?date=&cust_id=0&show=0&item_type=');return document.MM_returnValue" value="Product sales" />
  &nbsp;&nbsp;&nbsp;&nbsp;
  <input name="account_button" type="button" class="imagebutton"  id="account_button" value="Customer sales" onclick="MM_goToURL('parent','customer_ordered_list.php?date=&cust_id=0');return document.MM_returnValue"/>
&nbsp;&nbsp;&nbsp;&nbsp;
<input name="account_button3" type="button" class="imagebutton"  id="account_button3" value="Distributor sales" onclick="MM_goToURL('parent','distributor_ordered_report_set.php?report_select=1');return document.MM_returnValue"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
  <br />
  <br>
  <br>
  <br>
  <br>
  Deliveries:
<div class="page_inside_frame">
     
        <input name="product_button2" type="button" class="imagebutton" id="product_button2" onClick="MM_goToURL('parent','delivery_products.php?date=&cust_id=0&show=0&item_type=');return document.MM_returnValue" value="Product deliveries" />
&nbsp;&nbsp;&nbsp;&nbsp;
<input name="account_button2" type="button" class="imagebutton"  id="account_button2" value="Customer deliveries" onclick="MM_goToURL('parent','customer_delivered_list.php?date=&cust_id=0');return document.MM_returnValue"/>
      
</div>
<br />
<br />
<br>
<br>
<br>
<br>
Stock:
<div class="page_inside_frame">
    <input name="product_button" type="button" class="imagebutton" id="product_button" onclick="MM_goToURL('parent','select_stock_report.php');return document.MM_returnValue" value="Stock report" />
&nbsp;&nbsp;
<input name="direct_material_button" type="button" class="imagebutton" id="direct_material_button" onclick="MM_goToURL('parent','direct_material_stock_report.php?stock_date_select=&stock_date_select2=');return document.MM_returnValue" value="Direct material stock" />  
  </div>


<br />
<br />
<br />
</form>
</div>

    </td>
    </tr>
    </table>
</div>

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

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