<?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";

// Start Form Handler
if(phpversion() <= "4.0.6") { $_POST=$HTTP_POST_VARS; }
if (isset($_POST['submit']))
	{
	if (strlen(trim($package_name))==0) { $err0=true; } else { $n0=true; }
	if (strlen(trim($monthly_cost))==0) { $err1=true; } else { $n1=true; }
	if (strlen(trim($quarterly_cost))==0) { $err2=true; } else { $n2=true; }
	if (strlen(trim($semi_annual_cost))==0) { $err3=true; } else { $n3=true; }
	if (strlen(trim($annual_cost))==0) { $err4=true; } else { $n4=true; }
	if (strlen(trim($web_space))==0) { $err6=true; } else { $n6=true; }
	if (strlen(trim($bandwidth))==0) { $err7=true; } else { $n7=true; }
	if (isset($tpp_high)) { if (strlen(trim($tpp_pro_period))==0) { $err8=true; } else { $n8=true; } } else {$n8=true;}

	if (isset($n0)&&isset($n1)&&isset($n2)&&isset($n3)&&isset($n4)&&isset($n7)&&isset($n8))
		{
		// if isset($pid) then it's an edit
		if (isset($pid)) { $query="update plan_specs set "; }
		else { $query="insert into plan_specs set "; }
		$query.="package_name='".addslashes(trim($package_name))."', ";
		$query.="plan_status='".addslashes(trim($plan_status))."', ";
		$query.="monthly_cost='".addslashes(str_replace("$", "", trim($monthly_cost)))."', ";
		$query.="quarterly_cost='".addslashes(str_replace("$", "", trim($quarterly_cost)))."', ";
		$query.="semi_annual_cost='".addslashes(str_replace("$", "", trim($semi_annual_cost)))."', ";
		$query.="annual_cost='".addslashes(str_replace("$", "", trim($annual_cost)))."', ";
		$query.="setup_cost='".addslashes(str_replace("$", "", trim($setup_cost)))."', ";
		$query.="web_space='".addslashes(trim($web_space))."', ";
		$query.="bandwidth='".addslashes(trim($bandwidth))."', ";
		$query.="monthly_pid='".addslashes(trim($monthly_pid))."', ";
		$query.="quarterly_pid='".addslashes(trim($quarterly_pid))."', ";
		$query.="semi_annual_pid='".addslashes(trim($semi_annual_pid))."', ";
		$query.="annual_pid='".addslashes(trim($annual_pid))."', ";
		$query.="addon_gid='".addslashes(trim($addon_gid))."', ";
		     
		$query.="ip_addresses='".addslashes(trim($ip_addresses))."', ";
		$query.="memory='".addslashes(trim($memory))."', ";
		$query.="processor='".addslashes(trim($processor))."', ";
		$query.="os='".addslashes(trim($os))."', ";
		$query.="in_stock='".addslashes(trim($in_stock))."', ";
		$query.="display_text='".addslashes(trim(str_replace("\"", "'", $display_text)))."', ";
		$query.="dedicated='1', ";

		if (isset($free_trial)) 
			{
			$query.="free_trial='1', ";
			$query.="free_trial_length='".addslashes(trim($free_trial_length))."', ";
			}
		else 
			{ 
			$query.="free_trial='0', ";
			$query.="free_trial_length='0', ";
			}

		if (isset($tpp_pro_period))
			{
			$query.="tpp_pro_period='".addslashes(trim($tpp_pro_period))."', ";
			}
		else { $query.="tpp_pro_period='x', "; }

		$query.="gid='".addslashes(trim($gid))."'";

		if (isset($pid)) { $query.=" where pid='".addslashes(trim($pid))."'"; mysql_query($query); }
		else { mysql_query($query); $pid=mysql_insert_id(); }

		if ($addon_gid!=0)
			{
			// update the payment processors for the group
			mysql_query("update addon_groups set group_payment='' where addon_gid='".addslashes(trim($addon_gid))."'");
			}

		$done=true;
		}
	}

