<?php
session_start();

require_once "../SystemController/DbConnection.php";
if(!isset($_SESSION['admin_id'])){
    header("Location: index.php");
}
$db_handle = new Dbconnection();
if(isset($_GET['user'])){
	$user = $_GET['user'];
$delete = $db_handle->delete("DELETE FROM users WHERE id = $user");

	if($delete){

$_SESSION['msg-s'] = "User Deleted successfully";

header("location: users.php?page=users");
	}
}

if(isset($_GET['admin'])){
	$admin = $_GET['admin'];
$delete = $db_handle->delete("DELETE FROM admins WHERE id = $admin");

	if($delete){

$_SESSION['msg-s'] = "Admin Deleted successfully";

header("location: admins.php?page=admins");
	}
}

if(isset($_GET['deposit-detail'])){
	$id = $_GET['deposit-detail'];
$delete = $db_handle->delete("DELETE FROM bank_details WHERE id = $id");

	if($delete){

$_SESSION['msg-s'] = "Bank Detail Deleted successfully";

header("location: deposit-details.php?page=deposit-details");
	}
}

