Exemplo n.º 1
0
    $cn->insertSuggestion($suggestion[0]);
});
$app->put('/api/suggestions/:id', function ($id) use($app) {
    $req = $app->request();
    $bdy = $req->getBody();
    $suggestion = json_decode($bdy);
    $cn = new Suggestions();
    $cn->updateSuggestion($id, $suggestion[0]);
});
$app->delete('/api/suggestions/:id', function ($id) {
    $cn = new Suggestions();
    $cn->deleteSuggestion($id);
});
$app->get('/api/locations/', function () {
    $cn = new Locations();
    $cn->getLocations();
});
$app->post('/api/locations/', function () use($app) {
    $req = $app->request();
    $bdy = $req->getBody();
    $location = json_decode($bdy);
    $cn = new Locations();
    $cn->insertLocation($locaiton[0]);
});
$app->get('/api/locations/:id', function ($id) {
    $cn = new Locations();
    $cn->getLocationById($id);
});
$app->put('/api/locations/:id', function ($id) use($app) {
    $req = $app->request();
    $bdy = $req->getBody();
Exemplo n.º 2
0
/**
* Get information of all truck locations.
*/
function getLocations()
{
    $location = new Locations();
    $location->getLocations();
}