<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 12/4/2014 ELL
//
	include ("check_session.php");
	
	$ID = $_REQUEST['ID'];
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Preview Archive</title>
<style type="text/css">
	#preview_close_button	{
		display:block;
		position:absolute;
		right:50px;
		bottom:50px;
	}
</style>
</head>

<body>
<?php
	$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "page_data_bkup WHERE `ID`='$ID'";
	$result = $bwb_dbh->query($query);
	$row = $result->fetch(PDO::FETCH_ASSOC);
	$page_content = $row["page_content"];
	$page_name = $row["page_name"];
	
	echo "<p style='margin-left:20px; margin-bottom:20px; font-weight:bold;'>" . EDITOR_PAGE_NAME . ": $page_name</p>\n";
	echo "<div style='max-width:800px; margin-left:50px;'>\n";
	
	$page_content = htmlspecialchars($page_content);
	$page_content  = str_replace("\n", "<br />", $page_content);
	echo $page_content;
?>
</div>
<div id="preview_close_button"><img src="theme/<?php echo $theme; ?>/images/close-button.png" alt="<?php echo CLOSE_WORD; ?>" onClick="window.close();" style="cursor:pointer;" /></div>
	
<script language="javascript" type="text/javascript">
    if (navigator.appName == "Microsoft Internet Explorer")
		document.getElementById("preview_frame").height = document.documentElement.clientHeight - 32;
	else if (navigator.appName == "Opera")
		document.getElementById("preview_frame").height = window.innerHeight - 32;
	else
		document.getElementById("preview_frame").height = window.innerHeight - 32;
</script>
</body>
</html>