295 lines
11 KiB
PHP
Executable File
295 lines
11 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: karthi
|
|
* Date: 12/12/17
|
|
* Time: 11:56 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 Fees_Status_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['getStudentList_get']['limit'] = 500; // 500 requests per hour per user/key
|
|
$this->methods['getStudentList_post']['limit'] = 1000; // 1000 requests per hour per user/key
|
|
$this->methods['getStudentList_delete']['limit'] = 50; // 50 requests per hour per user/key
|
|
$this->methods['getFeesStructure_post']['limit'] = 1000; // 1000 requests per hour per user/key
|
|
$this->methods['updateFeesDetails_post']['limit'] = 1000; // 1000 requests per hour per user/key
|
|
$this->methods['getUniversityCourseForFees_post']['limit'] = 1000; // 1000 requests per hour per user/key
|
|
$this->methods['getFeesStructureAssign_post']['limit'] = 1000; // 1000 requests per hour per user/key
|
|
$this->methods['setFeesForStudent_post']['limit'] = 1000; // 1000 requests per hour per user/key
|
|
// $this->methods['sendStudentNotification_post']['limit'] = 2000; // 2000 requests per hour per user/key
|
|
|
|
|
|
// load the model
|
|
$this->load->model('Fees_status_model', 'Fees_model');
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
* get student list for fees update
|
|
* created by kms
|
|
* */
|
|
public function getStudentList_post()
|
|
{
|
|
$search['requestedBy'] = $this->post('requestedtBy');
|
|
$search['Firstname'] = $this->post('studentName');
|
|
$search['MobileNumber'] = $this->post('mobileNumber');
|
|
$search['UniversityID'] = $this->post('university');
|
|
$search['CourseID'] = $this->post('course');
|
|
$search['requestedDept'] = $this->post('requestedDept');
|
|
$search['requestedBranch'] = $this->post('branchId');
|
|
$getStudentDetails = $this->Fees_model->getStudentList($search);
|
|
if ($getStudentDetails)
|
|
{
|
|
$getStudentDetails['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($getStudentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
|
}
|
|
else
|
|
{
|
|
// Set the response and exit
|
|
$this->response([
|
|
'message' => 'No records found!',
|
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/*
|
|
* get student fees structure
|
|
* created by kms
|
|
* */
|
|
public function getFeesStructure_post()
|
|
{
|
|
$student['ID'] = $this->post('ID');
|
|
$student['requestedBy'] = $this->post('requestedtBy');
|
|
$student['CourseID'] = $this->post('courseID');
|
|
$student['StudentID'] = $this->post('studentID');
|
|
$getStudentFeesDetails = $this->Fees_model->getStudentFeesStructure($student);
|
|
if ($getStudentFeesDetails)
|
|
{
|
|
$getStudentFeesDetails['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($getStudentFeesDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
|
}
|
|
else
|
|
{
|
|
// Set the response and exit
|
|
$this->response([
|
|
'message' => 'No records found!',
|
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
|
}
|
|
|
|
|
|
}
|
|
/*
|
|
* update fees details for student
|
|
* created by kms
|
|
* */
|
|
|
|
|
|
public function updateFeesDetails_post()
|
|
{
|
|
$now = new DateTime();
|
|
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
|
|
/*for track purpose*/
|
|
|
|
/* $trackDetails['MobileNumber'] = $this->post('mobileNumber');
|
|
$trackDetails['LeadName'] = $this->post('studentName');
|
|
$trackDetails['University'] = $this->post('university');
|
|
$trackDetails['Course'] = $this->post('course');
|
|
$trackDetails['StatusCode'] = $this->post('statusCode');
|
|
$trackDetails['FollowupOn'] = $now->format('d-m-Y');
|
|
$trackDetails['FollowupComments'] = $this->post('commentsForStudent');
|
|
$trackDetails['CreatedBy'] = $this->post('createdBy');
|
|
$trackDetails['CreatedOn'] = $now->format('Y-m-d H:i:s');*/
|
|
|
|
/*track array end*/
|
|
|
|
$detailsChild['StudentID'] = $this->post('studID');
|
|
$detailsChild['FeesId'] = $this->post('feesID');
|
|
$detailsChild['ReceiptNo'] = $this->post('billNO');
|
|
$detailsChild['BillDate'] = $this->post('billDate');
|
|
$detailsChild['BillAmount'] = $this->post('billAmount');
|
|
$detailsChild['ModeOfPayment'] = $this->post('modeOfPayment');
|
|
$detailsChild['CommentsForStudent'] = $this->post('commentsForStudent');
|
|
$detailsChild['InternalComments'] = $this->post('internalComments');
|
|
$detailsChild['CreatedBy'] = $this->post('createdBy');
|
|
$detailsChild['CreatedOn'] = $now->format('Y-m-d H:i:s');
|
|
$detailsChild['UpdatedBy'] = $this->post('requestedBranch');
|
|
$updateDetails = $this->Fees_model->updateFees($detailsChild,$this->post('courseID'),$this->post('feesName'));// Check if the users data store contains users (in case the database result returns NULL)
|
|
if ($updateDetails)
|
|
{
|
|
$updateDetails['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($updateDetails, 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 university and course details for fees update
|
|
* created by kms
|
|
* */
|
|
public function getUniversityCourseForFees_post()
|
|
{
|
|
$getUnivDetails = $this->Fees_model->getUniversityDetails();
|
|
if ($getUnivDetails)
|
|
{
|
|
$getUnivDetails['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($getUnivDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
|
}
|
|
else
|
|
{
|
|
// Set the response and exit
|
|
$this->response([
|
|
'message' => 'No records found!',
|
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/*
|
|
* get student set fees details
|
|
* created by kms
|
|
* */
|
|
/*
|
|
* get student fees structure
|
|
* created by kms
|
|
* */
|
|
public function getFeesStructureAssign_post()
|
|
{
|
|
$student['ID'] = $this->post('ID');
|
|
$student['requestedBy'] = $this->post('requestedtBy');
|
|
$student['CourseID'] = $this->post('courseID');
|
|
$student['StudentID'] = $this->post('studentID');
|
|
$getStudentFeesDetails = $this->Fees_model->getFeesStructureAssign($student);
|
|
if ($getStudentFeesDetails)
|
|
{
|
|
$getStudentFeesDetails['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($getStudentFeesDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
|
}
|
|
else
|
|
{
|
|
// Set the response and exit
|
|
$this->response([
|
|
'message' => 'No records found!',
|
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
|
}
|
|
|
|
|
|
}
|
|
/*
|
|
* set fees for student
|
|
* created by kms
|
|
* */
|
|
public function setFeesForStudent_post()
|
|
{
|
|
$now = new DateTime();
|
|
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
|
|
$details['StudentID'] = $this->post('studID');
|
|
$details['CourseID'] = $this->post('courseID');
|
|
$details['FeesType'] = $this->post('feesID');
|
|
$details['CourseFees'] = $this->post('courseAmount');
|
|
$details['SessionName'] = $this->post('session');
|
|
$details['ToSessionName'] = $this->post('sessionTo');
|
|
$details['RollNo'] = $this->post('rollNo');
|
|
$details['STFOrWR'] = $this->post('STFWR');
|
|
$details['Waiver'] = $this->post('waiver');
|
|
$details['Others'] = $this->post('other');
|
|
$details['CreatedBy'] = $this->post('createdBy');
|
|
$details['CreatedOn'] = $now->format('Y-m-d H:i:s');
|
|
$details['BatchCode'] = $this->post('batchCode');
|
|
|
|
$jsonInstallmenData = $this->post('installmentItems');
|
|
|
|
$updateDetails = $this->Fees_model->setFees($details,$jsonInstallmenData);// Check if the users data store contains users (in case the database result returns NULL)
|
|
if ($updateDetails)
|
|
{
|
|
$updateDetails['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($updateDetails, 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
|
|
}
|
|
|
|
|
|
}
|
|
/*
|
|
* send notification for student
|
|
* created by kms
|
|
* */
|
|
public function sendStudentNotification_get(){
|
|
|
|
$sendMessage = $this->Fees_model->studentNotification();
|
|
|
|
if ($sendMessage)
|
|
{
|
|
echo "Success";
|
|
/* $this->response([
|
|
'message' => 'Done!',
|
|
'status' => REST_Controller::HTTP_OK
|
|
], REST_Controller::HTTP_OK); // NOT_FOUND (404) being the HTTP response code*/
|
|
}
|
|
else
|
|
{
|
|
// Set the response and exit
|
|
/* $this->response([
|
|
'message' => 'No records found!',
|
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code*/
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} |