/** * @api {get} /events/all Requesting all events * @apiName Get All Events * @apiGroup Event * * * @apiSuccess {jsonObject} Events JSONObject containing event info & meta info. http://www.jsoneditoronline.org/?id=a1d0eb703336fa4f5eb93a72813c5a06 * * @apiSuccessExample Success-Response: * HTTP/1.1 200 OK * * * */ $app->get('/events/all', function () use($app, $eventMapper) { $allEvents = $eventMapper->getAllEvents(); $response = array(); if ($allEvents) { $status = 200; $response["error"] = 0; $response["code"] = $status; $response["events"] = array(); $response["total_events"] = sizeof($allEvents); array_push($response["events"], $allEvents); $app->response->setStatus(200); } else { $status = 204; $response["error"] = 0; $response["total_events"] = 0; $response["message"] = "Oops, Events not found"; //$app->response->setStatus(204);
<!doctype html> <?php //session_start(); //if(!isset($_SESSION['username'])){ //header("location:index.php"); //} //include('db.php'); //$query=mysql_query("SELECT * FROM events"); $root = realpath($_SERVER["DOCUMENT_ROOT"]); require_once "{$root}/Udaan2016/fms/mappers/EventMapper.php"; $eventMapper = new \Udaan\EventMapper(); $result = $eventMapper->getAllEvents(); ?> <html><head> <meta charset="utf-8"> <title>UDAAN 2016</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!-- Le styles --> <link href="assets/css/bootstrap.css" rel="stylesheet"> <link href="assets/css/main.css" rel="stylesheet"> <!-- DATA TABLE CSS --> <link href="assets/css/table.css" rel="stylesheet"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>