supplier_contacts_get($id); }); // ------------------------------- Suppliers ------------------------------- // ------------------------------- Bank Accounts ------------------------------- // Bank Accounts // Get All Bank Accounts $rest->get('/bankaccounts/', function () use($rest) { global $req; include_once API_ROOT . "/bankaccounts.inc"; $page = $req->get("page"); if ($page == null) { bankaccounts_all(); } else { // If page = 1 the value will be 0, if page = 2 the value will be 1, ... $from = --$page * RESULTS_PER_PAGE; bankaccounts_all($from); } }); // Get Specific Bank Account $rest->get('/bankaccounts/:id', function ($id) use($rest) { include_once API_ROOT . "/bankaccounts.inc"; bankaccounts_get($id); }); // ------------------------------- Bank Accounts ------------------------------- // ------------------------------- GL Accounts ------------------------------- // GL Accounts // Get GL Accounts $rest->get('/glaccounts/', function () use($rest) { global $req; include_once API_ROOT . "/glaccounts.inc"; $page = $req->get("page");
supplier_delete($id); }); // Get Supplier Contacts $rest->get('/suppliers/:id/contacts/', function ($id) use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/suppliers.inc"; supplier_contacts_get($id); }); // ------------------------------- Suppliers ------------------------------- // ------------------------------- Bank Accounts ------------------------------- // Bank Accounts // Get All Bank Accounts $rest->get('/bankaccounts/', function () use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/bankaccounts.inc"; bankaccounts_all(); }); // Get Specific Bank Account $rest->get('/bankaccounts/:id', function ($id) use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/bankaccounts.inc"; bankaccounts_get($id); }); // ------------------------------- Bank Accounts ------------------------------- // ------------------------------- GL Accounts ------------------------------- // GL Accounts // Get GL Accounts $rest->get('/glaccounts/', function () use($rest) { global $path_to_root; include_once $path_to_root . "/modules/api/glaccounts.inc"; glaccounts_all();