<?php require_once('open_connection.php');?>
<html>
<body bgcolor="black">
  <?php
 					
					$quotation_id = $_GET['quotation_id'];
					
                    $del_query=mysql_query("SELECT tbl_dir_fnb_customer.cust_id, tbl_dir_fnb_quotation.quotation_id,
					                        tbl_dir_fnb_quotation.quotation_date_from, tbl_dir_fnb_quotation.quotation_date_to
                                            FROM tbl_dir_fnb_customer
                                            LEFT JOIN tbl_dir_fnb_quotation ON tbl_dir_fnb_customer.cust_id = tbl_dir_fnb_quotation.cust_id where quotation_id=".$quotation_id);
					 
                    $row=mysql_fetch_array($del_query);
                    $cust_id=$row['cust_id'];
					
                ?>
				<h2>Add cust_id to <?php echo $row['cust_id']?></h2>
				<h2>Add quotation_id to <?php echo $row['quotation_id']?></h2>
				
<?php

			
			mysql_query("DELETE tbl_dir_fnb_quotation,tbl_dir_fnb_item FROM tbl_dir_fnb_quotation
			             LEFT JOIN tbl_dir_fnb_item ON tbl_dir_fnb_quotation.quotation_id=tbl_dir_fnb_item.quotation_id
						 WHERE tbl_dir_fnb_quotation.quotation_id= '$quotation_id'");
			echo "<script> alert('1 record deleted');
window.location.href='quotation_chooseDate_zerogst.php?cust_id=$cust_id';
</script>";
?>
</body>
</html>