// End Form Handler

include $server_admin_inc."/header.php";

if (isset($pid))
	{
	$query="select ";
	$query.="package_name, ";		// 0
	$query.="plan_status, ";		// 1
	$query.="monthly_cost, ";		// 2
	$query.="quarterly_cost, ";		// 3
	$query.="semi_annual_cost, ";	// 4
	$query.="annual_cost, ";		// 5
	$query.="setup_cost, ";			// 6
	$query.="web_space, ";			// 7
	$query.="bandwidth, ";			// 8     
	$query.="ip_addresses, ";		// 9
	$query.="memory, ";				// 10
	$query.="processor, ";			// 11
	$query.="os, ";					// 12
	$query.="display_text, ";		// 13
	$query.="tpp_pro_period, ";		// 14
	$query.="gid, ";				// 15
	$query.="monthly_pid, ";		// 16
	$query.="quarterly_pid, ";		// 17
	$query.="semi_annual_pid, ";	// 18
	$query.="annual_pid, ";			// 19
	$query.="addon_gid, ";			// 20
	$query.="free_trial, ";			// 21
	$query.="free_trial_length ";	// 22
	$query.="from plan_specs ";
	$query.="where pid='".addslashes(trim($pid))."'";

	// execute query
	$rs=mysql_fetch_row(mysql_query($query));

	$package_name=stripslashes(trim($rs[0]));
	$plan_status=stripslashes(trim($rs[1]));
	$monthly_cost=stripslashes(trim($rs[2]));
	$quarterly_cost=stripslashes(trim($rs[3]));
	$semi_annual_cost=stripslashes(trim($rs[4]));
	$annual_cost=stripslashes(trim($rs[5]));
	$setup_cost=stripslashes(trim($rs[6]));
	$web_space=stripslashes(trim($rs[7]));
	$bandwidth=stripslashes(trim($rs[8]));
	$ip_addresses=stripslashes(trim($rs[9]));
	$memory=stripslashes(trim($rs[10]));
	$processor=stripslashes(trim($rs[11]));
	$os=stripslashes(trim($rs[12]));
	$display_text=stripslashes(trim($rs[13]));
	$tpp_pro_period=stripslashes(trim($rs[14]));
	$gid=stripslashes(trim($rs[15]));
	$monthly_pid=stripslashes(trim($rs[16]));
	$quarterly_pid=stripslashes(trim($rs[17]));
	$semi_annual_pid=stripslashes(trim($rs[18]));
	$annual_pid=stripslashes(trim($rs[19]));
	$addon_gid=stripslashes(trim($rs[20]));
	$free_trial=stripslashes(trim($rs[21]));
	$free_trial_length=stripslashes(trim($rs[22]));
	}

# added 6/16/2003 - is paypal active?
$query_x="select ";
$query_x.="status "; // 0
$query_x.="from ";
$query_x.="payment_process ";
$query_x.="where ";
$query_x.="pid='1'";

$rs_x=mysql_fetch_row(mysql_query($query_x));

$show_status=stripslashes(trim($rs_x[0]));
# end added 6/16/2003

// Check to make sure we have groups defined
$ct=mysql_fetch_row(mysql_query("select count(*) from plan_groups"));

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'>
	");

// start error messages table
if (isset($err0)||isset($err1)||isset($err2)||isset($err3)||isset($err4)||isset($err6)||isset($err7)||isset($err8))
	{
	echo"<table width='100%' cellpadding='2' cellspacing='0' border='0'>";
	}

// Left MIB Package null
if (isset($err0))
	{
	echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/error_arrow.gif'><b>ERROR!</b> You must enter a <b>MIB Package Name</b> to continue.</td> 
			</tr>
			<tr>
				<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
			</tr>
		");
	}

