<?php
	error_reporting(0);
	define('INCLUDE_CHECK',true);
	session_start();
	require ('classes/config.php');
	require_once('classes/session.php');
		$get_userid = $_GET['user_id'];
		$sql = mysql_query("SELECT * FROM admin_account WHERE id='$get_userid'")or die ('An error occured ' . mysql_error());
		while($row = mysql_fetch_array($sql)){
			$user_status = $row['status'];
		}
		if($user_status == "deactive") {
			$user_status = "active";
		} else {
			$user_status = "deactive";
		}
			$update = mysql_query("UPDATE admin_account SET status='$user_status' WHERE id='$get_userid'");
			if($update){
				header("location: dashboard.php?action=users_setup");
			} else{
				echo mysql_error();
			}
?>