<?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();
if(empty($_POST["temMsgId"]) || empty($_POST["idCategoryEdit"]) || empty($_POST["msg"]) || empty($_POST["ckStatus"])) {
	header("location: category2.php?res=19");
	exit;
}
$chain = "AWdrh78y892Djk*^523*%$#ghgHGHia&%$*)AsfdsLJnLaad";
include("validateLogin.php");
include("includeInformation.php");
include("../functions/commonFunction.php");

$_POST['ckStatus']=1;
$resultUpdateTempMsg = mysqli_query($conn, "UPDATE `temp_msg` SET `msg`='".mysqli_real_escape_string($conn, $_POST["msg"])."', `idCategory`=$_POST[idCategoryEdit], `viewMsg`=$_POST[ckStatus] WHERE `id`=$_POST[temMsgId]");
if($resultUpdateTempMsg) {
	header("location: tempMsg.php?res=1&catId=".$_POST["idCategoryEdit"]."&showMsg=".$_POST['ckStatus']);
	ob_end_flush();
} else {
	header("location: tempMsg.php?res=225&catId=".$_POST["idCategoryEdit"]."&showMsg=".$_POST['ckStatus']);
	ob_end_flush();
}
?>
