<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 12/05/2013
// Modified: 4/24/2015	ELL
// Added exception handling.
// Revised: 12/14/2016	ELL
// Overhauled code to be more effective, adaptable and tighter.
// 
	
	include ("check_session.php");
	
	$document_root = $_SERVER['DOCUMENT_ROOT'];
	$install_dir = $document_root . "/install";
	$SQL_dir = $document_root . "/SQL";
	$notes_dir = $install_dir . "/_notes";
	$notes_dir_2 = $SQL_dir . "/_notes";
	
	error_reporting (E_ALL ^ E_NOTICE ^ E_WARNING);
	
	if (file_exists($notes_dir))	{
		array_map('unlink', glob($notes_dir . "/*"));
		rmdir($notes_dir);
	}
	array_map('unlink', glob($install_dir . "/*"));
	rmdir($install_dir);
	
	if (file_exists($notes_dir_2))	{
		array_map('unlink', glob($notes_dir_2 . "/*"));
		rmdir($notes_dir_2);
	}
	array_map('unlink', glob($SQL_dir . "/*"));
	rmdir($SQL_dir);
	
	error_reporting (E_ALL ^ E_NOTICE);
	
	header("Location: dashboard.php");
?>