<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<?php
include ("../navigation/header.php");
include ("../navigation/sales_sidebar.php");

	$d="";
	$s = $_GET['s'];
	$p = $_GET['p'];
	//if ($_SESSION['p'] >= 4) {$d=1;}
	//	$error = $_SESSION['error'];
	$_SESSION['p']=$p;
	$_SESSION['s']=$s;
	
	
	if (isset($_GET['prev_button']) )
	   {
		 $_SESSION['p']= $_SESSION['p']-1;
	   }
		 
	if (isset($_GET['next_button']) )
	  {
		$_SESSION['p']=$_SESSION['p']+1;
	  }
	
		
	
	if ($s==1) {
	  	$_SESSION['quote_no']	 = $_GET['quote_no'];
		$_SESSION['cust_id']	 = $_GET['cust_id'];
		
	  	$table_name2 = $_SESSION['db_prefix']."_customer";
		$customer_query = "SELECT * FROM $table_name2 WHERE cust_id ='".$_SESSION['cust_id']."' ";
		$customer_result = mySQL_query($customer_query);
		$customer_num = mysql_num_rows($customer_result);	
		$a1 = mysql_result($customer_result, 0, "account_type");
			if ($a1=="corporate") { 
				$_SESSION['company_name'] = mysql_result($customer_result, 0, "comp_name"); 
			} 
			else {
				$_SESSION['company_name'] = mysql_result($customer_result, 0, "title")." ".mysql_result($customer_result, 0, "name_2")." ".mysql_result($customer_result, 0, "comp_name");
 			}
			
		
	}
		
	if($s==2) {
	  $_SESSION['quote_line_1'] = $_GET['quote_line_1_text'];
	  $_SESSION['quote_line_2'] = $_GET['quote_line_2_text'];
	  $_SESSION['quote_line_3'] = $_GET['quote_line_3_text'];
	  $_SESSION['quote_price_1'] = $_GET['quote_price_1_text'];
	  $_SESSION['quote_price_2'] = $_GET['quote_price_2_text'];
	  $_SESSION['quote_price_3'] = $_GET['quote_price_3_text'];
 	};
	
	if($s==3) {
	  
	  $_SESSION['quotation_date'] = $_GET['quotation_date'];
	  $_SESSION['designer'] = $_GET['designer_select'];
	  $_SESSION['seller'] = $_GET['seller_select'];
	  
	$table_name = $_SESSION['db_prefix']."_presets";
	$followup_query = "SELECT preset_value FROM $table_name WHERE preset_name = 'follow_up' ";
	$followup_result = mySQL_query($followup_query);
	$days = mysql_result($followup_result, 0, "preset_value");
	
	
	$_SESSION['check_date'] = date("Y-m-d", strtotime(date("Y-m-d", strtotime($today)) . " +".$days." day"));
	if (date("l", strtotime($_SESSION['check_date'])) == "Sunday") {$_SESSION['check_date'] = date("Y-m-d", strtotime(date("Y-m-d", strtotime($_SESSION['check_date'])) . " +1 day")); }
	if (date("l", strtotime($_SESSION['check_date'])) == "Saturday") {$_SESSION['check_date'] = date("Y-m-d", strtotime(date("Y-m-d", strtotime($_SESSION['check_date'])) . " +2 day")); }
	};
	
	if($s==4) {
		$_SESSION['quote_no']	 = $_GET['quote_no'];
		$_SESSION['cust_id']	 = $_GET['cust_id'];
		
	  	$table_name2 = $_SESSION['db_prefix']."_customer";
		$customer_query = "SELECT * FROM $table_name2 WHERE cust_id ='".$_SESSION['cust_id']."' ";
		$customer_result = mySQL_query($customer_query);
		$customer_num = mysql_num_rows($customer_result);	
		$a1 = mysql_result($customer_result, 0, "account_type");
			if ($a1=="corporate") { 
				$_SESSION['company_name'] = mysql_result($customer_result, 0, "comp_name"); 
			} 
			else {
				$_SESSION['company_name'] = mysql_result($customer_result, 0, "title")." ".mysql_result($customer_result, 0, "name_2")." ".mysql_result($customer_result, 0, "comp_name");
 			}
			
	  $_SESSION['quotation_date'] = date('Y-m-d');	
			
	  $_SESSION['quote_line_1'] = '';
	  $_SESSION['quote_line_2'] = '';
	  $_SESSION['quote_line_3'] = '';
	  $_SESSION['quote_price_1'] = '';
	  $_SESSION['quote_price_2'] = '';
	  $_SESSION['quote_price_3'] = '';
	 		 
	}
	
	if($s==15) {
	 $_SESSION['reference'] = $_GET['reference'];
	 
	}
	
	if($s==7) {
		$_SESSION['text1_id'] = $_GET['text1_id'];
	 }
	
	if($s==8) {
		$_SESSION['text2_id'] = $_GET['text2_id'];
	}
	
	if($s==9) {
	 $_SESSION['text3_id'] = $_GET['text3_id'];
	}
	
	if($s==10) {
		$_SESSION['text4_id'] = $_GET['text4_id'];
	}
	
	?>

