<?PHP
echo "<table width='725' border='0' cellspacing='1' cellpadding='2'>";
if (trim($show_account)=="1")
	{
	echo("
		<form action='".$PHP_SELF."' method='POST'>
		<input type='hidden' name='sid' value='".$sid."'>
		<input type='hidden' name='oid' value='".$oid."'>
		".((trim($afuid)!="")?"<input type='hidden' name='afuid' value='".$afuid."'>":"")."
		".((trim($afdid)!="")?"<input type='hidden' name='afdid' value='".$afdid."'>":"")."
		<input type='hidden' name='show_client' value='".trim($show_client)."'>
		<input type='hidden' name='show_domain' value='".trim($show_domain)."'>
		<input type='hidden' name='show_account' value='".trim($show_account)."'>
		<input type='hidden' name='uid' value='".trim($uid)."'>
		<input type='hidden' name='domain_name' value='".trim($domain_name)."'>
		<input type='hidden' name='status' value='".trim($status)."'>
		<input type='hidden' name='domain_registration' value='".trim($domain_registration)."'>
		".((isset($in))?"<input type='hidden' name='in' value='".$in."'>":"")."
		".((isset($ix))?"<input type='hidden' name='ix' value='".$ix."'>":"")."
		".((isset($p))?"<input type='hidden' name='p' value='".$p."'>":"")."
		".((isset($pg))?"<input type='hidden' name='pg' value='".$pg."'>":"")."
		");
	}
echo("
	<tr>
		<td width='49%' align='left' valign='top'><img src='".$http_images."/menu_arrow.gif'><b>Dedicated Server Information</b><img src='".$http_images."/space.gif' width='135' height='1'></td>
		<td width='51%' align='left' valign='top'>[<a href='".$http_admin."/client_view.php?sid=".trim($sid)."&oid=".trim($oid)."".((trim($show_account)=="1")?"&show_account=0":"&show_account=1")."&show_client=".trim($show_client)."&show_domain=".trim($show_domain)."".((isset($in))?"&in=5":"")."".((isset($ix))?"&ix=5":"")."".((isset($p))?"&p=".$p."":"")."".((isset($pg))?"&pg=".$pg."":"")."'>".((trim($show_account)=="0")?"Show":"Hide")."</a>]</td>
	</tr>
</table>
	");
if (trim($show_account)=="1")
	{
	if (trim($order_status)=="0")
		{
		$installed_server="Account is pending.";
		}
	else
		{
		$rs2=mysql_fetch_row(mysql_query("select server_name from server_config where whm_id='".addslashes(trim($whm_id))."'"));
		$installed_server=$rs2[0];
		}
	echo("
	<table width='725' border='0' cellspacing='1' cellpadding='4'>
		");
	if (isset($e0)||isset($e1))
		{
		echo("
				<tr>
					<td colspan='2'><hr color='#F0EFED'></td>
				</tr>
			");
		}
	if (isset($e0))
		{
		echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><font color='#990000'><b>ERROR:</b> Please specify the servers Main IP Address to continue.</font></td>
			</tr>
			");
		}
	if (isset($e1))
		{
		echo("
			<tr>
				<td colspan='2' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'><font color='#990000'><b>ERROR:</b> Please specify the Server Specifications to continue.</font></td>
			</tr>
			");
		}
	if (isset($e0)||isset($e1))
		{
		echo("
				<tr>
					<td colspan='2'><hr color='#F0EFED'></td>
				</tr>
			");
		}
	echo("
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Next Due Date:</td>
			<td width='75%' align='left' valign='top'><input ".$input_style." size='15' maxlength='255' type='text' name='next_due_date' value='".date("m/d/Y", $next_due_date)."'> ex. MM/DD/YYYY</td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Account Created on:</td>
			<td width='75%' align='left' valign='top'><input ".$input_style." size='15' maxlength='255' type='text' name='ogcreate_hosting' value='".date("m/d/Y", $ogcreate_hosting)."'> ex. MM/DD/YYYY</td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Hosting Package:</td>
			<td width='75%' align='left' valign='top'><select name='xpid' ".$input_style.">
		");
	$row2=mysql_query("select pid, package_name, monthly_cost, quarterly_cost, semi_annual_cost, annual_cost from plan_specs where dedicated='1' order by package_name asc");
	while ($rs2=mysql_fetch_row($row2))
		{
		$rs2[0]=trim($rs2[0]);
		$payment_term=str_replace("-", "_", strtolower($payment_term));
		echo"<option value='".$rs2[0]."|monthly'".(($pid."|".$payment_term===$rs2[0]."|monthly")?" selected":"").">".$rs2[1]." - ".$rs2[2]." Monthly</option>\n";
		echo"<option value='".$rs2[0]."|quarterly'".(($pid."|".$payment_term===$rs2[0]."|quarterly")?" selected":"").">".$rs2[1]." - ".$rs2[3]." Quarterly</option>\n";
		echo"<option value='".$rs2[0]."|semi_annual'".(($pid."|".$payment_term===$rs2[0]."|semi_annual")?" selected":"").">".$rs2[1]." - ".$rs2[4]." Semi-Annually</option>\n";
		echo"<option value='".$rs2[0]."|annual'".(($pid."|".$payment_term===$rs2[0]."|annual")?" selected":"").">".$rs2[1]." - ".$rs2[5]." Annually</option>\n";
		}
	echo("
			</select></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Last Known Root Password:</td>
			<td width='75%' align='left' valign='top'><input ".$input_style." size='15' maxlength='255' type='text' name='root_pw' value='".trim($root_pw)."'></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Client Area Username:</td>
			<td width='75%' align='left' valign='top'><input ".$input_style." size='15' maxlength='255' type='text' name='client_username' value='".trim($client_username)."'> [<a href='".$http_web."/clogin.php?sid=".$client_sid."' target='_blank'>visit client area</a>]</td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Client Area Password:</td>
			<td width='75%' align='left' valign='top'><input ".$input_style." size='15' maxlength='255' type='text' name='client_password' value=''> <font color='#990000'>* Will always show blank</font></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Server Hostname:</td>
			<td width='75%' align='left' valign='top'><input ".$input_style." size='10' maxlength='255' type='text' name='server_hostname' value='".$server_hostname."'>&nbsp;.&nbsp;<input ".$input_style." size='29' maxlength='255' type='text' name='domain_name' value='".$domain_name."'></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Nameserver 1:</td>
			<td width='75%' align='left' valign='top'><input ".$input_style." size='10' maxlength='255' type='text' name='pns1' value='".$pns1."'>&nbsp;.&nbsp;".$domain_name."</td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Nameserver 2:</td>
			<td width='75%' align='left' valign='top'><input ".$input_style." size='10' maxlength='255' type='text' name='pns2' value='".trim($pns2)."'>&nbsp;.&nbsp;".$domain_name."</td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top' bgcolor='#F6F7F8'><img src='".$http_images."/space.gif' width='15' height='9'>Main IP Address:</td>
			<td width='75%' align='left' valign='top' bgcolor='#F6F7F8'><input ".$input_style." size='43' maxlength='255' type='text' name='ip' value='".trim($ip)."'>&nbsp;<font color='#990000'>&lt;&lt;&nbsp;Required to complete before activation.</font></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top' bgcolor='#F6F7F8'><img src='".$http_images."/space.gif' width='15' height='9'>IP Range:</td>
			<td width='75%' align='left' valign='top' bgcolor='#F6F7F8'><textarea name='ipblock' ".$input_style." rows='2' cols='42'>".$ipblock."</textarea>&nbsp;<font color='#990000'>&lt;&lt;&nbsp;Optionally complete before activation.</font></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top' bgcolor='#F6F7F8'><img src='".$http_images."/space.gif' width='15' height='9'>Rack Location:</td>
			<td width='75%' align='left' valign='top' bgcolor='#F6F7F8'><textarea name='rack' ".$input_style." rows='2' cols='42'>".$rack."</textarea>&nbsp;<font color='#990000'>&lt;&lt;&nbsp;Optionally complete before activation.</font></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top' bgcolor='#F6F7F8'><img src='".$http_images."/space.gif' width='15' height='9'>Server Specifications:</td>
			<td width='75%' align='left' valign='top' bgcolor='#F6F7F8'><font color='#990000'>(this is displayed in the email sent to the client)</font><br><textarea name='server_specs' ".$input_style." rows='4' cols='42'>".$server_specs."</textarea>&nbsp;<font color='#990000'>&lt;&lt;&nbsp;Required to complete before activation.</font></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Client Notes:</td>
			<td width='75%' align='left' valign='top'><textarea name='client_notes' ".$input_style." rows='4' cols='42'>".((isset($client_notes))?"".$client_notes."":"None Recorded")."</textarea></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Private Admin Notes:</td>
			<td width='75%' align='left' valign='top'><textarea name='admin_notes' ".$input_style." rows='4' cols='42'>".((isset($admin_notes))?"".$admin_notes."":"None Recorded")."</textarea></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Current Payment Type:</td>
			<td width='75%' align='left' valign='top'>
			<select name='payment_method' ".$input_style.">
		");
	$rspmx=mysql_query("select pid, name from payment_process order by name asc");
	while($rspm=mysql_fetch_row($rspmx))
		{
		echo"<option value='".$rspm[0]."'".(($payment_method==$rspm[0])?" selected":"").">".$rspm[1]."</option>\n";
		}
	echo("
			</select>
			</td>
		</tr>
		");

	// added 4/24/2003 Rockwell
	if ($addon_gid!=0)
		{
	echo("
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Package Addons:</td>
			<td width='75%' align='left' valign='top'>
			<table width='100%' cellpadding='0' cellspacing='0'>
		");
	$count=(substr_count($addon_choices, "|")-1);
	$explode=explode("|", $addon_choices);

	// select all addons for the set
	$query="select ";
	$query.="group_addons ";				// 0
	$query.="from addon_groups ";
	$query.="where addon_gid='".addslashes(trim($addon_gid))."'";
	
	$rs=mysql_fetch_row(mysql_query($query));
	
	$group_addons=stripslashes(trim($rs[0]));

	$ii=0;
	$x=0;
	$tok=strtok($group_addons, "|");
	while ($tok)
		{
		if (trim($addon_choices)!="") { for ($i=0; $i<=$count; $i++) { if ($explode[$i]==$tok) { $bit=true; } }	}

		$query0.="select ";
		$query0.="addon_name, ";				// 0
		$query0.="addon_description, ";			// 1
		$query0.="addon_show_description, ";	// 2
		$query0.="setup_cost, ";				// 3
		$query0.="setup_activate, ";			// 4
		$query0.="addon_cost, ";				// 5
		$query0.="addon_state, ";				// 6
		$query0.="addon_activate ";				// 7
		$query0.="from addon_specs ";
		$query0.="where aid='".addslashes(trim($tok))."'";

		$rs0=mysql_fetch_row(mysql_query($query0));

		$addon_name=stripslashes(trim($rs0[0])); 
		$addon_description=stripslashes(trim($rs0[1]));
		$addon_show_description=stripslashes(trim($rs0[2]));
		$setup_cost=stripslashes(trim($rs0[3])); 
		$setup_activate=stripslashes(trim($rs0[4]));
		$addon_cost=stripslashes(trim($rs0[5]));
		$addon_state=stripslashes(trim($rs0[6]));
		$addon_activate=stripslashes(trim($rs0[7]));

		echo("	
			<tr>
				<td align='left' valign='middle'><input type='checkbox' name='aid".$ii."' value='".$tok."'".((isset($bit))?" checked":"")."></td>
				<td align='left' valign='middle'>
			");
		if ($addon_show_description==1)
			{
			$addon_description=preg_replace("/[^A-Za-z0-9 ]/", "", strip_tags($addon_description));
			$addon_name=preg_replace("/[^A-Za-z0-9 ]/", "", strip_tags($addon_name));
			echo"&nbsp;<A HREF='javascript:void(0)' class='cleanlink3' onmouseover=\"return overlib('".$addon_description."', CAPTION, '".$addon_name."');\" onmouseout='nd();'>".$addon_name."</a>";
			}
		else
			{
			echo "&nbsp;".$addon_name;
			}
		echo("
				</td>
				<td align='left' valign='middle'>&nbsp;
			");
		if ($setup_activate==1) { echo $currency.sprintf("%01.2f", $setup_cost).$currency_type." Setup Fee"; }
		else { echo "No Setup Fee"; }
		echo("
				</td>
				<td align='left' valign='top' bgcolor='".$bgcolor."'>&nbsp;
			");
		if ($addon_activate==1) 
			{
			echo $currency.sprintf("%01.2f", $addon_cost).$currency_type;
			if ($addon_state==1) { echo " One Time Fee"; }
			else if ($addon_state==2) { echo " Per Month"; }
			else if ($addon_state==3) { echo " Per Year"; }
			}
		else 
			{ 
			echo "No Cost for Addon"; 
			}
		echo("
				</td>
			</tr>
			<tr>
				<td colspan='3'><img src='".$http_image."/space.gif' width='1' height='2'></td>
			</tr>
			");

		unset($bit);
		unset($xtok);
		unset($addon_name);
		unset($addon_description);
		unset($addon_show_description);
		unset($setup_cost);
		unset($setup_activate);
		unset($addon_cost);
		unset($addon_state);
		unset($addon_activate);
		unset($query0);
		unset($rs0);

		$ii++;

		$tok=strtok("|");
		}

	echo("
			</table>
			</td>
		</tr>
		");
		}
	// end added 4/24/2003 Rockwell
	echo("
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'>Available Actions:</td>
			<td width='75%' align='left' valign='top'><input type='radio' name='activate' value='0' id='a0'> <label for='a0'>Activate this account and send welcome email</label></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'></td>
			<td width='75%' align='left' valign='top'><input type='radio' name='activate' value='1' id='a1'> <label for='a1'>Activate this account and <b>do not</b> send welcome email</label></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'></td>
			<td width='75%' align='left' valign='top'><input type='radio' name='activate' value='2' id='a2'> <label for='a2'>Suspend this account</label></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'></td>
			<td width='75%' align='left' valign='top'><input type='radio' name='activate' value='3' id='a3'> <label for='a3'>Resend welcome email</label></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'></td>
			<td width='75%' align='left' valign='top'><input type='radio' name='activate' value='5' checked id='a5'> <label for='a5'><font color='#990000'>Delete</font> this account now.</label></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='15' height='9'></td>
			<td width='75%' align='left' valign='top'><input type='radio' name='activate' value='4' checked id='a4'> <label for='a4'>Do not change account status</label></td>
		</tr>
		<tr>
			<td width='25%' align='left' valign='top'><img src='".$http_images."/space.gif' width='200' height='2'></td>
			<td width='75%' align='left' valign='top'><img src='".$http_images."/space.gif' width='400' 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='edit_dedicated' value='Update Account Information Now'></td>
		</tr>
	</table>
	</form>
		");
	}
// end the hosting account
?>