<?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($_GET['id'])) {
	header("location: category2.php?res=2");
	exit;
}
$chain = "AWdrh78y892Djk*^523*%$#ghgHGHia&%$*)AsfdsLJnLaad";
include("validateLogin.php");
include("includeInformation.php");
include("../functions/commonFunction.php");

$catId = (int) $_GET['id'];
if(empty($catId)) {
	header("location: category2.php?res=2");
	exit;
}
$query1 = "DELETE FROM `category` WHERE `id`=$catId";
$result1 = mysqli_query($conn, $query1);
$query2 = "DELETE FROM `temp_msg` WHERE `idCategory`=$catId";
$result2 = mysqli_query($conn, $query2);
if($result1 && $result2) {
	header("location: category2.php?res=1");
	exit;
} else {
	header("location: category2.php?res=2");
	exit;
}
ob_end_flush();
?>
