<?
session_start();
include('_db.connection.php');
include('check.access.php');
include('_public.setup.php');
?>
	<script language="javascript">		
	function upgrade_plan() {
		var agree=confirm("Are you sure you want to change your plan?");
		if (agree) {
			document.upgrade_form.action = "https://www.paypal.com/cgi-bin/webscr";
			document.upgrade_form.submit();
		}
		else {
			false;
		}
	}
	</script>
	<table cellpadding="0" cellspacing="0" width="780" border="0">
		<?php include("i.header.php"); ?>
		<tr>
			<td>
				<table cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td valign="top">
							<!--
							**************************
							**** BEGIN BODY TABLE ****
							**************************
							-->
							<table cellpadding="0" cellspacing="0">
								<tr>
									<td><img src="./images/HeaderBlank2.gif"></td>
								</tr>
								<tr>
									<td height="50"></td>
								</tr>
								<tr>
									<td align="center">
										<!--
										**************************
										*** BEGIN BODY CONTENT ***
										**************************
										-->
										<table width="90%" border="0">
											<tr>
												<td>
													<table cellpadding="0" cellspacing="0" width="100%" style="border: 1px solid #083C58">
														<?
												$member_result = mysql_query("SELECT * FROM members WHERE member_id = '$mid'", $db);						
												$member = mysql_fetch_object($member_result);
											?>
											<tr>
												<td style="border: 1px solid #083C58; padding: 10px" bgcolor="#F8F8F8">
													<table width="100%">
														<tr>
															<td colspan="2">
															<b>UPGRADE YOUR PLAN:</b><br>

															To change your plan select the plan that you would like and click the "Update My Plan" button. You will then be taken to paypal to update your pricing plan. Once this is complete we will be notified and we'll update your plan to your new settings. <b>There is a brief waiting period for the changes to take affect, usually within 2 hours, but could take up to 8 hours.</b><br><br></td>
														</tr>
														<form name="upgrade_form" method="post">
														<input type="hidden" name="cmd" value="_xclick-subscriptions">
														<input type="hidden" name="business" value="<? echo $setup->paypal_email; ?>">
														<input type="hidden" name="modify" value="1">
														<input type="hidden" name="item_name" value="<? echo $setup->title; ?> (member <? echo $mid; ?>)">
														<input type="hidden" name="item_number" value="<? echo $mid; ?>">
														<input type="hidden" name="no_shipping" value="1">
														<input type="hidden" name="return" value="<? echo $setup->url; ?>">
														<input type="hidden" name="cancel_return" value="<? echo $setup->url; ?>">
														<input type="hidden" name="no_note" value="1">
														<input type="hidden" name="currency_code" value="USD">
														<input type="hidden" name="p3" value="30">
														<input type="hidden" name="t3" value="D">
														<input type="hidden" name="src" value="1">
														<input type="hidden" name="sra" value="1">
														<?
															//$plan_result = mysql_query("SELECT * FROM plans where plan_id = '3'");
															$plan_result = mysql_query("SELECT * FROM plans");
															while($plan = mysql_fetch_object($plan_result)){
														?>															
															<tr>																	
																<td><input type="radio" name="a3" value="<?php echo $plan->price; ?>" <?php if($member->plan == $plan->plan_id){ echo "checked"; }?>></td>																		
																<td><font face="Verdana" style="font-size: 11;" color="#083C58"><b><?php echo $plan->name; ?>: <font color="#ff0000"> <?php if($member->plan == $plan->plan_id){ echo "Your Current Plan"; }?><!--<font color="#ff0000">First 2 Weeks Free--></td>																	
															</tr>
															
															<tr>																	
																<td></td>																		
																<td><font face="Verdana" style="font-size: 11;" color="#083C58"><font color="#ff0000"><?php echo $plan->bandwidth; ?>mb</font> Bandwidth, Upload Unlimited Images, <b>$<?php echo $plan->price; ?></b>/month [<a href="#" onclick="window.open('plans.php?p=<? echo $plan->plan_id; ?>', 'image_win', ['HEIGHT=325', 'WIDTH=400', 'dependent','scrollbars=yes']);">more info</a>]<font color="7F7F7F"><? if($plan->plan_id == "1"){ ?><!--<br><i>Approx. 30,000 Image Views/month<br>[Recommended for hosting 1-100 Images]--><? } ?><? if($plan->plan_id == "2"){ ?><!--<br><i>Approx. 160,000 Image Views/month<br>[Recommended for hosting 100-500 Images]--><? } ?><? if($plan->plan_id == "3"){ ?><!--<br><i>Unlimited Image Views/month<br>[Recommended for hosting 500+ Images]--><? } ?></td>																	
															</tr>
															
															<tr>
																<td colspan="2">&nbsp;</td>
															</tr>																	
														<?
															}
														?>
														<tr>
															<td colspan="2" align="right"><input type="button" value="Update My Plan" border="0" onclick="upgrade_plan();" alt="Update"></td>
														</tr>
														</form>
													</table>
												</td>
											</tr>
											
													</table>
												</td>
											</tr>
											<tr>
												<td>&nbsp;</td>
											</tr>
										</table>
										<!--
										**************************
										**** END BODY CONTENT ****
										**************************
										-->
									</td>
								</tr>
							</table>
							<!--
							**************************
							***** END BODY TABLE *****
							**************************
							-->
						</td>
						<td valign="top"bgcolor="#295670"><img src="./images/IndexDropShadow.gif"></td>
						<td valign="top" bgcolor="#083C58">
							<?php include("i.member.rn.php"); ?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td background="./images/Footer.gif"><img src="./images/Footer.gif" border="0"></td>
		</tr>
		<tr>
			<td>
				<?php include("i.footer.php"); ?>
			</td>
		</tr>
	</table>

<?
mysql_close($db);
print($close);
?>