<?php
	include("../config.php");
	$response = array();
	if ($_POST['delete']) {
		$id = $_POST['delete'];
		$type              = 'delete_account';
	    $user_id           = $_SESSION['user_detail']['id'];
	    $data              = serialize($_POST);
	    $created_datetime  = date('Y-m-d H:i:s');
	    $created_id        = $_SESSION['user_detail']['id'];
	    $updated_datetime  = date('Y-m-d H:i:s');
	    $updated_id        = $_SESSION['user_detail']['id'];

		$query  = "DELETE FROM act_master WHERE id='".$id."'";
		$result = mysqli_query($conn,$query);
		/*$row    = mysqli_fetch_array($result);*/
		$activiti = "INSERT INTO `activities`(`type`, `user_id`, `data`, `created_id`, `created_datetime`, `updated_id`, `updated_datetime`) VALUES ('".$type."','".$user_id."','".$data."','".$created_id."','".$created_datetime."','".$updated_id."','".$updated_datetime."')";
    	$acttivity_res = mysqli_query($conn,$activiti);
		if ($result) {
			$response['status']  = 'success';
			$response['message'] = 'Account Group Deleted Successfully ...';
		} else {
			$response['status']  = 'error';
			$response['message'] = 'Unable to delete product ...';
		}
		echo json_encode($response);
	}
?>