<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--jscript-->
<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>

<?php

$table_name = $_SESSION['db_prefix']."_suppliers";
    $position_query = "SELECT supplier_id, account_name FROM $table_name ORDER BY account_name ASC";
	$arrId3 = array ();
	$arrName3 = array ();
	$position_result = execsql($position_query);
	if ($position_result!="") {
	$position_num = mysql_num_rows($position_result);
	$k = 0;
	while ($k < $position_num) {
		$arrId3[$k] = mysql_result($position_result, $k, "supplier_id");
		$arrName3[$k] = mysql_result($position_result, $k, "account_name");
		$k++;
	}
	}
	
	 

?>
</head>
<?php include('../include/wait.php') ?>

<body onLoad="MM_showHideLayers('wait','','hide')" onFocus="MM_showHideLayers('wait','','hide');"  onBlur="MM_showHideLayers('wait','','hide');">
<?php if ($_SESSION['first_choice']=='supplier') { ?>
<form id="form1" method="get" action="edit_selectWizbase.php">
  <table id="tableMain" width="595">
    <tr>
      <td><table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
          <tr>
            <td width="525" height="90" valign="top" ><table id="tableMain2" width="595">
                <!--begin of tableMain-->
                <tr>
                  <td><!--center of tableMain-->
                    
                    <table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
                      <tr>
                        <td width="525" height="90" valign="top" ><div class="wizard_frame">
                            <label class="label_std"> Select supplier to edit: &nbsp;&nbsp;</label>
                            <select name="supplier_select" class="select200" autofocus tabindex="1"  >
                              <option value=" "> </option>
                              <option value="" selected="selected"></option>
                              <?php
        	for ($k = 0; $k < count($arrId3); $k++) {
    		echo "<option value=" . "\"" . $arrId3[$k] . "\"" . ">" . $arrName3[$k] . "</option>";
	}
?>
                            </select>
                          </div>
                          <br />
                          <br />
                          <br /></td>
                        <!--center of tableMain--> 
                      </tr>
                      <tr>
                        <td><!--center of tableMain-->
                          
                          <table width="675" height="50" align="center" id="table_button_bar">
                            <tr>
                              <td width="117"><input type="submit" name="prev_button" id="prev_button" class="imagebutton" value="Prev" onclick=" needToConfirm = false;  MM_showHideLayers('wait','','show');" tabindex="3"/></td>
                              <td width="115">&nbsp;</td>
                              <td width="99"><input name="p" type="hidden" id="p" value="2" />
                                <input name="s" type="hidden" id="s" value="2" /></td>
                              <td width="125" align="right"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onclick="needToConfirm = false; cancel_confirmation(1, '../store/store_main.php');" value="Cancel" tabindex="4"/></td>
                              <td width="110" align="right"><input type="submit" name="next_button" class="imagebutton" value="Next" onclick="needToConfirm = false; MM_showHideLayers('wait','','show');"tabindex="2" /></td>
                            </tr>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table></td>
          </tr>
        </table>
  </table>
  <!--end of tableMain-->
</form>
<!--form validation--> 
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("supplier_select","req","Please select a customer");
</script>
<?php } ?>
<?php if ($_SESSION['first_choice']=='quotation') { ?>
<form id="form1" name="form1" method="get" action="acceptanceWizbase.php">
  <table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
    <tr>
      <td width="525" valign="top" ><br>
        <div class="wizard_frame">
        <label class="label_std">Select quotation:
          &nbsp;&nbsp;(click on quote number to continue)</label>
        <div class="scroll_frame_medium" style="width:620px; height:230px;">
          <table width="600" id="table_list" class="sortable-onload-1r rowstyle-alt no-arrow ">
            <tr>
              <th align="left" style="border-right:hidden" class="sortable-numeric">&nbsp;</th>
              <th align="left" class="sortable-numeric">Quote no</th>
              <th width="301" align="left" class="sortable-text">Customer</th>
              <th width="211" align="left" class="sortable-date-dmy">Due date:</th>
            </tr>
            <?php 
	$i=0;
	while ($i<$quote_num) {
		$a1 = mysql_result($quote_result, $i, "quote_no");
		$a2 = mysql_result($quote_result, $i, "cust_id");
			$table_name = $_SESSION['db_prefix']."_customer";
			$customer_query = "SELECT status, comp_name, bag_box, box_no, postal_place, phone, cell_1  FROM $table_name WHERE cust_id = '".$a2."' ";
			$customer_result = mySQL_query($customer_query);
			$a2a = mysql_result($customer_result, 0, "comp_name");
			$a2b = mysql_result($customer_result, 0, "bag_box");
			$a2c = mysql_result($customer_result, 0, "box_no");
			$a2d = mysql_result($customer_result, 0, "postal_place");
			$a2e = mysql_result($customer_result, 0, "phone");
			$a2f = mysql_result($customer_result, 0, "cell_1");
			$a2g = mysql_result($customer_result, 0, "status");
			$a2h="";
			if ($a2g!="new") { 
			$a2h="<img src=../images/customer_folder.png width=16 height=16 />"; }
			else {
            $a2h="<img src=../images/contact_folder.png width=16 height=16 />"; 
			}
		 $a3 = mysql_result($quote_result, $i, "required_date");	
			
		$customerTT = $a2h."<br><label class=tip_text_label>".$a2a."<br>".$a2b." ".$a2c."<br>".$a2d."<br>".$a2e." / ".$a2f."<br>";
	?>
            <tr>
              <td width="12" align="right" style="border-right:hidden;padding-right:0px;">Q</td>
              <td width="56" align="left" style="padding-left:=0px";><a href="quotation_details_edit.php?quote_no=<?php echo $a1?>&edit=0" onclick="needToConfirm = false;"><?php echo $a1?></a></td>
              <td><a href="" onMouseover="ddrivetip('<?php echo $customerTT ?>', 150)"; onMouseout="hideddrivetip()"><?php echo $a2a?></a></td>
              <td><?php echo date("d-m-Y", strtotime($a3)) ?>&nbsp;</td>
            </tr>
            <?php 
	$i++;
	}
	?>
          </table>
          <br>
        </div></td>
    </tr>
    <tr>
      <td><table width="675" height="50" align="center" id="table_button_bar">
          <tr>
            <td width="117">&nbsp;</td>
            <td width="115"><input name="p" type="hidden" id="p" value="1" />
              <input name="error" type="hidden" id="error" value="0" />
              <input name="s" type="hidden" id="s" value="1" /></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');" value="Cancel" /></td>
            <td width="110" align="right">&nbsp;</td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
<?php } ?>
</body>
