					<table width="95%" cellpadding="0" cellspacing="0">
					
						<tr>
						
							<script language="javascript">
						
								function save() {
									var agree=confirm("Are you sure save these changes?");
									if (agree) {
										document.member.action = "actions.php?a_mode=save_member_data";
										document.member.submit();
									}
									else {
										false
									}
								}
								
								function delete_account(id) {
									var agree=confirm("Are you sure you want to delete this account?");
									if (agree) {
										window.location = "actions.php?a_mode=delete_account&n=<? echo $n; ?>&id=" + id;
									}
									else {
										false
									}
								}
								
								function change_mem_pass(id) {
									var agree=confirm("Are you sure you want to change this members password?");
									if (agree) {
										document.member.action = "actions.php?a_mode=change_mem_pass";
										document.member.submit();
									}
									else {
										false
									}
								}
												
							</script>
						
							<td align="center" valign="top">
							
								<table width="60%">
									
									<?
									$member_result = mysql_query("SELECT * FROM members WHERE member_id = '$memid'", $db);						
									$member = mysql_fetch_object($member_result);
										$s_date = substr($member->signup_date, 4, 2) . "/" . substr($member->signup_date, 6, 2) . "/" . substr($member->signup_date, 0, 4);
										$l_date = substr($member->login_date, 4, 2) . "/" . substr($member->login_date, 6, 2) . "/" . substr($member->login_date, 0, 4);
										
										$used_space = "0";
										$image_result = mysql_query("SELECT image_id,file_size FROM images WHERE mid = '$memid'", $db);
										$image_count = mysql_num_rows($image_result);
										while($img = mysql_fetch_object($image_result)){
											$used_space = $used_space + ($img->file_size/1000);
										}
											
											$renew_days = $member->renew - date("z");
											
											if($member->custom_plan == 1){
												$plan_code = "C";
												$ratio = $member->used_bandwidth / $member->custom_bandwidth;
												$bw_available = $member->custom_bandwidth;
												$space_ratio = $used_space / $member->custom_space;
												$space_available = $member->custom_space;
											}
											else {
												$plan_result = mysql_query("SELECT * FROM plans WHERE plan_id = '$member->plan'");
												$plan = mysql_fetch_object($plan_result);
													$plan_code = substr($plan->name, 0, 1);
													$ratio = $member->used_bandwidth / $plan->bandwidth;
													$bw_available = $plan->bandwidth;
													$space_ratio = $used_space / $plan->space;
													$space_available = $plan->space;
											}
											
											$used_bw_w = round(210 * $ratio);
											$free_bw_w = 210 - $used_bw_w;
											
											$used_space_w = round(210 * $space_ratio);
											$free_space_w = 210 - $used_space_w;
									?>
									
									<form name="member" method="post">
									<input type="hidden" name="return" value="<? echo "mgr.index.php?n=" . $n . "&p_mode=" . $p_mode . "&memid=" . $memid . "&save=1"; ?>">
									<input type="hidden" name="memid" value="<? echo $member->member_id; ?>">
									
									<tr bgcolor="#eeeeee">
									
										<td align="center" colspan="3" style="border-bottom: 1px solid #CCCBCB;border-right: 1px solid #CCCBCB"><font face="verdana" size="2" color="#8C8E91"><b>Member: <? echo $member->email; ?> <font color="#ff0000"><? if($save == 1){ echo " - Saved"; } ?></b></td>
									
									</tr>
									
									<tr>
									
										<td valign="top" width="50%">
										
											<table>
											
												<tr>
												
													<td><font face="verdana" size="2" color="#8C8E91"><? if($mgr_login_type == "demo"){ ?>Name Hidden In Demo Mode<? } else { echo "$member->f_name $member->l_name"; } ?></td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b><? if($mgr_login_type == "demo"){ ?>Hidden In Demo Mode<? } else {  echo "<a href=\"mailto:$member->email\">$member->email</a>"; } ?></td>
													
												</tr>
												
												<tr>
													
													<td>&nbsp;</td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Signup Date:</b> <? echo $s_date; ?></td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Last Login:</b> <? echo $l_date; ?></td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Renew in:</b> <? echo $renew_days; ?> days</td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Total Image Views:</b> <? echo $member->total_views; ?></td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Views This Cycle:</b> <? echo $member->cycle_views; ?></td>
													
												</tr>
												
												<tr>
													
													<td>&nbsp;</td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Plan:</b></td>
													
												</tr>
												
												<tr>
												
													<td align="center">
														
														<table width="100%">
												
															<?
																$plan_result = mysql_query("SELECT * FROM plans order by 'display_order'");
																while($plan = mysql_fetch_object($plan_result)){
															?>
															
															<tr>
																
																<td><input type="radio" name="plan" value="<? echo $plan->plan_id; ?>" <? if($member->plan == $plan->plan_id and $member->custom_plan != 1){ echo "checked"; } ?>></td>
																<td width="100%"><font face="verdana" size="1" color="#8C8E91"><b><? echo $plan->name; ?><b></td>
																
															</tr>
															
															<?
																}
															?>
															<tr>
																
																<td bgcolor="#eeeeee"><input type="radio" name="plan" value="C" <? if($member->custom_plan == 1){ echo "checked"; } ?>></td>
																<td bgcolor="#eeeeee"><font face="verdana" size="1" color="#8C8E91"><b>Custom Plan<b></td>
																
															</tr>
															
															<tr>
																														
																<td colspan="2" valign="middle" bgcolor="#eeeeee">
																
																	<table cellpadding="0" cellspacing="0" width="100%">
																	
																		<tr>
																		
																			<td align="center" width="50%"><font face="verdana" size="1" color="#8C8E91">Space</td>	
																			<td width="50%"><font face="verdana" size="1" color="#8C8E91"><input type="text" name="custom_space" value="<? if($member->custom_plan == 1){ echo $member->custom_space; } ?>" style="width: 40; height: 16; font-size: 9; font-family: verdana;"> mb</td>
																			
																		</tr>
																		
																		<tr>
																		
																			<td align="center" width="50%"><font face="verdana" size="1" color="#8C8E91">Bandwidth</td>	
																			<td width="50%"><font face="verdana" size="1" color="#8C8E91"><input type="text" name="custom_bandwidth" value="<? if($member->custom_plan == 1){ echo $member->custom_bandwidth; } ?>" style="width: 40; height: 16; font-size: 9; font-family: verdana;"> mb</td>
																			
																		</tr>
																		
																	</table>
																	
																</td>
																
															</tr>
															
															<tr>
																														
																<td colspan="2" valign="middle" bgcolor="#eeeeee">
																
																	<table cellpadding="0" cellspacing="0" width="100%">
																	
																		<tr>
																		
																			<td align="center" width="50%"><font face="verdana" size="1" color="#8C8E91">Branding</td>	
																			<td width="50%"><input type="radio" name="c_branding" value="1" <? if($member->custom_branding == "1"){ echo "checked"; } ?>><font face="verdana" size="1" color="#8C8E91">On<br></font><input type="radio" name="c_branding" value="0" <? if($member->custom_branding == "0"){ echo "checked"; } ?>><font face="verdana" size="1" color="#8C8E91">Off </font></td>
																			
																		</tr>
																		
																	</table>
																	
																</td>
																
															</tr>
															
															<tr>
																														
																<td colspan="2" valign="middle" bgcolor="#eeeeee">
																
																	<table cellpadding="0" cellspacing="0" width="100%">
																	
																		<tr>
																		
																			<td align="center" width="50%"><font face="verdana" size="1" color="#8C8E91">Portfolio</td>	
																			<td width="50%"><input type="radio" name="c_portfolio" value="1" <? if($member->custom_portfolio == "1"){ echo "checked"; } ?>><font face="verdana" size="1" color="#8C8E91">On<br></font><input type="radio" name="c_portfolio" value="0" <? if($member->custom_portfolio == "0"){ echo "checked"; } ?>><font face="verdana" size="1" color="#8C8E91">Off </font></td>
																			
																		</tr>
																		
																	</table>
																	
																</td>
																
															</tr>
															
															<tr>
																														
																<td colspan="2" valign="middle" bgcolor="#eeeeee">
																
																	<table cellpadding="0" cellspacing="0" width="100%">
																	
																		<tr>
																		
																			<td align="center" width="50%"><font face="verdana" size="1" color="#8C8E91">Spins</td>	
																			<td width="50%"><input type="radio" name="c_spin" value="1" <? if($member->custom_spin == "1"){ echo "checked"; } ?>><font face="verdana" size="1" color="#8C8E91">On<br></font><input type="radio" name="c_spin" value="0" <? if($member->custom_spin == "0"){ echo "checked"; } ?>><font face="verdana" size="1" color="#8C8E91">Off </font></td>
																			
																		</tr>
																		
																	</table>
																	
																</td>
																
															</tr>
															
															<tr>
																														
																<td colspan="2" valign="middle" bgcolor="#eeeeee">
																
																	<table cellpadding="0" cellspacing="0" width="100%">
																	
																		<tr>
																		
																			<td align="center" width="50%"><font face="verdana" size="1" color="#8C8E91">Slideshow</td>	
																			<td width="50%"><input type="radio" name="c_slideshow" value="1" <? if($member->custom_slideshow == "1"){ echo "checked"; } ?>><font face="verdana" size="1" color="#8C8E91">On<br></font><input type="radio" name="c_slideshow" value="0" <? if($member->custom_slideshow == "0"){ echo "checked"; } ?>><font face="verdana" size="1" color="#8C8E91">Off </font></td>
																			
																		</tr>
																		
																	</table>
																	
																</td>
																
															</tr>													
														
														</table>
														
													</td>
													
												</tr>
												
												<tr>
													
													<td>&nbsp;</td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Notes:</b></td>
													
												</tr>
												
												<tr>
												
													<td><textarea name="notes" style="width:200; height:75;"><? echo $member->notes; ?></textarea></td>
													
												</tr>
												
											</table>
											
										</td>
										
										<td style="border-left: 1px solid #eeeeee;">&nbsp;</td>
										
										<td valign="top" width="200">
										
											<table>
											
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Status:</b><br> <input type="radio" value="1" name="active" <? if($member->active == 1){ echo "checked"; } ?>> Active <input type="radio" name="active" value="0" <? if($member->active == 0){ echo "checked"; } ?>>Inactive</td>
													
												</tr>
												
												<tr>
												
													<td>&nbsp;</td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Password:</b><br>
													<input type="input" name="password" value="<? echo $member->password; ?>" style="font-size: 10; width: 210;">
													</td>
													
												</tr>
												<tr>
													
													<td align="right"><input type="button" onclick="change_mem_pass();" value="Change Password" style="font-size: 10; width: 125;"></td>
													
												</tr>
												
												<tr>
												
													<td>&nbsp;</td>
													
												</tr>
												
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Used Bandwidth:</b></td>
													
												</tr>
												
												<tr>
												
													<td>
													
														<table width="100%" cellpadding="1" cellspacing="0">
								
															<tr>
															
																<td nowrap><img src="images/used.bw.gif" width="<? echo $used_bw_w; ?>" height="8"><img src="images/free.bw.gif" width="<? echo $free_bw_w; ?>" height="8"></td>
															
															</tr>
															
															<tr>
															
																<td align="right"><font face="verdana" size="1"><? echo round($member->used_bandwidth, 2); ?>mb of <? echo $bw_available; ?>mb</td>
																
															</tr>
															
														</table>
														
													</td>
													
												</tr>
												
												<tr>
													
													<td><font face="verdana" size="2" color="#8C8E91"><b>Used Disk Space:</b></td>
													
												</tr>
												
												<tr>
												
													<td>
													
														<table width="100%" cellpadding="1" cellspacing="0">
								
															<tr>
															
																<td nowrap><img src="images/used.bw.gif" width="<? echo $used_space_w; ?>" height="8"><img src="images/free.bw.gif" width="<? echo $free_space_w; ?>" height="8"></td>
															
															</tr>
															
															<tr>
															
																<td align="right"><font face="verdana" size="1"><? echo round($used_space, 2); ?>mb of <? echo $space_available; ?>mb</td>
																
															</tr>
															
														</table>
														
													</td>
													
												</tr>
												
												<tr>
												
													<td>&nbsp;</td>
													
												</tr>
												
												<tr>
													
													<td><input type="checkbox" name="renew" value="1"><font face="verdana" size="2" color="#8C8E91">Renew From Today <br><font face="verdana" size="1" color="#8C8E91">(sets bandwidth usage to 0 and today as the begining of a new month)</td>
													
												</tr>
												
												<tr>
												
													<td>&nbsp;</td>
													
												</tr>
												
												<tr>
													
													<td><input type="checkbox" name="reset_bw" value="1"><font face="verdana" size="2" color="#8C8E91">Set Bandwidth To 0 <br><font face="verdana" size="1" color="#8C8E91">(sets bandwidth usage to 0 but does not change renewal date)</td>
													
												</tr>
												
												<tr>
												
													<td>&nbsp;</td>
													
												</tr>
												
												<tr>
												
													<td><img src="images/img.icon.gif" valign="absmiddle"><font face="verdana" size="2" color="#8C8E91"> <? if($mgr_login_type == "demo"){ ?><a href="javascript:demo_mode();">View Account</a><? } else { ?><a href="../actions.php?pmode=login&username=<? echo $member->email; ?>&password=<? echo $member->password; ?>" target="_blank">View Account</a><? } ?></td>
													
												</tr>
												
												<tr>
												
													<td>&nbsp;</td>
													
												</tr>
												
												<tr>
												
													<td><img src="images/delete.icon.gif" valign="absmiddle"><font face="verdana" size="2" color="#8C8E91"> <? if($mgr_login_type == "demo"){ ?><a href="javascript:demo_mode();">Delete Account</a><? } else { ?><a href="javascript:delete_account(<? echo $member->member_id; ?>)">Delete Account</a><? } ?><br><font face="verdana" size="1" color="#8C8E91">(WARNING!! deleting this members account will delete all images associated with it. Once a members account is deleted it can not be recovered. You may want to just set the account Inactive instead.)</td>
													
												</td>
												
											</table>
											
										</td>
										
									</tr>
									
									<tr>
									
										<td colspan="3" align="right"><a href="mgr.index.php?p_mode=members&n=<? echo $n; ?>"><img src="images/b.cancel.gif" border="0"></a><? if($mgr_login_type == "demo"){ ?><a href="#" onclick="demo_mode();"><img src="images/b.save.gif" border="0"></a><? } else { ?><a href="#" onclick="save();"><img src="images/b.save.gif" border="0"></a><? } ?></td>
										
									</tr>
									
									</form>
									
									<tr bgcolor="#eeeeee">
						
										<td align="left" colspan="3" style="border-bottom: 1px solid #CCCBCB;border-right: 1px solid #CCCBCB"><font face="verdana" size="1" color="#8C8E91"><b> &nbsp; </b></td>
										
									</tr>
									
								</table>
							
							</td>
							
						</tr>
						
					</table>