<?php require_once('open_connection.php');?>
<html>
<body bgcolor="black">
  <?php
 					
					$invoice_ref_id = $_GET['invoice_ref_id'];
					
                    $del_query=mysql_query("select tbl_dir_evendor.vendor_id, tbl_dir_evendor.vendor_name,
					tbl_dir_fnb_invoice.invoice_ref_id, tbl_dir_fnb_invoice.invoice_date,tbl_dir_fnb_invoice.invoice_amount 
					from tbl_dir_fnb_invoice 
					Left join  tbl_dir_evendor ON tbl_dir_fnb_invoice.vendor_id=tbl_dir_evendor.vendor_id where invoice_ref_id=".$invoice_ref_id);
					 
                    $row=mysql_fetch_array($del_query);
                    $vendor_id=$row['vendor_id'];
					
                ?>
				<h2>Add vendor_id to <?php echo $row['vendor_id']?></h2>
				<h2>Add invoice_ref_id to <?php echo $row['invoice_ref_id']?></h2>
				
<?php

			
			mysql_query("DELETE FROM tbl_dir_fnb_invoice where invoice_ref_id= '$invoice_ref_id'");
			echo "<script> alert('1 record deleted');
window.location.href='vendor_fnb_invoice.php?vendor_id=$vendor_id';
</script>";
?>
</body>
</html>