
<?php 

if ($_SESSION['quote_no']=='') {
?>
<script language="javascript" type="text/javascript">
          needToConfirm = false;
          window.location="maintenance_no_return.php";
</script>
<?php
}
else {


require_once ('../include/tc_calendar.php');

$start = strtotime($_SESSION['quotation_date']);
$d = date("d", $start );
$m = date("m", $start );
$y = date("Y", $start );

?>

</head>

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

<body onLoad="MM_showHideLayers('wait','','hide')" onFocus="MM_showHideLayers('wait','','hide');">


<?php
$table_name = $_SESSION['db_prefix']."_list_quote_validity";
    $position_query = "SELECT item_name FROM $table_name ORDER BY item_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, "item_name");
		$arrName3[$k] = mysql_result($position_result, $k, "item_name");
		$k++;
	}
	}
	?>

<div class="wizard_page_middle_frame">
<form id="feedbackform" method="get"  >
     <div class="wizard_frame">
           <table width="641" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="147" height="40">Quotation date:
              </td>
              <td><?php 
				  //instantiate class and set properties
		$myCalendar = new tc_calendar("quotation_date", true);
		$myCalendar->setIcon("../images/iconCalendar.gif");
		$myCalendar->setDate($d, $m, $y);
		$myCalendar->setYearInterval(2010, 2020);
		//output the calendar
		$myCalendar->writeScript();
?></td>
              </tr>
            <tr>
              <td height="37">Prices valid for:</td>
              <td><select name="valid_days_select" id="valid_days_select">
				<option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
                <option value="7">7</option>
                <option value="10">10</option>
                <option value="14">14</option>
                <option value="30">30</option>
                <option value="<?php echo $_SESSION['valid_days']?>" selected="selected"><?php echo $_SESSION['valid_days']?></option>
              </select> 
                &nbsp;days</td>
              </tr>
            <tr>
              <td>Delivery:</td>
              <td><select name="delivery_days_select" id="delivery_days_select">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
                <option value="7">7</option>
                <option value="10">10</option>
                <option value="14">14</option>
                <option value="30">30</option>
                <option value="<?php echo $_SESSION['delivery_days']?>" selected="selected"><?php echo $_SESSION['delivery_days']?></option>
              </select> 
                &nbsp;days</td>
            </tr>
           </table>
          </div>
<br />

<div class="wizard_frame">
  <table width="671" border="0">
    <tr>
      <td width="143">Sales representative:</td>
      <td width="193"><?php echo $_SESSION['seller']?></td>
      <td width="99">&nbsp;</td>
      <td width="218">&nbsp;</td>
    </tr>
</table>
</div>
<div class="wizard_spacer_frame" style="height:10px;"></div>
<div class="wizard_frame">
              <table width="675" height="50" align="center" id="table_button_bar">
                <tr>
                  <td width="117"><input type="button" name="lastprev_button" class="imagebutton" value="Prev" onclick="needToConfirm = false;MM_goToURL('parent','maintenance_quoteWizbase.php?s=&p=2');return document.MM_returnValue; MM_showHideLayers('wait','','show');" tabindex="3"/></td>
                  <td width="115">&nbsp;</td>
                  <td width="99"><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="125" align="right"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onclick="needToConfirm = false; cancel_confirmation(1, '../maintenance/maintenance_main.php?date='); " 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>
              </div>
  </form>
  </div>
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("feedbackform");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("valid_days_select","req","- validity period.");
  frmvalidator.addValidation("delivery_days_select","req","- deilvery period.");
      
</script>


</body>
<?php
}
?>