


<?php
require_once ('classes/tc_calendar.php');
$start = strtotime($_SESSION['receiveDate']);
$d = date("d", $start );
$m = date("m", $start );
$y = date("Y", $start );

$suppliersQuery = "SELECT account_no, account_name FROM rad_suppliers  ORDER BY account_name ASC";
	$suppliersResult = execsql($suppliersQuery);
	$suppliersNum = mysql_num_rows($suppliersResult);
	$w = 0;
	$arrId2 = array ();
	$arrName2 = array ();
	while ($w < $suppliersNum) {
		$arrId2[$w] = mysql_result($suppliersResult, $w, "account_no");
		$arrName2[$w] = mysql_result($suppliersResult, $w, "account_name");
		$w++;
	}
?>




<script type="text/javascript" src="../css/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />
<script language="JavaScript" src="gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<!--form validation-->
<script language="javascript" type="text/javascript" >
<!--
function confirmRefresh() {
var okToRefresh = confirm("Do you really want to cancel this entry?");
var url='showAllProducts.php?cat=Tiles and Accessories&productSelect=All&colorSelect=All'
if (okToRefresh)
	{
			window.location=url;
	}
}
// -->
</script>
<script language="JavaScript">
  var needToConfirm = true;
  window.onbeforeunload = confirmExit;
   function confirmExit()
  {
    if (needToConfirm)
      return "You did not finish the wizard./nIf you leave now your data will not be saved.";
  }
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
</script>
<form id="feedbackform" method="get" action="deliveryWizbase.php"> 
  <table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
    <tr>
      <td width="525" ><p class="wizard">
        <label class="std" >Supplier:&nbsp;&nbsp;&nbsp;&nbsp;</label>
        <?php if ( $_SESSION['store']=="Tiles and Accessories") { ?>
        <label class="std" ><font color='#0066FF' size='+1'>Radstone</font></label>
        <?php  } else { ?>
        <select name="accountNo" id="accountNo" class="wizard3">
          <option value="<?php echo $_SESSION['supplierName']?>" ><selected="selected"><?php echo $_SESSION['supplierName']?></option>
          <?php 
    	for ($w = 0; $w < count($arrId2); $w++) {
		echo "<option value=\"".$arrId2[$w] . "\"" . ">" . $arrName2[$w] . "</option>";	
	    }
     ?>
        </select>
        
        &nbsp;
        <label class="star">*</label>
        &nbsp;&nbsp;&nbsp;<label class="std">Del. note / Invoice:</label>
      <input type="text" class="wizard1" name="delnoteText" id="delnoteText"  value="<?php echo $_SESSION['deliveryNote']?>" onkeyup="ToUpper(this)"/>
      
          <label class="star">*</label>
      </p>
        <?php } ?>
        <p class="wizard">
          <label class="std">Receive date:</label>
  &nbsp;&nbsp;&nbsp;
  <?php

		$myCalendar = new tc_calendar("receiveDate", true);
		$myCalendar->setIcon("../img/iconCalendar.gif");
		$myCalendar->setDate($d, $m, $y);
		$myCalendar->setPath("./");
		$myCalendar->setYearInterval(2010, 2030);
		//$myCalendar->dateAllow('2009-02-20', "", false);
		$myCalendar->writeScript();
?>
        </p>
      <p>&nbsp;</p></td>
    </tr>
    <tr>
      <td><table width="590" height="50" align="center" id="tableButtonBar">
          <tr>
            <td width="117"><input type="submit" name="prev_button" id="prev_button" class="imagebutton" value="Prev" onclick=" needToConfirm = false; " /></td>
            <td width="115"><span class="wizard">
              <input name="s" type="hidden" id="s" value="3" />
              <input name="p" type="hidden" id="p" value="3" />
            </span></td>
            <td width="99">&nbsp;</td>
            <td width="125"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onclick="javascript:confirmRefresh(); needToConfirm = false;" value="Cancel" /></td>
            <td width="110" align="left"><input type="submit" name="next_button" id="next_button" class="imagebutton" value="Next" onclick="needToConfirm = false; " /></td>
          </tr>
        </table></td>
    </tr>
  </table>
  </table>
</form>
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("feedbackform");
  frmvalidator.EnableMsgsTogether();
  <?php if ($_SESSION['store']!="Tiles and Accessories") { ?>
  frmvalidator.addValidation("accountNo","req","Please select a supplier.");
  frmvalidator.addValidation("delnoteText","req","Please enter the delivery note number.");
  <?php } ?>
  </script>
