<head>
<script type="text/javascript" src="../css/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />

<?php
    $table_name = $_SESSION['db_prefix']."_quotations";
	$quote_query = "SELECT cust_id, seller, company_contact, contact_phone, project_no, project_place, project_description  FROM $table_name WHERE  quote_no = '".$_SESSION['quote_no']."' ";
	$quote_result = mySQL_query($quote_query);
	$a1 = mysql_result($quote_result, 0, "cust_id");
	$a2 = mysql_result($quote_result, 0, "seller");
	$a3 = mysql_result($quote_result, 0, "company_contact");
	$a4 = mysql_result($quote_result, 0, "contact_phone");
	$a5 = mysql_result($quote_result, 0, "project_no");
	$a6 = mysql_result($quote_result, 0, "project_place");
	$a7 = mysql_result($quote_result, 0, "project_description");
	$cust_id = $a1;
	$quote_no = $_SESSION['quote_no'];
	$job_card_no='';
	
	$_SESSION['total_amount']=0;



//$quote_value = $_SESSION['quote_amount'] ;
$quote_value = '';
$quote = 'yes';
?>


</head>
<?php include('../include/wait.php') ?>
<link href="../css/wait.css" rel="stylesheet" type="text/css">
<body onLoad="MM_showHideLayers('wait','','hide')" onFocus="MM_showHideLayers('wait','','hide');">
<div class="page_middle_frame">

<form id="feedbackform" method="get" action="quoteWiz6.php" >
  <table width=595 border="0" align="center" cellpadding="10" cellspacing="0" bordercolor="#0066FF" border-collapse="collapse">
     <tr>
            <td width="525" ><div class="wizard_frame">
              <table width="650" id="table_details_display">
                <tr>
                  <td width="117">Quotation no:</td>
                  <td width="133">Q<?php echo $_SESSION['quote_no'] ?></td>
                  <td width="160">Quotation date:</td>
                  <td width="198"><?php echo date("d-m-Y", strtotime($_SESSION['quotation_date'])) ?></td>
                </tr>
                <tr>
                  <td>Sales rep:</span></td>
                  <td><?php echo  $_SESSION['seller'] ?></td>
                  <td>Priority:</td>
                  <td>
                  <?php if ($_SESSION['priority']=="Hot") { ?>
                <img src="../images/flame_red.png" width="16" height="16"  />
                Hot<?php } ?>
              <?php if ($_SESSION['priority']=="Warm") { ?>
                <img src="../images/flame_orange.png" width="16" height="16"  />
                Warm<?php } ?>
              <?php if ($_SESSION['priority']=="Cold") { ?>
                <img src="../images/flame_blue.png" width="16" height="16"  />
                Cold<?php } ?>
                </td>
                </tr>
              </table>
            </div>
              <div class="wizard_frame" >
              <?php 
				include ('../include/customer_block.php');
				echo '<br>';
				include ('../include/job_block.php')
			?>
              </div>
              
              <div class="wizard_frame">
              <table width="650" id="table_details_display">
                <tr>
                  <td colspan="4">Project details::</td>
                </tr>
                <tr>
                  <td width="123">Plot no:</td>
                  <td width="205"><?php echo $a5 ?></td>
                  <td width="109">Place:</td>
                  <td width="213"><?php echo $a6 ?></td>
                </tr>
                <tr>
                  <td>Project description:</td>
                  <td colspan="3"><?php echo $a7 ?></td>
                </tr>
              </table>
            </div>
            
<div class="wizard_frame">            
Re: <?php echo $_SESSION['re_text'] ?>            
</div>            
            <?php
