apollodec/Apollo/api/application/controllers/DayBook_Controller.php
2020-11-27 10:50:31 +05:30

829 lines
29 KiB
PHP
Executable File

<?php
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 DayBook_Controller extends REST_Controller {
/*
* daybook updation details
* params:
* created by kdk
* */
function __construct()
{
// Construct the parent class
parent::__construct();
// load the university model
$this->load->model('DayBook_model', 'daybook_model');
$this->methods['addAccountnameDetails_get']['limit'] = 500; // 500 requests per hour per user/key
$this->methods['addAccountnameDetails_post']['limit'] = 100; // 100 requests per hour per user/key
$this->methods['addAccountnameDetails_delete']['limit'] = 50; // 50 requests per hour per user/key
$this->load->model('Status_model', 'status_model');
$this->methods['GetSubTypes']['limit'] = 500;
}
public function addAccountnameDetails_post()
{
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$details['ListName'] = $this->post('statusName');
$details['ListGroup'] = "10";
$details['CreatedBy'] = $this->post('createdBy');
$details['IsActive'] = $this->post('status');
$details['BranchCode'] = $this->post('branch');
$details['CreatedOn'] = $now->format('Y-m-d H:i:s');
$statusDetails = $this->status_model->addstatus($details);// Check if the users data store contains users (in case the database result returns NULL)
if ($statusDetails)
{
$statusDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($statusDetails, 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 income expese type, name details
public function getIncomeExpenseTypeState_post() {
$reqData = $this->post('localReqDetails');
$getIncomeExpenseTypeState = $this->daybook_model->get_Income_Expense_typeState($reqData['localBranchID']);// Check if the employee exist
if ($getIncomeExpenseTypeState)
{
$getIncomeExpenseTypeState['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getIncomeExpenseTypeState, 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 empDayBookModuleAccessChk_post() {
$reqDataBy = $this->post('localReqDetails');
// print_r($reqDataBy);exit();
$empDayBkAccessChk = $this->daybook_model->emp_day_book_AccessChk($reqDataBy);// Check if the employee exist
if ($empDayBkAccessChk)
{
$empDayBkAccessChk['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($empDayBkAccessChk, 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
}
}
// {"data":{"date":"22-12-2017"},"localReqDetails":{"localUserID":"137","localBranchID":"001","localType":"R002","localOn":"2017-12-22T12:45:19.688Z","status":"active"}}
// get all daybook details
public function getDayBookDetails_post() {
$reqData = $this->post('data');
$reqDataBy = $this->post('localReqDetails');
$getDayBookDetails = $this->daybook_model->get_Daybook_Details_List($reqData, $reqDataBy);// Check if the employee exist
if ($getDayBookDetails)
{
$getDayBookDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getDayBookDetails, 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 getDayBookOnlineDetails_post() {
$reqData = $this->post('data');
$reqDataBy = $this->post('localReqDetails');
$getDayBookDetails = $this->daybook_model->get_Daybookonline_Details_List($reqData, $reqDataBy);// Check if the employee exist
if ($getDayBookDetails)
{
$getDayBookDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getDayBookDetails, 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 getNonDayBookDetails_post() {
$reqData = $this->post('data');
$reqDataBy = $this->post('localReqDetails');
$getDayBookDetails = $this->daybook_model->get_Daybook_NonDetails_List($reqData, $reqDataBy);// Check if the employee exist
if ($getDayBookDetails)
{
$getDayBookDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getDayBookDetails, 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 getDayBookApprovalDetails_post() {
$reqData = $this->post('data');
$reqDataBy = $this->post('localReqDetails');
$getDayBookApprovalDetails = $this->daybook_model->get_Daybook_Approval_Details_List($reqData, $reqDataBy);// Check if the employee exist
if ($getDayBookApprovalDetails)
{
$getDayBookApprovalDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getDayBookApprovalDetails, 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 getDayBookfilterDetails_post()
{
$reqData = $this->post('data');
$reqDataBy = $this->post('localReqDetails');
$filter['exptype'] = $this->post('exptype');
$filter['modeofpayment'] = $this->post('modeofpayment');
$filter['fdate'] = $this->post('fdate');
$filter['tdate'] = $this->post('tdate');
$getDayBookApprovalDetails = $this->daybook_model->get_Daybook_filterApproval_Details_List($reqData, $reqDataBy,$filter);// Check if the employee exist
if ($getDayBookApprovalDetails)
{
$getDayBookApprovalDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getDayBookApprovalDetails, 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 deleteDayBookDetails_post() {
$reqData = $this->post('data');
$reason = $this->post('reason');
// print_r($reqData);
// print_r($reason);
// exit();
$reqbyData = $this->post('localReqDetails');
$deletedayBookDetails = $this->daybook_model->delete_dayBookDetails($reqData,$reason);// Check if the employee exist
if ($deletedayBookDetails)
{
$deletedayBookDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($deletedayBookDetails, 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 deleteDayBookFeePayableDetails_post() {
$reqData = $this->post('data');
$reason = $this->post('reason');
$reqbyData = $this->post('requestDetails');
// print_r($reqbyData);exit();
$deletedayBookFeePayableDetails = $this->daybook_model->delete_dayBookFeePayableDetails($reqData,$reason,$reqbyData['localUserID']);// Check if the employee exist
if ($deletedayBookFeePayableDetails)
{
$deletedayBookFeePayableDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($deletedayBookFeePayableDetails, 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 updateDayBookDetails_post() {
$reqData = $this->post('data');
$reqbyData = $this->post('localReqDetails');
$updateFor = $reqData['id'];
$req['Type'] = $reqData['type'];
$req['Amount'] = $reqData['amount'];
$req['Description'] = $reqData['description'];
$req['UpdatedBy'] = $reqbyData['localUserID'];
$req['PaidTo'] = $reqData['paidTo'];
$req['PaidDescription'] = $reqData['description_paid'];
$req['VoucherNumber'] = $reqData['voucherNumber'];
$req['BranchCode'] = $reqData['branch'];
$req['Name'] = $reqData['name'];
$date = date('Y-m-d H:i:s');
$req['UpdatedOn'] = $date;
$updatedayBookDetails = $this->daybook_model->update_dayBookDetails($req , $updateFor);// Check if the employee exist
if ($updatedayBookDetails)
{
$updatedayBookDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($updatedayBookDetails, 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 updateNonOperationalDetails_post() {
$reqData = $this->post('data');
$reqbyData = $this->post('localReqDetails');
$updateFor = $reqData['id'];
$req['Type'] = $reqData['type'];
$req['Amount'] = $reqData['amount'];
$req['Description'] = $reqData['description'];
$req['UpdatedBy'] = $reqbyData['localUserID'];
$req['PaidTo'] = $reqData['paidTo'];
$req['PaidDescription'] = $reqData['description_paid'];
$req['VoucherNumber'] = $reqData['voucherNumber'];
$req['BranchCode'] = $reqData['branch'];
$req['Name'] = $reqData['name'];
$date = date('Y-m-d H:i:s');
$req['UpdatedOn'] = $date;
$updatedayBookDetails = $this->daybook_model->update_NonOperationalDetails($req , $updateFor);// Check if the employee exist
if ($updatedayBookDetails)
{
$updatedayBookDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($updatedayBookDetails, 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
}
}
// add details daybook
public function adddaybook_post() {
$reqData = $this->post('data');
$reqbyData = $this->post('localReqDetails');
//echo $reqData['type'].['ID'];die();
/// $typealone = json_decode($reqData['type']);
//print_r($typealone);die();
// echo $typealone->ID;die();
$req['Name'] = $reqData['name'];
$req['Type'] = $reqData['type'];
//$req['Type'] = $typealone->ID;
$req['Amount'] = $reqData['amount'];
// $d = new DateTime($reqData['date']);
$req['Date'] = $reqData['date'];
$req['Status'] = $reqData['status'];
$req['Description'] = $reqData['description'];
$req['BranchCode'] = $reqbyData['localBranchID'];
$req['CreatedBy'] = $reqbyData['localUserID'];
$req['PaidTo'] = $reqData['paidTo'];
$req['PaidDescription'] = $reqData['description_paid'];
$req['VoucherNumber'] = $reqData['voucherNumber'];
$date = date('Y-m-d H:i:s');
$req['CreatedOn'] = $date;
$req['ModeOfPayment'] = 'CASH';
if($reqData['Isdaybook']==true)
{
$req['Isdaybook']=1;
}
else
{
$req['Isdaybook']=0;
}
$non['Name'] = $reqData['name'];
$non['Type'] = $reqData['type'];
//$non['Type'] = $typealone->ID;
$non['Amount'] = $reqData['amount'];
// $d = new DateTime($reqData['date']);
$non['Date'] = $reqData['date'];
$non['Status'] = $reqData['status'];
$non['Description'] = $reqData['description'];
$non['BranchCode'] = $reqbyData['localBranchID'];
$non['CreatedBy'] = $reqbyData['localUserID'];
$non['PaidTo'] = $reqData['paidTo'];
$non['PaidDescription'] = $reqData['description_paid'];
$non['VoucherNumber'] = $reqData['voucherNumber'];
$date = date('Y-m-d H:i:s');
$non['CreatedOn'] = $date;
$non['ModeOfPayment'] = 'CASH';
$non['Isdaybook'] = 0;
$this->daybook_model->add_NonOperational($non);
// print_r($req);exit();
$addDayBookDetails = $this->daybook_model->add_dayBook($req);// Check if the employee exist
if ($addDayBookDetails)
{
$addDayBookDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($addDayBookDetails, 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
}
}
// add details non operational
public function addNonOperational_post() {
$reqData = $this->post('data');
$reqbyData = $this->post('localReqDetails');
$req['Name'] = $reqData['name'];
$req['Type'] = $reqData['type'];
$req['Amount'] = $reqData['amount'];
// $d = new DateTime($reqData['date']);
$req['Date'] = $reqData['date'];
$req['Status'] = $reqData['status'];
$req['Description'] = $reqData['description'];
$req['BranchCode'] = $reqbyData['localBranchID'];
$req['CreatedBy'] = $reqbyData['localUserID'];
$req['PaidTo'] = $reqData['paidTo'];
$req['PaidDescription'] = $reqData['description_paid'];
$req['VoucherNumber'] = $reqData['voucherNumber'];
$date = date('Y-m-d H:i:s');
$req['CreatedOn'] = $date;
$req['Isdaybook']=1;
// print_r($req);exit();
$addDayBookDetails = $this->daybook_model->add_NonOperational($req);// Check if the employee exist
if ($addDayBookDetails)
{
$addDayBookDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($addDayBookDetails, 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 updateDayBookStatusAdmin_post() {
$reqData = $this->post('data');
$reqDetails = $this->post('requestDetails');
$time = date('Y-m-d H:i:s');
$dateTime = $time;
$count = count($reqData);
for($i=0; $i < $count; $i++) {
$data[] = array(
'ID' => $reqData[$i]['dabookListId'],
'Approval_By' => $reqDetails['localUserID'],
'Status' => $reqData[$i]['ListCodeStatus'],
'Approval_Comments' => $reqData[$i]['comments'],
'UpdatedBy' => $reqDetails['localUserID'],
'UpdatedOn' => $dateTime,
);
}
$updateStatusAdminDetails = $this->daybook_model->update_status_admin($data);// Check if the employee exist
if ($updateStatusAdminDetails)
{
$updateStatusAdminDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($updateStatusAdminDetails, 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 getDayBookDetailsSuperAdmin_post() {
$reqData = $this->post('data');
$reqDataBy = $this->post('localReqDetails');
$getDayBookDetails = $this->daybook_model->get_Daybook_Details_List_superAdmin($reqData, $reqDataBy);// Check if the employee exist
if ($getDayBookDetails)
{
$getDayBookDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getDayBookDetails, 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 getAccounttypes_post()
{
$requestedBy = $this->post('requestedBy');
$requestedBranch = $this->post('requestBranch');
//echo $requestedBy;
$getStatus = $this->daybook_model->getAccounttype($requestedBy,$requestedBranch);
// print_r($getStatus);
// die();
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 ViewFullIncomeDetails_post()
{
$from = $this->post('from');
$to = $this->post('to');
$incid = 'I002';
$branch = $this->post('branch');
$getincomedetails = $this->daybook_model->getIncome_Details($from,$to,$incid,$branch);
// print_r($getincomedetails);
// die();
if ($getincomedetails)
{
$getincomedetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getincomedetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
}
public function getIncomeExpenseDetails_post()
{
$from = $this->post('from');
$to = $this->post('to');
$br = $this->post('branch');
// echo $from.'from';
// echo $to.'to';
$getStatus = $this->daybook_model->Income_expense($from,$to,$br);
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 GetSubTypes_post()
{
//echo 'in';
$getsubtypes = $this->daybook_model->Income_expenseSubtype();
// print_r($getsubtypes);
// die();
if($getsubtypes)
{
$getsubtypes['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getsubtypes, 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 GetPLforExcel_post()
{
$from= $this->post('from');
$to = $this->post('to');
$branch = $this->post('branch');
$getexceldet = $this->daybook_model->GetPLexcelDetails($from,$to,$branch);
if(!empty($getexceldet))
{
$getexceldet['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getexceldet, 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 getAllDayBookDetails_post()
{
$search['Firstname'] = $this->post('studentName');
$search['MobileNumber'] = $this->post('mobileNumber');
$search['receipt'] = $this->post('receipt');
$search['branchId'] = $this->post('branchId');
$allfinace = $this->daybook_model->GetAllDaybook($search);
//print_r($allfinace);
if($allfinace)
{
$allfinace['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($allfinace, 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 update_DayBookDetailsData_post()
{
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$up_details['ID']= $this->post('ID');
//$up_details['Date'] =$this->post('Date');
$up_details['Amount'] = $this->post('Amount');
$up_details['Reason'] = $this->post('Reason');
$up_details['IsActive'] = $this->post('IsActive');
$up_details['FeesPaymentID'] = $this->post('FID');
$up_details['requestedtBy'] = $this->post('requestedtBy');
$up_details['branchId'] = $this->post('branchId');
$updatevalue = $this->daybook_model->UpdateDayFee($up_details);
}
public function getStudentAllInfo_post()
{
$mobileNumber = $this->post('mobileNumber');
$getdetails = $this->daybook_model->GetStudentAllDetail($mobileNumber);
//print_r($getdetails);
//die();
if($getdetails)
{
$getdetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getdetails, 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 billModal_post()
{
$bilNo = $this->post('billNo');
$getStatus = $this->daybook_model->getBillDetails($bilNo);
//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 getExpenseType_post()
{
$branch=$this->post('branch');
$getexpensetype = $this->daybook_model->getExpenseType($branch);
if ($getexpensetype)
{
$getexpensetype['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getexpensetype, 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
}
}
}