<?php
include '../connect/cms-config.php' ;
include '../requires/session.php' ;
include '../requires/function.php' ;
// default variable
$type = $_GET['type'] ;
$id = escapeString($_POST['id']) ;
// check if not null
if ($type != ''){
	switch($type){
		case 'logout' :
			// update query
			$mysqli->query("UPDATE system_user SET
							user_login_cookies = ''
							WHERE user_id = '".$id."'") ;
			$result = 'success' ;
		break ;
	}
	$array_result['result'] = $result ;
	// return result
	echo json_encode($array_result) ;
	exit ;
}
// redirect page
header("Location: ".PATH) ;
exit ;
?>