<?php
include("includes/site_info.php");
include('session_handler.inc');

$WUserID = $_SESSION['Sess_UserId'];
$WUserType = $_SESSION['Sess_UserType'];
$WUserLastVisit = $_SESSION['Sess_LastVisit'];
$WUsername = $_SESSION['Sess_UserName'];
$result=mysql_query("SELECT * FROM members LEFT JOIN adverts ON (mem_userid=adv_userid) WHERE mem_userid=$WUserID",$link);
$sql_array = mysql_fetch_object($result);

?>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
    jQuery("#edit_profile").submit(function(){

	var str = 'Submit=profile_personal&' + jQuery(this).serialize();

   		jQuery.ajax({
   		type: "POST",
   		url: "profile_account_submit.php",
   		data: str,
   		success: function(result){
		jQuery("#msg_content").html(result);
		jQuery("#msg_content").fadeIn('slow');
		jQuery("#sub_content").hide();
		jQuery.get('profile_personal_result.php', function(data) {
 		jQuery("#result_content").fadeIn('slow');
 		jQuery('#result_content').html(data);
		});
		}

 });

return false;
    });
});
</script>

<div class="grey_12 white_back solid_line_separator pageHeading"><img src="images/icon-profile.gif" width="30" height="22" align="absmiddle"> Edit Personal Profile </div>
<div id="left_panel" style="width:100px;">
	<?php include("profile_panel.php");?>
</div>
<div id="middle_panel" style="width:676px;">
	<table width="100%" border="0" cellpadding="5" cellspacing="0" class="white_back_t_xb">
					<tr>
						<td valign="top" width="100%"><div id="msg_content" style="display:none"></div>
							<div id="result_content" style="display:none"></div>
							<div id="sub_content">
								<form id="edit_profile" name="edit_profile" method="post" style="padding:0; margin:0; border:0;">
									<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="white_back_t_xb p5">
										<tr>
											<td colspan="2" class="grey_12 orange_row_back solid_line_separator">
													<div style="background-color:#0000FF; width:10px; height:10px; float:left; margin-top:3px; margin-right:5px;"><img src="images/spacer.gif" width="10" height="10"></div>
													Personal Details</td>
										</tr>
										<tr>
											<td width="10">&nbsp;</td>
											<td><table width="100%" border="0" cellspacing="0" cellpadding="5" class="white_back_t_xb p5">
													<tr>
														<td valign="baseline">Children</td>
														<td><select name="children" id="children" size="1" class="button">
																<option value="">- Choose -</option>
																<?php
												$moodr=mysql_query("select * from dropvalue where drop_name='children' and drop_active='Y' order by drop_order");
												while($rst= mysql_fetch_array($moodr))
												{
												?>
																<option value="<?php echo $rst["drop_id"];?>"<?php if($rst["drop_id"]==$sql_array->adv_children){ echo " SELECTED";}?> ><?php echo $rst["drop_value"];?></option>
																<?php
												}
												?>
															</select></td>
													</tr>
													<tr>
														<td width="150" valign="baseline">Body Type</td>
														<td><select name="bodytype" id="bodytype" size="1" class="button">
																<option value="">- Choose -</option>
																<?php
												$moodr=mysql_query("select * from dropvalue where drop_name='bodytype' and drop_active='Y' order by drop_value");
												while($rst= mysql_fetch_array($moodr))
												{
												?>
																<option value="<?php echo $rst["drop_id"];?>"<?php if($rst["drop_id"]==$sql_array->adv_bodytype){ echo " SELECTED";}?> ><?php echo $rst["drop_value"];?></option>
																<?php
												}
												?>
															</select></td>
													</tr>
													<tr>
														<td valign="baseline">Height</td>
														<td><select name="height" id="height" size="1" class="button">
																<option value="">- Choose -</option>
																<?php
												$moodr=mysql_query("select * from dropvalue where drop_name='height' and drop_active='Y' order by drop_order");
												while($rst= mysql_fetch_array($moodr))
												{
												?>
																<option value="<?php echo $rst["drop_id"];?>"<?php if($rst["drop_id"]==$sql_array->adv_height){ echo " SELECTED";}?> ><?php echo $rst["drop_value"];?></option>
																<?php
												}
												?>
															</select></td>
													</tr>
													<tr>
														<td valign="baseline">Weight</td>
														<td><select name="weight" id="weight" size="1" class="button">
																<option value="">- Choose -</option>
																<?php
												$moodr=mysql_query("select * from dropvalue where drop_name='weight' and drop_active='Y' order by drop_order");
												while($rst= mysql_fetch_array($moodr))
												{
												?>
																<option value="<?php echo $rst["drop_id"];?>"<?php if($rst["drop_id"]==$sql_array->adv_weight){ echo " SELECTED";}?> ><?php echo $rst["drop_value"];?></option>
																<?php
												}
												?>
															</select></td>
													</tr>
													<tr>
														<td valign="baseline">Eye Color</td>
														<td><select name="eyecolor" id="eyecolor" size="1" class="button">
																<option value="">- Choose -</option>
																<?php
												$moodr=mysql_query("select * from dropvalue where drop_name='eyecolor' and drop_active='Y' order by drop_order");
												while($rst= mysql_fetch_array($moodr))
												{
												?>
																<option value="<?php echo $rst["drop_id"];?>"<?php if($rst["drop_id"]==$sql_array->adv_eyecolor){ echo " SELECTED";}?> ><?php echo $rst["drop_value"];?></option>
																<?php
												}
												?>
															</select></td>
													</tr>
													<tr>
														<td valign="baseline">Hair Color</td>
														<td><select name="haircolor" id="haircolor" size="1" class="button">
																<option value="">- Choose -</option>
																<?php
												$moodr=mysql_query("select * from dropvalue where drop_name='haircolor' and drop_active='Y' order by drop_order");
												while($rst= mysql_fetch_array($moodr))
												{
												?>
																<option value="<?php echo $rst["drop_id"];?>"<?php if($rst["drop_id"]==$sql_array->adv_haircolor){ echo " SELECTED";}?> ><?php echo $rst["drop_value"];?></option>
																<?php
												}
												?>
															</select></td>
													</tr>
													<tr>
														<td valign="baseline">Smoking Habits</td>
														<td><select name="smoker" id="smoker" size="1" class="button">
																<option value="">- Choose -</option>
																<?php
												$moodr=mysql_query("select * from dropvalue where drop_name='smoker' and drop_active='Y' order by drop_order");
												while($rst= mysql_fetch_array($moodr))
												{
												?>
																<option value="<?php echo $rst["drop_id"];?>"<?php if($rst["drop_id"]==$sql_array->adv_smoker){ echo " SELECTED";}?> ><?php echo $rst["drop_value"];?></option>
																<?php
												}
												?>
															</select></td>
													</tr>
													<tr>
														<td valign="baseline">Drinking Habits</td>
														<td><select name="drink" id="drink" size="1" class="button">
																<option value="">- Choose -</option>
																<?php
												$moodr=mysql_query("select * from dropvalue where drop_name='drink' and drop_active='Y' order by drop_order");
												while($rst= mysql_fetch_array($moodr))
												{
												?>
																<option value="<?php echo $rst["drop_id"];?>"<?php if($rst["drop_id"]==$sql_array->adv_drink){ echo " SELECTED";}?> ><?php echo $rst["drop_value"];?></option>
																<?php
												}
												?>
															</select></td>
													</tr>
												</table></td>
										</tr>
										<tr>
											<td>&nbsp;</td>
											<td>&nbsp;</td>
										</tr>
										<tr>
											<td colspan="2" class="grey_12 orange_row_back solid_line_separator">
													<div style="background-color:#0000FF; width:10px; height:10px; float:left; margin-top:3px; margin-right:5px;"><img src="images/spacer.gif" width="10" height="10" /></div>
													Interests / Favorites</td>
										</tr>
										<tr>
											<td>&nbsp;</td>
											<td><table width="100%" border="0" cellspacing="0" cellpadding="5" class="white_back_t_xb p5">
													<tr>
														<td width="150" valign="baseline">Interests</td>
														<td><textarea name="interests" cols="40" rows="4" id="interests"><?=$sql_array->adv_interests?>
