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