<?php 
ob_start();

include "db_conx.php"; // connecting to the database
$uid= $_GET['custid'];

// ======== getting for personal identification 
	$sql_delete = "SELECT * FROM personal_identification WHERE id = '$uid'";
	$query_delete = $db_conx->query($sql_delete);
	$row_delete = mysqli_fetch_assoc($query_delete);

	$passport_delete = $row_delete['passport'];
	// deleting the profile pics from outee
	$path = "../d/profile_img/$passport_delete";
	if(!unlink($path)) {
		echo "error";
	}
		$sql = "DELETE  FROM personal_information WHERE id = '$uid'";
		$result = $db_conx->query($sql);

		$sql2 = "DELETE  FROM personal_identification WHERE id = '$uid'";
		$result2 = $db_conx->query($sql2);

		$sql3 = "DELETE  FROM confidential_table WHERE id = '$uid'";
		$result3 = $db_conx->query($sql3);

		$sql4 = "DELETE  FROM transfer WHERE u_id = '$uid'";
		$result4 = $db_conx->query($sql4);
		if($result4){
			header("location: ../a/account.php?delete=successful");
				exit();
		}





ob_end_flush();

?>