if ($_SESSION['project']=='Electric fencing') { ?>
<div class="wizard_frame">
 
<table width="571" id="table_details_display">
  <tr>
    <td colspan="3">Options:</td>
    </tr>
  <tr>
    <td width="47">&nbsp;</td>
    <td width="369">Round bar, 8 line</td>
    <td width="141" align="right"><?php if ($_SESSION['round_bar']!=0) { echo number_format($_SESSION['round_bar'], 2, '.', ',');} else { echo '----';} ?></td>
  </tr>
  <tr>
    <td width="47">&nbsp;</td>
    <td width="369">Flat bar, 8 line</td>
    <td width="141" align="right"><?php if ($_SESSION['flat_bar']!=0) {echo number_format($_SESSION['flat_bar'], 2, '.', ',');} else { echo '----';} ?></td>
  </tr>
  <tr>
    <td width="47">&nbsp;</td>
    <td width="369">Square tube, 8 line</td>
    <td width="141" align="right"><?php if ($_SESSION['square_tube']!=0) {echo number_format($_SESSION['square_tube'], 2, '.', ',');} else { echo '----';} $_SESSION['total_amount'] = $_SESSION['square_tube'] ?></td>
  </tr>
  <tr>
    <td width="47">&nbsp;</td>
    <td width="369">Heavy duty square tube brackets, 12 line</td>
    <td width="141" align="right"><?php if ($_SESSION['heavy_duty']!=0) {echo number_format($_SESSION['heavy_duty'], 2, '.', ',');} else { echo '----';} ?></td>
  </tr>
  <tr>
    <td colspan="3">Extra options:</td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Earth loops</td>
    <td align="right"><?php if($_SESSION['earth_loops']!=0) { echo number_format($_SESSION['earth_loops'], 2, '.', ',');} else { echo '----';} ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Outrigger</td>
    <td align="right"><?php if($_SESSION['outrigger']!=0) { echo number_format($_SESSION['outrigger'], 2, '.', ',');} else { echo '----';} ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Wash line</td>
    <td align="right"><?php if($_SESSION['wash_line']!=0) { echo number_format($_SESSION['wash_line'], 2, '.', ',');} else { echo '----';} ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Strobe</td>
    <td align="right"><?php if($_SESSION['strobe']!=0) { echo number_format($_SESSION['strobe'], 2, '.', ',');} else { echo '----';} ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Anti lift bar</td>
    <td align="right"><?php if($_SESSION['anti_lift_bar']!=0) { echo number_format($_SESSION['anti_lift_bar'], 2, '.', ',');} else { echo '----';} ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>Ace 100 energizer</td>
    <td align="right"><?php if($_SESSION['ace_100']!=0) { echo number_format($_SESSION['ace_100'], 2, '.', ',');} else { echo '----';} ?></td>
  </tr>
</table>

</div>
<?php
}
if ( ($_SESSION['project']=='Gate motor') OR ($_SESSION['project']=='Pool fence') )  { ?>
              <div class="wizard_frame"><?php if ($_SESSION['project']=='Gate motor') { echo 'Gate Automation:';} else { echo 'Quote options:';} ?>
                <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num6']) { 
				  ?>
                  <tr>
                    <td width="437"><?php echo $_SESSION['item_text6'.$i] ?></td>
                    <td width="213" ><div align="right"><?php if ($_SESSION['amount_text6'.$i]!="") {echo number_format($_SESSION['amount_text6'.$i], 2, '.', ','); }   ?></div></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                </table>
              </div>
              <div class="wizard_frame"> <?php if ($_SESSION['project']=='Gate motor') { echo 'Optional extras:';} else { echo 'Extra options:';} ?>
                <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num7']) { 
				  ?>
                  <tr>
                    <td width="437"><?php echo $_SESSION['item_text7'.$i] ?></td>
                    <td width="213" ><div align="right"><?php if ($_SESSION['amount_text7'.$i]!="") {echo number_format($_SESSION['amount_text7'.$i], 2, '.', ','); }   ?></div></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                </table>
              </div>
              <?php
}
?>

