<?
include "header.php";
mysql_query("UPDATE ims SET first_login='no' WHERE u_id='$user_info[u_id]'");

if($user_info[price] > 0 & $user_info[subscribed] != "yes") {

$server_array = explode("/", $_SERVER['PHP_SELF']);
$server_array_mod = array_pop($server_array);
$server_info = implode("/", $server_array);
$server = "http://".$_SERVER['HTTP_HOST'].$server_info;
if($user_info[plan] == "0") {
$price = $user_info[price];
$plan = "Custom Plan";
$p_id = "0";
} else {
$plan_info = mysql_fetch_assoc(mysql_query("SELECT * FROM ims_plans WHERE p_id='$user_info[plan]'"));
$price = $plan_info[price];
$plan = $plan_info[plan];
$p_id = $plan_info[p_id];
}
$custom = $user_info[u_id];

echo $header;
echo "
<table width='520' cellpadding='0' cellspacing='0'>
<tr>
<td>
<b>Hello, $user_info[fname]!</b><br>
Before you may use your Image Hosting Account, you must create a PayPal subscription.
<br>Please click the button below to begin.
</td>
</tr>
</table>
<table cellpadding='0' cellspacing='0' style='margin-bottom: 5px;'>
<tr>
  <form name='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='POST'>
  <input type='hidden' name='cmd' value='_xclick-subscriptions'>
  <input type='hidden' name='business' value='$admin_info[paypal_email]'>
  <input type='hidden' name='item_name' value='$plan'>
  <input type='hidden' name='item_number' value='$p_id'>
  <input type='hidden' name='return' value='$server/first_login.php'>
  <input type='hidden' name='rm' value='2'>
  <input type='hidden' name='cancel_return' value='$server/first_login.php'>
  <input type='hidden' name='a3' value='$price'>
  <input type='hidden' name='p3' value='1'>
  <input type='hidden' name='t3' value='M'>
  <input type='hidden' name='src' value='1'>
  <input type='hidden' name='no_shipping' value='1'>
  <input type='hidden' name='no_note' value='1'>
  <input type='hidden' name='custom' value='$custom'>
  <input type='hidden' name='notify_url' value='$server/paypal.php'>
<td>
  <br>
  <input type='submit' class='button' value='Continue to PayPal'>
</td>
  </form>
</tr>
</table>
";
echo $footer;

} else {
echo $header;

echo "
<table width='520' cellpadding='0' cellspacing='0'>
<tr>
<td>
<b>Hello, $user_info[fname]!</b><br>
Welcome to your new hosting account.<br>
Please choose what you would like to do first:
<br><br>

<font face='verdana'><b>&#187;</b></font>&nbsp; <a href='index.php'><b>Continue to my account manager.</b></a><br>
<font face='verdana'><b>&#187;</b></font>&nbsp; <a href='support_manual.php'>View the \"Getting Started\" guide.</a><br>
</td>
</tr>
</table>
";

echo $footer;
}
?>