</textarea></td>
													</tr>
													<tr>
														<td valign="baseline">Favorite Foods</td>
														<td><textarea name="favoritefood" cols="40" rows="4" id="favoritefood"><?=$sql_array->adv_favoritefood?>
</textarea></td>
													</tr>
													<tr>
														<td valign="baseline">Favorite Sports</td>
														<td><textarea name="sports" cols="40" rows="4" id="sports"><?=$sql_array->adv_sports?>
</textarea></td>
													</tr>
													<tr>
														<td valign="baseline">Favorite Movies</td>
														<td><textarea name="movies" cols="40" rows="4" id="movies"><?=$sql_array->adv_movies?>
</textarea></td>
													</tr>
													<tr>
														<td valign="baseline">Favorite Music</td>
														<td><textarea name="music" cols="40" rows="4" id="music"><?=$sql_array->adv_music?>
</textarea></td>
													</tr>
													<tr>
														<td valign="baseline">Favorite Books</td>
														<td><textarea name="books" cols="40" rows="4" id="books"><?=$sql_array->adv_books?>
</textarea></td>
													</tr>
													<tr>
														<td valign="baseline">Favorite TV Shows</td>
														<td><textarea name="tvshows" cols="40" rows="4" id="tvshows"><?=$sql_array->adv_tvshows?>
</textarea></td>
													</tr>
													<tr>
														<td valign="baseline">Favorite Games </td>
														<td><textarea name="games" cols="40" rows="4" id="games"><?=$sql_array->adv_games?>
</textarea></td>
													</tr>
													<tr>
														<td valign="baseline">About Me</td>
														<td><textarea name="comment" cols="40" rows="4" id="comment"><?=$sql_array->adv_comment;?>
</textarea></td>
													</tr>
												</table></td>
										</tr>
										<tr>
											<td>&nbsp;</td>
											<td align="right">&nbsp;</td>
										</tr>
										<tr>
											<td>&nbsp;</td>
											<td align="right"><input name="user_id" type="hidden" value="<?=$WUserID?>" />
												<input name="save" type="submit" class="button" id="save" value="Save Changes"/></td>
										</tr>
										<tr>
											<td>&nbsp;</td>
											<td>&nbsp;</td>
										</tr>
									</table>
								</form>
							</div></td>
					</tr>
				</table>
</div>
