<?php


$table_name = $_SESSION['db_prefix']."_invoices";
$invoice_query = "SELECT invoice_amount, invoice_no, invoice_date, invoiced_by FROM $table_name WHERE job_card_no = '".$_SESSION['job_card_no']."'  ";
$invoice_result = mySQL_query($invoice_query);
$invoice_num = mysql_num_rows($invoice_result);
$invoice_amount = mysql_result($invoice_result, 0, "invoice_amount"); 
$invoice_no = mysql_result($invoice_result, 0, "invoice_no");
$invoice_date = mysql_result($invoice_result, 0, "invoice_date");
$invoiced_by = mysql_result($invoice_result, 0, "invoiced_by");


?>
</head>

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

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


<form id="form1" name="form1" method="GET" action="m_completeJobWizbase.php?p=4&s=3">
<div class="wizard_page_middle_frame">

<div class="wizard_frame">
This job / order was invoiced:
  <table width="600" id="table_display_wizard" >
  <tr>
    <td width="136">invoice number:</td>
    <td width="452"><?php echo $invoice_no ?>&nbsp;</td>
  </tr>
  <tr>
    <td>invoice date:</td>
    <td><?php echo date("d-m-Y", strtotime($invoice_date)) ?></td>
  </tr>
  <tr>
    <td>invoice amount:</td>
    <td>P <?php echo number_format($invoice_amount, 2, '.', ',') ?></td>
  </tr>
  <tr>
    <td>invoiced by:</td>
    <td><?php echo $invoiced_by ?></td>
  </tr>
  </table>
</div>


<div class="wizard_spacer_frame" style="height:200px;"></div>  
  
<div class="wizard_frame">
  <table width="590" 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','m_completeJobWizbase.php?s=&p=2'); return document.MM_returnValue; ;return document.MM_returnValue"/></td>
            <td width="115">&nbsp;</td>
            <td width="99"><span class="wizard">
              <input name="error" type="hidden" id="error" value="0" />
              <input name="p" type="hidden" id="p" value="3" />
              <input name="s" type="hidden" id="s" value="3" />
            </span></td>
            <td width="125" align="left"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false;  cancel_confirmation(1, '../production/production_main.php');" value="Cancel" /></td>
            <td width="110" align="left"><input type="submit" name="next_button" class="imagebutton" value="Next" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" /></td>
          </tr>
      </table>
    </div>
  </div>
</form>
</div>

<!--form validation-->
  <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  
	frmvalidator.addValidation("invoice_no_text","req","- invoice no");


  </script>
</body>