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

include $server_admin_inc."/header.php";

echo("
	<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='100%' cellpadding='2' cellspacing='0' border='0'>
				<tr>
					<td align='left' valign='top'><img src='".$http_images."/menu_arrow.gif'><b>Pre Version 2.1.0 Addon Details</b></td>
				</tr>
				<tr>
					<td align='left' valign='top'><img src='".$http_images."/space.gif' width='1' height='6'></td>
				</tr>
	");
$query="select ";
$query.="hosting_order.uid, ";				// 0
$query.="hosting_order.unique_ip, ";		// 1
$query.="hosting_order.ssl_cert, ";			// 2
$query.="hosting_order.extra_space, ";		// 3
$query.="hosting_order.addon_1, ";			// 4
$query.="hosting_order.addon_2, ";			// 5
$query.="hosting_order.addon_3, ";			// 6
$query.="plan_specs.package_name, ";		// 7
$query.="plan_specs.unique_ip_cost, ";		// 8
$query.="plan_specs.ssl_cost, ";			// 9
$query.="plan_specs.extra_space_cost, ";	// 10
$query.="plan_specs.extra_space, ";			// 11
$query.="plan_specs.addon_1_name, ";		// 12
$query.="plan_specs.addon_1_cost, ";		// 13
$query.="plan_specs.addon_1_terms, ";		// 14
$query.="plan_specs.addon_2_name, ";		// 15
$query.="plan_specs.addon_2_cost, ";		// 16
$query.="plan_specs.addon_2_terms, ";		// 17
$query.="plan_specs.addon_3_name, ";		// 18
$query.="plan_specs.addon_3_cost, ";		// 19
$query.="plan_specs.addon_3_terms, ";		// 20
$query.="hosting_order.domain_name ";		// 21
$query.="from hosting_order, plan_specs ";
$query.="where hosting_order.pid=plan_specs.pid ";
$query.="order by hosting_order.oid asc";

$row=mysql_query($query);
if (!$row) 
	{
	echo("
				<tr>
					<td align='left' valign='top'>This tool does not apply to your installation.</td>
				</tr>
		");
	}
else
	{
	while ($rs=mysql_fetch_row($row))
		{
		$uid=stripslashes(trim($rs[0]));
		$unique_ip=stripslashes(trim($rs[1]));
		$ssl_cert=stripslashes(trim($rs[2]));
		$extra_space_host=stripslashes(trim($rs[3]));
		$addon_1=stripslashes(trim($rs[4]));
		$addon_2=stripslashes(trim($rs[5]));
		$addon_3=stripslashes(trim($rs[6]));
		$package_name=stripslashes(trim($rs[7]));
		$unique_ip_cost=stripslashes(trim($rs[8]));
		$ssl_cost=stripslashes(trim($rs[9]));
		$extra_space_cost=stripslashes(trim($rs[10]));
		$extra_space=stripslashes(trim($rs[11]));
		$addon_1_name=stripslashes(trim($rs[12]));
		$addon_1_cost=stripslashes(trim($rs[13]));
		$addon_1_terms=stripslashes(trim($rs[14]));
		$addon_2_name=stripslashes(trim($rs[15]));
		$addon_2_cost=stripslashes(trim($rs[16]));
		$addon_2_terms=stripslashes(trim($rs[17]));
		$addon_3_name=stripslashes(trim($rs[18]));
		$addon_3_cost=stripslashes(trim($rs[19]));
		$addon_3_terms=stripslashes(trim($rs[20]));
		$domain_name=stripslashes(trim($rs[21]));

		$rs0=mysql_fetch_row(mysql_query("select first_name, last_name, email from user where uid='".addslashes(trim($uid))."'"));
		$first_name=stripslashes(trim($rs0[0]));
		$last_name=stripslashes(trim($rs0[1]));
		$email=stripslashes(trim($rs0[2]));
		
		@$data.=("
			<tr>
				<td>
			");
		@$data.="<a href='mailto:$email'>".$first_name." ".$last_name."</a> - <a href='http://".$domain_name."' target='_blank'>".$domain_name."</a><br>";
		@$data.="<b>".$package_name."</b><br>";
		if ($unique_ip==1) 
			{ 
			@$xdata.="Unique IP - ".$currency.sprintf("%01.2f", $unique_ip_cost).$currency_type."<br>"; 
			$bit=true;
			}
		if ($ssl_cert==1) { @$xdata.="SSL Cert - ".$currency.sprintf("%01.2f", $ssl_cost).$currency_type."<br>"; $bit=true; }
		if ($extra_space_host!=0) { @$xdata.=$extra_space_host." MB Extra Webspace - ".$currency.sprintf("%01.2f", $extra_space_cost).$currency_type."<br>"; $bit=true; }
		if ($addon_1==1) { @$xdata.=$addon_1_name." ".(($addon_1_terms=="Fee")?"One time Fee":" per ".$addon_1_terms."")." - ".$currency.sprintf("%01.2f", $addon_1_cost).$currency_type."<br>"; $bit=true; }
		if ($addon_1==1) { @$xdata.=$addon_2_name." ".(($addon_2_terms=="Fee")?"One time Fee":" per ".$addon_2_terms."")." - ".$currency.sprintf("%01.2f", $addon_2_cost).$currency_type."<br>"; $bit=true; }
		if ($addon_1==1) { @$xdata.=$addon_3_name." ".(($addon_3_terms=="Fee")?"One time Fee":" per ".$addon_3_terms."")." - ".$currency.sprintf("%01.2f", $addon_3_cost).$currency_type."<br>"; $bit=true; }
		@$ydata.="<br><br>";
		@$ydata.=("
				</td>
			</tr>
			");

		if (isset($bit))
			{
			@$final.=$data;
			@$final.=$xdata;
			@$final.=$ydata;
			}

		unset($bit);
		unset($xdata);
		unset($ydata);
		unset($data);
		unset($last_name);
		unset($email);
		unset($uid);
		unset($unique_ip);
		unset($ssl_cert);
		unset($extra_space_host);
		unset($addon_1);
		unset($addon_2);
		unset($addon_3);
		unset($package_name);
		unset($unique_ip_cost);
		unset($ssl_cost);
		unset($extra_space_cost);
		unset($extra_space);
		unset($addon_1_name);
		unset($addon_1_cost);
		unset($addon_1_terms);
		unset($addon_2_name);
		unset($addon_2_cost);
		unset($addon_2_terms);
		unset($addon_3_name);
		unset($addon_3_cost);
		unset($addon_3_terms);
		unset($domain_name);
		$x++;
		}
	echo $final;
	}
echo("
			</table>
			</td>
		</tr>
	</table>
	");
include $server_admin_inc."/footer.php";
mysql_close($dblink);
?>