Beispiel #1
0
    $cn = new Suggestions();
    $cn->getSuggestionsByID($id);
});
$app->post('/api/suggestions/', function () use($app) {
    $req = $app->request();
    $bdy = $req->getBody();
    $suggestion = json_decode($bdy);
    $cn = new Suggestions();
    $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]);