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

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

<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 = $con->query($customer_query);

	$w = 0;
	$arrId4 = array ();
	$arrName4 = array ();
	while($row = $customer_result->fetch_assoc()) {
		$account_type = $row["account_type"];
		$cust_id = $row["cust_id"];
		$comp_name = $row["comp_name"];
		$name_2 = $row["name_2"];
		$title = $row["title"];
		
		if ($account_type=="corporate") { 
				$arrName4[$w] = $comp_name; 
		} 
		else {
				$arrName4[$w] = $comp_name.', '.$name_2." (".$title.')';
 		}
		$arrId4[$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;&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="stock_count_button" type="button" class="imagebutton" id="stock_count_button" onclick="MM_goToURL('parent','select_stock_report.php?stock_take_date=<?php echo $today ?>');return document.MM_returnValue" value="Stock count" />
<br>
<br> 
</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>
