<head>
<?php 
$table_name = $_SESSION['db_prefix']."_list_names_admin";
$sellers_query = "SELECT item_name FROM $table_name  ORDER BY item_name ASC";
  $sellers_result = execsql($sellers_query);
  $sellers_num = mysql_num_rows($sellers_result);
  $w = 0;
  $arrId2 = array ();
  $arrName2 = array ();
  while ($w < $sellers_num) {
    $arrId2[$w] = mysql_result($sellers_result, $w, "item_name");
    $arrName2[$w] = mysql_result($sellers_result, $w, "item_name");
    $w++;
  }
  
require_once ('../include/tc_calendar.php');  
$start = strtotime($_SESSION['acceptance_date']);
$d = date("d", $start );
$m = date("m", $start );
$y = date("Y", $start );
?>

<!--style sheets-->


<!--jscript-->
<script type="text/javascript" src="../jscript/jquery.1.4.2.js"></script>
<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<script language="JavaScript" src="../jscript/upper_case.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/numbers_only_decimal.js"  type="text/javascript"></script> 
<script language="javascript" src="../jscript/calendar.js"></script> 

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

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

<div class="wizard_page_middle_frame">
<form id="form1" method="get" >
     
              <div class="wizard_frame">
                <table width="642" id="table_display_wizard">
                  <tr>
                    <td width="143" valign="top">Job  value:&nbsp;&nbsp;
                      <label class="star">*</label></td>
                    <td width="487" valign="top">                     
                    <input name="received_text" type="text" autofocus class="text100" id="received_text" style="text-align:right" onChange=" this.value = this.value.replace (/(\...).*/, '$1')" onKeyPress="return isNumberKey(event)" value="<?php echo $_SESSION['received']?>" tabindex="1"/>
                    &nbsp;&nbsp;(excl VAT)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quotation value:&nbsp;&nbsp;P&nbsp;<?php echo number_format($_SESSION['value'], 2, '.', ',');?> </td>
                  </tr>
                  <tr>
                    <td>Payment terms:&nbsp;&nbsp;<label class="star">*</label></td>
                    <td valign="top"><p>
                      <label>
                        <input name="account_group" type="radio" id="account_group_0" onClick="MM_showHideLayers('table_display_wizard2','','show','table_display_wizard3','','hide'); $('#order_no_text').attr('value', '---'); $('#invoice_no_text').attr('value', '---'); $('#receipt_text').attr('value', '');" value="cash" <?php if ($_SESSION['account']=="cash") {?>checked="checked" <?php }?>/>
                        cash</label>
                      &nbsp;&nbsp;&nbsp;
                      <label>
                        <input name="account_group" type="radio" id="account_group_1" onClick="MM_showHideLayers('table_display_wizard2','','hide','table_display_wizard3','','show'); $('#order_no_text').attr('value', ''); $('#invoice_no_text').attr('value', ''); $('#receipt_text').attr('value', '---');" value="account" <?php if ($_SESSION['account']=="account") {?>checked="checked" <?php }?> />
                        account</label>
                      <br />
                    </p></td>
                  </tr>
                </table>
                </div>
                <div class="wizard_frame">
                <table width="582" id="table_display_wizard2">
                  <tr>
                    <td width="131" valign="top"><label class="label_std">Receipt no:</label>&nbsp;&nbsp;<label class="star">*</label> </td>
                    <td width="439" valign="top"><input name="receipt_text" type="text" class="text150" id="receipt_text" onKeyUp="ToUpper(this)"  value="<?php echo $_SESSION['receipt']?>"/></td>
                  </tr>
                </table>
                </div>
                <div class="wizard_frame">
                <table width="309" id="table_display_wizard3">
                  <tr>
                    <td width="140" valign="top"><label class="label_std">Order  no:</label>&nbsp;&nbsp;<label class="star">*</label> </td>
                    <td width="157" valign="top"><input name="order_no_text" type="text" class="text150" id="order_no_text" onKeyUp="ToUpper(this)"  value="<?php echo $_SESSION['order']?>"/></td>
                  </tr>
                </table>
                </div>
                <br />
                <div class="wizard_frame">
                <table width="582" id="table_display_wizard">
                  <tr>
                    <td width="131" valign="top">Accepted by:&nbsp;&nbsp;<label class="star">*</label></td>
                    <td width="439" valign="top"><select name="acceptor_select" id="acceptor_select" class="select160" tabindex="2">
                      <option value="<?php echo $_SESSION['acceptor']?>" selected="selected"><?php echo $_SESSION['acceptor']?></option>
                      <?php 
      for ($w = 0; $w < count($arrId2); $w++) {
    echo "<option value=\"".$arrId2[$w] . "\"" . ">" . $arrName2[$w] . "</option>";  
      }
     ?>
                    </select></td>
                  </tr>
                  
                  <tr>
                    <td valign="top">Order date:</td>
                    <td valign="top"><?php 
          //instantiate class and set properties
    $myCalendar = new tc_calendar("acceptance_date", true);
    $myCalendar->setIcon("../images/iconCalendar.gif");
    $myCalendar->setDate($d, $m, $y);
    $myCalendar->setYearInterval(2010, 2099);
    //output the calendar
    $myCalendar->writeScript();
?></td>
                  </tr>
                </table>
             </div>   
            <br>
            
<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_showHideLayers('wait','','show');MM_goToURL('parent','acceptanceWizbase.php?s=&amp;p=3');return document.MM_returnValue" tabindex="4"/></td>
                  <td width="115">&nbsp;</td>
                  <td width="99"><span class="wizard">
                    <input name="s" type="hidden" id="s" value="4" />
                    <input name="p" type="hidden" id="p" value="4" />
                  </span></td>
                  <td width="125"><input name="cancel_button" type="button" class="imagebutton" id="cancel_button" onClick="editwindow=dhtmlmodal.open('editBox', 'iframe', '../edit_windows/undo_quote.php?quote_no=<?php echo $_SESSION['quote_no'] ?>&status=cancel&p=4', 'Cancel create job', 'width=550px,height=125px,center=1,resize=0,scrolling=0')
needToConfirm = false;
editwindow.onclose=function(){return window}; return false; MM_showHideLayers('wait','','show');" value="Cancel" tabindex="5"/></td>
                  <td width="110" align="left"><input type="submit" name="next_button" class="imagebutton" value="Next" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" tabindex="3"/></td>
                </tr>
              </table>
 </div>             
</form>
</div>

<!--form validation-->
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("received_text","req","- job value amount.");
  frmvalidator.addValidation("account_group","selone","- select cash or account.");
  frmvalidator.addValidation("receipt_text","req","- receipt no.");
  frmvalidator.addValidation("order_no_text","req","- order no.");
  frmvalidator.addValidation("acceptor_select","req","- accepted by.");
  frmvalidator.addValidation("job_card_no_text","req","- order no.");
</script>
</body>