course details changes done
This commit is contained in:
parent
bff97d1f2f
commit
bedf13b2bd
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Created by PhpStorm.
|
||||||
|
* User: karthi
|
||||||
|
* Date: 12/21/17
|
||||||
|
* Time: 3:41 PM
|
||||||
|
*/
|
||||||
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
|
|
||||||
|
// This can be removed if you use __autoload() in config.php OR use Modular Extensions
|
||||||
|
/** @noinspection PhpIncludeInspection */
|
||||||
|
require_once APPPATH . '/libraries/REST_Controller.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is an example of a few basic user interaction methods you could use
|
||||||
|
* all done with a hardcoded array
|
||||||
|
*
|
||||||
|
* @package CodeIgniter
|
||||||
|
* @subpackage Rest Server
|
||||||
|
* @category Controller
|
||||||
|
* @author
|
||||||
|
* @license MIT
|
||||||
|
* @link
|
||||||
|
*/
|
||||||
|
class StudentView_Controller extends REST_Controller
|
||||||
|
{
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
// Construct the parent class
|
||||||
|
parent::__construct();
|
||||||
|
// Configure limits on our controller methods
|
||||||
|
// Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php
|
||||||
|
|
||||||
|
$this->methods['getStudentInfo_post']['limit'] = 500;
|
||||||
|
// load the employee model
|
||||||
|
$this->load->model('Studentview_model', 'studentview_model');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*get student basic info
|
||||||
|
* created by kms
|
||||||
|
* */
|
||||||
|
public function getStudentInfo_post()
|
||||||
|
{
|
||||||
|
$requestedBy = $this->post('requestedBy');
|
||||||
|
|
||||||
|
$studentListDetails = $this->studentview_model->getStudentInfo($requestedBy);// Check if the employee exist
|
||||||
|
if ($studentListDetails) {
|
||||||
|
$studentListDetails['status'] = REST_Controller::HTTP_OK;
|
||||||
|
// Set the response and exit
|
||||||
|
$this->response($studentListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||||
|
} else {
|
||||||
|
// Set the response and exit
|
||||||
|
$this->response([
|
||||||
|
'message' => 'No users were found',
|
||||||
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||||
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user