<?php

// redirect to the error page
function error($message)
{
	$_SESSION['ERR'] = $message;
	if (page::get("nav-id") != "error") {
		header("Location: /" . SUBFOLDER . "error.php");
	}
	die();
}

// stop processing api call and send error message
function endrequest($message)
{
	$response['success'] = false;
	$response['error'] = $message;
	echo json_encode($response);
	die();
}
