+if ( $response['custnum'] || $response['svcnum'] ) {
+
+ header("Location:main.php");
+ die();
+
+} elseif ( $response['customers'] ) {
+var_dump($response['customers']);
+?>
+
+ <? $title ='Select customer'; include('elements/header.php'); ?>
+ <? include('elements/error.php'); ?>
+
+ <FORM NAME="SelectCustomerForm" ACTION="process_select_cust.php" METHOD=POST>
+ <INPUT TYPE="hidden" NAME="action" VALUE="switch_cust">
+
+ <TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=2 CELLPADDING=0>
+
+ <TR>
+ <TH ALIGN="right">Customer </TH>
+ <TD>
+ <SELECT NAME="custnum" ID="custnum" onChange="custnum_changed()">
+ <OPTION VALUE="">Select a customer
+ <? foreach ( $response['customers'] AS $custnum => $customer ) { ?>
+ <OPTION VALUE="<? echo $custnum ?>"><? echo htmlspecialchars( $customer ) ?>
+ <? } ?>
+ </SELECT>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD COLSPAN=2 ALIGN="center"><INPUT TYPE="submit" ID="submit" VALUE="Select customer" DISABLED></TD>
+ </TR>
+
+ </TABLE>
+ </FORM>
+
+ <SCRIPT TYPE="text/javascript">
+
+ function custnum_changed () {
+ var form = document.SelectCustomerForm;
+ if ( form.custnum.selectedIndex > 0 ) {
+ form.submit.disabled = false;
+ } else {
+ form.submit.disabled = true;
+ }
+ }
+
+ </SCRIPT>
+
+ <? include('elements/footer.php'); ?>
+
+<?
+
+// } else {
+//
+// die 'login successful, but unrecognized info (no custnum, svcnum or customers)';
+
+}