<?php
if ( ($_SESSION['project']=='Manase 358') OR ($_SESSION['project']=='Gate') OR ($_SESSION['project']=='Razor wire') OR ($_SESSION['project']=='Wall spikes') OR ($_SESSION['project']=='Farm fence') OR ($_SESSION['project']=='Free standing electric fence') OR ($_SESSION['project']=='Miscelaneous') ) { ?>
              <div class="wizard_frame"> Option 1: <?php echo $_SESSION['option1_text'] ?>
                <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num2']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text2'.$i] ?></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                </table>
                <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num3']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text3'.$i] ?></td>
                    <td width="220" ><div align="right">
                      <?php if ($_SESSION['amount_text3'.$i]!="") {echo number_format($_SESSION['amount_text3'.$i], 2, '.', ','); } ?>
                    </div></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
              </table>
              </div>
              
              <?php if ($_SESSION['option2_text']!='.') { ?> 
              <div class="wizard_frame"> Option 2: <?php echo $_SESSION['option2_text'] ?> 
                <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num4']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text4'.$i] ?></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                </table>
                  <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num5']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text5'.$i] ?></td>
                    <td width="220" ><div align="right">
                      <?php if ($_SESSION['amount_text5'.$i]!="") {echo number_format($_SESSION['amount_text5'.$i], 2, '.', ','); } ?>
                    </div></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                  <tfoot>
                  </tfoot>
                </table>
              </div>
              <?php }
			  
if (($_SESSION['project']=='Manase 358') OR ($_SESSION['project']=='Miscelaneous')) {				  
			  if ($_SESSION['option3_text']!='.') { ?> 
              <div class="wizard_frame"> Option 3: <?php echo $_SESSION['option3_text'] ?> 
                <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num_M4']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text_M4'.$i] ?></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                </table>
                  <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num_M5']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text_M5'.$i] ?></td>
                    <td width="220" ><div align="right">
                      <?php if ($_SESSION['amount_text_M5'.$i]!="") {echo number_format($_SESSION['amount_text_M5'.$i], 2, '.', ','); } ?>
                    </div></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                  <tfoot>
                  </tfoot>
                </table>
              </div>
              <?php }
			  }
			  
			if ($_SESSION['option4_text']!='.') { ?> 
              <div class="wizard_frame"> Option 4: <?php echo $_SESSION['option4_text'] ?> 
                <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num_K4']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text_K4'.$i] ?></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                </table>
                  <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num_K5']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text_K5'.$i] ?></td>
                    <td width="220" ><div align="right">
                      <?php if ($_SESSION['amount_text_K5'.$i]!="") {echo number_format($_SESSION['amount_text_K5'.$i], 2, '.', ','); } ?>
                    </div></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                  <tfoot>
                  </tfoot>
                </table>
              </div>
              <?php }
			  
			  if ($_SESSION['option5_text']!='.') { ?> 
              <div class="wizard_frame"> Option 5: <?php echo $_SESSION['option5_text'] ?> 
                <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num_L4']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text_L4'.$i] ?></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                </table>
                  <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num_L5']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text_L5'.$i] ?></td>
                    <td width="220" ><div align="right">
                      <?php if ($_SESSION['amount_text_L5'.$i]!="") {echo number_format($_SESSION['amount_text_L5'.$i], 2, '.', ','); } ?>
                    </div></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
                  <tfoot>
                  </tfoot>
                </table>
              </div>
              <?php }
			  }  
?>


<?php 

if ($_SESSION['project']=='Palisade fencing') { ?>
<div class="wizard_frame" id="palisade_option2_div" ><br>
      <table id="dataTable5" width="590" border="1" style="border-collapse:collapse;">
        <tr>
          <td width="408" valign="middle"></textarea>Devils fork</td>
          <td width="140" align="right" valign="middle"><?php if ($_SESSION['palisade_text']!='') { echo number_format($_SESSION['palisade_text'], 2, '.', ','); } ?>
          </td>
          
        </tr>
</table>
</div>
<div class="wizard_frame" id="palisade_gate_div" >  
  Gates:&nbsp;<br>
      <table id="dataTable5" width="590" border="1" style="border-collapse:collapse;">
        <tr>
          <td width="408" valign="middle"><?php echo $_SESSION['gate_text0'];  ?></td>
          <td width="140" align="right" valign="middle"><?php if ($_SESSION['palisade_text6']!='') { echo number_format($_SESSION['palisade_text6'], 2, '.', ','); } ?>
          </td>
          
        </tr>
      <?php if ($_SESSION['gate_text1']!='') { ?>  
      <tr>
        <td valign="middle"><?php  echo $_SESSION['gate_text1']; ?></td>
        <td align="right" valign="middle"><?php if ($_SESSION['palisade_text7']!='') { echo number_format($_SESSION['palisade_text7'], 2, '.', ','); } ?></td>
      </tr>
      <?php
	  }
	  if ($_SESSION['gate_text2']!='') { ?> 
      <tr>
        <td valign="middle"><?php echo $_SESSION['gate_text2']; ?></td>
        <td align="right" valign="middle"><?php if ($_SESSION['palisade_text8']!='') { echo number_format($_SESSION['palisade_text8'], 2, '.', ','); }  ?></td>
      </tr>
      <?php } ?>
      </table>
</div> 
  
<?php
}
?>



