Ejemplo n.º 1
0
 /**
  * Singleton Pattern
  *
  * Auto Create Object Instance.
  *
  */
 public static function getInstance()
 {
     if (null === self::$_objInstance) {
         self::$_objInstance = new ExamAssignment();
     }
     return self::$_objInstance;
 }
Ejemplo n.º 2
0
    session_cache_limiter(false);
    session_start();
}
/**
 * Initialize Cookie Security params
 */
$cookiesSettings = array('cookies.secret_key' => 'edupol', 'cookies.cipher' => MCRYPT_RIJNDAEL_256, 'cookies.cipher_mode' => MCRYPT_MODE_CBC);
$app = new Slim($cookiesSettings);
$app->contentType('application/json');
$rank = Rank::getInstance();
$division = Division::getInstance();
$address = Address::getInstance();
$position = Position::getInstance();
$examstore = ExamStore::getInstance();
$course = Course::getInstance();
$examAssignment = ExamAssignment::getInstance();
$app->get('/ranks', array($rank, 'getRanks'));
$app->get('/positions', array($position, 'getPositions'));
$app->get('/division/belongto', array($division, 'getBelongto'));
$app->get('/divisions', array($division, 'getDivisions'));
$app->post('/division/mapping', array($division, 'saveMapping'));
$app->get('/squads', array($address, 'getSquad'));
$app->get('/sections', array($address, 'getSection'));
$app->get('/provinces', array($address, 'getProvinces'));
$app->get('/provinces/:id', array($address, 'getProvincesByDivisionID'));
$app->get('/districts/:id', array($address, 'getDistrictsByID'));
$app->get('/subdistricts/:id', array($address, 'getSubDistrictsByID'));
$app->get('/examstore/history', array($examstore, 'getListOfExams'));
$app->post('/examstore/authen', array($examstore, 'authen'));
$app->post('/examstore/login', array($examstore, 'login'));
$app->post('/examstore/regis', array($examstore, 'regis'));