<?php session_start();?>
<?php require_once('open_connection.php');?>
<link href="css/gridtable.css" rel="stylesheet" type="text/css" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>quotation_status</title>
</head>
<script>
function staffcatOnchange(){
    var staffcat = document.getElementById('quotation_status').value 
    if(staffcat == "Partial"|| staffcat == "Paid")
        document.getElementById("staff_join").style.display="block";
    else
        document.getElementById("staff_join").style.display="none";
}
 </script>
<body bgcolor="#333333"> 
<?php $quotation_id = $_GET['quotation_id'];?> 
<?php
                        $get_query=mysql_query("SELECT * from tbl_dir_fnb_rquotation WHERE quotation_id='$quotation_id'")or die(mysql_error());						
                        $row=mysql_fetch_array($get_query);
						$quotation_status=$row['quotation_status'];
						$cust_id=$row['cust_id'];
                        echo $cust_id;
                    ?>
					<table width="100%" border="0" align="center">   
<tr>
<td width="15%" bgcolor="#333333">&nbsp;</td>

<td width="70%" align="center" bgcolor="#FFFFFF"> 

<table width="100%" border="0" align="center">

<!-- row for header picc 1 -->
<tr>  
     <th width="100%" colspan="4"><img src="images/header-cox.jpg" width="100%" height="auto"></th>
</tr>

<!-- row for header picc 2 -->
<tr>
     <th width="100%" colspan="4"><img src="images/eoffice-cox.jpg" width="100%" height="auto"></th>
</tr>
<!-- calling frame -->	
<tr>
    <td colspan="1" width="10%" align="center"><?php include("header.php");?></td>
	
</tr>
<tr><td>
<form method="post">					
<table width="56%" border="1" align="center" class="gridtable">
  <tr >
    <td width="152" ><div align="center" ><strong>Status</strong></div></td>
    <td width="510"><b>
	<label class="control-label"  style="margin-left:20px"  for="input01">Status </label>
      <label style="margin-left:12px">:<select name="quotation_status" id="quotation_status" >
	    <option value="<?php echo $row['quotation_status']; ?>" ><?php echo $row['quotation_status']; ?></option>
        <option value="Confirm">Confirm</option>
		<option value="Cancel">Cancel</option>
		<option value="InProgress">In Progress</option>
      </select></label><p>
	   <div><label class="control-label" style="vertical-align:top;"  for="input01">Description</label>
							 <label style="vertical-align:top">:<textarea rows="4" name="quotation_desc"  cols="50"><?php echo $row['quotation_desc']; ?></textarea></label></div>
	
							 </div>
							
    </td>
  </tr>
 
</table>
 <div align="center"><button name="save" class="button">Save</button> &nbsp;
		
		 <input type="button" value = "Back" onClick="history.go(-1);return true;" class="button"></div>
</form>
</td></td>
<tr>
	<th align="center" colspan="4">
	<img src="images/footer-cox.jpg" width="100%" height="70%">
		
	</th>
</tr>

<!--- end for ruang kerja 80% -->
</table> 

</td>

<td width="15%" bgcolor="#333333">&nbsp;</td>

</tr>

<!--- end for ruang kerja 100% -->
</table>

<?php

            if (isset($_POST['save'])){
			
			            
			                  $quotation_id        =$_GET['quotation_id'];
							  $quotation_status   = addslashes($_POST['quotation_status']);
							  $quotation_desc    = addslashes($_POST['quotation_desc']);
							  
							   
		  								  $status="update tbl_dir_fnb_rquotation SET quotation_status='$quotation_status',quotation_desc='$quotation_desc'
					             				   WHERE quotation_id='$quotation_id'";

  /*$update_total="update tbl_dir_fnb_item SET tbl_dir_fnb_item.item_total_value=(SELECT SUM(item_total) )
 				 WHERE  tbl_dir_fnb_item.quotation_id='$quotation_id'";*/
		
			$result= mysql_query($status);
			
		 
		 if ($result){
		 		echo "<script language='javascript'>window.location='quotation_chooseDate_Ramadhan.php?cust_id=$cust_id'</script>";}
			else{
				echo 'Unsuccessful, please try again';}
    }  
	
	


?>
</body>
</html>
