

<?php
   include ('../include/formValidations.php');
   
   $priceQuery = "SELECT price FROM nam_products WHERE productId ='10000'" ;
   $priceResult = execsql($priceQuery);
   $_SESSION['PalletsPriceText'] = mysql_result($priceResult, 0, "price");
   
?>
<link rel="stylesheet" href="../css/dhtmlwindow.css" type="text/css" />
<script type="text/javascript" src="../css/dhtmlwindow.js">
</script>


<script type="text/javascript" src="../css/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />
<link rel="stylesheet" href="../css/modal.css" type="text/css" />
<script type="text/javascript" src="../css/modal.js"></script>
<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 type="text/javascript">
function addproduct(){
//Open a modal window with an iframe page inside, and assign the result to a global variable called "addproductwindow"
addproductwindow=dhtmlmodal.open('EmailBox', 'iframe', 'selectProduct.php', 'Select a product', 'width=350px,height=170px,center=1,resize=0,scrolling=0')
needToConfirm = false;
addproductwindow.onclose=function(){return window}
}
</script>

<script type="text/javascript">
function removeproduct(){
//Open a modal window with an iframe page inside, and assign the result to a global variable called "removeproductwindow"
removeproductwindow=dhtmlmodal.open('EmailBox', 'iframe', 'removeProduct.php?value=<?php echo $_SESSION['QuantityText'.$i]?>', 'Remove this product', 'width=300px,height=300px,center=1,resize=0,scrolling=0')
needToConfirm = false;
removeproductwindow.onclose=function(){return window}
}

</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>

<link href="../css/main.css" rel="stylesheet" type="text/css">
<body onUnload="needToConfirm = false;">

<form id="feedbackform" method="get"  >
  <table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
    <tr>
      <td width="525" height="133" ><p class="wizard">
        <label class="std">Click 'Add' to add products to the order.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
        <input type="button" name="button" id="button" class="imagebutton" value="Add"  onClick="addproduct(); return false" />
      </p>
      
              
     
      <table width="549" align="center" id="tableResume">
        <tr>
          <td width="72">Qty</td>
          <td width="177">Product</td>
          <td width="81" align="center">Price</td>
          <td width="100" align="center">Amount</td>
          <td width="50">&nbsp;</td>
        </tr>
         <?php
	  $i=0;
	  $l=$_SESSION['line_no'];
	  While ($i < $l ) { ?>
        <?php if ($_SESSION['QuantityText'.$i]>0) { ?>
        <tr> 
          <td><?php  echo $_SESSION['QuantityText'.$i]; ?></td>
          <td><?php echo $_SESSION['ProductText'.$i]; ?></td>
          <td align="right"><?php  echo number_format( $_SESSION['PriceText'.$i], 2, '.', ', ') ?></td>
          <td align="right"><?php  echo number_format( $_SESSION['TotalText'.$i], 2, '.', ', ') ?></td>
          <td><input name="removeButton" type="button" class="smalllinkbutton" id="removebutton" onClick="removeproductwindow=dhtmlmodal.open('EmailBox', 'iframe', 'changeProduct.php?line_no=<?php echo $i?>', 'Change this product', 'width=330px,height=230px,center=1,resize=0,scrolling=0')
needToConfirm = false;
removeproductwindow.onclose=function(){return window}; return false"  value="Edit" ></td>
        </tr>
         <?php }
	  $i++;
	  } ?>
      </table></td>
    </tr>
    <tr>
      <td><table width="590" height="50" align="center" id="tableButtonBar">
          <tr>
            <td width="117"><input type="submit" name="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"><span class="wizard"></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" 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();
  frmvalidator.addValidation("PalletsText","req","Please enter number of pallets with this order.\nIf no pallets are on order, enter 0.");
  
</script>
</body>

