


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

$customerQuery = "SELECT CompanyName,  CustNo FROM nam_customer WHERE active=" . 1 ." ORDER BY CompanyName ASC";
	$customerResult = execsql($customerQuery);
	$customerNum = mysql_num_rows($customerResult);
	$w = 0;
	$arrId = array ();
	$arrName = array ();
	while ($w < $customerNum) {
		$arrId[$w] = mysql_result($customerResult, $w, "CustNo");
		$arrName[$w] = mysql_result($customerResult, $w, "CompanyName");
		$w++;
	}

$empQuery = "SELECT  empId, empFName, empLName FROM nam_employees  ORDER BY empFName ASC";
	$empResult = execsql($empQuery);
	$empNum = mysql_num_rows($empResult);
	$s = 0;
	$arr3Id = array ();
	$arr3Name = array ();
	while ($s < $empNum) {
		$arr3Id[$s] =  mysql_result($empResult, $s, "empId");
		$arr3Name[$s] = mysql_result($empResult, $s, "empFName")." ".mysql_result($empResult, $s, "empLName");
		$s++;
	}
?>

<?php 
if ($_SESSION['store'] == "Tiles and Accessories" ) { ?>
       <script type="text/javascript">
	      function toggle1()  {
	        document.getElementById('departmentContainer').style.display = 'block';
	        document.getElementById('employeeContainer').style.display = 'none';
		  }
	   </script> 
	  <?php   } 
	else { ?>
	   <script type="text/javascript">
	      function toggle1()  {
			document.getElementById('departmentContainer').style.display = 'none';
	        document.getElementById('employeeContainer').style.display = 'block';
		  }
	    </script> 
<?php }  ?>






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

<script type="text/javascript" src="../css/jquery.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="../css/jquery.autocomplete.css" />
<script type="text/javascript">
 $(document).ready(function(){
  $("#orderNoText").autocomplete("order_autocomplete_2.php", {
        selectFirst: true
  });
 });
</script>

<body  onload="toggle1();">

<form id="feedbackform" method="get" action="returnWizbase.php"> 
  <table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
    <tr>
      <td width="525" ><div id="departmentContainer"><p class="wizard">
        <label class="std">
          Returned on order no :</label>&nbsp;&nbsp;<label class="star">*</label>
        <input name="orderNoText" type="text" class="wizard1" id="orderNoText" onKeyPress="return numbersonly(this, event)" value="<?php echo $_SESSION['orderNo']?>" />
      </p>
      </div>
      
      
      <div id="employeeContainer">
        <p class="wizard">
          <label class="std">Returned by:&nbsp;&nbsp;</label>
          <select name="empSelect" id="empSelect"  class="wizard3">
            <option value="<?php echo $_SESSION['empId'] ?>"> <selected="selected"> <?php echo $_SESSION['empName']?></option>
            <?php
    	for ($s = 0; $s < count($arr3Id); $s++) {
			echo "<option value=".$arr3Id[$s]. ">" . $arr3Name[$s] . "</option>";	
	    }
     ?>
          </select><label class="star">*</label>
          <br />
          <label class="std">Was the item on loan? &nbsp;&nbsp;&nbsp;</label>
          <select name="loanSelect" id="loanSelect" class="wizard2">
            <option value="yes">yes</option>
            <option value="no">no</option>
            <option value="<?php echo $_SESSION['loan'] ?>" selected><?php echo $_SESSION['loan'] ?> </option>
          </select><label class="star">*</label>
        </p></div>
        <p class="wizard">
          <label class="std">Return 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("CustText","req","Please select customer.");
  <?php 
  }
  ?>
  
</script>
</body>