enrolment university received changes

This commit is contained in:
gandhimathi 2018-08-28 14:10:19 +05:30
parent 245e3bdf5d
commit 5c1454abab
4 changed files with 133 additions and 1 deletions

View File

@ -159,6 +159,7 @@ defined('SESSIONSCHEDULEDETAILS') OR define('SESSIONSCHEDULEDETAILS','T_SessionS
defined('STUDENTDOCUMENTDETAILS') OR define('STUDENTDOCUMENTDETAILS','T_StudentDocumentsDetails');
defined('STUDENTDOCUMENTTRACKDETAILS') OR define('STUDENTDOCUMENTTRACKDETAILS','T_Student_DocumentTrack_Details');
defined('REGISTRATIONDETAILS') OR define('REGISTRATIONDETAILS','T_Registration_Details');
defined('ENROLMENTRECEIVEDFROMUNIV') OR define('ENROLMENTRECEIVEDFROMUNIV','T_Enrolment_Received_From_University');
// define APPLICATION certificate type constant

View File

@ -340,4 +340,7 @@ $route['insertUniversityfile'] = 'UniversityFile_Controller/insertUniversityfile
//Application Form Details
$route['getApplicationFromDetails'] = 'StatusUpdation_Controller/getApplicationFromDetails';
$route['updateApplicationFormStatus'] = 'StatusUpdation_Controller/updateApplicationFormStatus';
$route['getApplicationFormStatusList'] = 'StatusUpdation_Controller/getApplicationFormStatusList';
$route['getApplicationFormStatusList'] = 'StatusUpdation_Controller/getApplicationFormStatusList';
// update university enrolment and fees details received
$route['receiveEnrolmentFromUniv'] = 'Receive_Enrolment_Fees_Univ_Controller/receiveEnrolmentFromUniv';

View File

@ -0,0 +1,69 @@
<?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
// 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()
{
$enrolmentDetails = $this->post('details');
$localDetails = $this->post('localDetails');
$updatedDetails = $this->receive_model->updateEnrolmentDetails($enrolmentDetails,$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
}
}
}

View File

@ -0,0 +1,59 @@
<?php
/**
* Created by PhpStorm.
* User: karthi
* Date: 8/28/18
* Time: 11:02 AM
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class Receive_Enrolment_Fees_Univ_model extends CI_Model {
/*
* add received enrolment details
* params:enrolment details, local details
* created by kms
* */
public function updateEnrolmentDetails($enrolment=null,$local=null)
{
$errorArray=array();
// loop for fetch details
foreach ($enrolment as $checkRow){
// check enrolment no and form id in upload list
if(array_key_exists("Enrollment_No",$checkRow) AND array_key_exists("Form Id",$checkRow)){
// check enrolment no exist in student course details details
$this->db->select('STC.BranchID,US.UniversityID,US.UniversityName');
$this->db->from(STUDENTCOURSE.' as STC');
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID AND US.BranchCode = STC.BranchID');
$this->db->where('STC.EnrollmentID',$checkRow['Enrollment_No']);
$studentCourseDetails = $this->db->get()->first_row();
if($studentCourseDetails){
}
else{
$error["StudentName"]=$checkRow['Student_Name'];
$error["Message"]="Enrolment number is not exist in student course details.";
$errorArray[]=$error;
}
}
else{
// for capture error message
$error["StudentName"]=$checkRow['Student_Name'];
$error["Message"]="Enrolment number/Form id is not exist.";
$errorArray[]=$error;
}
print_r($errorArray);
}
die();
return false;
}
}