Ejemplo n.º 1
0
// Requiring necessary stuff
require_once '/../libs/Slim/Slim.php';
require '../models/Event.class.php';
require_once '../models/Contingents.class.php';
require_once '../mappers/EventMapper.php';
require_once '../mappers/ContingentMapper.php';
require_once '../mappers/Registrations.php';
// Autoloading the slim
\Slim\Slim::registerAutoloader();
$app = new \Slim\Slim();
// Very imp. Since we are interested with only REST API in the file, setting all of the response content type as JSON.
$app->response->headers->set('Content-Type', 'application/json');
// EventMapper object
$eventMapper = new \Udaan\EventMapper();
//Contingent Mapper object
$contingentMapper = new \Udaan\ContingentMapper();
//Registrations mapper
$registrationMapper = new \Udaan\Registrations();
// ALL of the functions that respond according to request depending upon URL requests,begin here.
/**
 * @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
 *
 *
Ejemplo n.º 2
0
<!doctype html>
<?php 
session_start();
if (!isset($_SESSION['username'])) {
    header("location:index.php");
}
include 'db.php';
//$query=mysql_query("SELECT * FROM contingent_college");
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require_once "{$root}/Udaan2016/fms/mappers/ContingentMapper.php";
$ContingentMapper = new \Udaan\ContingentMapper();
$result = $ContingentMapper->getAllColleges();
?>

<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>
Ejemplo n.º 3
0
<?php

require_once 'mappers/ContingentMapper.php';
require_once 'models/Contingents.class.php';
$cm = new \Udaan\ContingentMapper();
$c = $cm->getContingentObject(428);
$c->setName('1');
$c->setAcl1Email("aa");
echo $c->getAcl1Email();
Ejemplo n.º 4
0
require_once '/../libs/Slim/Slim.php';
require '../models/Event.class.php';
require_once '../models/Contingents.class.php';
require_once '../mappers/EventMapper.php';
require_once '../mappers/ContingentMapper.php';
require_once '../mappers/Registrations.php';
header('Access-Control-Allow-Origin: *');
// Autoloading the slim
\Slim\Slim::registerAutoloader();
$app = new \Slim\Slim();
// Very imp. Since we are interested with only REST API in the file, setting all of the response content type as JSON.
$app->response->headers->set('Content-Type', 'application/json');
// EventMapper object
$eventMapper = new \Udaan\EventMapper();
//Contingent Mapper object
$contingentMapper = new \Udaan\ContingentMapper();
//Registrations mapper
$registrationMapper = new \Udaan\Registrations();
// ALL of the functions that respond according to request depending upon URL requests,begin here.
/**
 * @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
 *
 *