apollodec/Apollo/api/application/controllers/DataCorrection_Controller.php
venbatechnologies@gmail.com 4af8072068 feetransfer
2018-12-13 18:19:26 +05:30

326 lines
10 KiB
PHP

<?php
/**
* Date: 04/09/18
* Time: 11:24 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 DataCorrection_Controller extends REST_Controller {
function __construct()
{
// Construct the parent class
parent::__construct();
// load the model
$this->load->model('Data_correction', 'Data_correction');
}
public function StudMerge_post()
{
$name = $this->post('name');
$getStatus = $this->Data_correction->Student_Merge($name);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function getMob_post()
{
$deleteNo = $this->post('deleteNo');
$mergeNo = $this->post('mergeNo');
$getStatus = $this->Data_correction->getMobile($deleteNo,$mergeNo);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function getAllstudentcoursedetail_post()
{
$search['Firstname'] = $this->post('studentName');
$search['MobileNumber'] = $this->post('mobileNumber');
$search['receipt'] = $this->post('receipt');
$search['requestedtBy'] =$this->post('requestedtBy');
$search['branchId']=$this->post('branchId');
$search['requestedDept'] = $this->post('requestedDept');
$search['University'] = $this->post('University');
$stucourse = $this->Data_correction->GetAllCourseDetails($search);
if($stucourse)
{
$stucourse['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($stucourse, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
public function getAllfeedetail_post()
{
$search['University'] = $this->post('University');
$search['courseId'] = $this->post('courseId');
$search['studentId'] =$this->post('studentId');
$search['requestedtBy'] =$this->post('requestedtBy');
$search['branchId']=$this->post('branchId');
$search['requestedDept'] = $this->post('requestedDept');
$feedetails = $this->Data_correction->GetFeeDetails($search);
if($feedetails)
{
$feedetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($feedetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
public function updateCourseDetailss_post()
{
$search['University'] = $this->post('universityid');
$search['courseId'] = $this->post('courseId');
$search['studentId'] =$this->post('studentid');
$search['requestedtBy'] =$this->post('requestedtBy');
$search['branchId']=$this->post('branchId');
$search['requestedDept'] = $this->post('requestedDept');
$search['Reason'] = $this->post('Reason');
$search['IsActive'] = $this->post('IsActive');
$updatedetails = $this->Data_correction->UpdateCouseandfee($search);
$allfeeid = $this->Data_correction->GetAllfeeid($search);
if(!empty($allfeeid))
{
foreach($allfeeid as $fi)
{
$feeid = $fi->FeesID;
$feedeact = $this->Data_correction->feedetailupdate($search,$feeid);
}
}
// 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
// {
// $this->response([
// 'message' => 'No records found!',
// 'status' => REST_Controller::HTTP_NOT_FOUND
// ], REST_Controller::HTTP_NOT_FOUND);
// }
}
public function getStudentCourseFeeDetails_post()
{
$search['Firstname'] = $this->post('studentName');
$search['MobileNumber'] = $this->post('mobileNumber');
$search['receipt'] = $this->post('receipt');
$search['requestedtBy'] =$this->post('requestedtBy');
$search['branchId']=$this->post('branchId');
$search['requestedDept'] = $this->post('requestedDept');
$search['University'] = $this->post('University');
$stucourse = $this->Data_correction->GetAllCoursefeeDetails($search);
if($stucourse)
{
$stucourse['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($stucourse, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
public function getCoursefeedetail_post()
{
$search['University'] = $this->post('University');
$search['courseId'] = $this->post('courseId');
$search['studentId'] =$this->post('studentId');
$search['requestedtBy'] =$this->post('requestedtBy');
$search['branchId']=$this->post('branchId');
$search['requestedDept'] = $this->post('requestedDept');
$coursedetails = $this->Data_correction->GetCourseFeeDetails($search);
if($coursedetails)
{
$coursedetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($coursedetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
public function getAllCoursefeepaiddetail_post()
{
$search['studentId'] = $this->post('studentId');
$search['CourseId'] = $this->post('courseId');
$coursefeedetails = $this->Data_correction->GetCourseFeePaidDetails($search);
if($coursefeedetails)
{
$coursefeedetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($coursefeedetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
public function updatefeepaiddetail_post()
{
$search['studentId'] = $this->post('studentId');
$search['Act_CourseId'] = $this->post('act_courseId');
$search['DeAct_CourseId'] = $this->post('de_actcourseId');
$updatefeedetails['transferstatus'] = $this->Data_correction->UpdateFeePaidDetails($search);
if($updatefeedetails['transferstatus'])
{
$updatefeedetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($updatefeedetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
public function getAllfeepaiddetail_post()
{
$search['studentId'] = $this->post('studentId');
$search['CourseID'] = $this->post('CourseID');
$paidfeedetails = $this->Data_correction->GetFeePaidDetails($search);
if($paidfeedetails)
{
$paidfeedetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($paidfeedetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
}