array('select-all', 'insert-into', 'update', 'select-one'),
'invoice-recv' => array('select-all'),
'partner' => array('select-all'),
'preinvoice' => array('select-all')
);
if (isset($_POST['setToken'])) { $_SESSION['apitoken'] = $_POST['token']; }
if (isset($_POST['clearToken'])) { unset($_SESSION['apitoken']); unset($_SESSION['history']); }
if (isset($_GET['setDebug'])) { $_SESSION['debugmode'] = 1; }
if (isset($_GET['clearDebug'])) { unset($_SESSION['debugmode']);}
$RESOURCE = isset($_POST['resource']) ? $_POST['resource'] : '';
$METHOD = isset($_POST['method']) ? $_POST['method'] : '';
$ARGS = isset($_POST['args']) ? $_POST['args'] : '';
$FORMAT = isset($_POST['format']) ? $_POST['format'] : '';
$EXPLORE = isset($_POST['explore']) ? $_POST['explore'] : '';
include "style/header.php";
if (isset($_POST['call']) && isset($_SESSION['apitoken'])) {
$strpc = new StrpcAPI($_SESSION['apitoken'], "www.invoicefox.com", isset($_SESSION['debugmode']));
$_SESSION['history'][] = array('resource'=>$RESOURCE, 'method'=>$METHOD, 'args'=>$ARGS, 'format'=>$FORMAT, 'explore'=>$EXPLORE);
$response = $strpc->call($RESOURCE, $METHOD, $ARGS, $FORMAT, $EXPLORE);
echo "
"; print_r($response->res); echo ""; } ?>