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

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


<form id="feedbackform" method="get" action="qbillWiz6.php" >
<div class="wizard_page_middle_frame">
<div class="wizard_frame">
  <table width="680" align="center" id="table_resume_wizard" >
              <tr>
                <td align="left" valign="top">Title:</td>
                <td colspan="3" align="left" valign="top"><?php echo $_SESSION['title'] ?>&nbsp;</td>
              </tr>
              <tr>
                <td align="left" valign="top">Date:</td>
                <td colspan="3" align="left" valign="top"><?php echo date("d-m-Y", strtotime($_SESSION['receive_date'])) ?>&nbsp;</td>
              </tr>
              <tr>
                <td >Project:</td>
                <td colspan="3" align="left" valign="top"><?php echo $_SESSION['project'] ?>&nbsp;</td>
              </tr>
              <tr>
                <td width="144" >Project or plot no:&nbsp;</td>
                <td colspan="3" align="left" valign="top"><?php echo $_SESSION['project_no'].', '.$_SESSION['project_area'].', '.$_SESSION['project_place'] ?>&nbsp;</td>
              </tr>
              <tr>
                <td valign="top">Short description:</td>
                <td colspan="3" align="left" valign="top"><?php echo $_SESSION['description'] ?>&nbsp;</td>
              </tr>
              <tr>
                <td align="left" valign="top">Sales representative:
                &nbsp;&nbsp;</td>
                <td colspan="3" align="left" valign="top"><?php echo $_SESSION['seller'] ?>&nbsp;</td>
              </tr>
              <tr>
                <td colspan="4" align="left" valign="top">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="2" align="left" valign="top"><b>Companies quoted</b></td>
                <td align="left" valign="top">Reference</td>
                <td align="left" valign="top">Amount</td>
              </tr>
              <?php
			  	$table_name = $_SESSION['db_prefix']."_qbill_lines_temp";
				$bill_query = "SELECT * FROM $table_name WHERE user_name = '".$_SESSION['username']."' ";
				$bill_result = mySQL_query($bill_query);
				$bill_num = mysql_num_rows($bill_result);
				
			  $i=0;
			  while ($i<$bill_num) { 
			    $cust_id = mysql_result($bill_result, $i, "cust_id");
				$reference = mysql_result($bill_result, $i, "reference");
				$amount = mysql_result($bill_result, $i, "amount");
				
				$cust_id = mysql_result($bill_result, $i, "cust_id");
			 	$table_name = $_SESSION['db_prefix']."_customer";
				$name_query = "SELECT comp_name FROM $table_name WHERE cust_id = '".$cust_id."' ";
				$name_result = mySQL_query($name_query);
				$comp_name = mysql_result($name_result, 0, "comp_name");?>
              <tr>
                <td colspan="2" align="left" valign="top"><?php echo $comp_name ?></td>
                <td width="130" align="left" valign="top"><?php echo $reference ?>&nbsp;</td>
                <td width="210" align="left" valign="top"><?php echo number_format($amount, 2, '.', ',') ?>&nbsp;</td>
              </tr>
              <?php
			  $i++;
			  }
			  ?>
            </table>
</div>
<div class="wizard_spacer_frame" style="height:10px;"></div>
<div class="wizard_frame">
              <label class="label_std">If you want to make changes use the 'Prev' button to go back. <br />
              Click 'New' to make a new entry or to finish the wizard click 'Finish'.</label>
           </div>
<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','qbillWizbase.php?s=&p=2');return document.MM_returnValue" /></td>
                  <td width="115">
                    <input name="s" type="hidden" id="s" value="5" />
                    <input name="p" type="hidden" id="p" value="5" />
                  </td>
                  <td width="99"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="cancel_confirmation(1, '../sales/sales_main.php?date=0');" value="Cancel" /></td>
                  <td width="125" align="right"><input type="submit" name="new_button" class="imagebutton" id="new_button" value="New" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" /></td>
                  <td width="110" align="right"><input  name="finish_button" type="submit" class="imagebutton" id="finish_button" value="Finish" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');"  /></td>
                </tr>
              </table>
</div>
</div> 
</form>

</body>

