apollodec/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php
2018-09-08 09:16:08 +05:30

395 lines
18 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: karthi
* Date: 8/28/18
* Time: 11:01 AM
*/
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 Receive_Enrolment_Fees_Univ_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['receiveEnrolmentFromUniv_post']['limit'] = 500; // 500 requests per hour per user/key
$this->methods['formIDFeeCompareDetails_post']['limit'] = 500;
$this->methods['getUniversitySessionDetails_post']['limit'] = 500;
$this->methods['getExistStudentEnrolmentDetails_post']['limit'] = 1000;
$this->methods['addManualEnrolmentDetails_post']['limit'] = 1000;
// load the model
$this->load->model('Receive_Enrolment_Fees_Univ_model', 'receive_model');
}
/*
* This method used to add received enrolment details
* created by kms
* */
public function receiveEnrolmentFromUniv_post()
{
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$enrolmentDetails = $this->post('details');
$localDetails = $this->post('localDetails');
$fromDetails['CreatedOn'] = $now->format('Y-m-d H:i:s');
$fromDetails['CreatedBy'] = $localDetails['localUserID'];
$fromDetails['UniversityCode']=$this->post('universityID');
$fromDetails['UniversityName']=$this->post('universityName');
$fromDetails['BranchCode']=$localDetails['localBranchID'];
$updatedDetails = $this->receive_model->updateEnrolmentDetails($enrolmentDetails,$fromDetails);// Check if the users data store contains users (in case the database result returns NULL)
if ($updatedDetails['status'])
{
$updatedDetails['status'] = true;
// Set the response and exit
$this->response($updatedDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'Something went wrong.please try again!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
/*
* This method used to add formid related student fee details form university
* created by kdk
* */
public function insertFormIdUnivFeeDetails_post(){
$formIdDetails = $this->post('details');
$localDetails = $this->post('localDetails');
$updatedDetails = $this->receive_model->formIdFeeDetails($formIdDetails,$localDetails);// Check if the users data store contains users (in case the database result returns NULL)
if ($updatedDetails)
{
$updatedDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($updatedDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'Something went wrong.please try again!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function getStudentUnivFeeCompareDetails_post(){
$searchData = $this->post('search');
$getUnivStudentFeeCompare = $this->receive_model->getStudentUnivFeeCompareDetails($searchData);// Check if the users data store contains users (in case the database result returns NULL)
if ($getUnivStudentFeeCompare)
{
$getUnivStudentFeeCompare['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getUnivStudentFeeCompare, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'Something went wrong.please try again!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
/*
* get form id bases get fees comparsion details
* created by kms
* */
public function formIDFeeCompareDetails_post(){
$formData['FormID'] = $this->post('formId');
$formData['EnrolmentNo'] = $this->post('enrolmentId');;
$getDetails = $this->receive_model->getFormIDFeeDetails($formData);
if ($getDetails['status']=true)
{
// Set the response and exit
$this->response($getDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else if($getDetails['status']=false){
$this->response([
'message' => $getDetails['Message'],
], REST_Controller::HTTP_OK); // NOT_FOUND (404) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'Something went wrong.please try again!',
'status' => false
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function getUnmatchedRecordDetails_post(){
$getDetailsFor = $this->post('getDetailsFor');
$getUnmatchedFormDetails = $this->receive_model->getUnmatchedFormDetails($getDetailsFor);// Check if the users data store contains users (in case the database result returns NULL)
if ($getUnmatchedFormDetails)
{
$getUnmatchedFormDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getUnmatchedFormDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'Something went wrong.please try again!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function getUniversitySessionDetails_post(){
$reqData = $this->post('data');
$loginUserId = $reqData['localUserID'];
$loginUserBranchId = $reqData['localBranchID'];
$loginUserType = $reqData['localType'];
$getUniversityListDetails = $this->receive_model->getUniversitySessionList($loginUserBranchId); // Check if the employee exist
if ($getUniversityListDetails['status']) {
// $getUniversityListDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getUniversityListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else if($getUniversityListDetails['status']==false){
$this->response(['message' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
/*
* get exist enrolment student details
* created by kms
* */
public function getExistStudentEnrolmentDetails_post(){
$localData = $this->post('localDetails');
$enrolmentID=$this->post('enrolmentID');
$getEnrolmentDetails=$this->receive_model->getExistStudentEnrolmentDetails($enrolmentID,$localData);
if($getEnrolmentDetails['status']==true){
$this->response($getEnrolmentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else if($getEnrolmentDetails['status']==false){
$this->response($getEnrolmentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else{
$this->response(['message' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
/*
* add manual enrolment details
* cretaed by kms
* */
public function addManualEnrolmentDetails_post(){
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$localData = $this->post('localDetails');
$studentInfo=$this->post('studentInfo');
$semDetails=$this->post('sem');
$studentInfo['CreatedOn'] = $now->format('Y-m-d H:i:s');
$studentInfo['FormID'] = $this->post('formID');
$studentInfo['SemesterYear'] = $semDetails['sem'];
$studentInfo['FormType'] = $semDetails['FormType'];
$studentInfo['SessionName'] = $semDetails['SessionName'];
$studentInfo['EnrolmentNo'] = $this->post('enrolmentID');
$studentInfo['CreatedBy'] = $localData['localUserID'];
$studentInfo['BranchCode'] = $localData['localBranchID'];
$studentInfo['ManualEntry'] = 1;
$addEnrolmentDetails=$this->receive_model->addManualEnrolmentDetails($studentInfo);
if($addEnrolmentDetails['status']==true){
$this->response($addEnrolmentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else if($addEnrolmentDetails['status']==false){
$this->response($addEnrolmentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else{
$this->response(['message' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function getUnivCourseFromFileDetails_post(){
// $reqData = $this->post('data');
// $reqBranch = $this->post('reqBranch');
$getUnivCourseFromFileDetails = $this->receive_model->getUnivCourseFromFileDetails(); // Check if the employee exist
if ($getUnivCourseFromFileDetails) {
$getUnivCourseFromFileDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getUnivCourseFromFileDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function getForFormIdDraftDetails_post(){
$reqBranch = $this->post('localDetails');
$getForFormIdDraftDetails = $this->receive_model->getForFormIdDraftDetails(); // Check if the employee exist
if ($getForFormIdDraftDetails) {
$getForFormIdDraftDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getForFormIdDraftDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function addForFormIdDraftDetails_post(){
$reqBranch = $this->post('localDetails');
$details = $this->post('details');
$addForFormIdDraftDetails = $this->receive_model->addForFormIdDraftDetails($details, $reqBranch); // Check if the employee exist
if ($addForFormIdDraftDetails) {
$addForFormIdDraftDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($addForFormIdDraftDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function draftMovetoList_post(){
$reqBranch = $this->post('localDetails');
$details = $this->post('details');
$draftMovetoList = $this->receive_model->draftMovetoList($details, $reqBranch); // Check if the employee exist
if ($draftMovetoList) {
$draftMovetoList['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($draftMovetoList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function editDraftFormIdFeesDetails_post(){
$reqBranch = $this->post('localDetails');
$details = $this->post('details');
$detailsID = $this->post('detailsID');
$details = $this->post('details');
$editDraftFormIdFeesDetails = $this->receive_model->editDraftFormIdFeesDetails($reqBranch, $details, $detailsID); // Check if the employee exist
if ($editDraftFormIdFeesDetails) {
$editDraftFormIdFeesDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($editDraftFormIdFeesDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
// get formid fee details list with status
public function getStudentUnivFormIdFeeDatailsList_post(){
$reqBranchData = $this->post('data');
$searchDetails = $this->post('search');
$getStudentUnivFormIdFeeDatailsList = $this->receive_model->getStudentUnivFormIdFeeDatailsList($reqBranchData, $searchDetails); // Check if the employee exist
if ($getStudentUnivFormIdFeeDatailsList) {
$getStudentUnivFormIdFeeDatailsList['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStudentUnivFormIdFeeDatailsList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function getFormIdDetailsStatusUpdateList_post(){
$reqBranchData = $this->post('localDetails');
$statusDetailsId = $this->post('detailsID');
$getFormIdDetailsStatusUpdateList = $this->receive_model->getFormIdDetailsStatusUpdateList($reqBranchData, $statusDetailsId); // Check if the employee exist
if ($getFormIdDetailsStatusUpdateList) {
$getFormIdDetailsStatusUpdateList['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getFormIdDetailsStatusUpdateList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function insertStatusUpdateDetails_post(){
$reqBranchData = $this->post('localDetails');
$statusDetails = $this->post('details');
$id = $this->post('id');
$formId = $this->post('formId');
$insertStatusUpdateDetails = $this->receive_model->insertStatusUpdateDetails($reqBranchData, $statusDetails, $id, $formId ); // Check if the employee exist
if ($insertStatusUpdateDetails) {
$insertStatusUpdateDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($insertStatusUpdateDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else {
// Set the response and exit
$this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
}