<head>
<?php 
$page_name = "Stores-new order";
include ("../navigation/access.php");
if ($permission_num==1) {
	

	 $_SESSION['name'] ="";

	 

$table_name = $_SESSION['db_prefix']."_customer";
    $position_query = "SELECT cust_id, comp_name FROM $table_name WHERE account_type!= 'closed' ORDER BY comp_name ASC";
	$arrId3 = array ();
	$arrName3 = array ();
	$position_result = $con->query($position_query);
	$position_num = mysqli_num_rows($position_result);
	$k = 0;
	while ($k < $position_num) {
	while($row = $position_result->fetch_assoc()) {
		$arrId3[$k] = $row["cust_id"];
		$arrName3[$k] = $row["comp_name"];
		$k++;
	}
	}
	

?>
<!--style sheets-->

<!--jscript-->
<script type="text/javascript" src="../jscript/jquery.min.js"></script>
<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<script language="JavaScript" src="../jscript/upper_case.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/numbers_only.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/capitalize_textbox.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/lower_case.js"  type="text/javascript"></script>

<link href="../css/main.css" rel="stylesheet" type="text/css">
</head>
<?php include('../include/wait.php') ?>

<body onLoad="MM_showHideLayers('wait','','hide');" onFocus="MM_showHideLayers('wait','','hide');"  onBlur="MM_showHideLayers('wait','','hide');">
<form id="form1" name="form1" method="get" action="newOrderWizbase.php">
  <div class="page_middle_frame" style="height:400px;">
  <br>
  <br>
    <div class="wizard_frame" id="client"  >&nbsp;&nbsp;
          <label class="label_std">Select account:&nbsp;&nbsp;</label>
          <label class="star">*</label>
          &nbsp;&nbsp;&nbsp;
          <select name="account_select" class="select200"  >
            <option value=" "> </option>
            <option value="" selected></option>
            <?php
        	for ($k = 0; $k < count($arrId3); $k++) {
    		echo "<option value=" . "\"" . $arrId3[$k] . "\"" . ">" . $arrName3[$k] . "</option>";
	}
?>
          </select>
          &nbsp;&nbsp;&nbsp; </div>
    <table width="675" height="50" align="center" id="table_button_bar">
          <tr>
            <td width="117"><input type="hidden" name="type_text" id="type_text"></td>
            <td width="115"><input name="p" type="hidden" id="p" value="1" />
                            <input name="s" type="hidden" id="s" value="1" />
                            <input name="e" type="hidden" id="e" value="" /></td>
            <td width="99">&nbsp;</td>
            <td width="125"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false; cancel_confirmation(1, '../store/store_main.php?date='); " value="Cancel" /></td>
            <td width="110" align="right"><input type="submit" name="next_button" class="imagebutton" value="Next"  onClick="needToConfirm = false; " /></td>
          </tr>
        </table>
        
</div>       
</form>

<!--form validation--> 

<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  /*frmvalidator.addValidation("type_group","selone","Please select existing or new customer.");*/
  frmvalidator.addValidation("account_select","req","- account.");
  
  
</script>
</body>
<?php } else { ?>
<script> needToConfirm = false; </script>
<?php
    $_SESSION['denied_return'] = "store/store_main.php?date=";	?>
<body onLoad="accessdenied(); return false">
</body>
<?php }
?>
