<?php
	session_start();

	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
	
	include("connect.php");
	if(isset($_POST['qmid'])){
	$qmid=(int)mysqli_real_escape_string($conn,$_POST['qmid']);}
	else{
		$qmid=(int)mysqli_real_escape_string($conn,$_GET['id']);
	}
	
	$query="delete from res_quotation_detail where qmid=$qmid";
	$result= mysqli_query($conn, $query) or die("Error");
	
	$query2="delete from res_followup_detail where qmid=$qmid";
	$result2= mysqli_query($conn, $query2) or die("Error");
	
	
	
	$query1="delete from res_quotation_master where qmid=$qmid";
	$result1= mysqli_query($conn, $query1) or die("Error");

	
	
	$_SESSION['msg'] = "Quotation Deleted";
	header('Location: quotationmaster.php');
?>