$json = $event->addEvent($hostid, $name, $startdate, $enddate, $addr1, $addr2, $city, $state, $zip, $islocal, $isvirtual, $ticketprice, $description); //return results// echo $json; }); //get specific event// $app->get('/id/:eventid/', function ($eventid) use($app, $resourceServer) { $event = new Event(); $json = $event->getEvent($eventid); echo $json; }); //get events for a specific host// $app->get('/host/', $authorize(), function () use($app, $resourceServer) { //get currently logged in host id from session// $hostid = $resourceServer->getAccessToken()->getSession()->getOwnerId(); $event = new Event(); $json = $event->getHostEvents($hostid); echo $json; }); //send out emails to winners// //never got finished. localhost is a very uncooperative with sending emails... // $app->post('/notify/', function() use ($app, $resourceServer) { // $to = $app->request->post('to'); // $subject = $app->request->post('subject'); // $message = $app->request->post('message'); // $headers = "From: goraffleme@aol.com"; // if(mail($to, $subject, $message)) { // $array = array('success' => true, // 'message' => 'Mail Sent'); // echo json_encode($array); // } // else {