예제 #1
0
    $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();
    $contact = json_decode($bdy);
    $cn = new Locations();
    $cn->updateLocation($id, $location[0]);
});
$app->delete('/api/locations/:id', function ($id) {
    $cn = new Locations();
    $cn->deleteLocation($id);
});
$app->get('/api/venues/', function () {
    $cn = new Venues();
    $cn->getVenues();
});
$app->post('/api/venues/', function () use($app) {
    $req = $app->request();
    $bdy = $req->getBody();
    $venue = json_decode($bdy);
    $cn = new Venues();
    $cn->insertVenue($venue[0]);
});
$app->get('/api/venues/:id', function ($id) {
    $cn = new Venues();
    $cn->getVenueById($id);