  <script type="text/javascript" src="calendar1.js"></script>
  <br>
  <table border=1 cellspacing=1 cellpadding=2 width=760 style="border: 1px inset;">
  <form action="controllers/inputController.php" method="post" name="itqform" id="itqform">
  <input name="itq_pkey" id="itq_pkey" type="hidden" value="<?=$itq_data['itq_pkey'];?>">
  <input name="itq_mropkey" id="itq_mropkey" type="hidden" value="<?=$pubitemid;?>">
  <input name="itq_subtradepkey" id="itq_subtradepkey" type="hidden" value="<?=$mro_data['mro_subtradepkey'];?>">
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Date</td>
  <td valign=top width=610 class=formvalue>
  <input name="itq_date" id="itq_date" type="text" value="<?=unconverttounixslash($itq_data['itq_date']);?>" maxlength=10 style="width: 90px;" onKeypress="dateOnly();">
  <a href="javascript:cal1.popup();"><img src="images/icon/cal.gif" width="16" height="16" border="0" alt="Click to select date"></a>&nbsp;&nbsp;<i>(dd/mm/yyyy)</i>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>From</td>
  <td valign=top width=610 class=formvalue>
  <input name="itq_from" id="itq_from" type="text" value="<?=$itq_data['itq_from'];?>" maxlength=200 style="width: 360px;">
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>ITQ Type *</td>
  <td valign=top width=610 class=formvalue>
  <input type="radio" name="itq_type" id="itq_type" value="1" <? if ($itq_data['itq_type']=="1") echo "checked"; ?>>Items as per attached B.Q.</input><br>
  <input type="radio" name="itq_type" id="itq_type" value="2" <? if ($itq_data['itq_type']=="2") echo "checked"; ?>>Items as per attached B.Q. and Drawings</input><br>
  <input type="radio" name="itq_type" id="itq_type" value="3" <? if ($itq_data['itq_type']=="3") echo "checked"; ?>>Items as per attached B.Q., Drawings and specifications</input><br>
  <input type="radio" name="itq_type" id="itq_type" value="4" <? if ($itq_data['itq_type']=="4") echo "checked"; ?>>Items as per attached B.Q. and specifications</input><br>
  <input type="radio" name="itq_type" id="itq_type" value="5" <? if ($itq_data['itq_type']=="5") echo "checked"; ?>>Items as per listed belows</input><br>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Return Date *</td>
  <td valign=top width=610 class=formvalue>
  <input name="itq_returndate" id="itq_returndate" type="text" value="<?=unconverttounixslash($itq_data['itq_returndate']);?>" maxlength=10 style="width: 90px;" onKeypress="dateOnly();">
  <a href="javascript:cal2.popup();"><img src="images/icon/cal.gif" width="16" height="16" border="0" alt="Click to select date"></a>&nbsp;&nbsp;<i>(dd/mm/yyyy)</i>
  </td>
  </tr>
  <tr valign=top>
  <td valign=top width=150 class=formlabel>Suppliers *</td>
  <td valign=top width=610 class=formvalue>
  <? $fullsupplier=""; ?>
  <? $fullname=""; ?>
  <? foreach ($supplier_list as $mysupplier) { ?>
    <? $fullsupplier = $fullsupplier.";".$mysupplier['itq_supplierpkey']; ?>
    <? $supp_data = $mysupplierModel->getdata_supplier($mysupplier['itq_supplierpkey']); ?>
    <? $fullname = $fullname.$supp_data['supplier_name']."\r\n"; ?>
  <? } ?>
  <? if ($fullsupplier!="") $fullsupplier = substr($fullsupplier,1); ?>
  <input name="itq_approvealert" id="itq_approvealert" type="hidden" value="0">
  <input name="itq_supppkey" id="itq_supppkey" type="hidden" value="<?=$fullsupplier;?>">
  <!--input name="itq_suppname" id="itq_suppname" type="hidden" value="" onChange="updateSuppliers();"-->
  <!--<select name="itq_suppliers" id="itq_suppliers" size=10 style="width: 360px;">
  </select>-->
  <textarea name="itq_suppliers" id="itq_suppliers" rows=10 readonly style="width: 360px;"><?=$fullname;?></textarea>
  &nbsp;<button name="selectsupplier" id="selectsupplier" type="button" onClick="selectSuppliers();">Select Suppliers..</button>
  </td>
  </tr>
  <input name="job" id="job" type="hidden" value="">
  </form>
  </table>

  <script language="javascript">
    var cal1 = new calendar1(document.forms['itqform'].elements['itq_date']);
    cal1.year_scroll = true;
    cal1.time_comp = false;
    var cal2 = new calendar1(document.forms['itqform'].elements['itq_returndate']);
    cal2.year_scroll = true;
    cal2.time_comp = false;
  </script>

  <script type="text/javascript">

  function validateForm() {

    var isvalid=true;
    var errmsg="";
    var itqtype=document.getElementById('itq_type');
    var itqreturndate=document.getElementById('itq_returndate');
    var itqsuppliers=document.getElementById('itq_suppliers');
    var itqalert=document.getElementById('itq_approvealert');

    if ((itqtype.value=="")||(itqreturndate.value=="")||(itqsuppliers.value=="")) {
      errmsg='Type, Return Date and Suppliers must be specified!\n';
      isvalid=false;
    }
    if (isvalid==false) {
      alert('Error:\n'+errmsg);
    } else {
      if (itqalert.value=="1") {
        if (confirm("You have selected one or more Suppliers that have not been approved yet. Approve Suppliers and proceed?")) {
          isvalid=true;
        } else {
          isvalid=false;
        }
      }
    }
    return isvalid;

  }

  function selectSuppliers() {

    mysupps=document.itqform.itq_supppkey.value;
    window.open('views/ibox_selectsuppliers.php?suppliers='+mysupps,'selectwindow', 'menubar=0,toolbar=0,scrollbars=1,resizable=0,location=0,width=600,height=600');

  }

  function updateSuppliers() {
    //alert('hi');
  }

  </script>
