<?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.
// 
	
	include ("check_session.php");
	
	$document_root = $_SERVER['DOCUMENT_ROOT'];
	$do_install_file = $document_root . "/install/do_install.php";
	$run_sql_install_file = $document_root . "/install/run_sql_install.php";
	$install_file = $document_root . "/install/install.php";
	$db_connect_file = $document_root . "/install/db_connect.php";
	$config_file = $document_root . "/install/config.php";
	$index_file = $document_root . "/install/index.php";
	$install_folder = $document_root . "/install";
	$database_file = $document_root . "/SQL/database.sql";
	$SQL_folder = $document_root . "/SQL";
	
	error_reporting (E_ALL ^ E_NOTICE ^ E_WARNING);
	
	try {
		unlink($do_install_file);
	} catch (Exception $e) {
		unset($e);
	}
	try {
		unlink($run_sql_install_file);
	} catch (Exception $e) {
		unset($e);
	}
	try {
		unlink($install_file);
	} catch (Exception $e) {
		unset($e);
	}
	try {
		unlink($db_connect_file);
	} catch (Exception $e) {
		unset($e);
	}
	try {
		unlink($config_file);
	} catch (Exception $e) {
		unset($e);
	}
	try {
		unlink($index_file);
	} catch (Exception $e) {
		unset($e);
	}
	if (file_exists($document_root . "/install/_notes"))
		unlink($document_root . "/install/_notes");
	try {
		rmdir($install_folder);
	} catch (Exception $e) {
		unset($e);
	}
	try {
		unlink($database_file);
	} catch (Exception $e) {
		unset($e);
	}
	if (file_exists($document_root . "/SQL/_notes"))
		unlink($document_root . "/SQL/_notes");
	try {
		rmdir($SQL_folder);
	} catch (Exception $e) {
		unset($e);
	}
	
	error_reporting (E_ALL ^ E_NOTICE);
	
	header("Location: dashboard.php");
?>