<?php
	// required headers
	header("Access-Control-Allow-Origin: *");
	header("Content-Type: application/json; charset=UTF-8");
	 
	// include database and object files
	include_once '../config/database.php';
	include_once '../objects/user.php';
	 
	// instantiate database
	$database = new Database();
	$db = $database->getConnection();
	 
	$user = new User($db);
	$data = json_decode(file_get_contents("php://input"));
	$user->id=$data->id;
	$user->getOneRow();

	$user=array(
		"id" =>$user->id,
		"staff_id" =>$user->staff_id,
		"username" =>$user->username,
		"password" =>$user->password,
		"userrole_id" =>$user->userrole_id,
		"rolename" =>$user->rolename,
		"profilepicture" =>$user->profilepicture
	);

	echo json_encode($user);
?>