<?php
	date_default_timezone_set('Europe/Madrid'); 
	require("../config/config.php");
	if (!isset($_SESSION)){
		session_name(SESSION);
		session_start();
	}
	require("../config/functions.php");
	header('Content-Type: text/html; charset=UTF-8');
	include("../config/languages/lang.".GetLang().".php");

    if (!empty($_POST["type"])){
		$type = GetConexion()->real_escape_string($_POST["type"]);
		if ($type == 2){
			if (mysqli_query(GetConexion(), "update ".DB_ACCOUNT.".account set social_id = '1234567' where id = ".$_SESSION["user_id"]." limit 1;")){
				echo '<script>SendNotification("'.$lang["request1"].'", "success", "check");</script>';
			}
			else{
				echo '<script>SendNotification("'.$lang["request2"].'", "danger", "check");</script>';
			}
		}
		else{
			if (mysqli_query(GetConexion(), "update ".DB_PLAYER.".safebox set password = '12345' where account_id = ".$_SESSION["user_id"]." limit 1;")){
				echo '<script>SendNotification("'.$lang["request3"].'", "success", "check");</script>';
			}
			else{
				echo '<script>SendNotification("'.$lang["request4"].'", "danger", "check");</script>';
			}
		}
	}
?>