<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />
<link href="../css/wait.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../window/dhtmlwindow.css" type="text/css" />
<link rel="stylesheet" href="../window/modal.css" type="text/css" />



<!--jscript-->
<script language="JavaScript" src="../jscript/cancel_confirmation.js"  type="text/javascript"></script> 
<script language="JavaScript" src="../jscript/confirm_exit.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/show_hide_layers.js"  type="text/javascript"></script>  
<script type="text/javascript" src="../window/dhtmlwindow.js"></script>
<script type="text/javascript" src="../window/modal.js"></script>
<script language="JavaScript" src="../jscript/go_to_url.js"  type="text/javascript"></script> 


</head>


<body>
<div class="main_frame" style="height:auto; min-height:550px;" >

<table  id="table_main">
  <!--begin of tableMain-->
  <tr>
    <td height="68"  align="left" valign="top"> 
<div class="page_head_frame">    
<table width="657" border="0">
  <tr>
    <td width="582">
  <label class="label_page_head">Capture quote project</label> 
 &nbsp;
  <label class="label_page_head_2"><?php echo $_SESSION['company_name']?> </label>&nbsp;</td>
    <td width="65"><label style="font-size:24px; color:#FB6808;"><?php echo "Q".$_SESSION['quote_no'] ?></label></td>
  </tr>
</table>
</div>
      
</td> <!--center of tableMain-->
</tr>
<tr>
<td> <!--center of tableMain-->

      <div class="wizard_main_frame">
      <table >
      <tr>
      <td >
      <div class='wizard_paging_frame'>
        <table align="left">
      <tr>
      <td>
      <?php if ($_SESSION['p']==1) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;1</div>
      <div class="active_step_label"><br /><br /><br />
        Customer details</div></div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;1</div>
      <div class="de_active_step_label"><br /><br /><br />
      Customerdetails</div></div>
      <?php } ?>
      
      </td>
      <td>
      <?php if ($_SESSION['p']==2) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;2</div>
      <div class="active_step_label"><br /><br /><br />
      Quote items</div></div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;2</div>
      <div class="de_active_step_label"><br /><br /><br />
      quote items</div></div>
      <?php } ?>
     </td>
      <td>
      <?php if ($_SESSION['p']==3) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;3</div>
      <div class="active_step_label"><br /><br /><br />
      Quote details</div></div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;3</div>
      <div class="de_active_step_label"><br /><br /><br />
      Quote detals</div></div>
      <?php } ?>
      </td>
      <td>
      <?php if ($_SESSION['p']==4) { ?>
      <div class="active_step_frame"><div class="active_step_head_label">&nbsp;4</div>
      <div class="active_step_label"><br /><br /><br />
      Finish</div></div>
      <?php } else { ?>
      <div class="de_active_step_frame"><div class="de_active_step_head_label">&nbsp;4</div>
      <div class="de_active_step_label"><br /><br /><br />
        Finish</div></div>
      <?php } ?>
       </td>
      </tr>
      </table>
      </div>
      </td>
      </tr>
      <tr>
      <td><?php 
	if ($_SESSION['p']==1) { include("quoteWiz1.php"); }
	if ($_SESSION['p']==2) { include("quoteWiz2.php"); }
	if ($_SESSION['p']==3) { include("quoteWiz3.php"); }
	if ($_SESSION['p']==4) { include("quoteWiz5.php"); }
	
    ?></td>
    </tr>
    </table>
    </div>
    </td>
  </tr>
</table>

</td>
</tr>
</table>  <!--end of tableMain-->
</div>

</body>
<?php include ('../navigation/side_bar.php'); ?>