<?php
// session level
$query = "SELECT `id`, `password`, `first_name`, `last_name`, `dob_month`, `dob_day`, `dob_year`, `sex`, `location`, `country`, `ci_email`, `ci_website`, `ci_aim`, `ci_msn`, `ci_yahoo`, `ci_xfire`, `ci_xbox_live`, `gi_mycode`, `gi_gameid`, `cs_manufacturer`, `cs_operating_system`, `cs_processor`, `cs_memory`, `cs_harddrive`, `cs_video_card`, `cs_sound_card`, `cs_headphones`, `cs_monitor`, `cs_mouse`, `cs_mousepad`, `cs_keyboard`, `f_team`, `f_map`, `f_weapon`, `f_drink`, `f_food`, `f_band`, `biography`
FROM `players` WHERE `id` = \"".$_SESSION["xpl_gfx_suserid"]."\"";
if($_SESSION["xpl_gfx_slevel"] >= "1")
{
// session level > 1
// posting variables
$_POST = valid_post($_POST);
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$dob_month = $_POST['dob_month'];
$dob_day = $_POST['dob_day'];
$dob_year = $_POST['dob_year'];
$sex = $_POST['sex'];
$location = $_POST['location'];
$country = $_POST['country'];
$ci_email = $_POST['ci_email'];
$ci_website = $_POST['ci_website'];
$ci_aim = $_POST['ci_aim'];
$ci_msn = $_POST['ci_msn'];
$ci_yahoo = $_POST['ci_yahoo'];
$ci_xfire = $_POST['ci_xfire'];
$ci_xbox_live = $_POST['ci_xbox_live'];
$gi_gameid = $_POST['gi_gameid'];
$cs_manufacturer = $_POST['cs_manufacturer'];
$cs_operating_system = $_POST['cs_operating_system'];
$cs_processor = $_POST['cs_processor'];
$cs_memory = $_POST['cs_memory'];
$cs_harddrive = $_POST['cs_harddrive'];
$cs_video_card = $_POST['cs_video_card'];
$cs_sound_card = $_POST['cs_sound_card'];
$cs_headphones = $_POST['cs_headphones'];
$cs_monitor = $_POST['cs_monitor'];
$cs_mouse = $_POST['cs_mouse'];
$cs_mousepad = $_POST['cs_mousepad'];
$cs_keyboard = $_POST['cs_keyboard'];
$f_team = $_POST['f_team'];
$f_map = $_POST['f_map'];
$f_weapon = $_POST['f_weapon'];
$f_drink = $_POST['f_drink'];
$f_food = $_POST['f_food'];
$f_band = $_POST['f_band'];
$biography = $_POST['biography'];
$new_password = md5("!".md5("*".$_POST["new_password"]."*")."!");
$confirm_password = md5("!".md5("*".$_POST["confirm_password"]."*")."!");
// updating account
$query = "UPDATE `players` SET
`first_name` = \"".$first_name."\",
`last_name` = \"".$last_name."\",
`dob_month` = \"".$dob_month."\",
`dob_day` = \"".$dob_day."\",
`dob_year` = \"".$dob_year."\",
`sex` = \"".$sex."\",
`location` = \"".$location."\",
`country` = \"".$country."\",
`ci_email` = \"".$ci_email."\",
`ci_website` = \"".$ci_website."\",
`ci_aim` = \"".$ci_aim."\",
`ci_msn` = \"".$ci_msn."\",
`ci_yahoo` = \"".$ci_yahoo."\",
`ci_xfire` = \"".$ci_xfire."\",
`ci_xbox_live` = \"".$ci_xbox_live."\",
`gi_gameid` = \"".$gi_gameid."\",
`cs_manufacturer` = \"".$cs_manufacturer."\",
`cs_operating_system` = \"".$cs_operating_system."\",
`cs_processor` = \"".$cs_processor."\",
`cs_memory` = \"".$cs_memory."\",
`cs_harddrive` = \"".$cs_harddrive."\",
`cs_video_card` = \"".$cs_video_card."\",
`cs_sound_card` = \"".$cs_sound_card."\",
`cs_headphones` = \"".$cs_headphones."\",
`cs_monitor` = \"".$cs_monitor."\",
`cs_mouse` = \"".$cs_mouse."\",
`cs_mousepad` = \"".$cs_mousepad."\",
`cs_keyboard` = \"".$cs_keyboard."\",
`f_team` = \"".$f_team."\",
`f_map` = \"".$f_map."\",
`f_weapon` = \"".$f_weapon."\",
`f_drink` = \"".$f_drink."\",
`f_food` = \"".$f_food."\",
`f_band` = \"".$f_band."\",
`biography` = \"".$biography."\"
WHERE `id`";
$result = mysql_query($query);
///////////////////////////////////////////////////
$Upload_Path = "images/players/";
$tmp_name = $_FILES['userfile']['tmp_name'];
// Type of file, image/gif or so on
$type = $_FILES['userfile']['type'];
// If an error occurrs, this will change from 0
$error = $_FILES['userfile']['error'];
// Size of file
$size = $_FILES['userfile']['size'];
// Name of file on local computer, without path
$name = $_FILES['userfile']['name'];
// This is to set a new name
$new_name = "profile_".$_SESSION['xpl_gfx_suserid'].".jpg";
// Attempt to upload the file
$Upload = copy($tmp_name, $Upload_Path . $new_name);
///////////////////////////////////////////////////
// check if user posted new password
if($_POST["new_password"] > "1" AND $_POST["confirm_password"] > "1")
{
// new password = 1 so we check to see if new password and confirmation password match
if($new_password != $confirm_password)
{
// new password and confirmation password = 0
print '<div id="news">';
print '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="37" align="left" background="images/pages/middle_header2.jpg" style="padding-left: 10px"></td>
</tr>
</table>';
print '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="10" align="left"></td>
</tr>
</table>';
print '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="1" align="left"></td>
</tr>
<tr valign="top">
<td height="10" align="left"></td>
</tr>';
print '<tr valign="top">
<td height="1" align="left" style="padding-left: 10px"class="dredx"><b>Edit Profile</b></td>
</tr>
<tr valign="top">
<td height="10" align="left"></td>
</tr>
<tr valign="middle">
<td height="40" bgcolor="#DCDEDF" align="left" style="padding-left: 10px" class="dblackx"><b>Error</b></td>
</tr>
<tr valign="top">
<td height="1" align="left"></td>
</tr>
<tr valign="top">
<td height="10" bgcolor="#F3F4F4" align="left"></td>
</tr>
<tr valign="top">
<td height="1" bgcolor="#F3F4F4" align="left" style="padding-left: 10px; padding-right: 10px" class="dblackx">Your new password and confirmation password do not match.</td>
</tr>
<tr valign="top">
<td height="10" bgcolor="#F3F4F4" align="left"></td>
</tr>';
print '<tr valign="top">
<td height="10" align="left"></td>
</tr>
<tr valign="top">
<td height="1" align="left"></td>
</tr>
</table>';
print '</div>';
}
else
{
// new password and confirmation password = 1
// update password
$query = "UPDATE `players` SET `password` = \"".$new_password."\" WHERE `id`";
$result = mysql_query($query);
print '<div id="news">';
print '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="37" align="left" background="images/pages/middle_header2.jpg" style="padding-left: 10px">></td>
</tr>
</table>';
print '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="10" align="left"></td>
</tr>
</table>';
print '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="1" align="left"></td>
</tr>
<tr valign="top">
<td height="10" align="left"></td>
</tr>';
print '<tr valign="top">
<td height="1" align="left" style="padding-left: 10px"class="dredx"><b>Edit Profile</b></td>
</tr>
<tr valign="top">
<td height="10" align="left"></td>
</tr>
<tr valign="middle">
<td height="40" bgcolor="#DCDEDF" align="left" style="padding-left: 10px" class="dblackx"><b>Complete</b></td>
</tr>
<tr valign="top">
<td height="1" align="left"></td>
</tr>
<tr valign="top">
<td height="10" bgcolor="#F3F4F4" align="left"></td>
</tr>
<tr valign="top">
<td height="1" bgcolor="#F3F4F4" align="left" style="padding-left: 10px; padding-right: 10px" class="dblackx">Your account has been updated.</td>
</tr>
<tr valign="top">
<td height="10" bgcolor="#F3F4F4" align="left"></td>
</tr>';
print '<tr valign="top">
<td height="10" align="left"></td>
</tr>
<tr valign="top">
<td height="1" align="left"></td>
</tr>
</table>';
print '</div>';
}
}
else
{
// new password = 0
print '<div id="news">';
print '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="37" align="left" background="images/pages/middle_header2.jpg" style="padding-left: 10px"></td>
</tr>
</table>';
print '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="10" align="left"></td>
</tr>
</table>';
print '<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="1" align="left"></td>
</tr>
<tr valign="top">
<td height="10" align="left"></td>
</tr>';
print '<tr valign="top">
<td height="1" align="left" style="padding-left: 10px"class="dredx"><b>Edit Profile</b></td>
</tr>
<tr valign="top">
<td height="10" align="left"></td>
</tr>
<tr valign="middle">
<td height="40" bgcolor="#DCDEDF" align="left" style="padding-left: 10px" class="dblackx"><b>Complete</b></td>
</tr>
<tr valign="top">
<td height="1" align="left"></td>
</tr>
<tr valign="top">
<td height="10" bgcolor="#F3F4F4" align="left"></td>
</tr>
<tr valign="top">
<td height="1" bgcolor="#F3F4F4" align="left" style="padding-left: 10px; padding-right: 10px" class="dblackx">Your account has been updated.</td>
</tr>
<tr valign="top">
<td height="10" bgcolor="#F3F4F4" align="left"></td>
</tr>';
}
?>