<?
if($_POST[motto]) {
mysql_query("UPDATE users SET mission='$_POST[motto]' WHERE name='$_SESSION[habboname]'");
}
if($_POST[email]) {
mysql_query("UPDATE users SET email='$_POST[email]' WHERE name='$_SESSION[habboname]'");
}
if($_POST[currentpassword]) {
$pass = $mysql->profile(get, $habboname, none, none, none);
if($_POST[currentpassword] === $pass[pass] && $_POST[newpassword] === $_POST[newpasswordconfirm]) {
mysql_query("UPDATE users SET pass='$_POST[newpasswordconfirm]' WHERE name='$_SESSION[habboname]'");
}
}
$avatar = mysql_fetch_array(mysql_query("SELECT * FROM homes WHERE owner = '$habboname'"));
$figure = $mysql->profile(get, $habboname, none, none, none);
?>
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<td style="width: 6px;">&nbsp;</td>
		<td valign="top" style="width: 271px; padding-top: 3px;" class="habboPage-col">
		<?php if($edit == 'yes' && $_SESSION[edit] == 'true') { ?>
		<a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>addbox=1&colum=1&page=profile" alt=""><img src="<?php echo("$imgpath"); ?>images/button/add.gif" alt=""/></a>Add Box
	  <?php } ?>
	  <?php $notecheck = mysql_query("SELECT * FROM pages WHERE page = 'profile' AND colum = '1'");
	  if(!mysql_num_rows($notecheck)=="0"){
	  while($row = mysql_fetch_array($notecheck)){
	  if($edit == 'yes' && $_SESSION[edit] == 'true') { } else {
		include 'changer.php'; }
	  ?>
    <div class="v3box <?php echo("$row[colore]") ?>">
     <?php if($edit == 'yes' && $_SESSION[edit] == 'true') { ?>
		 <form action="<?php echo("$sitepath"); ?>profile?id=<?php echo("$row[id]"); ?>" method="post" id="change-form">
		 <div class="v3box-top"><h3><input type="text" value="<?php echo("$row[title]") ?>" name="title" id="title" />&nbsp<?php if($edit == 'yes' && $_SESSION[edit] == 'true') { ?> <a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>nobox=1&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/del.gif" alt=""/></a><?php } ?><br><?php if($edit == 'yes' && $_SESSION[edit] == 'true') { ?><a href="<?php echo("$sitepath"); ?>profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=blue&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/blue.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=green&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/green.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=black&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/black.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=orange&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/orange.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=yellow&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/yellow.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=lightgrey&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/lightgrey.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=darkgrey&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/darkgrey.gif" alt=""/></a><?php } ?>
     </h3></div>
	   <div class="v3box-content">
		 <div class="v3box-body">
		 <p>
		 <textarea name="boxcontent" id="boxcontent" cols="20" rows="12"/><?php echo("$row[content]"); ?></textarea>
		 </p>
		 <p class="last">
		<input type="submit" value="change" name="save" class="process-button" id="change-submit" />
	</p>
</form>
		<?php } else { ?>
			<div class="v3box-top"><h3><?php echo("$row[title]") ?>&nbsp<?php if($edit == 'yes' && $_SESSION[edit] == 'true') { ?> <a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>nobox=1&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/del.gif" alt=""/></a><?php } ?><?php if($edit == 'yes' && $_GET[editcolore] == 'true' && $_SESSION[edit] == 'true') { ?><a href="<?php ("$page"); ?><?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=blue&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/blue.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=green&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/green.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=black&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/black.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=orange&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/orange.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=yellow&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/yellow.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=lightgrey&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/lightgrey.gif" alt=""/></a><a href="profile<?php if($htaccess == 'v0') { ?>?<?php } ?><?php  if($htaccess == 'v1') { ?>&<?php } ?>boxcolore=darkgrey&id=<?php echo("$row[id]"); ?>" alt=""><img src="<?php echo("$imgpath"); ?>images/button/darkgrey.gif" alt=""/></a><?php } ?>
</h3></div>
	<div class="v3box-content">
		<div class="v3box-body">
<?php echo("$row[content]") ?><?php } ?>
			<div class="clear"></div>

		</div>
	</div>
	<div class="v3box-bottom"><div></div></div>
</div>
<?php } } ?>
		</td>
		<td valign="top" style="width: 446px; padding-top: 3px;" class="habboPage-col rightmost">

<div class="panel" id="panel1">

<div class="processbox">
	<div class="headline"><div class="headline-content"><div class="headline-wrapper">
		<h2><?php echo("$name"); ?> PROFILE - <?php echo("$habboname"); ?> </h2>
	</div></div></div>
	<div class="content-top">
		<div class="content">


<div id="process-errors">
<div class="content-red">
	<div class="content-red-body" id="process-errors-content">
	<div class="clear"></div>
	</div>
</div>
<div class="content-red-bottom"><div class="content-red-bottom-body"></div></div>
</div>

<div id="profiletabs">
<ul>
<?php if($_GET[tab] == '1') { ?>
<?
if($_POST['gender']){
mysql_query("UPDATE users SET app='".trim($_POST['figure'])."', sex='".trim($_POST['gender'])."' WHERE name='".$_SESSION['habboname']."'");
}
$figure = $mysql->profile(get, $habboname, none, none, none);
?>
<li id="selected"><a href="<?php echo("$sitepath"); ?>profile?tab=1">MY CLOTHING</a>

<li ><a href="<?php echo("$sitepath"); ?>profile?tab=2">MY MOTTO</a>
<li ><a href="<?php echo("$sitepath"); ?>profile?tab=3">MY EMAIL</a>
<li ><a class="last-tab" href="<?php echo("$sitepath"); ?>profile?tab=4">MY PASSWORD</a>
</ul>
</div>
<br clear="all" />
<div class="content-white-outer">
	<div class="content-white">
		<div class="content-white-body">

<div class="content-white-content">
<div id="flashcontent">

You need to have a Flash player installed on your computer before being able to edit your <?php echo("$name"); ?> character. You can download the player from here: http://www.adobe.com/go/getflashplayer

</div>

<script type="text/javascript" language="JavaScript">
var swfobj = new SWFObject("<?php echo("$imgpath"); ?>images/flash/HabboRegistration.swf", "habboreg", "406", "327", "7");
swfobj.addParam("base", "/gallery/web-5.0.17/flash/");
swfobj.addVariable("post_url", "<?php echo("$sitepath"); ?>profile?");
swfobj.addVariable("back_url", "<?php echo("$sitepath"); ?>");
swfobj.addVariable("figuredata_url", "<?php echo("$imgpath"); ?>images/flash/figure_data_xml.xml");
swfobj.addVariable("localization_url", "<?php echo("$imgpath"); ?>images/flash/figure_editor.xml");
swfobj.addVariable("post_figure", "figure");
swfobj.addVariable("post_gender", "gender");
swfobj.addVariable("figure", "<?php echo("$figure[app]"); ?>");
swfobj.addVariable("gender", "<?php echo("$figure[sex]"); ?>");
swfobj.write("flashcontent");
</script>
<?php } elseif($_GET[tab] == '2') { ?>
<?
$motto = $mysql->profile(get, $habboname, none, none, none);
?>
<li ><a href="<?php echo("$sitepath"); ?>profile?tab=1">MY CLOTHING</a>

<li id="selected"><a href="<?php echo("$sitepath"); ?>profile?tab=2">MY MOTTO</a>
<li ><a href="<?php echo("$sitepath"); ?>profile?tab=3">MY EMAIL</a>
<li ><a class="last-tab" href="<?php echo("$sitepath"); ?>profile?tab=4">MY PASSWORD</a>
</ul>
</div>
<br clear="all" />
<div class="content-white-outer">
	<div class="content-white">
		<div class="content-white-body">

<div class="content-white-content"><form action="<?php echo("$sitepath"); ?>profile?tab=2" method="post">
<h3>CHANGE YOUR PROFILE</h3>

<div>
<span class="label">Name:</span>
<?php echo("$habboname"); ?>

</div>

<div class="clear"></div>

<div>

<span class="label">Motto:</span>
<input type="text" name="motto" size="32" maxlength="32" value="<?php echo("$motto[mission]"); ?>" id="motto" />
</div>

<p>
Your motto is what other <?php echo("$name"); ?>s will see on your <?php echo("$name"); ?> Home page and beneath your <?php echo("$name"); ?> in the Hotel.
</p>

<div id="register-buttons">
<div id="register-buttons-continue">
<input type="submit" value="Save changes" name="save" class="process-button" />
</div>
<div id="register-buttons-back"></div>
</div>

</form>
<?php } elseif($_GET[tab] == '3') { ?>
<?
$email = $mysql->profile(get, $habboname, none, none, none);
?>
<li ><a href="<?php echo("$sitepath"); ?>profile?tab=1">MY CLOTHING</a>

<li ><a href="<?php echo("$sitepath"); ?>profile?tab=2">MY MOTTO</a>
<li id="selected"><a href="<?php echo("$sitepath"); ?>profile?tab=3">MY EMAIL</a>
<li ><a class="last-tab" href="<?php echo("$sitepath"); ?>profile?tab=4">MY PASSWORD</a>
</ul>
</div>
<br clear="all" />
<div class="content-white-outer">
	<div class="content-white">
		<div class="content-white-body">

<div class="content-white-content">
<form action="<?php echo("$sitepath"); ?>profile?tab=3" method="post" id="emailform">
<h3>CHANGE YOUR EMAIL SETTINGS</h3>

<div>
<span class="label">Name:</span> <?php echo("$habboname"); ?>

</div>
<br />
<div>
<label for="email" class="left">Email address:</label>
<div id="email_error" class="left"><input type="text" name="email" id="email" size="32" maxlength="32" value="<?php echo("$email[email]"); ?>" /></div>
</div>

<div class="clear"></div>

<div class="clear"></div>

<div class="clear"></div>

<div id="register-buttons">
<div id="register-buttons-continue">
<input type="submit" value="Save changes" name="save" class="process-button" />
<div id="register-buttons-back"></div>
</div>
</div>
</form>

<?php } elseif($_GET[tab] == '4') { ?>
<li ><a href="<?php echo("$sitepath"); ?>profile?tab=1">MY CLOTHING</a>

<li ><a href="<?php echo("$sitepath"); ?>profile?tab=2">MY MOTTO</a>
<li ><a href="<?php echo("$sitepath"); ?>profile?tab=3">MY EMAIL</a>
<li id="selected"><a class="last-tab" href="<?php echo("$sitepath"); ?>profile?tab=4">MY PASSWORD</a>
</ul>
</div>
<br clear="all" />
<div class="content-white-outer">
	<div class="content-white">
		<div class="content-white-body">

<div class="content-white-content">
<form action="<?php echo("$sitepath"); ?>profile?tab=3" method="post" id="pwform">

<h3>CHANGE YOUR PASSWORD</h3>

<h3>GIVE YOUR CURRENT DETAILS</h3>

<p>
 <label for="currentpassword">Current password</label><br />
 <input type="password" size="32" maxlength="32" name="currentpassword" id="currentpassword" class="currentpassword " />
</p>
<h3>ENTER NEW PASSWORD</h3>
<p>
 <label for="bean_password">New password</label><br /> 
 <input type="password" size="32" maxlength="32" name="newpassword" id="newpassword" class="required-password required-password2 " />
</p>
<p>
 <label for="bean_retypedPassword">New password (again)</label><br />
 <input type="password" size="32" maxlength="32" name="newpasswordconfirm" id="newpasswordconfirm" class="required-retypedPassword required-retypedPassword2 " />
</p>
	<div class="clear"></div>
</div>

<div id="register-buttons">
<div id="register-buttons-continue">
<input type="submit" value="Change password" name="save" class="process-button" />
</div>
<div id="register-buttons-back"></div>

</form>
<?php } else { ?>
<?
$figure = $mysql->profile(get, $habboname, none, none, none);
if($_POST['gender'] && $_POST['figure'] == $figure[app] && $_POST['gender'] == $figure[sex]){
mysql_query("UPDATE users SET app='$_GET[figure]', sex='$_GET[gender]' WHERE name='$_SESSION[habboname]'");
}
$figure = $mysql->profile(get, $habboname, none, none, none);
?>
<li id="selected"><a href="<?php echo("$sitepath"); ?>profile?tab=1">MY CLOTHING</a>

<li ><a href="<?php echo("$sitepath"); ?>profile?tab=2">MY MOTTO</a>
<li ><a href="<?php echo("$sitepath"); ?>profile?tab=3">MY EMAIL</a>
<li ><a class="last-tab" href="<?php echo("$sitepath"); ?>profile?tab=4">MY PASSWORD</a>
</ul>
</div>
<br clear="all" />
<div class="content-white-outer">
	<div class="content-white">
		<div class="content-white-body">

<div class="content-white-content">
<div id="flashcontent">

You need to have a Flash player installed on your computer before being able to edit your <?php echo("$name"); ?> character. You can download the player from here: http://www.adobe.com/go/getflashplayer

</div>

<script type="text/javascript" language="JavaScript">
var swfobj = new SWFObject("<?php echo("$imgpath"); ?>images/flash/HabboRegistration.swf", "habboreg", "406", "327", "7");
swfobj.addParam("base", "/gallery/web-5.0.17/flash/");
swfobj.addVariable("post_url", "<?php echo("$sitepath"); ?>profile?");
swfobj.addVariable("back_url", "<?php echo("$sitepath"); ?>");
swfobj.addVariable("figuredata_url", "<?php echo("$imgpath"); ?>images/flash/figure_data_xml.xml");
swfobj.addVariable("localization_url", "<?php echo("$imgpath"); ?>images/flash/figure_editor.xml");
swfobj.addVariable("post_figure", "figure");
swfobj.addVariable("post_gender", "gender");
swfobj.addVariable("figure", "<?php echo("$figure[app]"); ?>");
swfobj.addVariable("gender", "<?php echo("$figure[sex]"); ?>");
swfobj.write("flashcontent");
</script>
<?php } ?>
</div>
		<div class="clear"></div>
		</div>
	</div>
	<div class="content-white-bottom">
		<div class="content-white-bottom-body"></div>

	</div>
</div>

			<div class="clear"></div>
		</div>
	</div>
	<div class="content-bottom"><div class="content-bottom-content"></div></div>
</div>

</div>	    </td>
	    <td style="width: 3px;">&nbsp;</td>

	    <td valign="top" style="padding-top: 3px;">
<div class="profilebox">
	<div class="profilebox-header"><h3>My info</h3></div>
	<div class="profilebox-header-bottom"><div></div></div>
	<div class="profilebox-body">
		<div class="profilebox-content">
	<div class="profile-info">
		<div class="name"><?php echo("$habboname"); ?></div>

			<img alt="offline" src="http://images.habbohotel.com/habboweb/17/13d/web-gallery/images/myhabbo/profile/habbo_offline.gif" />
		<div class="birthday text">
			<?php echo("$name"); ?> Created On:
		</div>
		<div class="birthday date">
			<?php echo("$figure[habbobirth]"); ?>
		</div>
        <div class="badges">
        </div>
	</div>

	<div class="figure">
			<img src="http://www.habbo.co.uk/habbo-imaging/avatarimage?user=<?php echo $avatar['habboname']; ?>&action=std&frame=3&direction=4&head_direction=4&gesture=sml&img_format=gif" />
	</div>
<div>
	<div class="content-blue">
		<div class="content-blue-body">
				<?php echo("$figure[mission]"); ?>
		<div class="clear"></div>

		</div>
	</div>
	<div class="content-blue-bottom">
		<div class="content-blue-bottom-body"></div>
	</div>
</div>
			<div class="clear"></div>
		</div>
	</div>

</div>
	     </td>
	    <td style="width: 6px;">&nbsp;</td>
	 </tr>
	 </table>