<?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["counter"])) {
    header("location: category.php?res=2");
    exit;
}
$chain = "AWdrh78y892Djk*^523*%$#ghgHGHia&%$*)AsfdsLJnLaad";
include("validateLogin.php");
include("includeInformation.php");
for($i=0;$i<$_POST["counter"];$i++) {
	$idCategory="allcheck".$i;
	$idCategory = @$_POST[$idCategory];
  	if($idCategory) {
        $query="delete from ".$userCategory." where id='".$idCategory."' and userId='".$_SESSION["userCatId"]."'";
		$result = mysqli_query($conn, $query);
		$queryDelete = " delete from `".$userNumber."` where categoryId='".$idCategory."'";
		$resultDelete = mysqli_query($queryDelete);
	}
}
header("location:category.php?res=1");
exit;
ob_end_flush();
?>
