category_delete($id); }); // ------------------------------- Item Categories ------------------------------- // ------------------------------- Tax Types ------------------------------- // Tax Types // Get All Item Tax Types $rest->get('/taxtypes/', function () use($rest) { global $req; include_once API_ROOT . "/taxtypes.inc"; $page = $req->get("page"); if ($page == null) { taxtypes_all(); } else { // If page = 1 the value will be 0, if page = 2 the value will be 1, ... $from = --$page * RESULTS_PER_PAGE; taxtypes_all($from); } }); // ------------------------------- Tax Types ------------------------------- // ------------------------------- Tax Groups ------------------------------- // Tax Groups // Get All Tax Groups $rest->get('/taxgroups/', function () use($rest) { global $req; include_once API_ROOT . "/taxgroups.inc"; $page = $req->get("page"); if ($page == null) { taxgroups_all(); } else { // If page = 1 the value will be 0, if page = 2 the value will be 1, ... $from = --$page * RESULTS_PER_PAGE;
category_edit($id); }); // Delete Item Category $rest->delete('/category/:id', function ($id) use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/category.inc"; category_delete($id); }); // ------------------------------- Item Categories ------------------------------- // ------------------------------- Tax Types ------------------------------- // Tax Types // Get All Item Tax Types $rest->get('/taxtypes/', function () use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/taxtypes.inc"; taxtypes_all(); }); // ------------------------------- Tax Types ------------------------------- // ------------------------------- Tax Groups ------------------------------- // Tax Groups // Get All Tax Groups $rest->get('/taxgroups/', function () use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/taxgroups.inc"; taxgroups_all(); }); // ------------------------------- Tax Groups ------------------------------- // ------------------------------- Customers ------------------------------- // Customers // Get Customer General Info $rest->get('/customers/:id', function ($id) use($rest) {