// No Monthly price defined
if (isset($err1))
	{
	echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/error_arrow.gif'><b>ERROR!</b> You must enter a <b>Monthly Cost</b> to continue.</td> 
			</tr>
			<tr>
				<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
			</tr>
		");
	}

// No Quarterly price defined
if (isset($err2))
	{
	echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/error_arrow.gif'><b>ERROR!</b> You must enter a <b>Quarterly Cost</b> to continue.</td> 
			</tr>
			<tr>
				<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
			</tr>
		");
	}

// No Semi-Annual price defined
if (isset($err3))
	{
	echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/error_arrow.gif'><b>ERROR!</b> You must enter a <b>Semi-Annual</b> Cost to continue.</td> 
			</tr>
			<tr>
				<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
			</tr>
		");
	}

// No Annual price defined
if (isset($err4))
	{
	echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/error_arrow.gif'><b>ERROR!</b> You must enter a <b>Annual Cost</b> to continue.</td> 
			</tr>
			<tr>
				<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
			</tr>
		");
	}

// No web space amount defined.
if (isset($err6))
	{
	echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/error_arrow.gif'><b>ERROR!</b> You must enter an amount of <b>web space</b> to continue.</td> 
			</tr>
			<tr>
				<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
			</tr>
		");
	}

// No bandwidth amount defined.
if (isset($err7))
	{
	echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/error_arrow.gif'><b>ERROR!</b> You must enter an amount of <b>bandwidth</b> to continue.</td> 
			</tr>
			<tr>
				<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
			</tr>
		");
	}

// Missing TPP-PRO Period
if (isset($err8))
	{
	echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/error_arrow.gif'><b>ERROR!</b> You must enter a <b>TPP-PRO Period</b> to continue.</td> 
			</tr>
			<tr>
				<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
			</tr>
		");
	}

