<?php

	require_once 'dbconfig.php';
	
	if(isset($_GET['qid']))
	{
		$stmt_select = $DB_con->prepare('SELECT Logo FROM tbl_quotations WHERE quotations_id =:qid');
		$stmt_select->execute(array(':qid'=>$_GET['qid']));
		$imgRow=$stmt_select->fetch(PDO::FETCH_ASSOC);
		unlink("images/quotation/".$imgRow['Logo']);    

		$stmt_delete = $DB_con->prepare('DELETE FROM tbl_quotations_items WHERE quotations_id =:qid');
		$stmt_delete->bindParam(':qid',$_GET['qid']);
		$stmt_delete->execute();
		

        $stmt_delete1 = $DB_con->prepare('DELETE FROM tbl_quotations WHERE quotations_id =:qid');
		$stmt_delete1->bindParam(':qid',$_GET['qid']);
		$stmt_delete1->execute();
		
		echo"<script type='text/javascript'>window.location.href = 'quotationlist.php';</script>";
		
	}

?>