<?

  if (!(file_exists ('../inc/var.php')))
  {
    header ('Location: ../inc/install.php');
    exit ();
  }

  include '../inc/var.php';
  include '../inc/connect.php';
  $error_display = '';
  $installfiles = $server_root . '/inc/install4.php';
  $installfiles2 = $server_root . '/inc/install2.php';
  $securemyinc = $server_root . '/inc';
  if (!(file_exists ($below_public)))
  {
    $stop = true;
    $error_display .= '&nbsp;-&nbsp;Please create the directory ' . $below_public . '<br>';
  }

  if (!(is_writable ($below_public)))
  {
    $stop = true;
    $error_display .= '&nbsp;-&nbsp;Please chmod ' . $below_public . ' to 0777<br>';
  }

  if (!(file_exists ($server_backup)))
  {
    $stop = true;
    $error_display .= '&nbsp;-&nbsp;Please create the directory ' . $server_backup . '<br>';
  }

  if (!(is_writable ($server_backup)))
  {
    $stop = true;
    $error_display .= '&nbsp;-&nbsp;Please chmod ' . $server_backup . ' to 0777<br>';
  }

  if (!(file_exists ($resolver_log)))
  {
    $stop = true;
    $error_display .= '&nbsp;-&nbsp;Please create the directory ' . $resolver_log . '<br>';
  }

  if (!(is_writable ($resolver_log)))
  {
    $stop = true;
    $error_display .= '&nbsp;-&nbsp;Please chmod ' . $resolver_log . ' to 0777<br>';
  }

  if (file_exists ($installfiles))
  {
    $stop = true;
    $error_display .= '<BR><font size=\'+1\'><B>Security Risk:</b></font><BR><B>&nbsp;-&nbsp;Please delete your install4.php file in the ' . $server_root . '/inc folder </b><br>';
  }

  if (file_exists ($installfiles2))
  {
    $stop = true;
    $error_display .= '<BR><font size=\'+1\'><B>Security Risk:</b></font><BR><B>&nbsp;-&nbsp;Please delete your install2.php file in the ' . $server_root . '/inc folder </b><br>';
  }

  if (isset ($stop))
  {
    echo '
	<style>
		div.wrapper_license
	{
	width: 700;
	background-color: #F7F7F7; 
	border-width: 1px; 
	border-color: #D6D5D6;
	border-style: solid; 
	padding: 4px 4px 4px 4px;
	-moz-border-radius: 4px;
	}
	span.text_bold_large
	{
	color: #525163;
	font-size: 22px;
	font-family: Verdana, Arial, Sans-Serif;
	font-weight: bold;
	}
	span.text
	{
	color: #525163;
	font-size: 11px;
	font-family: Verdana, Arial, Sans-Serif;
	}
	span.text_red
	{
	color: #CE0000;
	font-size: 11px;
	font-family: Verdana, Arial, Sans-Serif;
	}
	</style>
	<table width=\'700\' cellpadding=\'2\' cellspacing=\'0\' border=\'0\' align=\'center\'>
	<tr>
		<td align=\'center\' valign=\'middle\'><span class=\'text_bold_large\'>The system detected the following errors</span></td>
	</tr>
	<tr>
		<td align=\'center\' valign=\'middle\'><img src=\'themes/blue/images/spacer.gif\' width=\'1\' height=\'12\'></td>
	</tr>
</table>
<table width=\'700\' cellpadding=\'2\' cellspacing=\'0\' border=\'0\' align=\'center\'>
	<tr>
		<td valign=\'middle\'>
		<div class=\'wrapper_license\'><br />
		<span class=\'text_red\'>' . $error_display . '</span>
		<br><br><span class=\'text\'>Please <a href=\'' . $http_admin . '/index2.php?sid=' . $sid . '\'><b>click here</b></a> to continue once the changes have been made</span>.
		</div>
		</td>
	</tr>
</table>
<table width=\'700\' cellpadding=\'2\' cellspacing=\'0\' border=\'0\' align=\'center\'>
	<tr>
		<td align=\'center\' valign=\'middle\'><img src=\'themes/blue/images/spacer.gif\' width=\'1\' height=\'36\'></td>
	</tr>
</table>
		';
    exit ();
  }

  include '../inc/whm_functions.php';
  include '../inc/client_functions.php';
  if (isset ($define_admin))
  {
    include $server_admin_tools . '/define_admin_check.php';
  }

  include '../inc/login_functions.php';
  if (isset ($submit_resolve))
  {
    header ('Location: ' . $http_admin . '/resolver.php?sid=' . trim ($sid) . '&xoid=' . trim ($xoid) . '');
  }

  $ct0 = mysql_fetch_row (mysql_query ('select count(*) from hosting_order where reseller=\'0\' and status=\'1\''));
  $total_active_accounts = $ct0[0];
  $active_resellers = mysql_fetch_row (mysql_query ('select count(*) from hosting_order where reseller=\'1\' and status=\'1\''));
  $total_active_resellers = $active_resellers[0];
  $active_resold = mysql_fetch_row (mysql_query ('select count(*) from hosting_order, user where hosting_order.reseller=\'1\' and hosting_order.status=\'1\' and user.reseller_primary_domain!=hosting_order.oid and hosting_order.uid=user.uid order by user.uid asc'));
  $total_active_resold_accounts = $active_resold[0];
  $dc = 'select ';
  $dc .= 'count(hosting_order.oid) ';
  $dc .= 'from hosting_order, plan_specs ';
  $dc .= 'where ';
  $dc .= 'hosting_order.status=\'1\' ';
  $dc .= 'and ';
  $dc .= 'hosting_order.pid=plan_specs.pid ';
  $dc .= 'and ';
  $dc .= 'plan_specs.dedicated=\'1\' ';
  $dc .= 'order by hosting_order.oid asc';
  $dct = mysql_fetch_row (mysql_query ($dc));
  $ct1 = mysql_fetch_row (mysql_query ('select count(*) from server_config'));
  $total_servers = $ct1[0];
  $ct2 = mysql_fetch_row (mysql_query ('select count(*) from hosting_order, plan_specs where hosting_order.pid=plan_specs.pid and hosting_order.resolved=\'0\' and hosting_order.status=\'1\' and plan_specs.dedicated=\'0\''));
  $total_unresolved = $ct2[0];
  $ct3 = mysql_fetch_row (mysql_query ('select count(*) from hosting_order where status=\'0\''));
  $total_pending = $ct3[0];
  if ($total_pending <= 0)
  {
    $pending_list = '
		<tr>
			<td colspan=\'2\' BGCOLOR=\'#dbedf9\'><img src=\'' . $http_images . '/drop_arrow.gif\'><b>No pending orders in the database.</b></td>
		</tr>
		';
  }
  else
  {
    $pending_list = '
		<tr>
			<td align=\'center\' valign=\'middle\' BGCOLOR=\'#asdaf9\'><B><FONT COLOR=\'#3f3f3f\' SIZE=\'-2\' FACE=\'Verdana\'>View</FONT></B></td>
			<td align=\'left\' valign=\'middle\' BGCOLOR=\'#asdaf9\'><B><FONT COLOR=\'#3f3f3f\' SIZE=\'-2\' FACE=\'Verdana\'>Client</FONT></B></td>
			<td align=\'left\' valign=\'middle\' BGCOLOR=\'#asdaf9\'><B><FONT COLOR=\'#3f3f3f\' SIZE=\'-2\' FACE=\'Verdana\'>Domain</FONT></B></td>
			<td align=\'center\' valign=\'middle\' BGCOLOR=\'#asdaf9\'><B><FONT COLOR=\'#3f3f3f\' SIZE=\'-2\' FACE=\'Verdana\'>Order Date</FONT></B></td>
		</tr>
		';
    $xq = 'select ';
    $xq .= 'user.first_name, ';
    $xq .= 'user.last_name, ';
    $xq .= 'user.email, ';
    $xq .= 'hosting_order.domain_name, ';
    $xq .= 'hosting_order.ogcreate, ';
    $xq .= 'hosting_order.oid, ';
    $xq .= 'plan_specs.dedicated, ';
    $xq .= 'hosting_order.payment_method, ';
    $xq .= 'hosting_order.reseller, ';
    $xq .= 'hosting_order.server_hostname ';
    $xq .= 'from ';
    $xq .= 'user, hosting_order, plan_specs ';
    $xq .= 'where ';
    $xq .= 'hosting_order.status=\'0\' ';
    $xq .= 'and ';
    $xq .= 'user.uid=hosting_order.uid ';
    $xq .= 'and ';
    $xq .= 'hosting_order.pid=plan_specs.pid ';
    $xq .= 'order by user.uid asc';
    $row4 = mysql_query ($xq);
    while ($rs4 = mysql_fetch_row ($row4))
    {
      $pending_list .= '
			<tr>
				<td align=\'center\' valign=\'middle\' BGCOLOR=\'#dbedf9\'><A HREF=\'' . $http_admin . '/client_view.php?oid=' . trim ($rs4[5]) . '&status=0&sid=' . trim ($sid) . '\'><img border=\'0\' src=\'' . $http_images . '/icon_view.gif\'></A></td>
				<td align=\'left\' valign=\'middle\' BGCOLOR=\'#dbedf9\'><a href=\'mailto:' . $rs4[2] . '\'>' . $rs4[0] . ' ' . $rs4[1] . '</a></td>
				<td align=\'left\' valign=\'middle\' BGCOLOR=\'#dbedf9\'>
				<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' border=\'0\'>
					<tr>
						<td width=\'1%\' align=\'left\' valign=\'middle\'>';
      if (!(((!($rs4[6] == 1) AND !($rs4[7] == 6)) AND !($rs4[8] == 1))))
      {
        $resolved_details .= '&nbsp;&nbsp;';
      }

      if ($rs4[6] == 1)
      {
        $pending_list .= '<img src=\'' . $http_images . '/dedicated.gif\' alt=\'Dedicated Server\'>&nbsp;';
      }

      if ($rs4[7] == 6)
      {
        $pending_list .= '<img src=\'' . $http_images . '/mailinpayment.gif\' alt=\'Mail in Payment\'>&nbsp;';
      }

      if ($rs4[7] == 1)
      {
        $pending_list .= '<img src=\'' . $http_images . '/paypal_gif.gif\' alt=\'PayPal\'>&nbsp;';
      }

      if ($rs4[7] == 3)
      {
        $pending_list .= '<img src=\'' . $http_images . '/paysystems_gif.gif\' alt=\'PaySystems\'>&nbsp;';
      }

      if ($rs4[7] == 9)
      {
        $pending_list .= '<img src=\'' . $http_images . '/internetsecure_gif.gif\' alt=\'Internet Secure\'>&nbsp;';
      }

      if ($rs4[7] == 8)
      {
        $pending_list .= '<img src=\'' . $http_images . '/auth_gif.gif\' alt=\'Authorize.net\'>&nbsp;';
      }

      if ($rs4[7] == 2)
      {
        $pending_list .= '<img src=\'' . $http_images . '/wp_gif.gif\' alt=\'WorldPay\'>&nbsp;';
      }

      if ($rs4[7] == 4)
      {
        $pending_list .= '<img src=\'' . $http_images . '/2co_gif.gif\' alt=\'2Checkout\'>&nbsp;';
      }

      if ($rs4[7] == 10)
      {
        $pending_list .= '<img src=\'' . $http_images . '/lpoint_gif.gif\' alt=\'LinkPoint\'>&nbsp;';
      }

      if ($rs4[7] == 11)
      {
        $pending_list .= '<img src=\'' . $http_images . '/psigate_gif.gif\' alt=\'PSiGate\'>&nbsp;';
      }

      if ($rs4[7] == 12)
      {
        $pending_list .= '<img src=\'' . $http_images . '/paypal_gif.gif\' alt=\'PayPal Alternate\'>&nbsp;';
      }

      if ($rs4[7] == 13)
      {
        $pending_list .= '<img src=\'' . $http_images . '/wp_gif.gif\' alt=\'WorldPay Alternate\'>&nbsp;';
      }

      if ($rs4[7] == 15)
      {
        $pending_list .= '<img src=\'' . $http_images . '/offlinecc_gif.gif\' alt=\'Offline Credit Card\'>&nbsp;';
      }

      if ($rs4[7] == 14)
      {
        $pending_list .= '<img src=\'' . $http_images . '/cybersource_gif.gif\' alt=\'CyberSource HOP\'>&nbsp;';
      }

      if ($rs4[8] == 1)
      {
        $pending_list .= '<img src=\'' . $http_images . '/reseller.gif\' alt=\'Reseller\'>&nbsp;';
      }

      unset ($bit);
      $pending_list .= '</td>
						<td width=\'99%\' align=\'left\' valign=\'middle\'><B>[<a href=\'' . $http_admin . '/redirect.php?pushed=http://' . ($rs4[6] == 1 ? '' . $rs4[6] . '.' : '') . $rs4[3] . '\' target=\'_blank\'>http://' . ($rs4[6] == 1 ? '' . $rs4[9] . '.' : '') . $rs4[3] . '</a>]</B></td>
					</tr>
				</table>
				</td>
				<td align=\'center\' valign=\'middle\' BGCOLOR=\'#dbedf9\'><FONT SIZE=\'-2\' FACE=\'Verdana\'>' . date ('m/d/Y', $rs4[4]) . '</FONT></td>
			</tr>
			';
    }
  }

  $current_server = current_server_internal ();
  if ($current_server == 99)
  {
    $current_server_name = 'Undefined';
    $current_server_name_main = 'No active server defined';
  }
  else
  {
    $rs0 = mysql_fetch_row (mysql_query ('select server_name, server_ip, max_accounts from server_config where whm_id=\'' . addslashes (trim ($current_server)) . '\''));
    $current_server_name = $rs0[0];
    $current_server_name_main = 'Stats for ' . $current_server_name . ' (' . $current_server . ')';
    $server_ip = $rs0[1];
    $max_accounts = $rs0[2];
  }

  $rs1 = mysql_fetch_row (mysql_query ('select sum(total_due_reoccur) from hosting_order where status=\'1\''));
  $total_monthly_income = sprintf ('%01.2f', $rs1[0]);
  $row2 = mysql_query ('select payment_term, total_due_reoccur from hosting_order where status=\'1\' order by payment_term asc');
  while ($rs2 = mysql_fetch_row ($row2))
  {
    if (strtolower (trim ($rs2[0])) == 'monthly')
    {
      $pmonthly += $rs2[1];
      $pmonthly_ct += 1;
      continue;
    }
    else
    {
      if (strtolower (trim ($rs2[0])) == 'quarterly')
      {
        $pquarterly += $rs2[1];
        $pquarterly_ct += 1;
        continue;
      }
      else
      {
        if (strtolower (trim (str_replace ('-', '_', $rs2[0]))) == 'semi_annual')
        {
          $psemi_annual += $rs2[1];
          $psemi_annual_ct += 1;
          continue;
        }
        else
        {
          if (strtolower (trim ($rs2[0])) == 'annual')
          {
            $pannual += $rs2[1];
            $pannual_ct += 1;
            continue;
          }

          continue;
        }

        continue;
      }

      continue;
    }
  }

  $tall = $pmonthly_ct + $pquarterly_ct + $psemi_annual_ct + $pannual_ct;
  $tallcash = $currency . sprintf ('%01.2f', $pmonthly * 12 + $pquarterly * 4 + $psemi_annual * 2 + $pannual) . ' ' . $currency_type;
  $payment_type_amount = '<table width=\'100%\' cellspacing=\'0\' cellpadding=\'2\' border=\'0\'>';
  $payment_type_amount .= '	
						<tr>
							<td>30-Day Records:</td>
							<td>' . $pmonthly_ct . '</td>
							<td>(' . $currency . sprintf ('%01.2f', $pmonthly) . $currency_type . ')</td>
						</tr>
						';
  $payment_type_amount .= '	
						<tr>
							<td>90-Day Records:</td>
							<td>' . $pquarterly_ct . '</td>
							<td>(' . $currency . sprintf ('%01.2f', $pquarterly) . $currency_type . ')</td>
						</tr>
						';
  $payment_type_amount .= '	
						<tr>
							<td>180-Day Records:</td>
							<td>' . $psemi_annual_ct . '</td>
							<td>(' . $currency . sprintf ('%01.2f', $psemi_annual) . $currency_type . ')</td>
						</tr>
						';
  $payment_type_amount .= '	
						<tr>
							<td>360-Day Records:</td>
							<td>' . $pannual_ct . '</td>
							<td>(' . $currency . sprintf ('%01.2f', $pannual) . $currency_type . ')</td>
						</tr>
						';
  $payment_type_amount .= '	
						<tr>
							<td><b>Total Records:</b><BR><div style=\'font-size:9px\'>Est. Annual Income</td>
							<td><b>' . $tall . '</b></td>
							<td><b>(' . $tallcash . ')</b></td>
						</tr>
						';
  $payment_type_amount .= '</table>';
  if ($current_server != 99)
  {
    if ($activate_serverstats == 'yes')
    {
      $temp = @read_log ($current_server, $below_public);
      list ($xwhm_username, $xwhm_password) = split ('[|]', $temp);
      $total_bandwidth_mb = show_bandwidth_usage ($server_ip, $xwhm_username, $xwhm_password);
      $total_bandwidth_mb = sprintf ('%01.4f', $total_bandwidth_mb / 1000);
      $parse_versions = show_cpanel_version ($server_ip, $xwhm_username, $xwhm_password);
      list ($whm_version, $cpanel_version) = split ('[|]', $parse_versions);
      $current_version = '<center><B>If Load is high - values may not show</b>';
      $server_status = show_server_status ($server_ip, $xwhm_username, $xwhm_password);
      list ($xapache, $xbind, $xserver_load) = split ('[|]', $server_status);
      list ($apache, $apache_status) = split ('[©]', $xapache);
      if ($apache_status == 1)
      {
        $xapache_status = 'red_block.gif';
      }
      else
      {
        $xapache_status = 'green_block.gif';
      }

      list ($bind, $bind_status) = split ('[©]', $xbind);
      if ($bind_status == 1)
      {
        $xbind_status = 'red_block.gif';
      }
      else
      {
        $xbind_status = 'green_block.gif';
      }

      list ($server_load, $server_load_status) = split ('[©]', $xserver_load);
      if ($server_load_status == 1)
      {
        $xserver_load_status = 'red_block.gif';
      }
      else
      {
        $xserver_load_status = 'green_block.gif';
      }

      $total_active_on_server = list_accounts ($server_ip, $xwhm_username, $xwhm_password, 1);
    }
  }

  $ct4 = mysql_fetch_row (mysql_query ('select count(*) from ticket where status=\'0\''));
  $open_trouble_tickets = $ct4[0];
  if ($open_trouble_tickets <= 0)
  {
    $active_ticket_details = '
		<tr>
			<td colspan=\'3\' bGCOLOR=\'#dbedf9\'><img src=\'' . $http_images . '/drop_arrow.gif\'><b>No Pending Trouble Tickets found.</b></td>
		</tr>
		';
  }
  else
  {
    $active_ticket_details = '
		<tr>
			<td width=\'15%\' align=\'center\' valign=\'middle\' bGCOLOR=\'#asdaf9\'><b><font COLOR=\'#3f3f3f\' SIZE=\'-2\' face=\'Verdana\'>Ticket
			#</font></b></td>
			<td width=\'60%\' align=\'left\' valign=\'middle\' bGCOLOR=\'#asdaf9\'><b><font COLOR=\'#3f3f3f\' SIZE=\'-2\'
			face=\'Verdana\'>Client Username </font></b></td> 
			<td width=\'25%\' align=\'center\' valign=\'middle\' bGCOLOR=\'#asdaf9\'><b><font COLOR=\'#3f3f3f\' SIZE=\'-2\' face=\'Verdana\'>Date Opened</font></b></td>
		</tr>
		';
    $row4 = mysql_query ('select user.first_name, user.last_name, user.email, ticket.id, ticket.ogcreate from user, ticket where user.uid=ticket.uid and ticket.status=\'0\' order by user.uid asc');
    while ($rs4 = mysql_fetch_row ($row4))
    {
      $active_ticket_details .= '
			<tr>
				<td width=\'15%\' align=\'center\' valign=\'middle\' bGCOLOR=\'#dbedf9\'><b><font SIZE=\'-2\' face=\'Verdana\'>' . stripslashes ($rs4[3]) . '</font></b></td>
				<td width=\'60%\' align=\'left\' valign=\'middle\' bGCOLOR=\'#dbedf9\'>
				<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' border=\'0\'>
					<tr>
						<td width=\'10%\' align=\'center\' valign=\'middle\'><a href=\'' . $http_admin . '/trouble_ticket_active.php?sid=' . trim ($sid) . '&id=' . trim ($rs4[3]) . '\'><img border=\'0\' src=\'' . $http_images . '/icon_view.gif\'></a></td>
						<td width=\'90%\' align=\'left\' valign=\'middle\'><a href=\'mailto:' . stripslashes ($rs4[2]) . '\'><font SIZE=\'-2\' face=\'Verdana\'>' . stripslashes ($rs4[0]) . ' ' . stripslashes ($rs4[1]) . '</font></A></td>
					</tr>
				</table>
				</td> 
				<td width=\'25%\' align=\'center\' valign=\'middle\' bGCOLOR=\'#dbedf9\'><font SIZE=\'-2\' face=\'Verdana\'>' . date ('m/d/Y', $rs4[4]) . '</font></td>
			</tr>
			';
      ++$ctx;
    }
  }

  $ct5 = mysql_fetch_row (mysql_query ('select count(hosting_order.oid) from hosting_order, plan_specs where hosting_order.pid=plan_specs.pid and hosting_order.resolved=\'0\' and plan_specs.dedicated=\'0\' and hosting_order.status=\'1\' '));
  $unresolved_total_count = $ct5[0];
  if ($unresolved_total_count <= 0)
  {
    $resolved_details = '
			<tr>
				<td colspan=\'4\' BGCOLOR=\'#dbedf9\'><img src=\'' . $http_images . '/drop_arrow.gif\'><b>No unresolved accounts found.</b></FONT></td>
			</tr>
			';
  }
  else
  {
    $resolved_details = '
		<tr>
			<td align=\'center\' valign=\'middle\' BGCOLOR=\'#asdaf9\'><B><FONT COLOR=\'#000000\' SIZE=\'-2\' FACE=\'Verdana\'>View</FONT></B></td>
			<td align=\'left\' valign=\'middle\' BGCOLOR=\'#asdaf9\'><B><FONT COLOR=\'#000000\' SIZE=\'-2\' FACE=\'Verdana\'>Client</FONT></B></td>
			<td align=\'left\' valign=\'middle\' BGCOLOR=\'#asdaf9\'><B><FONT COLOR=\'#000000\' SIZE=\'-2\' FACE=\'Verdana\'>Domain</FONT></B></td>
			<td align=\'center\' valign=\'middle\' BGCOLOR=\'#asdaf9\'><B><FONT COLOR=\'#000000\' SIZE=\'-2\' FACE=\'Verdana\'>Order Date</FONT></B></td>
		</tr>
		';
    $qy = 'select ';
    $qy .= 'user.first_name, ';
    $qy .= 'user.last_name, ';
    $qy .= 'user.email, ';
    $qy .= 'hosting_order.domain_name, ';
    $qy .= 'hosting_order.ogcreate, ';
    $qy .= 'hosting_order.oid, ';
    $qy .= 'plan_specs.dedicated, ';
    $qy .= 'hosting_order.payment_method, ';
    $qy .= 'hosting_order.reseller ';
    $qy .= 'from ';
    $qy .= 'user, hosting_order, plan_specs ';
    $qy .= 'where ';
    $qy .= 'user.uid=hosting_order.uid ';
    $qy .= 'and ';
    $qy .= 'hosting_order.resolved=\'0\' ';
    $qy .= 'and ';
    $qy .= 'plan_specs.dedicated=\'0\' ';
    $qy .= 'and ';
    $qy .= 'hosting_order.pid=plan_specs.pid ';
    $qy .= 'and hosting_order.status=\'1\' ';
    $qy .= 'order by hosting_order.ogcreate asc';
    $row5 = mysql_query ($qy);
    while ($rs5 = mysql_fetch_row ($row5))
    {
      $resolved_details .= '
			<tr>
				<td align=\'center\' valign=\'middle\' BGCOLOR=\'#dbedf9\'><A HREF=\'' . $http_admin . '/client_view.php?oid=' . trim ($rs5[5]) . '&sid=' . trim ($sid) . '\'><img border=\'0\' src=\'' . $http_images . '/icon_view.gif\'></A></td>
				<td align=\'left\' valign=\'middle\' BGCOLOR=\'#dbedf9\'><a href=\'mailto:' . $rs5[2] . '\'>' . $rs5[0] . ' ' . $rs5[1] . '</a></td>
				<td align=\'left\' valign=\'middle\' BGCOLOR=\'#dbedf9\'>
				<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' border=\'0\'>
					<tr>
						<td width=\'1%\' align=\'left\' valign=\'middle\'>';
      if (!(((!($rs5[6] == 1) AND !($rs5[7] == 6)) AND !($rs5[8] == 1))))
      {
        $resolved_details .= '&nbsp;&nbsp;';
      }

      if ($rs5[6] == 1)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/dedicated.gif\' alt=\'Dedicated Server\'>&nbsp;';
      }

      if ($rs5[7] == 6)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/mailinpayment.gif\' alt=\'Mail in Payment\'>&nbsp;';
      }

      if ($rs5[7] == 1)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/paypal_gif.gif\' alt=\'PayPal\'>&nbsp;';
      }

      if ($rs5[7] == 3)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/paysystems_gif.gif\' alt=\'PaySystems\'>&nbsp;';
      }

      if ($rs5[7] == 9)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/internetsecure_gif.gif\' alt=\'Internet Secure\'>&nbsp;';
      }

      if ($rs5[7] == 8)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/auth_gif.gif\' alt=\'Authorize.net\'>&nbsp;';
      }

      if ($rs5[7] == 2)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/wp_gif.gif\' alt=\'WorldPay\'>&nbsp;';
      }

      if ($rs5[7] == 4)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/2co_gif.gif\' alt=\'2Checkout\'>&nbsp;';
      }

      if ($rs5[7] == 10)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/lpoint_gif.gif\' alt=\'LinkPoint\'>&nbsp;';
      }

      if ($rs5[7] == 11)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/psigate_gif.gif\' alt=\'PSiGate\'>&nbsp;';
      }

      if ($rs5[7] == 12)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/paypal_gif.gif\' alt=\'PayPal Alternate\'>&nbsp;';
      }

      if ($rs5[7] == 13)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/wp_gif.gif\' alt=\'WorldPay Alternate\'>&nbsp;';
      }

      if ($rs5[7] == 15)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/offlinecc_gif.gif\' alt=\'Offline Credit Card\'>&nbsp;';
      }

      if ($rs5[7] == 14)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/cybersource_gif.gif\' alt=\'CyberSource HOP\'>&nbsp;';
      }

      if ($rs5[8] == 1)
      {
        $resolved_details .= '<img src=\'' . $http_images . '/reseller.gif\' alt=\'Reseller\'>&nbsp;';
      }

      unset ($bit);
      $resolved_details .= '</td>
						<td width=\'99%\' align=\'left\' valign=\'middle\'><B>[<a href=\'' . $http_admin . '/redirect.php?pushed=http://' . $rs5[3] . '\' target=\'_blank\'>http://' . $rs5[3] . '</a>]</B></td>
					</tr>
				</table>
				</td>
				<td align=\'center\' valign=\'middle\' BGCOLOR=\'#dbedf9\'><FONT SIZE=\'-2\' FACE=\'Verdana\'>' . date ('m/d/Y', $rs5[4]) . '</FONT></td>
			</tr>
			';
    }
  }

  include $server_admin_inc . '/header.php';
  echo '
	<table width=\'100%\' cellpadding=\'0\' cellspacing=\'0\' border=\'0\'>
		<tr>
			<td width=\'1%\' align=\'left\' valign=\'top\'><img src=\'' . $http_images . '/space.gif\' width=\'6\' height=\'230\'></td>
			<td width=\'1%\' align=\'left\' valign=\'top\'>
	';
  include $server_admin_inc . '/main_glance_block.php';
  include $server_admin_inc . '/income_breakdown.php';
  include $server_admin_inc . '/main_news_block.php';
  echo '
			</td>
			<td width=\'1%\' align=\'left\' valign=\'top\'><img src=\'' . $http_images . '/space.gif\' width=\'6\' height=\'1\'></td>
			<td width=\'97%\' align=\'left\' valign=\'top\'>
			<form action=\'' . $PHP_SELF . '\' method=\'POST\'>
		';
  include $server_admin_inc . '/main_general_block.php';
  if ($activate_serverstats != no)
  {
    include $server_admin_inc . '/main_server_block.php';
  }

  include $server_admin_inc . '/main_user_block.php';
  if ($activate_support != no)
  {
    include $server_admin_inc . '/main_trouble_ticket_block.php';
  }

  include $server_admin_inc . '/main_resolver_block.php';
  echo '
			</form>
			</td>
		</tr>
	</table>
	';
  mysql_close ($dblink);
  include $server_admin_inc . '/footer.php';
?>
