CODE
global $SESSION_INFO , $Template , $DB;
$Template -> assign("Main:News:Subtitle" , "" , "index");
$Template -> assign("Main:News:Title" , "Edit Profile" , "index");
if ( !$SESSION_INFO['id'] )
{
echo"Nie jesteś zalogowany!";
}
else{
if($_GET['id2']){
$_POST = htmlspecialchars_array($_POST);
$DB->Query("UPDATE users SET `gn_name` = '". $_POST['name'] ."' , `gn_sur_name` = '". $_POST['surname'] ."' , `gn_flag` = '". $_POST['from'] ."' ,
`gn_city` = '". $_POST['city'] ."' , `gn_age` = '". $_POST['age'] ."' , `gn_mail` = '". $_POST['mail'] ."' , `gn_gg` = '". $_POST['gg'] ."' ,
`hw_cpu` = '". $_POST['cpu'] ."' ,`hw_memory` = '". $_POST['memory'] ."' ,`hw_graphic` = '". $_POST['graphic'] ."' , `hw_sound` = '". $_POST['sound'] ."' ,
`hw_motherboard` = '". $_POST['motherboard'] ."' ,`hw_monitor` = '". $_POST['monitor'] ."' ,`hw_mouse` = '". $_POST['mouse'] ."' ,`hw_mousepad` = '". $_POST['mousepad'] ."' ,
`hw_keyboard` = '". $_POST['keyboard'] ."' ,`ig_resolution` = '".$_POST['resolution']."' , `ig_sensitivity` = '".$_POST['sensitivity']."' , `ig_radartype` = '".$_POST['radar']."' ,
`ig_crosshair` = '".$_POST['crosshair']."' , `ig_config` = '".$_POST['config']."' ,`awards` = '".$_POST['awards']."' ,`description` = '".$_POST['description']."' ,`avatar` = '".$_POST['avatar']."'
WHERE id = '".$SESSION_INFO['id']."' ");
echo "Profil zaktualizowany!";
$adr=$_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ;
$adr=str_replace('/index.php','',$adr);
// if(!is_uploaded_file($_FILES[plik][tmp_name])){
// }
// if($_FILES[plik][error] != 0){
// echo "Error: Config nie został zuploadowany!"; }
if($_FILES[plik][type] == "text/plain" || $_FILES[plik][type] == "application/x-zip-compressed" || $_FILES[plik][type] == "application/octet-stream"){
if(move_uploaded_file($_FILES[plik][tmp_name], "configs/" . $SESSION_INFO['id'] . ".cfg" )){
echo "Config Zuploadowany!
";
}else{
echo "Error: nie został Zuploadowany";
}
}
else{
echo "Możesz uploadować tylko *.cfg lub *.txt!";
}
}
else{
$Template -> new_file("editprofile" );
$Template -> assign_array($SESSION_INFO , "editprofile");
$Template -> Display("editprofile");
$Template -> Destroy("editprofile");
}
}
?>