// complete the error table
if (isset($err0)||isset($err1)||isset($err2)||isset($err3)||isset($err4)||isset($err6)||isset($err7)||isset($err8))
	{
	echo("
			<tr>
				<td align='left' valign='top'><hr align='left' valign='top' color='#F0EFED' width='725'></td>
			</tr>
		</table>
		");
	}

// ok, all done - Plan added
if (isset($done))
	{
	echo("
		<table width='725' cellpadding='2' cellspacing='0' border='0'>
			<tr>
				<td align='left' valign='top'><img src='".$http_images."/menu_arrow.gif'>The package was ".((isset($pid))?"edited":"created")." successfully!</td>
			</tr>
			<tr>
				<td align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><a href='".$http_admin."/plan_build_dedicated.php?sid=".trim($sid)."'>Add a new dedicated server package</a>.</td>
			</tr>
			<tr>
				<td align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><a href='".$http_admin."/plan_edit.php?sid=".trim($sid)."'>Choose a package to edit</a>.</td>
			</tr>
			<tr>
				<td align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Make edits to <b>".$package_name."</b> below:</td>
			</tr>
			<tr>
				<td align='left' valign='top'><hr align='left' valign='top' color='#F0EFED' width='725'></td>
			</tr>
		</table>
		");
	}

// if we have no groups defined kill off script until we can get some added.
if ($ct[0]<=0)
	{
	echo("
		<table width='725' border='0' cellspacing='1' cellpadding='2'>
			<tr>
				<td align='left' valign='top'><img src='".$http_images."/error_arrow.gif'><b>No plan groups defined.</b></td> 
			</tr>
			<tr>
				<td align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
			</tr>
			<tr>
				<td align='left' valign='top'>Please use the <a href='".$admin_path."/group_editor.php?sid=".$sid."'>Group Editor</a> to define a plan group.</td> 
			</tr>
		</table>
			");
		// End Main Process
		mysql_close($dblink);
		die();
		}

echo("
<form action='".$PHP_SELF."' method='POST'>
".((isset($pid))?"<input type='hidden' name='pid' value='".trim($pid)."'>":"")."
<input type='hidden' name='sid' value='".trim($sid)."'>
<table width='725' cellpadding='2' cellspacing='0' border='0'>
	<tr>
		<td colspan='2' align='left' valign='top'><img src='".$http_images."/menu_arrow.gif'><b>Plan Details</b></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/".((isset($err0))?"error_arrow.gif":"space.gif")."' width='15' height='9'>Package Name:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='30' maxlength='255' name='package_name' value='".((isset($package_name))?"".$package_name."":"")."'> [Required]</td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Package Status:</td> 
		<td width='75%' align='left' valign='top'><input type='checkbox' name='plan_status' VALUE='1'".((isset($plan_status))?"".(($plan_status==1)?" checked":"")."":" checked")."> Check to make package viewable to the public.</td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Choose Plan Group:</td> 
		<td width='75%' align='left' valign='top'>
		<select name='gid' ".$input_style.">
	");
$rog=mysql_query("select gid, name from plan_groups order by name asc");
while ($rg=mysql_fetch_row($rog))
	{
	echo "<option value='".$rg[0]."'".((isset($gid))?"".(($gid==$rg[0])?" selected":"")."":"").">".stripslashes($rg[1])."</option>\n";
	}
echo("
		</select>
		</td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Choose Addon Group:</td> 
		<td width='75%' align='left' valign='top'>
		<select name='addon_gid' ".$input_style.">
			<option value='0'>Show No Addons</option>
	");
$rogx=mysql_query("select addon_gid, name from addon_groups where group_status='1' order by name asc");
while ($rgx=mysql_fetch_row($rogx))
	{
	echo"<option value='".$rgx[0]."'";
	if (isset($addon_gid)) { if ($addon_gid==$rgx[0]) { echo " selected"; } }
	echo">".stripslashes($rgx[1])."</option>\n";
	}
echo("
		</select>
		</td> 
	</tr>
	<tr>
		<td colspan='2'><hr align='left' valign='top' color='#F0EFED' width='725'></td>
	</tr>
	<tr>
		<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
	</tr>
	<tr>
		<td colspan='2' align='left' valign='top'><img src='".$http_images."/menu_arrow.gif'><b>Pay Structure</b></td> 
	</tr>
	");
// is TPP PRO Active? if so grab the PaySystems TPP-Pro Period Value
$rs_tpp=mysql_fetch_row(mysql_query("select status from payment_process where name='Paysystems TPP-PRO'"));

// is 2co an option?
$rs_2co=mysql_fetch_row(mysql_query("select status from payment_process where name='2Checkout'"));
if ($rs_tpp[0]==1)
	{
	echo("
		<!--- set bit for error checking--->
		<input type='hidden' name='tpp_high' value='1'>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/".((isset($err8))?"error_arrow.gif":"space.gif")."' width='15' height='9'>PaySystems TPP-Pro Period:</td> 
			<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='15' maxlength='20' name='tpp_pro_period' value='".((isset($pid))?"".(($tpp_pro_period==0)?"":"".$tpp_pro_period."")."":"".((isset($tpp_pro_period))?"".((trim($tpp_pro_period)=="0")?"":"".trim($tpp_pro_period)."")."":"")."")."'>&nbsp;&nbsp;[Required]</td> 
		</tr>
		");
	}
echo("
	<tr>
		<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='8'></td> 
	</tr>
	");
if ($show_status==1)
	{
	echo("
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><b>Paypal Only</b> - Free Trial Period:</td> 
			<td width='75%' align='left' valign='top'><input type='checkbox' name='free_trial' value='1'".((isset($free_trial))?"".(($free_trial==1)?" checked":"")."":"")."> Check here to give a <select name='free_trial_length' ".$input_style.">
		");
	for ($i=1; $i<=30; $i++)
		{
		echo "<option value='".$i."'".((isset($free_trial_length))?"".(($free_trial_length==$i)?" selected":"")."":"").">".$i."</option>\n";
		}
	echo("		
			</select> month free trial.&nbsp;&nbsp;[Optional]</td> 
		</tr>
		<tr>
			<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='8'></td> 
		</tr>
		");
	}
echo("
	<tr>
		<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/error_arrow.gif'><font color='#990000'>Enter -1 to <b>not display</b> a payment period in the order system.</font></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/".((isset($err1))?"error_arrow.gif":"space.gif")."' width='15' height='9'>Monthly Cost:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='15' maxlength='20' name='monthly_cost' value='".((isset($pid))?"".$monthly_cost."":"".((isset($monthly_cost))?"".trim($monthly_cost)."":"")."")."'>");
if ($rs_2co[0]==1)
	{
	echo"&nbsp;&nbsp;2Checkout ID:&nbsp<input ".$input_style." type='text' size='4' maxlength='32' name='monthly_pid' value='".((isset($monthly_pid))?"".$monthly_pid."":"")."'>";
	}
echo("&nbsp;&nbsp;[Required]</td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/".((isset($err2))?"error_arrow.gif":"space.gif")."' width='15' height='9'>Quarterly Cost:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='15' maxlength='20' name='quarterly_cost' value='".((isset($pid))?"".$quarterly_cost."":"".((isset($quarterly_cost))?"".trim($quarterly_cost)."":"")."")."'>");
if ($rs_2co[0]==1)
	{
	echo"&nbsp;&nbsp;2Checkout ID:&nbsp<input ".$input_style." type='text' size='4' maxlength='32' name='quarterly_pid' value='".((isset($quarterly_pid))?"".$quarterly_pid."":"")."'>";
	}
echo("&nbsp;&nbsp;[Required]</td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/".((isset($err3))?"error_arrow.gif":"space.gif")."' width='15' height='9'>Semi-Annual Cost:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='15' maxlength='20' name='semi_annual_cost' value='".((isset($pid))?"".$semi_annual_cost."":"".((isset($semi_annual_cost))?"".trim($semi_annual_cost)."":"")."")."'>");
if ($rs_2co[0]==1)
	{
	echo"&nbsp;&nbsp;2Checkout ID:&nbsp<input ".$input_style." type='text' size='4' maxlength='32' name='semi_annual_pid' value='".((isset($semi_annual_pid))?"".$semi_annual_pid."":"")."'>";
	}
echo("&nbsp;&nbsp;[Required]</td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/".((isset($err4))?"error_arrow.gif":"space.gif")."' width='15' height='9'>Annual Cost:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='15' maxlength='20' name='annual_cost' value='".((isset($pid))?"".$annual_cost."":"".((isset($annual_cost))?"".trim($annual_cost)."":"")."")."'>");
if ($rs_2co[0]==1)
	{
	echo"&nbsp;&nbsp;2Checkout ID:&nbsp<input ".$input_style." type='text' size='4' maxlength='32' name='annual_pid' value='".((isset($annual_pid))?"".$annual_pid."":"")."'>";
	}
echo("&nbsp;&nbsp;[Required]</td> 
	</tr>
	<tr>
		<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='8'></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Setup Fee:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='15' maxlength='20' name='setup_cost' value='".((isset($pid))?"".(($setup_cost==0)?"":"".$setup_cost."")."":"".((isset($setup_cost))?"".trim($setup_cost)."":"")."")."'> [leave blank for no setup fee]".(($rs_2co[0]==1)?"<br><img border='0' src='".$http_images."/space.gif' width='2' height='16'><img src='".$http_images."/drop_arrow.gif'><font color='#990000'>* Setup fee does not apply for 2Checkout.</font><br><img src='".$http_images."/space.gif' width='20' height='16'><font color='#990000'>You can enter a value for your clients to see, but the value must be set at 2checkout to be charged.</font>":"")."</td> 
	</tr>
	<tr>
		<td colspan='2'><hr align='left' valign='top' color='#F0EFED' width='725'></td>
	</tr>
	<tr>
		<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
	</tr>
	<tr>
		<td colspan='2' align='left' valign='top'><img src='".$http_images."/menu_arrow.gif'><b>Server Attributes</b></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/".((isset($err6))?"error_arrow.gif":"space.gif")."' width='15' height='9'>Disk Drive Size:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='10' maxlength='10' name='web_space' value='".((isset($web_space))?"".$web_space."":"")."'> <b>GB</b> [Required]</td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/".((isset($err7))?"error_arrow.gif":"space.gif")."' width='15' height='9'>Monthly Bandwidth Limit:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='10' maxlength='20' name='bandwidth' value='".((isset($bandwidth))?"".$bandwidth."":"")."'> <b>GB</b> [Required]</td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Servers in Stock:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='10' maxlength='10' name='in_stock' value='".((isset($in_stock))?"".$in_stock."":"")."'></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'># of IP Addresses:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='30' maxlength='20' name='ip_addresses' value='".((isset($ip_addresses))?"".$ip_addresses."":"")."'></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Memory:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='30' maxlength='20' name='memory' value='".((isset($memory))?"".$memory."":"")."'></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Processor:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='30' maxlength='20' name='processor' value='".((isset($processor))?"".$processor."":"")."'></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Operating System:</td> 
		<td width='75%' align='left' valign='top'><input ".$input_style." type='text' size='30' maxlength='20' name='os' value='".((isset($os))?"".$os."":"")."'></td> 
	</tr>
	<tr>
		<td colspan='2'><hr align='left' valign='top' color='#F0EFED' width='725'></td>
	</tr>
	<tr>
		<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><img src='".$http_images."/menu_arrow.gif'><b>Package Description</b></td> 
		<td width='75%' align='left' valign='top'><font color='#990000'>* This description shows up in step one of the order process.</font></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Attributes Available:</td> 
		<td width='75%' align='left' valign='top'>
		<table width='470' cellpadding='4' cellspacing='0' border='1' bordercolor='#F0EFED'>
			<tr>
				<td width='50%' align='left' valign='middle'>&nbsp;{{disk_space}}</td>
				<td width='50%' align='left' valign='middle'>&nbsp;{{bandwidth}}</td>
			</tr>
			<tr>
				<td width='50%' align='left' valign='middle'>&nbsp;{{ip_addresses}}</td>
				<td width='50%' align='left' valign='middle'>&nbsp;{{memory}}</td>
			</tr>
			<tr>
				<td width='50%' align='left' valign='middle'>&nbsp;{{processor}}</td>
				<td width='50%' align='left' valign='middle'>&nbsp;{{operating_system}}</td>
			</tr>
		</table>
		</td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Display Text:</td> 
		<td width='75%' align='left' valign='top'><textarea name='display_text' rows='16' cols='75' ".$input_style.">".((isset($display_text))?"".htmlentities($display_text)."":"{{operating_system}} {{processor}} server with {{memory}} RAM, {{disk_space}} disk space, {{bandwidth}} GB bandwidth/month and {{ip_addresses}} IP addresses.")."</textarea></td> 
	</tr>
	<tr>
		<td colspan='2' align='left' valign='top'><hr color='#F0EFED' width='725'></td>
	</tr>
	<tr>
		<td colspan='2' align='left' valign='top'><img border='0' src='".$http_images."/space.gif' width='1' height='2'></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'></td> 
		<td width='75%' align='left' valign='top'><input ".$button_style." type='submit' name='submit' value='".((isset($pid))?"Edit":"Create")." Dedicated Server Package Now &gt'></td> 
	</tr>
	<tr>
		<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='247' height='1'></td> 
		<td width='75%' align='left' valign='top'><img src='".$http_images."/space.gif' width='277' height='1'></td> 
	</tr>
	<tr>
		<td colspan='2'><img src='".$http_images."/space.gif' width='1' height='8'></td>
	</tr>
</table>
</form>

			</td>
		</tr>
	</table>
	");
include $server_admin_inc."/footer.php";
mysql_close($dblink);
?>