<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 6/3/2009
// Revised: 1/16/2012	ELL
// Addaed deleting of drafts.
// Revised: 2/8/2012	ELL
// Added table prefix handling.
	
	include ("check_session.php");
		
	$head_name = $_REQUEST['head_name'];
	
	// Delete head.
	$query = "DELETE FROM " . BWB_TABLE_PREFIX . "head WHERE head_name = '". $head_name . "'";
	$cnt = $bwb_dbh->exec($query);
	
	// Delete draft.
	$query = "DELETE FROM " . BWB_TABLE_PREFIX . "page_data_draft WHERE page_name='$head_name' AND `source`=2";
	$cnt = $bwb_dbh->exec($query);
	
	header("Location: manage_head.php");
?>