<?php
/**
 * Processing Forget password form data:
 * check data then generate new password and send it through SMPT Email
 *
 * PHP version 7.3
 *
 * @package        SMS
 * @version        Release 1.0.0
 * @create_by      Mohammad aljaouni
 * @create_date    10-08-2020
 * @edited_by      Mohammad aljaouni
 * @last_edit_date 10-08-2020
 * @todo           Nothing
 */
ob_start();
session_start();
$chain = "AWdrh78y892Djk*^523*%$#ghgHGHia&%$*)AsfdsLJnLaad";
include("validateLogin.php");
include("includeInformation.php");
$idUser = (integer)$_POST["id"];
if($_POST["allowChangeSender"] == 1)
    $allowChangeSender = 1;
else
    $allowChangeSender = 0;
if($_POST["specifyNumber"] == 1)
    $specifyNumber = 1;
else
    $specifyNumber = 0;
if($_POST["specifyNumber"] == 1) {
	$_POST["number"]="";
}
$query  =" UPDATE `user_login` SET";
$query .=" `allowChangeSender`='".$allowChangeSender."',";
$query .=" `specifyNumber`='".$specifyNumber."',";
$query .=" `sender`='".mysqli_real_escape_string($conn, $_POST["sender"])."',";
$query .=" `number`='".mysqli_real_escape_string($conn, $_POST["number"])."'";
$query .=" WHERE `id`='".$idUser."'";
$result = mysqli_query($conn, $query);
if($result)
	$data="1";
else
	$data="2";
echo $data;
ob_end_flush();
?>