<?php
if ($_SESSION['project']=='Diamond mesh') { ?>
              <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<6) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text8'.$i] ?></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
              </table>
                <table width="650" id="table_details_display">
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num9']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text9'.$i] ?></td>
                    <td width="220" ><div align="right">
                      <?php if ($_SESSION['amount_text9'.$i]!="") {echo number_format($_SESSION['amount_text9'.$i], 2, '.', ','); } ?>
                    </div></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
              </table>
              <?php if ($_SESSION['picture']=='yes') { echo 'Picture printed on quotation.'; } else { echo 'No picture printed on quotation.'; }?>
       </div>
<?php }
?>

<?php
if ($_SESSION['project']=='Palisade standard') { ?>
              <div class="wizard_frame"> Option 1: <?php echo $_SESSION['option1_text'] ?><br>
				 
                <table width="650" id="table_details_display">
                <tr>
                    <td width="396">Selected fence height</td>
                    <td width="220" ><?php echo $_SESSION['fence_height']?>&nbsp;mm</td>
                  </tr>
                  <tr>
                    <td width="396">&nbsp;</td>
                    <td width="220" >&nbsp;</td>
                  </tr>
                  <?php
				  $i=0;
				  while ($i<$_SESSION['line_num9']) { 
				  ?>
                  <tr>
                    <td width="396"><?php echo $_SESSION['item_text9'.$i] ?></td>
                    <td width="220" ><div align="right">
                      <?php if ($_SESSION['amount_text9'.$i]!="") {echo number_format($_SESSION['amount_text9'.$i], 2, '.', ','); } ?>
                    </div></td>
                  </tr>
                  <?php
				  $i++;
				  }
				  ?>
              </table>
              
              </div>
<?php }
?>

<div class="wizard_frame">
  Terms.<br>
  Payment: <?php echo $_SESSION['terms']?><br>
  Price valid for: <?php echo $_SESSION['valid_days']?> days.<br>
  Prices <?php echo $_SESSION['VAT'] ?> VAT.<br>
  Delivery: <?php echo $_SESSION['delivery_days']?> days.
  

</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>
       </td>
           
    </tr>
          <tr>
            <td>
              <table width="675" height="50" align="center" id="table_button_bar">
                <tr>
                  <td width="141" valign="top"><input type="button" name="lastprev_button" class="imagebutton" value="Prev" onClick="needToConfirm = false;MM_goToURL('parent','quoteWizbase.php?s=6&amp;p=3');return document.MM_returnValue; MM_showHideLayers('wait','','show');" /></td>
                  <td width="130" valign="top">
                    <input name="s" type="hidden" id="s" value="5" />
                    <input name="p" type="hidden" id="p" value="5" />
                  </td>
                  <td width="137" valign="top">&nbsp;</td>
                  <td width="131" align="right" valign="top"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false; cancel_confirmation(1, '../sales/sales_main.php?date='); " value="Cancel" /></td>
                  <td width="87" align="right" valign="top"><input  name="finish_button" type="submit" class="imagebutton" id="finish_button" value="Finish" onClick="needToConfirm = false;MM_showHideLayers('wait','','show')" /></td>
                </tr>
              </table></td>
          </tr>
  </table>
  
  
</form>
</div>
</body>
