<head>
<?php
   
		
		
		 
		 $table_name = $_SESSION['db_prefix']."_quotations";
	 		$quote_query = "SELECT *  FROM $table_name WHERE quote_no = '".$_SESSION['quote_no']."' ";
	 		$quote_result = mySQL_query($quote_query);
		 	$_SESSION['cust_id']=mysql_result($quote_result, 0, "cust_id");
		 	$_SESSION['seller']=mysql_result($quote_result, 0, "seller");
		 	$_SESSION['designer']=mysql_result($quote_result, 0, "designer");
		 	$_SESSION['company_contact']=mysql_result($quote_result, 0, "company_contact");
		 	$_SESSION['contact_phone']=mysql_result($quote_result, 0, "contact_phone");
	 	 	$_SESSION['project_no']=mysql_result($quote_result, 0, "project_no");
			$_SESSION['quote_type']=mysql_result($quote_result, 0, "quote_type");
			
			
			 $quote='yes';
		 $b9=$_SESSION['project_no'];
		 $b10=mysql_result($quote_result, 0, "project_place");
	 	 //$_SESSION['value']=mysql_result($quote_result, 0, "value");
		 $cust_id = $_SESSION['cust_id'];
		 $job_no='';
			
		 	
		 		
		$table_name2 = $_SESSION['db_prefix']."_customer";
		$customer_query = "SELECT * FROM $table_name2 WHERE cust_id = '".$_SESSION['cust_id']."' ";
		$customer_result = mySQL_query($customer_query);
		$_SESSION['status'] = mysql_result($customer_result, 0, "status");
	 	$_SESSION['type'] = mysql_result($customer_result, 0, "account_type");
		$_SESSION['comp_name'] = mysql_result($customer_result, 0, "comp_name");
	 	$_SESSION['name_2'] = mysql_result($customer_result, 0, "name_2");
	 	$_SESSION['title'] = mysql_result($customer_result, 0, "title");
	 	$_SESSION['bag_box'] = mysql_result($customer_result, 0, "bag_box");
	 	$_SESSION['box_no'] = mysql_result($customer_result, 0, "box_no");
	 	$_SESSION['post_place'] = mysql_result($customer_result, 0, "postal_place");
	 	$_SESSION['phys_address'] = mysql_result($customer_result, 0, "phys_address");
	 	$_SESSION['phys_place'] = mysql_result($customer_result, 0, "phys_place");
	 	$_SESSION['country'] = mysql_result($customer_result, 0, "country");
	 	$_SESSION['phone'] = mysql_result($customer_result, 0, "phone");
	 	$_SESSION['phone_2'] = mysql_result($customer_result, 0, "phone_2");
	 	$_SESSION['fax'] = mysql_result($customer_result, 0, "fax");
	 	$_SESSION['vat_no'] = mysql_result($customer_result, 0, "vat_no");
	 	$_SESSION['contact_1'] = mysql_result($customer_result, 0, "contact_1");
	 	$_SESSION['cell_1'] = mysql_result($customer_result, 0, "cell_1");
	 	$_SESSION['email_1'] = mysql_result($customer_result, 0, "email_1");
	 	$_SESSION['contact_2'] = mysql_result($customer_result, 0, "contact_2");
	 	$_SESSION['cell_2'] = mysql_result($customer_result, 0, "cell_2");
	 	$_SESSION['email_2'] = mysql_result($customer_result, 0, "email_2");
	 	$_SESSION['web_site'] = mysql_result($customer_result, 0, "web_site");
	 	$_SESSION['notes'] = mysql_result($customer_result, 0, "notes");
		
		$table_name = $_SESSION['db_prefix']."_quotation_lines";
		$line_query = "SELECT quote_item_price   FROM $table_name WHERE quote_number = '".$_SESSION['quote_no']."' ";
		$line_result = mySQL_query($line_query);
		$line_num = mysql_num_rows($line_result);
	
	$l=0;
	$a7=0;
		$l=0;
		while($l<$line_num) {
	   	$price=mysql_result($line_result, $l, "quote_item_price");
	    $a7=$price+$a7;	
		$l++;
	    
	}
	$_SESSION['value']=$a7;
	$quote_value = $a7;
	
	$table_name = $_SESSION['db_prefix']."_quotation_notes";
	$note_query = "SELECT note_text FROM $table_name WHERE quote_number = '".$_SESSION['quote_no']."' ORDER BY line_id DESC LIMIT 1 ";
	$note_result = mySQL_query($note_query);
	$_SESSION['note'] = mysql_result($note_result, 0, "note_text");
	
	$quote_no = $_SESSION['quote_no'];
	
?>

<!--jscript-->


</head>

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

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

<div class="page_middle_frame">
<form action="acceptanceWizbase.php" method="get">
      <div class="wizard_frame">
        <label class="label_std">Quoatation no Q<?php echo $_SESSION['quote_no']?> &nbsp;(<?php echo $_SESSION['quote_type']?>) was successful.</label>
        <br>
        <br>
        <label class="label_end">Check the quotation details before continueing. If the quote is the required one, click "Next" to continue to enter the quote as a job. The quote needs to be completed, if the wizard is not completed, the status of the quote will be reversed.<br>
          If this is not the quote to make a job click the "undo" button.</label>
      <br>
<br><label class="label_std" style="color:#FF0000;">   Note: if this wizard is not completed, the quotation will remain with the status of pending.</label>
<br></div>
<br>

         <div class="wizard_frame">
         <?php 
		include ('../include/customer_block.php');
		echo '<br>';
		include ('../include/job_block.php');
		?>
         </div><br>
<br>
<br>
<br>

      <table width="590" height="50" align="left" id="table_button_bar">
        <tr>
          <td width="117"> <input name="undo_button" type="button" class="imagebutton" id="undo_button" onClick="editwindow=dhtmlmodal.open('editBox', 'iframe', '../edit_windows/undo_quote.php?quote_no=<?php echo $_SESSION['quote_no'] ?>&status=undo&p=2', 'Undo acceptance', 'width=500px,height=125px,center=1,resize=0,scrolling=0')
needToConfirm = false;
editwindow.onclose=function(){return window}; return false; MM_showHideLayers('wait','','show');" value="Undo" tabindex="2"/></td>
          <td width="115">&nbsp;</td>
          <td width="99"><input name="p" type="hidden" id="p" value="2" />
            <input name="s" type="hidden" id="s" value="2" />
            </span></td>
          <td width="125" align="right"><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=2', 'Cancel create job', 'width=500px,height=125px,center=1,resize=0,scrolling=0')
needToConfirm = false;
editwindow.onclose=function(){return window}; return false; MM_showHideLayers('wait','','show');" value="Cancel" tabindex="3"/></td>
          <td width="110" align="right"><input type="submit" name="next_button" class="imagebutton" value="Next" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" tabindex="1"/></td>
        </tr>
      </table>
</form>
</div>
</body>      