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


<link rel="stylesheet" type="text/css" href="../css/jquery.autocomplete.css" />
<script type="text/javascript" src="../css/jquery.1.4.2.js"></script>
<script type="text/javascript" src="../css/jquery.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />
<script>
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="form1" name="form1" method="get" action="orderWizbase.php">
  <table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
    <tr>
      <td width="525" ><?php if ($_SESSION['error']==1) { ?>
        <p class="wizard2"> <img src="../img/icon-error.png" width="30" height="30" />&nbsp;&nbsp;&nbsp;&nbsp;
          <label class="std">Order number "<?php echo $_SESSION['orderNo'] ?>" allready exists, please use another number.</label>
        </p>
        <?php 
	 	 
	 } ?>
        <p class="wizard">
          <label class="std">What is the order number?&nbsp;&nbsp;&nbsp;&nbsp;</label>
          <input name="order_no_text" type="text" id="order_no_text" class="wizard2"  value="<?php echo $_SESSION['orderNo'] ?>" onkeypress="return numbersonly(this, event)" />
          &nbsp;
          <label class="star">*</label>
          <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" />
        </p>
        <p class="wizard">
          <label class="std">Order date:</label>
  &nbsp;&nbsp;&nbsp;
  <?php

		$myCalendar = new tc_calendar("order_date", true);
		$myCalendar->setIcon("../img/iconCalendar.gif");
		$myCalendar->setDate($d, $m, $y);
		$myCalendar->setPath("./");
		$myCalendar->setYearInterval(2010, 2030);
		$myCalendar->writeScript();
?>
      </p></td>
    </tr>
    <tr>
      <td><table width="590" height="50" align="center" id="tableButtonBar">
          <tr>
            <td width="117">&nbsp;</td>
            <td width="115">&nbsp;</td>
            <td width="99">&nbsp;</td>
            <td width="125" align="left"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onclick="needToConfirm = false; confirmRefresh();" value="Cancel" /></td>
            <td width="110" align="left"><input type="submit" name="next_button" class="imagebutton" value="Next" onclick="needToConfirm = false; " /></td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
<!--form validation-->
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("order_no_text","req","Please enter the order number.");
  </script>
