<?php

	require_once 'dbconfig4.php';
	
	if(isset($_GET['dwid']))
	{

		$stmt_select = $DB_con->prepare('SELECT ddocument FROM investtute WHERE dwid =:dwid');
		$stmt_select->execute(array(':dwid'=>$_GET['dwid']));
		$imgRow=$stmt_select->fetch(PDO::FETCH_ASSOC);
		unlink("img/downloads/".$imgRow['ddocument']);

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

		echo"<script type='text/javascript'>window.location.href = 'downloads.php';</script>";
		
	}

?>