<?php
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//   Program Name         : ProPhotoHost                                     //
//   Release Version      : 1.0                                              //
//   Home Page            : http://www.prophotohost.com                      //
//   Program Author       : Jake P                                           //
//   Supplied by          : drew010                                          //
//   Nullified by         : CyKuH [WTN]                                      //
//   Distribution         : via WebForum, ForumRU and associated file dumps  //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
session_start();
include('i.setup.php');
include('i.connection.php');
include('i.function.php');

$result = mysql_query("SELECT member_email, member_status FROM member WHERE member_key = '$member_key'", $db);
$data = mysql_fetch_object($result);

$date = now();

$sql = "UPDATE member SET member_status='A', updated_on='$date' WHERE member_key = '$member_key'";
$result = mysql_query($sql);

$result = mysql_query("SELECT member_status FROM member WHERE member_key = '$member_key'", $db);
$rows = mysql_num_rows($result);
?>

<html>

<head>
<title><?php print($page_title); ?></title>

<?php include('i.style.php'); ?>

</head>

<body <?php if($session_access == false) { ?>onload="document.login.email.focus();"<?php } ?> marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" rightmargin="0">
	
	<table width="100%" cellpadding="0" cellspacing="0">
		
		<?php include('i.header.php'); ?>
		
		<tr>
			
			<td valign="top">
				
				<table cellpadding="0" cellspacing="0">
					
					<tr>
						
						<td><font face="verdana" size="1">&nbsp;&nbsp;&nbsp;</font></td>
						
					</tr>
					
				<tr>
					
					<td><font face="verdana" size="1">&nbsp;&nbsp;&nbsp;</font></td>
					
					<td valign="top">
						
						<table cellpadding="0" cellspacing="0">
							
							<?php include('i.tab.php'); ?>
							
						</table>
						
					</td>
					
					<td><font face="verdana" size="1">&nbsp;&nbsp;</font></td>
					
					<td valign="top" width="100%">
						
						<table width="100%" cellpadding="0" cellspacing="0">
							
							<tr>
								
								<td><font face="verdana" size="1">&nbsp;</font></td>
								
								<td width="100%">
									
									<table width="100%" cellpadding="0" cellspacing="0">
										
										<tr>
											
											<td><img src="./images/heading.signup.gif"></td>
											
										</tr>
										
										<tr>
											
											<td height="8" background="images/hr.gif"></td>
											
										</tr>
										
										<tr>
											
											<td><font face="verdana" size="1">&nbsp;</font></td>
											
										</tr>
										
										<tr>
											
											<td valign="top">
												
												<table height="250">
													
													<?php if($rows == 0) { ?>
													
													<tr>
														
														<td valign="top"><font face="verdana" size="1">Sorry, but you do not have an account with us.<br><a href="./signup.php">Click here</a> to signup.</font></td>
														
													</tr>
													
													<?php } else { ?>
														
														<?php if($data->member_status == "A") { ?>
														
														<tr>
															
															<td valign="top"><font face="verdana" size="1">Your account has already been activated.<br><a href="./index.php">Click here</a> to login.</font></td>
															
														</tr>
														
														<?php } else { ?>
														
														<tr>
															
															<td valign="top"><font face="verdana" size="1">Thank you for signing up with <?php print($page_name); ?>, your account is now activated.<br><br>Your username is <?php print($data->member_email); ?><br><br><a href="./index.php">Click here</a> to login.</font></td>
															
														</tr>
														
														<?php
														$result = mysql_query("SELECT member_name, member_email FROM member WHERE member_key = '$member_key'", $db);
														$data = mysql_fetch_object($result);
														
														$message .= "New member\n\n";
														$message .= "Name: " . $data->member_name . "\n";
														$message .= "E-mail: " . $data->member_email . "\n";
														
														mail($page_info_email, "New member " . $data->member_name, $message, "From: " . $data->member_email);
														?>
														
														<?php } ?>
														
													<?php } ?>
													
												</table>
												
											</td>
											
										</tr>
										
										<tr>
										
										<tr>
											
											<td><font face="verdana" size="1">&nbsp;</font></td>
											
										</tr>
										
										<tr>
											
											<td height="8" background="images/hr.gif"></td>
											
										</tr>
										
									</table>
									
								</td>
								
								<td><font face="verdana" size="1">&nbsp;</font></td>
								
							</tr>
							
						</table>
						
					</td>
					
				</tr>
				
			</table>
			
		</td>
		
	</tr>
	
	<?php include('i.footer.php'); ?>
	
	</table>
	
</body>

</html>