<?PHP
include "../inc/var.php";
include "../inc/connect.php";
include $server_inc."/whm_functions.php";
include $server_inc."/client_functions.php";
include $server_inc."/login_functions.php";
include $server_inc."/invoice_functions.php";

echo("
	<html>
	<head>
	<title>Creating Past Invoices...</title>
	</head>
	<table width='725' cellpadding='0' cellspacing='0' border='0'>
		<tr>
			<td width='1%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='375'></td>
			<td width='99%' align='left' valign='top'>
			
		<table width='725' cellpadding='0' cellspacing='0' border='0'>
			<tr>
				<td align='left' valign='top'><img src='".$http_images."/menu_arrow_back.gif'><a href='javascript: void(0);'onclick=\"javascript: window.close(); window.opener.document.location.replace('".$http_admin."/invoice_hosting_history.php?sid=".$sid."&oid=".$recreate."')\"><b>Click to Close Window, Update View</b></a></td>
			</tr>
			<tr>
				<td align='left' valign='top'><hr align='left' valign='top' color='#F0EFED' width='725'></td>
			</tr>
		</table>
	");

if (!isset($i_agree)) 
	{
	echo("
		<form action='".$PHP_SELF."' method='POST'>
		<input type='hidden' name='sid' value='".$sid."'>
		<input type='hidden' name='recreate' value='".$recreate."'>
		<table width='725' cellpadding='0' cellspacing='0' border='0'>
			<tr>
				<td align='left' valign='top'>If you click the button below to start this process all current hosting order invoices for this client will be lost.<br>You should run this file only 1 time.<br>Please back up your database before clicking the button below.<br><br><font color='#990000'><b>Proceed at your own risk.</b></font><br><br><input type='submit' name='i_agree' value='Yes, I fully understand the statement above.'></td>
			</tr>
		</table>
		</form>
		");
	}
else { echo nl2br(create_individual_invoice_history(base64_decode($recreate), $below_public)); }

echo("
				</td>
			</tr>
		</table>
		</body>
		</html>
		");

mysql_close($dblink);
?>