<?php
include("../include/session.php");
if( !$session->isAdmin() && !$session->isRadstoneReceptionUser() ){
	//header("Location: ../Store/storeMenu.php");?>
<script language="javascript" type="text/javascript">
        <!--
		  window.location="denied.php";
        -->
       </script>
<?php 
}else{
	include("../storeHeader.php");
	

    $CustNo = mysql_real_escape_string($_GET['CustNo']);
	
    $dropDownQuery = "SELECT CustNo, CompanyName FROM customer WHERE active = 1 ORDER BY CompanyName ASC";
	$dropDownResult = execsql($dropDownQuery);
	$num = mysql_num_rows($dropDownResult);
	$a = 0;
	$arrId = array ();
	$arrName = array ();
	while ($a < $num) {
		$arrId[$a] = mysql_result($dropDownResult, $a, "CustNo");
		$arrName[$a] = mysql_result($dropDownResult, $a, "CompanyName");
		$a++;
	}
	
	$w=0;
	while ($w < 16) {
	$b = 'b';	
	   ${$b.$w} = '';
	   $w++;
	}
	
	
	
	if ($CustNo!='0') {
	$selectQuery = "SELECT * FROM customer  WHERE CustNo =".$CustNo;
	$selectResult = execsql($selectQuery);
	
	$b0 = mysql_result($selectResult, 0, "CustNo");
	$b1 = mysql_result($selectResult, 0, "CompanyName");
	$b2 = mysql_result($selectResult, 0, "ContactName");
	$b3 = mysql_result($selectResult, 0, "Phone");
	$b7 = mysql_result($selectResult, 0, "Fax");
	$b4 = mysql_result($selectResult, 0, "Cell");
    $b8 = mysql_result($selectResult, 0, "email");
	$b5 = mysql_result($selectResult, 0, "PostalAddress");
	$b6 = mysql_result($selectResult, 0, "PostalPlace");
	$b9 = mysql_result($selectResult, 0, "VATNo");
	$b10 = mysql_result($selectResult, 0, "Remarks");
	$b11 = mysql_result($selectResult, 0, "AccNo");
	$b13 = mysql_result($selectResult, 0, "EntryDate");
	$b14 = mysql_result($selectResult, 0, "ModDate");
	}
   
	?>
<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>
<link href="../css/main.css" rel="stylesheet" type="text/css" />



<table id="tableMain" width="595">
  <!--begin of tableMain-->
  <tr>
    <td ><div class="headerbox2"> Customer Details </div>
      <br />
      <p class="main"><label class="std"><font size="3"><?php echo $b1 ?></font></label> </p>
      <br /><br />
</td>
    <!--center of tableMain-->
  </tr>
  <tr>
    <td><!--center of tableMain-->
      <table width="599" id="tablePlain">
        <tr>
          <td width="103">Cust. No:</td>
          <td width="186"><b>
            <?php echo $b0?>
            </b></td>
          <td>Account No: </td>
          <td><b>
            <?php echo $b11?>
            </b></td>
        </tr>
        <tr>
          <td>Company Name:</td>
          <td><b>
            <?php echo $b1?>
            </b></td>
          <td width="109">Contact Name: </td>
          <td width="165"><b>
            <?php echo $b2?>
            </b></td>
        </tr>
        <tr>
          <td>Postal Address: </td>
          <td colspan="3"><b>
            <?php echo $b5."  ".$b6?>
            </b> </span></td>
        </tr>
        <tr>
          <td>Phone:</td>
          <td><b>
            <?php echo $b3?>
            </b></td>
          <td>Fax:</td>
          <td><b>
            <?php echo $b7?>
            </b></td>
        </tr>
        <tr>
          <td>Cell:</td>
          <td><b>
            <?php echo $b4?>
            </b></td>
          <td>e-mail:</td>
          <td><b>
            <?php echo $b8?>
            </b></td>
        </tr>
        <tr>
          <td>VAT No.: </td>
          <td><b>
            <?php echo $b9?>
            </b></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>Remarks:</td>
          <td colspan="3"><b>
            <?php echo $b10?>
            </b></td>
        </tr>
      </table></td>
  </tr>
   <tr>
  <td><span class="main">
  <input name="button4" type="button" class="linkbutton" id="button4" onclick="MM_goToURL('parent','deliveriesCustomer.php?CustNo=<?php echo $b0 ?>&date=0');return document.MM_returnValue" value="Deliveries" />
  </span>
    <p class="main">
    <label class="std">&nbsp;&nbsp;&nbsp;&nbsp;</label>
    <input name="button5" type="button" class="imagebutton" id="button5" onclick="MM_goToURL('parent','showAllProducts.php?cat=Tiles and Accessories&amp;productSelect=All&amp;colorSelect=All');return document.MM_returnValue" value="Done" />
    </p>
  </p></td>
  </tr>
</table>
<!--end of tableMain-->
<p>
  <?php
	}
	include("../footer.php");

?>
</p>
</p>
