status updation screen changes : kdk

This commit is contained in:
dineshkumarkannan 2018-04-26 11:51:02 +05:30
parent 118c65bde2
commit 062b103cc1
4 changed files with 1699 additions and 2437 deletions

View File

@ -1,11 +1,9 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
// This can be removed if you use __autoload() in config.php OR use Modular Extensions // This can be removed if you use __autoload() in config.php OR use Modular Extensions
/** @noinspection PhpIncludeInspection */ /** @noinspection PhpIncludeInspection */
require_once APPPATH . '/libraries/REST_Controller.php'; require_once APPPATH . '/libraries/REST_Controller.php';
/** /**
* This is an example of a few basic user interaction methods you could use * This is an example of a few basic user interaction methods you could use
* all done with a hardcoded array * all done with a hardcoded array
@ -18,14 +16,12 @@ require_once APPPATH . '/libraries/REST_Controller.php';
* @link * @link
*/ */
class StatusUpdation_Controller extends REST_Controller { class StatusUpdation_Controller extends REST_Controller {
/* /*
* status Updation details * status Updation details
* params: * params:
* created by kdk * created by kdk
* */ * */
function __construct() function __construct() {
{
// Construct the parent class // Construct the parent class
parent::__construct(); parent::__construct();
$this->methods['getUniversity_post']['limit'] = 100; $this->methods['getUniversity_post']['limit'] = 100;
@ -40,20 +36,16 @@ class StatusUpdation_Controller extends REST_Controller {
$loginUserId = $reqData['localUserID']; $loginUserId = $reqData['localUserID'];
$loginUserBranchId = $reqData['localBranchID']; $loginUserBranchId = $reqData['localBranchID'];
$loginUserType = $reqData['localType']; $loginUserType = $reqData['localType'];
$getUniversityListDetails = $this->statusupdation_model->get_university_course_batch($loginUserBranchId);// Check if the employee exist $getUniversityListDetails = $this->statusupdation_model->get_university_course_batch($loginUserBranchId); // Check if the employee exist
if ($getUniversityListDetails) if ($getUniversityListDetails) {
{
$getUniversityListDetails['status'] = REST_Controller::HTTP_OK; $getUniversityListDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($getUniversityListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($getUniversityListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'message' => 'No list were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -61,22 +53,16 @@ class StatusUpdation_Controller extends REST_Controller {
public function getSearchDetails_post() { public function getSearchDetails_post() {
$reqSearchData = $this->post('data'); $reqSearchData = $this->post('data');
$reqData = $this->post('requestDetails'); $reqData = $this->post('requestDetails');
// print_r($reqSearchData);exit(); $getSearchDetails = $this->statusupdation_model->get_search_result($reqSearchData, $reqData); // Check if the employee exist
if ($getSearchDetails) {
$getSearchDetails = $this->statusupdation_model->get_search_result($reqSearchData, $reqData);// Check if the employee exist
if ($getSearchDetails)
{
$getSearchDetails['status'] = REST_Controller::HTTP_OK; $getSearchDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($getSearchDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($getSearchDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'message' => 'No list were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -85,64 +71,39 @@ class StatusUpdation_Controller extends REST_Controller {
$reqData = $this->post('data'); $reqData = $this->post('data');
$stuFor = $this->post('stuFor'); $stuFor = $this->post('stuFor');
$reqBranch = $this->post('reqBranch'); $reqBranch = $this->post('reqBranch');
$getSemYeatList = $this->statusupdation_model->get_semyear_result($reqData, $stuFor, $reqBranch);// Check if the employee exist $getSemYeatList = $this->statusupdation_model->get_semyear_result($reqData, $stuFor, $reqBranch); // Check if the employee exist
if ($getSemYeatList) if ($getSemYeatList) {
{
$getSemYeatList['status'] = REST_Controller::HTTP_OK; $getSemYeatList['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($getSemYeatList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($getSemYeatList, 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
}
} 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
}
} }
// update the study material Status // update the study material Status
public function updateStudentMaterialStatus_post() { public function updateStudentMaterialStatus_post() {
$reqData = $this->post('data'); $reqData = $this->post('data');
$reqDetails = $this->post('requestDetails'); $reqDetails = $this->post('requestDetails');
$time = date('Y-m-d H:i:s'); $time = date('Y-m-d H:i:s');
$dateTime = $time; $dateTime = $time;
$count = count($reqData); $count = count($reqData);
// echo $reqDetails['localUserID'];exit(); for ($i = 0;$i < $count;$i++) {
$data[] = array('StudentID' => $reqData[$i]['StudentID'], 'CourseID' => $reqData[$i]['CourseID'], 'BranchCode' => $reqData[$i]['BranchCode'], 'ListCode' => $reqData[$i]['ListCode'], 'SDate' => $reqData[$i]['SDate'], 'Coursedetail' => $reqData[$i]['Coursedetail'], 'Comments' => $reqData[$i]['Comments'], 'Sem' => $reqData[$i]['Sem'], 'CreatedBy' => $reqDetails['localUserID'], 'CreatedOn' => $dateTime,);
for($i=0; $i < $count; $i++) {
$data[] = array(
'StudentID' => $reqData[$i]['StudentID'],
'CourseID' => $reqData[$i]['CourseID'],
'BranchCode' => $reqData[$i]['BranchCode'],
'ListCode' => $reqData[$i]['ListCode'],
'SDate' => $reqData[$i]['SDate'],
'Coursedetail' => $reqData[$i]['Coursedetail'],
'Comments' => $reqData[$i]['Comments'],
'Sem' => $reqData[$i]['Sem'],
'CreatedBy' => $reqDetails['localUserID'],
'CreatedOn' => $dateTime,
);
} }
$updateStudentMaterialSta = $this->statusupdation_model->update_semyear($data); // Check if the employee exist
$updateStudentMaterialSta = $this->statusupdation_model->update_semyear($data);// Check if the employee exist if ($updateStudentMaterialSta) {
if ($updateStudentMaterialSta)
{
$updateStudentMaterialSta['status'] = REST_Controller::HTTP_OK; $updateStudentMaterialSta['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($updateStudentMaterialSta, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($updateStudentMaterialSta, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'message' => 'No list were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -150,110 +111,63 @@ class StatusUpdation_Controller extends REST_Controller {
public function updateAnswerBookLetStatus_post() { public function updateAnswerBookLetStatus_post() {
$reqData = $this->post('data'); $reqData = $this->post('data');
$reqDetails = $this->post('requestDetails'); $reqDetails = $this->post('requestDetails');
$time = date('Y-m-d H:i:s'); $time = date('Y-m-d H:i:s');
$dateTime = $time; $dateTime = $time;
$count = count($reqData); $count = count($reqData);
// echo $reqDetails['localUserID'];exit(); for ($i = 0;$i < $count;$i++) {
$data[] = array('StudentID' => $reqData[$i]['StudentID'], 'CourseID' => $reqData[$i]['CourseID'], 'BranchCode' => $reqData[$i]['BranchCode'], 'ListCode' => $reqData[$i]['ListCode'], 'AnsDate' => $reqData[$i]['SDate'], 'Coursedetail' => $reqData[$i]['Coursedetail'], 'Comments' => $reqData[$i]['Comments'], 'Sem' => $reqData[$i]['Sem'], 'CreatedBy' => $reqDetails['localUserID'], 'CreatedOn' => $dateTime,);
for($i=0; $i < $count; $i++) {
$data[] = array(
'StudentID' => $reqData[$i]['StudentID'],
'CourseID' => $reqData[$i]['CourseID'],
'BranchCode' => $reqData[$i]['BranchCode'],
'ListCode' => $reqData[$i]['ListCode'],
'AnsDate' => $reqData[$i]['SDate'],
'Coursedetail' => $reqData[$i]['Coursedetail'],
'Comments' => $reqData[$i]['Comments'],
'Sem' => $reqData[$i]['Sem'],
'CreatedBy' => $reqDetails['localUserID'],
'CreatedOn' => $dateTime,
);
} }
$updateAnswerBookletStat = $this->statusupdation_model->update_answerbooklet($data, $reqDetails); // Check if the employee exist
$updateAnswerBookletStat = $this->statusupdation_model->update_answerbooklet($data,$reqDetails);// Check if the employee exist if ($updateAnswerBookletStat) {
if ($updateAnswerBookletStat)
{
$updateAnswerBookletStat['status'] = REST_Controller::HTTP_OK; $updateAnswerBookletStat['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($updateAnswerBookletStat, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($updateAnswerBookletStat, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'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 certification type list // get certification type list
public function getCertificateList_post() { public function getCertificateList_post() {
$reqData = $this->post('data'); $reqData = $this->post('data');
$certificateList = $this->statusupdation_model->get_certificate_list($reqData['localBranchID']); // Check if the employee exist
$certificateList = $this->statusupdation_model->get_certificate_list();// Check if the employee exist if ($certificateList) {
if ($certificateList)
{
$certificateList['status'] = REST_Controller::HTTP_OK; $certificateList['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($certificateList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($certificateList, 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
}
} 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
}
} }
// update certification status // update certification status
public function updateCertificationStatus_post() { public function updateCertificationStatus_post() {
$reqData = $this->post('data'); $reqData = $this->post('data');
$reqDetails = $this->post('requestDetails'); $reqDetails = $this->post('requestDetails');
$time = date('Y-m-d H:i:s'); $time = date('Y-m-d H:i:s');
$dateTime = $time; $dateTime = $time;
$count = count($reqData); $count = count($reqData);
// echo $reqDetails['localUserID'];exit(); for ($i = 0;$i < $count;$i++) {
$data[] = array('StudentID' => $reqData[$i]['StudentID'], 'CourseID' => $reqData[$i]['CourseID'], 'BranchCode' => $reqData[$i]['BranchCode'], 'ListCode' => $reqData[$i]['ListCode'], 'CDate' => $reqData[$i]['SDate'], 'Coursedetail' => $reqData[$i]['Coursedetail'], 'Comments' => $reqData[$i]['Comments'], 'Sem' => $reqData[$i]['Sem'], 'CreatedBy' => $reqDetails['localUserID'], 'CreatedOn' => $dateTime,
for($i=0; $i < $count; $i++) {
$data[] = array(
'StudentID' => $reqData[$i]['StudentID'],
'CourseID' => $reqData[$i]['CourseID'],
'BranchCode' => $reqData[$i]['BranchCode'],
'ListCode' => $reqData[$i]['ListCode'],
'CDate' => $reqData[$i]['SDate'],
'Coursedetail' => $reqData[$i]['Coursedetail'],
'Comments' => $reqData[$i]['Comments'],
'Sem' => $reqData[$i]['Sem'],
'CreatedBy' => $reqDetails['localUserID'],
'CreatedOn' => $dateTime,
// 'CertificationType' => $reqData[$i]['CertificateType'], // 'CertificationType' => $reqData[$i]['CertificateType'],
'CertificationType' => 'MARK CARD', 'CertificationType' => 'MARK CARD', 'CertificationNo' => $reqData[$i]['CertificateNumber'],);
'CertificationNo' =>$reqData[$i]['CertificateNumber'],
);
} }
$updateCertificateStatus = $this->statusupdation_model->update_certificateStatus($data); // Check if the employee exist
$updateCertificateStatus = $this->statusupdation_model->update_certificateStatus($data);// Check if the employee exist if ($updateCertificateStatus) {
if ($updateCertificateStatus)
{
$updateCertificateStatus['status'] = REST_Controller::HTTP_OK; $updateCertificateStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($updateCertificateStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($updateCertificateStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'message' => 'No list were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -261,42 +175,22 @@ class StatusUpdation_Controller extends REST_Controller {
public function updateApplicationStatus_post() { public function updateApplicationStatus_post() {
$reqData = $this->post('data'); $reqData = $this->post('data');
$reqDetails = $this->post('requestDetails'); $reqDetails = $this->post('requestDetails');
$time = date('Y-m-d H:i:s'); $time = date('Y-m-d H:i:s');
$dateTime = $time; $dateTime = $time;
$count = count($reqData); $count = count($reqData);
// echo $reqDetails['localUserID'];exit(); for ($i = 0;$i < $count;$i++) {
$data[] = array('StudentID' => $reqData[$i]['StudentID'], 'CourseID' => $reqData[$i]['CourseID'], 'BranchCode' => $reqData[$i]['BranchCode'], 'ListCode' => $reqData[$i]['ListCode'], 'AppDate' => $reqData[$i]['SDate'], 'Comments' => $reqData[$i]['Comments'], 'CreatedBy' => $reqDetails['localUserID'], 'CreatedOn' => $dateTime, 'CertificationType' => $reqData[$i]['CertificateType'], 'CertificationNo' => $reqData[$i]['CertificateNumber'],);
for($i=0; $i < $count; $i++) {
$data[] = array(
'StudentID' => $reqData[$i]['StudentID'],
'CourseID' => $reqData[$i]['CourseID'],
'BranchCode' => $reqData[$i]['BranchCode'],
'ListCode' => $reqData[$i]['ListCode'],
'AppDate' => $reqData[$i]['SDate'],
'Comments' => $reqData[$i]['Comments'],
'CreatedBy' => $reqDetails['localUserID'],
'CreatedOn' => $dateTime,
'CertificationType' => $reqData[$i]['CertificateType'],
'CertificationNo' =>$reqData[$i]['CertificateNumber'],
);
} }
$updateApplicationStatus = $this->statusupdation_model->update_applicationStatus($data, $reqDetails); // Check if the employee exist
$updateApplicationStatus = $this->statusupdation_model->update_applicationStatus($data,$reqDetails);// Check if the employee exist if ($updateApplicationStatus) {
if ($updateApplicationStatus)
{
$updateApplicationStatus['status'] = REST_Controller::HTTP_OK; $updateApplicationStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($updateApplicationStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($updateApplicationStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'message' => 'No list were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -305,20 +199,16 @@ class StatusUpdation_Controller extends REST_Controller {
$reqData = $this->post('data'); $reqData = $this->post('data');
$reqDetails = $this->post('statusFor'); $reqDetails = $this->post('statusFor');
$reqBranch = $this->post('reqBranch'); $reqBranch = $this->post('reqBranch');
$getStatusList = $this->statusupdation_model->get_status_list($reqData, $reqBranch);// Check if the employee exist $getStatusList = $this->statusupdation_model->get_status_list($reqData, $reqBranch); // Check if the employee exist
if ($getStatusList) if ($getStatusList) {
{
$getStatusList['status'] = REST_Controller::HTTP_OK; $getStatusList['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($getStatusList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($getStatusList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'message' => 'No list were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -326,23 +216,16 @@ class StatusUpdation_Controller extends REST_Controller {
$reqData = $this->post('data'); $reqData = $this->post('data');
$reqDetailsFor = $this->post('statusFor'); $reqDetailsFor = $this->post('statusFor');
$reqDetails = $this->post('getDetailsFor'); $reqDetails = $this->post('getDetailsFor');
$getPrevStatusList = $this->statusupdation_model->get_prev_status_list($reqDetailsFor, $reqDetails); // Check if the employee exist
$getPrevStatusList = $this->statusupdation_model->get_prev_status_list($reqDetailsFor, $reqDetails);// Check if the employee exist if ($getPrevStatusList) {
if ($getPrevStatusList)
{
$getPrevStatusList['status'] = REST_Controller::HTTP_OK; $getPrevStatusList['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($getPrevStatusList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($getPrevStatusList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'message' => 'No list were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
} }
}
} }

View File

@ -1,11 +1,9 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
// This can be removed if you use __autoload() in config.php OR use Modular Extensions // This can be removed if you use __autoload() in config.php OR use Modular Extensions
/** @noinspection PhpIncludeInspection */ /** @noinspection PhpIncludeInspection */
require_once APPPATH . '/libraries/REST_Controller.php'; require_once APPPATH . '/libraries/REST_Controller.php';
/** /**
* This is an example of a few basic user interaction methods you could use * This is an example of a few basic user interaction methods you could use
* all done with a hardcoded array * all done with a hardcoded array
@ -18,42 +16,34 @@ require_once APPPATH . '/libraries/REST_Controller.php';
* @link * @link
*/ */
class Student_Controller extends REST_Controller { class Student_Controller extends REST_Controller {
/* /*
* get student details * get student details
* params: * params:
* created by kdk * created by kdk
* */ * */
function __construct() function __construct() {
{
// Construct the parent class // Construct the parent class
parent::__construct(); parent::__construct();
// Configure limits on our controller methods // Configure limits on our controller methods
// Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php // Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php
$this->methods['addStudent_post']['limit'] = 100; $this->methods['addStudent_post']['limit'] = 100;
// load the employee model // load the employee model
$this->load->model('Student_model', 'student_model'); $this->load->model('Student_model', 'student_model');
} }
// list of branch for admin student add screen // list of branch for admin student add screen
public function getBranchListDetails_post() { public function getBranchListDetails_post() {
$reqData = $this->post('data'); $reqData = $this->post('data');
$branchListDetails = $this->student_model->get_branch_list();// Get Branch list $branchListDetails = $this->student_model->get_branch_list(); // Get Branch list
if ($branchListDetails) if ($branchListDetails) {
{
$branchListDetails['status'] = REST_Controller::HTTP_OK; $branchListDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($branchListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($branchListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -61,21 +51,16 @@ class Student_Controller extends REST_Controller {
public function getBranchActiveStatusforStuAdd_post() { public function getBranchActiveStatusforStuAdd_post() {
$reqData = $this->post('data'); $reqData = $this->post('data');
$branchId = $reqData['localBranchID']; $branchId = $reqData['localBranchID'];
// print_r($reqData);exit(); $checkBranchActiveStatis = $this->student_model->getBranchActiveStatusforStuAdd($branchId); // Get Branch list
$checkBranchActiveStatis = $this->student_model->getBranchActiveStatusforStuAdd($branchId);// Get Branch list if ($checkBranchActiveStatis) {
if ($checkBranchActiveStatis)
{
$checkBranchActiveStatis['status'] = REST_Controller::HTTP_OK; $checkBranchActiveStatis['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($checkBranchActiveStatis, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($checkBranchActiveStatis, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -85,23 +70,17 @@ class Student_Controller extends REST_Controller {
$loginUserId = $reqData['localUserID']; $loginUserId = $reqData['localUserID'];
$loginUserBranchId = $reqData['localBranchID']; $loginUserBranchId = $reqData['localBranchID'];
$loginUserType = $reqData['localType']; $loginUserType = $reqData['localType'];
$studentListDetails = $this->student_model->get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $searchReqData); // Check if the employee exist
$studentListDetails = $this->student_model->get_student_list( $loginUserId, $loginUserBranchId, $loginUserType, $searchReqData);// Check if the employee exist if ($studentListDetails) {
if ($studentListDetails)
{
$studentListDetails['status'] = REST_Controller::HTTP_OK; $studentListDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
} else {
// Set the response and exit
$this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
} }
public function getStudentUniversity_post() { public function getStudentUniversity_post() {
@ -109,59 +88,47 @@ class Student_Controller extends REST_Controller {
$loginUserId = $reqData['localUserID']; $loginUserId = $reqData['localUserID'];
$loginUserBranchId = $reqData['localBranchID']; $loginUserBranchId = $reqData['localBranchID'];
$loginUserType = $reqData['localType']; $loginUserType = $reqData['localType'];
$getUniversityListDetails = $this->student_model->get_university_list($loginUserBranchId);// Check if the employee exist $getUniversityListDetails = $this->student_model->get_university_list($loginUserBranchId); // Check if the employee exist
if ($getUniversityListDetails) if ($getUniversityListDetails) {
{
$getUniversityListDetails['status'] = REST_Controller::HTTP_OK; $getUniversityListDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($getUniversityListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($getUniversityListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'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 getStudentCourseList_post() { public function getStudentCourseList_post() {
$studentID = $this->post('studentID'); $studentID = $this->post('studentID');
$reqData = $this->post('updatedBy'); $reqData = $this->post('updatedBy');
$studentCourse = $this->student_model->get_student_course_list( $studentID, $reqData );// Check if the employee exist $studentCourse = $this->student_model->get_student_course_list($studentID, $reqData); // Check if the employee exist
if ($studentCourse) if ($studentCourse) {
{
$studentCourse['status'] = REST_Controller::HTTP_OK; $studentCourse['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentCourse, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentCourse, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
public function getStudentCourseDetails_post() { public function getStudentCourseDetails_post() {
$studentCourseID = $this->post('studentcourseId'); $studentCourseID = $this->post('studentcourseId');
$studentCourse = $this->student_model->get_student_course( $studentCourseID );// Check if the employee exist $studentCourse = $this->student_model->get_student_course($studentCourseID); // Check if the employee exist
if ($studentCourse) if ($studentCourse) {
{
$studentCourse['status'] = REST_Controller::HTTP_OK; $studentCourse['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentCourse, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentCourse, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -169,21 +136,16 @@ class Student_Controller extends REST_Controller {
$exceptId = $this->post('exceptId'); $exceptId = $this->post('exceptId');
$datas = $this->post('datas'); $datas = $this->post('datas');
$checkFor = $this->post('check'); $checkFor = $this->post('check');
$checkRes = $this->student_model->check_update_exist($exceptId, $datas, $checkFor); // Check if the employee exist
$checkRes = $this->student_model->check_update_exist( $exceptId, $datas, $checkFor );// Check if the employee exist if ($checkRes) {
if ($checkRes)
{
$checkRes['status'] = REST_Controller::HTTP_OK; $checkRes['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($checkRes, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($checkRes, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -191,7 +153,6 @@ class Student_Controller extends REST_Controller {
$data = $this->post('data'); $data = $this->post('data');
$updatedBy = $this->post('updatedBy'); $updatedBy = $this->post('updatedBy');
$id = $data['ID']; $id = $data['ID'];
$req['StudentID'] = $data['StudentID']; $req['StudentID'] = $data['StudentID'];
$req['UniversityID'] = $data['UniversityID']; $req['UniversityID'] = $data['UniversityID'];
$req['CourseID'] = $data['CourseID']; $req['CourseID'] = $data['CourseID'];
@ -202,25 +163,20 @@ class Student_Controller extends REST_Controller {
$req['EnrollmentID'] = $data['EnrollmentID']; $req['EnrollmentID'] = $data['EnrollmentID'];
$req['Specilization1'] = $data['Specilization1']; $req['Specilization1'] = $data['Specilization1'];
$req['Specilization2'] = $data['Specilization2']; $req['Specilization2'] = $data['Specilization2'];
$req['DeactiveComments'] = $data['IsActive'] == 1 ? '': $data['DeactiveComments']; $req['DeactiveComments'] = $data['IsActive'] == 1 ? '' : $data['DeactiveComments'];
$req['UpdatedBy'] = $updatedBy; $req['UpdatedBy'] = $updatedBy;
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$req['UpdatedOn'] = $date; $req['UpdatedOn'] = $date;
$studentCourseUpdate = $this->student_model->update_student_course($req, $id);
$studentCourseUpdate = $this->student_model->update_student_course( $req, $id ); if ($studentCourseUpdate) {
if ($studentCourseUpdate)
{
$studentCourseUpdate['status'] = REST_Controller::HTTP_OK; $studentCourseUpdate['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentCourseUpdate, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentCourseUpdate, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -228,21 +184,16 @@ class Student_Controller extends REST_Controller {
public function getListofStuDocDetails_post() { public function getListofStuDocDetails_post() {
$StudentID = $this->post('exceptId'); $StudentID = $this->post('exceptId');
$localdata = $this->post('localData'); $localdata = $this->post('localData');
$studentDocDetails = $this->student_model->getStudent_doc_details($StudentID); $studentDocDetails = $this->student_model->getStudent_doc_details($StudentID);
if ($studentDocDetails) if ($studentDocDetails) {
{
$studentDocDetails['status'] = REST_Controller::HTTP_OK; $studentDocDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentDocDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentDocDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -250,72 +201,49 @@ class Student_Controller extends REST_Controller {
$StudentID = $this->post('exceptId'); $StudentID = $this->post('exceptId');
$docEntryId = $this->post('docDetailsID'); $docEntryId = $this->post('docDetailsID');
$localdata = $this->post('localData'); $localdata = $this->post('localData');
$stuDocDeleteDetails = $this->student_model->deleteStu_doc_details($StudentID, $docEntryId); $stuDocDeleteDetails = $this->student_model->deleteStu_doc_details($StudentID, $docEntryId);
if ($stuDocDeleteDetails) if ($stuDocDeleteDetails) {
{
$stuDocDeleteDetails['status'] = REST_Controller::HTTP_OK; $stuDocDeleteDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($stuDocDeleteDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($stuDocDeleteDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
} else {
// Set the response and exit
$this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
} }
public function addStudentEntrollDocDetails_post() { public function addStudentEntrollDocDetails_post() {
// echo $this->post('stuDocProof_Status');exit(); $docName = $_FILES['stuDocProof']['name'];
$docName = $_FILES['stuDocProof']['name'] ; $docsize = $_FILES['stuDocProof']['size'];
$docsize = $_FILES['stuDocProof']['size'] ;
$docSource = $_FILES['stuDocProof']['tmp_name']; $docSource = $_FILES['stuDocProof']['tmp_name'];
$temp = $this->post('data');
$temp= $this->post('data');
$data = json_decode($temp, true); $data = json_decode($temp, true);
$updatedBy = $this->post('updatedBy'); $updatedBy = $this->post('updatedBy');
$studentId = $this->post('studentID'); $studentId = $this->post('studentID');
$doc_upload_status = $this->post('stuDocProof_Status'); $doc_upload_status = $this->post('stuDocProof_Status');
$req['doc_name'] = $docName; $req['doc_name'] = $docName;
$req['doc_size'] = $docsize; $req['doc_size'] = $docsize;
$req['doc_source'] = $docSource; $req['doc_source'] = $docSource;
$req['document_type_name'] = $data['documentName']; $req['document_type_name'] = $data['documentName'];
$req['document_status'] = ''; $req['document_status'] = '';
$req['document_comments'] = $data['documentComments']; $req['document_comments'] = $data['documentComments'];
$req['student_id'] = $studentId; $req['student_id'] = $studentId;
$req['CreatedBy'] = $updatedBy; $req['CreatedBy'] = $updatedBy;
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$req['CreatedOn'] = $date; $req['CreatedOn'] = $date;
$studentEntrollDocAdd = $this->student_model->student_entroll_doc_add($req, $doc_upload_status); // Check if the employee exist
$studentEntrollDocAdd = $this->student_model->student_entroll_doc_add( $req, $doc_upload_status);// Check if the employee exist if ($studentEntrollDocAdd) {
if ($studentEntrollDocAdd)
{
$studentEntrollDocAdd['status'] = REST_Controller::HTTP_OK; $studentEntrollDocAdd['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentEntrollDocAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentEntrollDocAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
// print_r($temp);
// echo $docName, $studentId, $data['documentName'];
// exit();
} else {
// Set the response and exit
$this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
} }
// get student pending enrollment document details // get student pending enrollment document details
@ -323,48 +251,37 @@ class Student_Controller extends REST_Controller {
$StudentID = $this->post('exceptId'); $StudentID = $this->post('exceptId');
$localdata = $this->post('localData'); $localdata = $this->post('localData');
$studentPendingDocDetails = $this->student_model->getStudent_PendingDoc_Details($StudentID); $studentPendingDocDetails = $this->student_model->getStudent_PendingDoc_Details($StudentID);
if ($studentPendingDocDetails) if ($studentPendingDocDetails) {
{
$studentPendingDocDetails['status'] = REST_Controller::HTTP_OK; $studentPendingDocDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentPendingDocDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentPendingDocDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
public function addStudentEnrollPendingDocDetails_post() { public function addStudentEnrollPendingDocDetails_post() {
$updateDetails = $this->post('updateDetails'); $updateDetails = $this->post('updateDetails');
$localdata = $this->post('localData'); $localdata = $this->post('localData');
$reqData['StudentID'] = $updateDetails['student']; $reqData['StudentID'] = $updateDetails['student'];
$reqData['Details'] = $updateDetails['doc_Details']; $reqData['Details'] = $updateDetails['doc_Details'];
$reqData['Status'] = $updateDetails['checkTracking']; $reqData['Status'] = $updateDetails['checkTracking'];
$reqData['CreatedBy'] = $localdata['localUserID']; $reqData['CreatedBy'] = $localdata['localUserID'];
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$reqData['CreatedOn'] = $date; $reqData['CreatedOn'] = $date;
$addStudentPendingDocDetails = $this->student_model->addStu_PendingDoc_Details($reqData, $localdata);
$addStudentPendingDocDetails = $this->student_model->addStu_PendingDoc_Details($reqData,$localdata); if ($addStudentPendingDocDetails) {
if ($addStudentPendingDocDetails)
{
$addStudentPendingDocDetails['status'] = REST_Controller::HTTP_OK; $addStudentPendingDocDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($addStudentPendingDocDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($addStudentPendingDocDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
@ -372,44 +289,33 @@ class Student_Controller extends REST_Controller {
public function deleteDocPendingDetails_post() { public function deleteDocPendingDetails_post() {
$expID = $this->post('exceptId'); $expID = $this->post('exceptId');
$localData = $this->post('localData'); $localData = $this->post('localData');
// echo $expID;
// print_r($localData);exit();
$stuEnrollPendingDocDeleteDetails = $this->student_model->deleteStu_entrollPending_doc_details($expID); $stuEnrollPendingDocDeleteDetails = $this->student_model->deleteStu_entrollPending_doc_details($expID);
if ($stuEnrollPendingDocDeleteDetails) if ($stuEnrollPendingDocDeleteDetails) {
{
$stuEnrollPendingDocDeleteDetails['status'] = REST_Controller::HTTP_OK; $stuEnrollPendingDocDeleteDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($stuEnrollPendingDocDeleteDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($stuEnrollPendingDocDeleteDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
public function updateStudentImgDetails_post() { public function updateStudentImgDetails_post() {
$imagename = $_FILES['idStuUpProof']['name']; $imagename = $_FILES['idStuUpProof']['name'];
$size = $_FILES['idStuUpProof']['size']; $size = $_FILES['idStuUpProof']['size'];
$imageSource = $_FILES['idStuUpProof']['tmp_name']; $imageSource = $_FILES['idStuUpProof']['tmp_name'];
$temp = $this->post('data');
$temp= $this->post('data');
$data = json_decode($temp, true); $data = json_decode($temp, true);
$updatedBy = $this->post('updatedBy'); $updatedBy = $this->post('updatedBy');
$updateStudent = $data['StudentID']; $updateStudent = $data['StudentID'];
$req['MobileNumber'] = $data['MobileNumber']; $req['MobileNumber'] = $data['MobileNumber'];
$req['Firstname'] = $data['Firstname']; $req['Firstname'] = $data['Firstname'];
$req['Lastname'] = $data['Lastname']; $req['Lastname'] = $data['Lastname'];
$req['Fathername'] = $data['Fathername']; $req['Fathername'] = $data['Fathername'];
$req['EmailID'] = $data['EmailID']; $req['EmailID'] = $data['EmailID'];
$req['MotherName'] = $data['MotherName']; $req['MotherName'] = $data['MotherName'];
$req['AlternateNumber'] = $data['AlternateNumber']; $req['AlternateNumber'] = $data['AlternateNumber'];
$req['Gender'] = $data['Gender']; $req['Gender'] = $data['Gender'];
$req['DOB'] = $data['DOB']; $req['DOB'] = $data['DOB'];
@ -419,7 +325,6 @@ class Student_Controller extends REST_Controller {
$req['OtherID'] = $data['OtherID']; $req['OtherID'] = $data['OtherID'];
$req['OtherIDDetails'] = $data['OtherIDDetails']; $req['OtherIDDetails'] = $data['OtherIDDetails'];
$req['Qualification'] = $data['Qualification']; $req['Qualification'] = $data['Qualification'];
$req['PreQualification'] = $data['PreQualification']; $req['PreQualification'] = $data['PreQualification'];
$req['Caste'] = $data['Caste']; $req['Caste'] = $data['Caste'];
$req['Category'] = $data['Category']; $req['Category'] = $data['Category'];
@ -432,47 +337,38 @@ class Student_Controller extends REST_Controller {
$req['ReferersMobileNumber'] = $data['ReferersMobileNumber']; $req['ReferersMobileNumber'] = $data['ReferersMobileNumber'];
$req['ProfilePicPath'] = $data['ProfilePicPath']; $req['ProfilePicPath'] = $data['ProfilePicPath'];
$req['Comments'] = $data['Comments']; $req['Comments'] = $data['Comments'];
$req['DeactiveComments'] = $data['IsActive'] == 1 ? '': $data['DeactiveComments']; $req['DeactiveComments'] = $data['IsActive'] == 1 ? '' : $data['DeactiveComments'];
$req['IsActive'] = $data['IsActive']; $req['IsActive'] = $data['IsActive'];
$req['LoginAccess'] = $data['LoginAccess'] == 1 ? "1" : "0"; $req['LoginAccess'] = $data['LoginAccess'] == 1 ? "1" : "0";
$req['UpdatedBy'] = $updatedBy; $req['UpdatedBy'] = $updatedBy;
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$req['UpdatedOn'] = $date; $req['UpdatedOn'] = $date;
$studentUpdate = $this->student_model->update_student( $req, $updateStudent, $imagename, $imageSource, $size );// Check if the employee exist $studentUpdate = $this->student_model->update_student($req, $updateStudent, $imagename, $imageSource, $size); // Check if the employee exist
if ($studentUpdate) if ($studentUpdate) {
{
$studentUpdate['status'] = REST_Controller::HTTP_OK; $studentUpdate['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentUpdate, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentUpdate, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
} }
public function updateStudentExistDetail_post(){ }
public function updateStudentExistDetail_post() {
$data = $this->post('data'); $data = $this->post('data');
$updatedBy = $this->post('updatedBy'); $updatedBy = $this->post('updatedBy');
$updateStudent = $data['StudentID']; $updateStudent = $data['StudentID'];
$imagename = ''; $imagename = '';
$size = ''; $size = '';
$imageSource = ''; $imageSource = '';
$req['MobileNumber'] = $data['MobileNumber']; $req['MobileNumber'] = $data['MobileNumber'];
$req['Firstname'] = $data['Firstname']; $req['Firstname'] = $data['Firstname'];
$req['Lastname'] = $data['Lastname']; $req['Lastname'] = $data['Lastname'];
$req['Fathername'] = $data['Fathername']; $req['Fathername'] = $data['Fathername'];
$req['EmailID'] = $data['EmailID']; $req['EmailID'] = $data['EmailID'];
$req['MotherName'] = $data['MotherName']; $req['MotherName'] = $data['MotherName'];
$req['AlternateNumber'] = $data['AlternateNumber']; $req['AlternateNumber'] = $data['AlternateNumber'];
$req['Gender'] = $data['Gender']; $req['Gender'] = $data['Gender'];
$req['DOB'] = $data['DOB']; $req['DOB'] = $data['DOB'];
@ -482,7 +378,6 @@ class Student_Controller extends REST_Controller {
$req['OtherID'] = $data['OtherID']; $req['OtherID'] = $data['OtherID'];
$req['OtherIDDetails'] = $data['OtherIDDetails']; $req['OtherIDDetails'] = $data['OtherIDDetails'];
$req['Qualification'] = $data['Qualification']; $req['Qualification'] = $data['Qualification'];
$req['PreQualification'] = $data['PreQualification']; $req['PreQualification'] = $data['PreQualification'];
$req['Caste'] = $data['Caste']; $req['Caste'] = $data['Caste'];
$req['Category'] = $data['Category']; $req['Category'] = $data['Category'];
@ -495,150 +390,115 @@ class Student_Controller extends REST_Controller {
$req['ReferersMobileNumber'] = $data['ReferersMobileNumber']; $req['ReferersMobileNumber'] = $data['ReferersMobileNumber'];
$req['ProfilePicPath'] = $data['ProfilePicPath']; $req['ProfilePicPath'] = $data['ProfilePicPath'];
$req['Comments'] = $data['Comments']; $req['Comments'] = $data['Comments'];
$req['DeactiveComments'] = $data['IsActive'] == 1 ? '': $data['DeactiveComments']; $req['DeactiveComments'] = $data['IsActive'] == 1 ? '' : $data['DeactiveComments'];
$req['IsActive'] = $data['IsActive'] == 1 ? "1" : "0"; $req['IsActive'] = $data['IsActive'] == 1 ? "1" : "0";
$req['LoginAccess'] = $data['LoginAccess'] == 1 ? "1" : "0"; $req['LoginAccess'] = $data['LoginAccess'] == 1 ? "1" : "0";
$req['UpdatedBy'] = $updatedBy; $req['UpdatedBy'] = $updatedBy;
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$req['UpdatedOn'] = $date; $req['UpdatedOn'] = $date;
$studentUpdate = $this->student_model->update_student($req, $updateStudent, $imagename, $imageSource, $size); // Check if the employee exist
$studentUpdate = $this->student_model->update_student( $req, $updateStudent, $imagename, $imageSource, $size );// Check if the employee exist if ($studentUpdate) {
if ($studentUpdate)
{
$studentUpdate['status'] = REST_Controller::HTTP_OK; $studentUpdate['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentUpdate, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentUpdate, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
public function getCourseBatch_post() { public function getCourseBatch_post() {
$data = $this->post('data'); $data = $this->post('data');
$reqDetails = $this->post('reqDetails'); $reqDetails = $this->post('reqDetails');
$getCourseBatchListDetails = $this->student_model->get_courseBatch_list($data, $reqDetails['localBranchID']); // Check if the employee exist
$getCourseBatchListDetails = $this->student_model->get_courseBatch_list($data, $reqDetails['localBranchID']);// Check if the employee exist if ($getCourseBatchListDetails) {
if ($getCourseBatchListDetails)
{
$getCourseBatchListDetails['status'] = REST_Controller::HTTP_OK; $getCourseBatchListDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($getCourseBatchListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($getCourseBatchListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $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
'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 chkStudentExistDetail_post() { public function chkStudentExistDetail_post() {
$data = $this->post('data'); $data = $this->post('data');
$checkData = $this->post('check'); $checkData = $this->post('check');
$checkRes = $this->student_model->check_exist( $data, $checkData );// Check if the employee exist $checkRes = $this->student_model->check_exist($data, $checkData); // Check if the employee exist
if ($checkRes) if ($checkRes) {
{
$checkRes['status'] = REST_Controller::HTTP_OK; $checkRes['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($checkRes, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($checkRes, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
} }
}
public function getExistingStudentDetails_post() { public function getExistingStudentDetails_post() {
$data = $this->post('data'); $data = $this->post('data');
$reqDetails = $this->post('check'); $reqDetails = $this->post('check');
$checkExisRes = $this->student_model->get_exist_stu_details( $data, $reqDetails );// Check if the employee exist $checkExisRes = $this->student_model->get_exist_stu_details($data, $reqDetails); // Check if the employee exist
if ($checkExisRes) if ($checkExisRes) {
{
$checkExisRes['status'] = REST_Controller::HTTP_OK; $checkExisRes['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($checkExisRes, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($checkExisRes, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
// add new course for student // add new course for student
public function insertStudentCourse_post(){ public function insertStudentCourse_post() {
$addStudent = $this->post('addStudent'); $addStudent = $this->post('addStudent');
$coursedata = $this->post('coursedata'); $coursedata = $this->post('coursedata');
$createdBy = $this->post('createdBy'); $createdBy = $this->post('createdBy');
$createdBranch = $this->post('loginBranch'); $createdBranch = $this->post('loginBranch');
$reqCourse['StudentID'] = $addStudent; $reqCourse['StudentID'] = $addStudent;
$reqCourse['UniversityID'] = $coursedata['university']; $reqCourse['UniversityID'] = $coursedata['university'];
$reqCourse['CourseID'] = $coursedata['course']; $reqCourse['CourseID'] = $coursedata['course'];
$reqCourse['SessionID'] = $coursedata['batch']; $reqCourse['SessionID'] = $coursedata['batch'];
$reqCourse['DOJ'] = $coursedata['dateofjoining']; $reqCourse['DOJ'] = $coursedata['dateofjoining'];
$reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; $reqCourse['EnrollmentID'] = $coursedata['enrollmentid'];
$reqCourse['Specilization1'] = $coursedata['specilization1']; $reqCourse['Specilization1'] = $coursedata['specilization1'];
$reqCourse['Specilization2'] = $coursedata['specilization2']; $reqCourse['Specilization2'] = $coursedata['specilization2'];
$reqCourse['BranchID'] = $createdBranch; $reqCourse['BranchID'] = $createdBranch;
$reqCourse['IsActive'] = '1'; $reqCourse['IsActive'] = '1';
$reqCourse['CreatedBy'] = $createdBy; $reqCourse['CreatedBy'] = $createdBy;
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$reqCourse['CreatedOn'] = $date; $reqCourse['CreatedOn'] = $date;
// print_r($reqCourse);exit(); // print_r($reqCourse);exit();
$studentAddCourse = $this->student_model->add_student_course( $addStudent , $reqCourse);// Check if the employee exist $studentAddCourse = $this->student_model->add_student_course($addStudent, $reqCourse); // Check if the employee exist
if ($studentAddCourse) if ($studentAddCourse) {
{
$studentAddCourse['status'] = REST_Controller::HTTP_OK; $studentAddCourse['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentAddCourse, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentAddCourse, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else } else {
{
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
public function insertStudentImg_post() { public function insertStudentImg_post() {
// print_r($this->post('idProof'));exit();
$imagename = $_FILES['idStuProof']['name']; $imagename = $_FILES['idStuProof']['name'];
$size = $_FILES['idStuProof']['size']; $size = $_FILES['idStuProof']['size'];
$imageSource = $_FILES['idStuProof']['tmp_name']; $imageSource = $_FILES['idStuProof']['tmp_name'];
// echo $size;exit();
$temp = $this->post('data'); $temp = $this->post('data');
$tempBranch = $this->post('coursedata'); $tempBranch = $this->post('coursedata');
$data = json_decode($temp, true); $data = json_decode($temp, true);
$coursedata = json_decode($tempBranch, true); $coursedata = json_decode($tempBranch, true);
$createdBy = $this->post('createdBy'); $createdBy = $this->post('createdBy');
$createdBranch = $this->post('loginBranch'); $createdBranch = $this->post('loginBranch');
$req['Firstname'] = $data['firstname']; $req['Firstname'] = $data['firstname'];
$req['Lastname'] = $data['lastname']; $req['Lastname'] = $data['lastname'];
$req['Fathername'] = $data['fathername']; $req['Fathername'] = $data['fathername'];
@ -666,13 +526,10 @@ class Student_Controller extends REST_Controller {
$req['IsActive'] = $data['switchsetting']; $req['IsActive'] = $data['switchsetting'];
$req['Comments'] = $data['Comments']; $req['Comments'] = $data['Comments'];
$req['BranchCode'] = $createdBranch; $req['BranchCode'] = $createdBranch;
$req['DeactiveComments'] = $data['switchsetting'] == 1 ? '' : $data['DeactiveComments'];
$req['DeactiveComments'] = $data['switchsetting'] == 1 ? '': $data['DeactiveComments'];
$req['CreatedBy'] = $createdBy; $req['CreatedBy'] = $createdBy;
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$req['CreatedOn'] = $date; $req['CreatedOn'] = $date;
$reqCourse['UniversityID'] = $coursedata['university']; $reqCourse['UniversityID'] = $coursedata['university'];
$reqCourse['CourseID'] = $coursedata['course']; $reqCourse['CourseID'] = $coursedata['course'];
$reqCourse['SessionID'] = $coursedata['batch']; $reqCourse['SessionID'] = $coursedata['batch'];
@ -680,41 +537,33 @@ class Student_Controller extends REST_Controller {
$reqCourse['BranchID'] = $createdBranch; $reqCourse['BranchID'] = $createdBranch;
$reqCourse['IsActive'] = $data['switchsetting']; $reqCourse['IsActive'] = $data['switchsetting'];
$reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; $reqCourse['EnrollmentID'] = $coursedata['enrollmentid'];
$reqCourse['Specilization1'] = $coursedata['specilization1']; $reqCourse['Specilization1'] = $coursedata['specilization1'];
$reqCourse['Specilization2'] = $coursedata['specilization2']; $reqCourse['Specilization2'] = $coursedata['specilization2'];
$reqCourse['CreatedBy'] = $createdBy; $reqCourse['CreatedBy'] = $createdBy;
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$reqCourse['CreatedOn'] = $date; $reqCourse['CreatedOn'] = $date;
$studentAdd = $this->student_model->add_student($req, $reqCourse, $imagename, $imageSource, $size); // Check if the employee exist
$studentAdd = $this->student_model->add_student( $req , $reqCourse, $imagename, $imageSource, $size);// Check if the employee exist
if ($studentAdd) { if ($studentAdd) {
$studentAdd['status'] = REST_Controller::HTTP_OK; $studentAdd['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else { } else {
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
// add student // add student
public function addStudent_post() { public function addStudent_post() {
$imagename = ''; $imagename = '';
$size = ''; $size = '';
$imageSource = ''; $imageSource = '';
$data = $this->post('data'); $data = $this->post('data');
$coursedata = $this->post('coursedata'); $coursedata = $this->post('coursedata');
$createdBy = $this->post('createdBy'); $createdBy = $this->post('createdBy');
$createdBranch = $this->post('loginBranch'); $createdBranch = $this->post('loginBranch');
$req['Firstname'] = $data['firstname']; $req['Firstname'] = $data['firstname'];
$req['Lastname'] = $data['lastname']; $req['Lastname'] = $data['lastname'];
$req['Fathername'] = $data['fathername']; $req['Fathername'] = $data['fathername'];
@ -742,13 +591,10 @@ class Student_Controller extends REST_Controller {
$req['IsActive'] = $data['switchsetting']; $req['IsActive'] = $data['switchsetting'];
$req['Comments'] = $data['Comments']; $req['Comments'] = $data['Comments'];
$req['BranchCode'] = $createdBranch; $req['BranchCode'] = $createdBranch;
$req['DeactiveComments'] = $data['switchsetting'] == 1 ? '' : $data['DeactiveComments'];
$req['DeactiveComments'] = $data['switchsetting'] == 1 ? '': $data['DeactiveComments'];
$req['CreatedBy'] = $createdBy; $req['CreatedBy'] = $createdBy;
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$req['CreatedOn'] = $date; $req['CreatedOn'] = $date;
$reqCourse['UniversityID'] = $coursedata['university']; $reqCourse['UniversityID'] = $coursedata['university'];
$reqCourse['CourseID'] = $coursedata['course']; $reqCourse['CourseID'] = $coursedata['course'];
$reqCourse['SessionID'] = $coursedata['batch']; $reqCourse['SessionID'] = $coursedata['batch'];
@ -756,28 +602,21 @@ class Student_Controller extends REST_Controller {
$reqCourse['BranchID'] = $createdBranch; $reqCourse['BranchID'] = $createdBranch;
$reqCourse['IsActive'] = $data['switchsetting']; $reqCourse['IsActive'] = $data['switchsetting'];
$reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; $reqCourse['EnrollmentID'] = $coursedata['enrollmentid'];
$reqCourse['Specilization1'] = $coursedata['specilization1']; $reqCourse['Specilization1'] = $coursedata['specilization1'];
$reqCourse['Specilization2'] = $coursedata['specilization2']; $reqCourse['Specilization2'] = $coursedata['specilization2'];
$reqCourse['CreatedBy'] = $createdBy; $reqCourse['CreatedBy'] = $createdBy;
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$reqCourse['CreatedOn'] = $date; $reqCourse['CreatedOn'] = $date;
$studentAdd = $this->student_model->add_student($req, $reqCourse, $imagename, $imageSource, $size); // Check if the employee exist
$studentAdd = $this->student_model->add_student( $req , $reqCourse, $imagename, $imageSource, $size);// Check if the employee exist
if ($studentAdd) { if ($studentAdd) {
$studentAdd['status'] = REST_Controller::HTTP_OK; $studentAdd['status'] = REST_Controller::HTTP_OK;
// Set the response and exit // Set the response and exit
$this->response($studentAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code $this->response($studentAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
} else { } else {
// Set the response and exit // Set the response and exit
$this->response([ $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
'message' => 'No users were found',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
} }
} }
} }

View File

@ -4,24 +4,20 @@
* Time: 5:28 PM * Time: 5:28 PM
*/ */
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
class StatusUpdation_model extends CI_Model {
class StatusUpdation_model extends CI_Model
{
/* /*
* status updation details * status updation details
* params: * params:
* created by kdk * created by kdk
* */ * */
public function get_status_list_code($reqDetails) { public function get_status_list_code($reqDetails) {
if( $reqDetails == 'STUDY_MATERIAL') { if ($reqDetails == 'STUDY_MATERIAL') {
$searchFor = 'M001'; $searchFor = 'M001';
} else if ( $reqDetails == 'APPICATION_STATUS' ) { } else if ($reqDetails == 'APPICATION_STATUS') {
$searchFor = 'A001'; $searchFor = 'A001';
} else if ( $reqDetails == 'CERTIFICATION_STATUS' ) { } else if ($reqDetails == 'CERTIFICATION_STATUS') {
$searchFor = 'C001'; $searchFor = 'C001';
} else if ( $reqDetails == 'ANSWERBOOKLET_STATUS' ) { } else if ($reqDetails == 'ANSWERBOOKLET_STATUS') {
$searchFor = 'B001'; $searchFor = 'B001';
} }
return $searchFor; return $searchFor;
@ -31,18 +27,12 @@ class StatusUpdation_model extends CI_Model
public function get_status_list($reqDetails, $reqBranch) { public function get_status_list($reqDetails, $reqBranch) {
$statusCode = $this->get_status_list_code($reqDetails); $statusCode = $this->get_status_list_code($reqDetails);
$subQuery = "SELECT P.ListCode , P.ListName $subQuery = "SELECT P.ListCode , P.ListName
FROM ".PICK_LIST_DETAILS." as P LEFT JOIN ".DEFAULTACTIVITY." as SM ON SM.StatusCode = P.ListCode FROM " . PICK_LIST_DETAILS . " as P LEFT JOIN " . DEFAULTACTIVITY . " as SM ON SM.StatusCode = P.ListCode
WHERE WHERE
SM.StudentActivityCode = '$statusCode' SM.StudentActivityCode = '$statusCode'
AND SM.BranchCode = '$reqBranch' AND SM.BranchCode = '$reqBranch'
AND SM.IsActive = '1'"; AND SM.IsActive = '1'";
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
// $this->db->select('ListCode, ListName');
// $this->db->order_by('CreatedOn', 'DESC');
// $this->db->from('T_PickListDetails');
// $this->db->where('ListCode', 'S034');
// $staDetails = $this->db->get();
$statusDetails = $queryDetails->result(); $statusDetails = $queryDetails->result();
if (count($statusDetails) > 0) { if (count($statusDetails) > 0) {
$results['statusList'] = true; $results['statusList'] = true;
@ -56,7 +46,6 @@ class StatusUpdation_model extends CI_Model
public function get_couser_name($cours) { public function get_couser_name($cours) {
$this->db->select('t2.CourseName'); $this->db->select('t2.CourseName');
// $this->db->from('' . COURSE_FEES . ' as t1');
$this->db->from('' . COURSE . ' as t2'); $this->db->from('' . COURSE . ' as t2');
$this->db->where('t2.CourseID', $cours); $this->db->where('t2.CourseID', $cours);
$roleDetails = $this->db->get()->first_row(); $roleDetails = $this->db->get()->first_row();
@ -64,10 +53,10 @@ class StatusUpdation_model extends CI_Model
} }
// update Application status // update Application status
public function update_applicationStatus($arr,$reqDetails) { public function update_applicationStatus($arr, $reqDetails) {
$this->db->insert_batch(APPLICATION_STATUS, $arr); $this->db->insert_batch(APPLICATION_STATUS, $arr);
if ($this->db->affected_rows() >= 1) { if ($this->db->affected_rows() >= 1) {
if($this->get_ListCode_status($arr[0]['ListCode'])){ if ($this->get_ListCode_status($arr[0]['ListCode'])) {
$dateToMsg = $arr[0]['AppDate']; $dateToMsg = $arr[0]['AppDate'];
$statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']); $statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']);
$cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']);
@ -75,9 +64,7 @@ class StatusUpdation_model extends CI_Model
$mesg = "Status Update : $cerNamtToMsg $getCourseName - $statuToMsg $dateToMsg."; $mesg = "Status Update : $cerNamtToMsg $getCourseName - $statuToMsg $dateToMsg.";
$this->smssend($arr, $mesg); $this->smssend($arr, $mesg);
} }
// $result['addStatus'] = true; $this->updateDocumentStatusInCallTrack($arr, $reqDetails);
// $result['message'] = "Successfully Certification Status Updated";
$this->updateDocumentStatusInCallTrack($arr,$reqDetails);
$result['addStatus'] = true; $result['addStatus'] = true;
$result['message'] = "Successfully Documents Status Updated"; $result['message'] = "Successfully Documents Status Updated";
} else { } else {
@ -89,21 +76,15 @@ class StatusUpdation_model extends CI_Model
// update certificate stauts // update certificate stauts
public function update_certificateStatus($arr) { public function update_certificateStatus($arr) {
// $this->get_status_name_ListCode($arr[0]['ListCode']);
// $dateToMsg = $arr[0]['CDate'];
// print_r($arr);exit();
// echo $this->get_status_name_ListCode($arr[0]['ListCode']);exit();
$this->db->insert_batch(CERTIFICATION_STATUS, $arr); $this->db->insert_batch(CERTIFICATION_STATUS, $arr);
if ($this->db->affected_rows() >= 1) { if ($this->db->affected_rows() >= 1) {
// if( ($this->get_status_name_ListCode($arr[0]['ListCode']) == 'Received' || 'received' || 'RECEIVED') || ($this->get_status_name_ListCode($arr[0]['ListCode']) == 'Issued' || 'issued' || 'ISSUED')) { if ($this->get_ListCode_status($arr[0]['ListCode'])) {
if($this->get_ListCode_status($arr[0]['ListCode'])){
$dateToMsg = $arr[0]['CDate']; $dateToMsg = $arr[0]['CDate'];
$statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']); $statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']);
// $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); // $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']);
$cerNamtToMsg = 'MARK CARD'; $cerNamtToMsg = 'MARK CARD';
$getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']); $getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']);
$mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg.";
// $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg."; // $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg.";
$this->smssend($arr, $mesg); $this->smssend($arr, $mesg);
} }
@ -117,11 +98,12 @@ class StatusUpdation_model extends CI_Model
} }
// get certificate list // get certificate list
public function get_certificate_list() { public function get_certificate_list($branchId) {
$this->db->select('*'); $this->db->select('*');
$this->db->order_by('CreatedOn', 'DESC'); $this->db->order_by('CreatedOn', 'DESC');
$this->db->from(CERTIFICATION); $this->db->from(CERTIFICATION);
$this->db->where('IsActive', 1); $this->db->where('IsActive', 1);
$this->db->where('BranchCode', $branchId);
$cerfDetails = $this->db->get(); $cerfDetails = $this->db->get();
$certificateDetails = $cerfDetails->result(); $certificateDetails = $cerfDetails->result();
if (count($certificateDetails) > 0) { if (count($certificateDetails) > 0) {
@ -134,7 +116,6 @@ class StatusUpdation_model extends CI_Model
return $results; return $results;
} }
// self function for getting registered mobile for sms // self function for getting registered mobile for sms
public function get_registered_mobile($num) { public function get_registered_mobile($num) {
$this->db->select('MobileNumber'); $this->db->select('MobileNumber');
@ -146,27 +127,23 @@ class StatusUpdation_model extends CI_Model
// self function for getting the status for the LISTCODE // self function for getting the status for the LISTCODE
public function get_ListCode_status($listCode) { public function get_ListCode_status($listCode) {
// print_r ($listCode);exit();
$this->db->select('ListName'); $this->db->select('ListName');
$this->db->from(PICK_LIST_DETAILS); $this->db->from(PICK_LIST_DETAILS);
$this->db->where('ListCode', $listCode); $this->db->where('ListCode', $listCode);
// $this->db->or_like('ListName', 'RECEIVED');
// $this->db->or_like('ListName', 'ISSUED');
$statusDetails = $this->db->get()->first_row(); $statusDetails = $this->db->get()->first_row();
// echo $statusDetails->ListName;exit(); if ($statusDetails->ListName == 'RECEIVED' || $statusDetails->ListName == 'ISSUED') {
if ( $statusDetails->ListName == 'RECEIVED' || $statusDetails->ListName == 'ISSUED') {
return true; return true;
} else { } else {
return false; return false;
} }
} }
public function get_prev_status_list($reqDetailsFor, $reqDetails){ public function get_prev_status_list($reqDetailsFor, $reqDetails) {
if( $reqDetailsFor == 'STUDY_MATERIAL') { if ($reqDetailsFor == 'STUDY_MATERIAL') {
$searchFor = 'M001'; $searchFor = 'M001';
$searchTableFor = STUDY_MATERIAL_STATUS; $searchTableFor = STUDY_MATERIAL_STATUS;
$this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year, t2.ProgramType'); $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year, t2.ProgramType');
$this->db->from(''. $searchTableFor . ' as t1'); $this->db->from('' . $searchTableFor . ' as t1');
$this->db->where('t1.StudentID', $reqDetails['student']); $this->db->where('t1.StudentID', $reqDetails['student']);
$this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT');
$this->db->where('t2.CourseID', $reqDetails['CourseID']); $this->db->where('t2.CourseID', $reqDetails['CourseID']);
@ -183,14 +160,12 @@ class StatusUpdation_model extends CI_Model
$results['preStatusDetails'] = false; $results['preStatusDetails'] = false;
$results['message'] = 'No record found'; $results['message'] = 'No record found';
} }
} else if ( $reqDetailsFor == 'APPICATION_STATUS' ) { } else if ($reqDetailsFor == 'APPICATION_STATUS') {
$searchFor = 'A001'; $searchFor = 'A001';
$searchTableFor = APPLICATION_STATUS; $searchTableFor = APPLICATION_STATUS;
$this->db->select('t1.*, t4.Firstname, t5.ListName, t6.CertificateName'); $this->db->select('t1.*, t4.Firstname, t5.ListName, t6.CertificateName');
$this->db->from(''. $searchTableFor . ' as t1'); $this->db->from('' . $searchTableFor . ' as t1');
$this->db->where('t1.StudentID', $reqDetails['student']); $this->db->where('t1.StudentID', $reqDetails['student']);
// $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT');
// $this->db->where('t2.CourseID', $reqDetails['CourseID']);
$this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT');
$this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT');
$this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT');
@ -205,18 +180,17 @@ class StatusUpdation_model extends CI_Model
$results['preStatusDetails'] = false; $results['preStatusDetails'] = false;
$results['message'] = 'No record found'; $results['message'] = 'No record found';
} }
} else if ( $reqDetailsFor == 'CERTIFICATION_STATUS' ) { } else if ($reqDetailsFor == 'CERTIFICATION_STATUS') {
$searchFor = 'C001'; $searchFor = 'C001';
$searchTableFor = CERTIFICATION_STATUS; $searchTableFor = CERTIFICATION_STATUS;
$this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year, t2.ProgramType'); $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year, t2.ProgramType');
$this->db->from(''. $searchTableFor . ' as t1'); $this->db->from('' . $searchTableFor . ' as t1');
$this->db->where('t1.StudentID', $reqDetails['student']); $this->db->where('t1.StudentID', $reqDetails['student']);
$this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT');
$this->db->where('t2.CourseID', $reqDetails['CourseID']); $this->db->where('t2.CourseID', $reqDetails['CourseID']);
$this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT');
$this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT');
$this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT');
// $this->db->join('' . CERTIFICATION . ' as t6', 't6.CertificationID = t1.CertificationType', 'LEFT');
$this->db->order_by('t1.CreatedOn', 'DESC'); $this->db->order_by('t1.CreatedOn', 'DESC');
$statusDetails = $this->db->get(); $statusDetails = $this->db->get();
$prevStatusDetails = $statusDetails->result(); $prevStatusDetails = $statusDetails->result();
@ -227,11 +201,11 @@ class StatusUpdation_model extends CI_Model
$results['preStatusDetails'] = false; $results['preStatusDetails'] = false;
$results['message'] = 'No record found'; $results['message'] = 'No record found';
} }
} else if ( $reqDetailsFor == 'ANSWERBOOKLET_STATUS' ) { } else if ($reqDetailsFor == 'ANSWERBOOKLET_STATUS') {
$searchFor = 'B001'; $searchFor = 'B001';
$searchTableFor = ANSWER_BOOKLET; $searchTableFor = ANSWER_BOOKLET;
$this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year, t2.ProgramType'); $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year, t2.ProgramType');
$this->db->from(''. $searchTableFor . ' as t1'); $this->db->from('' . $searchTableFor . ' as t1');
$this->db->where('t1.StudentID', $reqDetails['student']); $this->db->where('t1.StudentID', $reqDetails['student']);
$this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT');
$this->db->where('t2.CourseID', $reqDetails['CourseID']); $this->db->where('t2.CourseID', $reqDetails['CourseID']);
@ -270,12 +244,10 @@ class StatusUpdation_model extends CI_Model
} }
// update answer booklet status // update answer booklet status
public function update_answerbooklet($arr,$reqDetails) { public function update_answerbooklet($arr, $reqDetails) {
// print_r($arr);exit();
$this->db->insert_batch(ANSWER_BOOKLET, $arr); $this->db->insert_batch(ANSWER_BOOKLET, $arr);
if ($this->db->affected_rows() >= 1) { if ($this->db->affected_rows() >= 1) {
$this->updateBookletStatusInCallTrack($arr,$reqDetails); $this->updateBookletStatusInCallTrack($arr, $reqDetails);
// $this->smssend($arr);
$result['addStatus'] = true; $result['addStatus'] = true;
$result['message'] = "Successfully Answer Booklet Status Updated"; $result['message'] = "Successfully Answer Booklet Status Updated";
} else { } else {
@ -292,17 +264,13 @@ class StatusUpdation_model extends CI_Model
$this->db->where('ID', $cours); $this->db->where('ID', $cours);
$roleDetails = $this->db->get()->first_row(); $roleDetails = $this->db->get()->first_row();
return "$roleDetails->Sem_Year $roleDetails->CourseName"; return "$roleDetails->Sem_Year $roleDetails->CourseName";
} }
// update study material status // update study material status
public function update_semyear($arr) { public function update_semyear($arr) {
// echo $cours;exit();
// $this->get_status_name_ListCode($arr[0]['ListCode']);
$this->db->insert_batch(STUDY_MATERIAL_STATUS, $arr); $this->db->insert_batch(STUDY_MATERIAL_STATUS, $arr);
if ($this->db->affected_rows() >= 1) { if ($this->db->affected_rows() >= 1) {
// if(($this->get_status_name_ListCode($arr[0]['ListCode']) == 'Received' || 'received' || 'Active') || ($this->get_status_name_ListCode($arr[0]['ListCode']) == 'Issued' || 'issued')) { if ($this->get_ListCode_status($arr[0]['ListCode']) == true) {
if($this->get_ListCode_status($arr[0]['ListCode']) == true) {
$dateToMsg = $arr[0]['SDate']; $dateToMsg = $arr[0]['SDate'];
$statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']); $statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']);
$cerNamtToMsg = 'Study Material'; $cerNamtToMsg = 'Study Material';
@ -310,7 +278,6 @@ class StatusUpdation_model extends CI_Model
$mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg.";
$this->smssend($arr, $mesg); $this->smssend($arr, $mesg);
} }
// $this->smssend($arr);
$result['addStatus'] = true; $result['addStatus'] = true;
$result['message'] = "Successfully Study Material Status Updated"; $result['message'] = "Successfully Study Material Status Updated";
} else { } else {
@ -322,13 +289,11 @@ class StatusUpdation_model extends CI_Model
// get sem/Year for the course // get sem/Year for the course
public function get_semyear_result($reqData, $stuFor, $reqBranch) { public function get_semyear_result($reqData, $stuFor, $reqBranch) {
// echo $stuFor;exit();
$subQuery = "SELECT CF.Sem_Year, CF.ID , IF(CF.ProgramType = 'Y001', '0', '1') as SEM_YEAR_TYPE $subQuery = "SELECT CF.Sem_Year, CF.ID , IF(CF.ProgramType = 'Y001', '0', '1') as SEM_YEAR_TYPE
FROM ".COURSE_FEES." as CF LEFT JOIN ".STUDENTS_FEES_STATUS." as SFS ON SFS.FeesType = CF.ID FROM " . COURSE_FEES . " as CF LEFT JOIN " . STUDENTS_FEES_STATUS . " as SFS ON SFS.FeesType = CF.ID
WHERE WHERE
SFS.CourseID = '$reqData' SFS.CourseID = '$reqData'
AND SFS.StudentID = '$stuFor'"; AND SFS.StudentID = '$stuFor'";
// AND CF.ProgramType ='Y001'";
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
$results['semYearResult'] = true; $results['semYearResult'] = true;
$results['semYear_result_details'] = $queryDetails->result(); $results['semYear_result_details'] = $queryDetails->result();
@ -337,156 +302,114 @@ class StatusUpdation_model extends CI_Model
// get serach result // get serach result
public function get_search_result($reqData, $req) { public function get_search_result($reqData, $req) {
// print_r($reqData['University']);
// print_r($req);
// exit();
$University = $reqData['University']; $University = $reqData['University'];
$Course = $reqData['Course']; $Course = $reqData['Course'];
$Batch = $reqData['Batch']; $Batch = $reqData['Batch'];
$branch = $req['localBranchID']; $branch = $req['localBranchID'];
if( $branch == 'All' ) { if ($branch == 'All') {
if ($University != '' && $Course == '' && $Batch == '') {
// echo $University;
// echo $branch
if($University != '' && $Course == '' && $Batch == '') {
$subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName
FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON
SC.CourseID = C.CourseID SC.CourseID = C.CourseID
WHERE WHERE
SC.UniversityID = '$University' SC.UniversityID = '$University'
AND S.IsActive = '1' AND S.IsActive = '1'
AND SC.IsActive = '1'"; AND SC.IsActive = '1'";
// AND S.BranchCode = '$branch'
// SC.UniversityID LIKE '%$University%'
// AND SC.CourseID LIKE '%$Course%'
// AND SC.BatchCode LIKE '%$Batch%'
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
$results['searchResult'] = true; $results['searchResult'] = true;
$results['search_result_details'] = $queryDetails->result(); $results['search_result_details'] = $queryDetails->result();
} else if ($University != '' && $Course != '' && $Batch == '' ) { } else if ($University != '' && $Course != '' && $Batch == '') {
$subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName
FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON
SC.CourseID = C.CourseID SC.CourseID = C.CourseID
WHERE WHERE
SC.CourseID = '$Course' AND SC.UniversityID = '$University' SC.CourseID = '$Course' AND SC.UniversityID = '$University'
AND S.IsActive = '1' AND S.IsActive = '1'
AND SC.IsActive = '1'"; AND SC.IsActive = '1'";
// AND S.BranchCode = '$branch'
// SC.UniversityID LIKE '%$University%'
// AND SC.CourseID LIKE '%$Course%'
// AND SC.BatchCode LIKE '%$Batch%'
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
$results['searchResult'] = true; $results['searchResult'] = true;
$results['search_result_details'] = $queryDetails->result(); $results['search_result_details'] = $queryDetails->result();
} else if ( $University != '' && $Course == '' && $Batch != '' ) { } else if ($University != '' && $Course == '' && $Batch != '') {
$subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName ,C.CourseCode, U.UniversityName $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName ,C.CourseCode, U.UniversityName
FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON
SC.CourseID = C.CourseID SC.CourseID = C.CourseID
LEFT JOIN ".STUDENTS_FEES_STATUS." as SFS ON SFS.StudentID = SC.StudentID LEFT JOIN " . STUDENTS_FEES_STATUS . " as SFS ON SFS.StudentID = SC.StudentID
WHERE SFS.CourseID = SC.CourseID AND WHERE SFS.CourseID = SC.CourseID AND
SFS.BatchCode = '$Batch' AND SC.UniversityID = '$University' SFS.BatchCode = '$Batch' AND SC.UniversityID = '$University'
AND S.IsActive = '1' AND S.IsActive = '1'
AND SC.IsActive = '1'"; AND SC.IsActive = '1'";
// AND S.BranchCode = '$branch'
// SC.UniversityID LIKE '%$University%'
// AND SC.CourseID LIKE '%$Course%'
// AND SC.BatchCode LIKE '%$Batch%'
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
$results['searchResult'] = true; $results['searchResult'] = true;
$results['search_result_details'] = $queryDetails->result(); $results['search_result_details'] = $queryDetails->result();
}else if ( $University != '' && $Course != '' && $Batch != '' ) { } else if ($University != '' && $Course != '' && $Batch != '') {
$subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName ,C.CourseCode, U.UniversityName $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName ,C.CourseCode, U.UniversityName
FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON
SC.CourseID = C.CourseID SC.CourseID = C.CourseID
LEFT JOIN ".STUDENTS_FEES_STATUS." as SFS ON SFS.StudentID = SC.StudentID LEFT JOIN " . STUDENTS_FEES_STATUS . " as SFS ON SFS.StudentID = SC.StudentID
WHERE SFS.CourseID = SC.CourseID AND WHERE SFS.CourseID = SC.CourseID AND
SFS.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University' SFS.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University'
AND S.IsActive = '1' AND S.IsActive = '1'
AND SC.IsActive = '1'"; AND SC.IsActive = '1'";
// AND S.BranchCode = '$branch'
// SC.UniversityID LIKE '%$University%'
// AND SC.CourseID LIKE '%$Course%'
// AND SC.BatchCode LIKE '%$Batch%'
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
$results['searchResult'] = true; $results['searchResult'] = true;
$results['search_result_details'] = $queryDetails->result(); $results['search_result_details'] = $queryDetails->result();
} }
} else { } else {
// echo $University; if ($University != '' && $Course == '' && $Batch == '') {
// echo $branch;
if($University != '' && $Course == '' && $Batch == '') {
$subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName
FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode LEFT JOIN ".COURSE." as C ON LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode LEFT JOIN " . COURSE . " as C ON
SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
WHERE WHERE
SC.UniversityID = '$University' SC.UniversityID = '$University'
AND S.IsActive = '1' AND S.IsActive = '1'
AND SC.BranchID = '$branch' AND SC.BranchID = '$branch'
AND SC.IsActive = '1'"; AND SC.IsActive = '1'";
// AND S.BranchCode = '$branch'
// SC.UniversityID LIKE '%$University%'
// AND SC.CourseID LIKE '%$Course%'
// AND SC.BatchCode LIKE '%$Batch%'
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
$results['searchResult'] = true; $results['searchResult'] = true;
$results['search_result_details'] = $queryDetails->result(); $results['search_result_details'] = $queryDetails->result();
} else if ($University != '' && $Course != '' && $Batch == '' ) { } else if ($University != '' && $Course != '' && $Batch == '') {
$subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName
FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode LEFT JOIN ".COURSE." as C ON LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode LEFT JOIN " . COURSE . " as C ON
SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
WHERE WHERE
SC.CourseID = '$Course' AND SC.UniversityID = '$University' SC.CourseID = '$Course' AND SC.UniversityID = '$University'
AND S.IsActive = '1' AND S.IsActive = '1'
AND SC.BranchID = '$branch' AND SC.BranchID = '$branch'
AND SC.IsActive = '1'"; AND SC.IsActive = '1'";
// AND S.BranchCode = '$branch'
// SC.UniversityID LIKE '%$University%'
// AND SC.CourseID LIKE '%$Course%'
// AND SC.BatchCode LIKE '%$Batch%'
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
$results['searchResult'] = true; $results['searchResult'] = true;
$results['search_result_details'] = $queryDetails->result(); $results['search_result_details'] = $queryDetails->result();
} else if ( $University != '' && $Course == '' && $Batch != '' ) { } else if ($University != '' && $Course == '' && $Batch != '') {
$subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName ,C.CourseCode, U.UniversityName $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName ,C.CourseCode, U.UniversityName
FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode
LEFT JOIN ".COURSE." as C ON C.CourseID = SC.CourseID AND SC.BranchID = C.BranchCode LEFT JOIN " . COURSE . " as C ON C.CourseID = SC.CourseID AND SC.BranchID = C.BranchCode
LEFT JOIN ".STUDENTS_FEES_STATUS." as SFS ON SFS.StudentID = SC.StudentID AND SC.BranchID = SFS.BranchCode LEFT JOIN " . STUDENTS_FEES_STATUS . " as SFS ON SFS.StudentID = SC.StudentID AND SC.BranchID = SFS.BranchCode
WHERE SFS.CourseID = SC.CourseID AND WHERE SFS.CourseID = SC.CourseID AND
SFS.BatchCode = '$Batch' AND SC.UniversityID = '$University' SFS.BatchCode = '$Batch' AND SC.UniversityID = '$University'
AND S.IsActive = '1' AND S.IsActive = '1'
AND SC.BranchID = '$branch' AND SC.BranchID = '$branch'
AND SC.IsActive = '1'"; AND SC.IsActive = '1'";
// AND S.BranchCode = '$branch'
// SC.UniversityID LIKE '%$University%'
// AND SC.CourseID LIKE '%$Course%'
// AND SC.BatchCode LIKE '%$Batch%'
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
$results['searchResult'] = true; $results['searchResult'] = true;
$results['search_result_details'] = $queryDetails->result(); $results['search_result_details'] = $queryDetails->result();
} else if ( $University != '' && $Course != '' && $Batch != '' ) { } else if ($University != '' && $Course != '' && $Batch != '') {
$subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName
FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode LEFT JOIN ".COURSE." as C ON LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode LEFT JOIN " . COURSE . " as C ON
SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
LEFT JOIN ".STUDENTS_FEES_STATUS." as SFS ON SFS.StudentID = SC.StudentID AND SC.BranchID = SFS.BranchCode LEFT JOIN " . STUDENTS_FEES_STATUS . " as SFS ON SFS.StudentID = SC.StudentID AND SC.BranchID = SFS.BranchCode
WHERE SFS.CourseID = SC.CourseID AND WHERE SFS.CourseID = SC.CourseID AND
SFS.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University' SFS.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University'
AND S.IsActive = '1' AND S.IsActive = '1'
AND SC.BranchID = '$branch' AND SC.BranchID = '$branch'
AND SC.IsActive = '1'"; AND SC.IsActive = '1'";
// AND S.BranchCode = '$branch'
// SC.UniversityID LIKE '%$University%'
// AND SC.CourseID LIKE '%$Course%'
// AND SC.BatchCode LIKE '%$Batch%'
$queryDetails = $this->db->query($subQuery); $queryDetails = $this->db->query($subQuery);
$results['searchResult'] = true; $results['searchResult'] = true;
$results['search_result_details'] = $queryDetails->result(); $results['search_result_details'] = $queryDetails->result();
@ -499,44 +422,34 @@ class StatusUpdation_model extends CI_Model
public function get_university_course_batch($branch) { public function get_university_course_batch($branch) {
$this->db->select('t1.UniversityID, t1.UniversityName'); $this->db->select('t1.UniversityID, t1.UniversityName');
$this->db->order_by('CreatedOn', 'DESC'); $this->db->order_by('CreatedOn', 'DESC');
$this->db->from(''.UNIVERSITY. ' as t1'); $this->db->from('' . UNIVERSITY . ' as t1');
$this->db->where('BranchCode', $branch); $this->db->where('BranchCode', $branch);
$this->db->where('IsActive', 1); $this->db->where('IsActive', 1);
// $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT');
$univDetails = $this->db->get(); $univDetails = $this->db->get();
$universityDetails = $univDetails->result(); $universityDetails = $univDetails->result();
$endResult = []; $endResult = [];
foreach($universityDetails as $clip){ foreach ($universityDetails as $clip) {
// University Details // University Details
$resultArr['UniversityID'] = $clip->UniversityID; $resultArr['UniversityID'] = $clip->UniversityID;
$resultArr['UniversityName'] = $clip->UniversityName; $resultArr['UniversityName'] = $clip->UniversityName;
// Course Details // Course Details
$this->db->select('t2.CourseID, t2.CourseName, t2.CourseCode'); $this->db->select('t2.CourseID, t2.CourseName, t2.CourseCode');
$this->db->from(''.COURSE. ' as t2'); $this->db->from('' . COURSE . ' as t2');
$this->db->where('t2.UniversityID', $clip->UniversityID); $this->db->where('t2.UniversityID', $clip->UniversityID);
$this->db->where('t2.IsActive', 1); $this->db->where('t2.IsActive', 1);
$this->db->where('BranchCode', $branch); $this->db->where('t2.BranchCode', $branch);
$courDetails = $this->db->get(); $courDetails = $this->db->get();
$courseDetails = $courDetails->result(); $courseDetails = $courDetails->result();
$resultArr['Course'] =$courseDetails; $resultArr['Course'] = $courseDetails;
// Batch Details // Batch Details
$this->db->select('t3.BatchName, t3.BatchCode'); $this->db->select('t3.BatchName, t3.BatchCode');
$this->db->from(''.BATCH. ' as t3'); $this->db->from('' . BATCH . ' as t3');
$this->db->where('t3.UniversityID', $clip->UniversityID); $this->db->where('t3.UniversityID', $clip->UniversityID);
$this->db->where('t3.IsActive', 1); $this->db->where('t3.IsActive', 1);
$this->db->where('BranchCode', $branch); $this->db->where('t3.BranchCode', $branch);
//Session Details
// $this->db->select('B.SessionID, B.SessionName');
// $this->db->from(SESSIONMASTER . ' as B');
// $this->db->join(SESSIONDETAILS . ' SD', 'SD.SessionID = B.SessionID');
// $this->db->where('SD.UniversityID', $clip->UniversityID);
// $this->db->where('B.IsActive', 1);
// $this->db->where('SD.IsActive', 1);
$batDetails = $this->db->get(); $batDetails = $this->db->get();
$batchDetails = $batDetails->result(); $batchDetails = $batDetails->result();
$resultArr['Batch'] =$batchDetails; $resultArr['Batch'] = $batchDetails;
array_push($endResult, $resultArr); array_push($endResult, $resultArr);
} }
$results['univList'] = true; $results['univList'] = true;
@ -544,31 +457,22 @@ class StatusUpdation_model extends CI_Model
return $results; return $results;
} }
// http://www.24x7sms.com/downloads/24X7SMS_http_API2.0.pdf // http://www.24x7sms.com/downloads/24X7SMS_http_API2.0.pdf
// API Key : xegCdYUIMf3 // API Key : xegCdYUIMf3
// Your new password for logging into Apollo student portal is (Password). Please change the password as soon as you login. // Your new password for logging into Apollo student portal is (Password). Please change the password as soon as you login.
// This is the template to be used. // This is the template to be used.
public function smssend($arr, $msg) public function smssend($arr, $msg) {
{ $number = array();
$number =array(); foreach ($arr as $ar) {
foreach($arr as $ar){
$mobi = $this->get_registered_mobile($ar['StudentID']); $mobi = $this->get_registered_mobile($ar['StudentID']);
array_push($number, "91$mobi"); array_push($number, "91$mobi");
} }
$mobile = implode(',', $number); $mobile = implode(',', $number);
// $message ="Your new password for logging into Apollo student portal is SAMPLE. Please change the password as soon as you login.";
// $mobile = "91$mobile";
$message = urlencode($msg); $message = urlencode($msg);
// echo $mobile , $message; $ch = curl_init();
$ch=curl_init(); curl_setopt($ch, CURLOPT_URL, "https://smsapi.24x7sms.com/api_2.0/SendSMS.aspx?APIKEY=xegCdYUIMf3&MobileNo=" . $mobile . "&SenderID=APOLLO&Message=" . $message . "&ServiceName=TEMPLATE_BASED");
curl_setopt($ch,CURLOPT_URL,"https://smsapi.24x7sms.com/api_2.0/SendSMS.aspx?APIKEY=xegCdYUIMf3&MobileNo=".$mobile."&SenderID=APOLLO&Message=".$message."&ServiceName=TEMPLATE_BASED");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$output =curl_exec($ch); $output = curl_exec($ch);
// print_r($output);exit();
curl_close($ch); curl_close($ch);
return $output; return $output;
} }
@ -576,7 +480,6 @@ class StatusUpdation_model extends CI_Model
// public function mailsend() { // public function mailsend() {
// //Load email library // //Load email library
// $this->load->library('email'); // $this->load->library('email');
// //SMTP & mail configuration // //SMTP & mail configuration
// $config = array( // $config = array(
// 'protocol' => 'smtp', // 'protocol' => 'smtp',
@ -590,87 +493,74 @@ class StatusUpdation_model extends CI_Model
// $this->email->initialize($config); // $this->email->initialize($config);
// $this->email->set_mailtype("html"); // $this->email->set_mailtype("html");
// $this->email->set_newline("\r\n"); // $this->email->set_newline("\r\n");
// //Email content // //Email content
// $htmlContent = '<h1>Sending email via SMTP server</h1>'; // $htmlContent = '<h1>Sending email via SMTP server</h1>';
// $htmlContent .= '<p>This email has sent via SMTP server from CodeIgniter application.</p>'; // $htmlContent .= '<p>This email has sent via SMTP server from CodeIgniter application.</p>';
// // Email body load the html template // // Email body load the html template
// // $body = $this->load->view('emails/anillabs.php',$data,TRUE); // // $body = $this->load->view('emails/anillabs.php',$data,TRUE);
// $this->email->to('recipient@example.com'); // $this->email->to('recipient@example.com');
// $this->email->from('sender@example.com','MyWebsite'); // $this->email->from('sender@example.com','MyWebsite');
// $this->email->subject('How to send email via SMTP server in CodeIgniter'); // $this->email->subject('How to send email via SMTP server in CodeIgniter');
// $this->email->message($htmlContent); // $this->email->message($htmlContent);
// //Send email // //Send email
// $this->email->send(); // $this->email->send();
// } // }
/* /*
* update followup details for booklet details in call tracking * update followup details for booklet details in call tracking
* created by kms * created by kms
* */ * */
public function updateBookletStatusInCallTrack($fromDetails=null,$reqDetails=null){ public function updateBookletStatusInCallTrack($fromDetails = null, $reqDetails = null) {
// get student details // get student details
$this->db->select('PLD.ListCode'); $this->db->select('PLD.ListCode');
$this->db->from(PICK_LIST_DETAILS.' as PLD'); $this->db->from(PICK_LIST_DETAILS . ' as PLD');
$this->db->where('PLD.ListName','ISSUED TO STUDENTS'); $this->db->where('PLD.ListName', 'ISSUED TO STUDENTS');
$this->db->where('PLD.ListCode',$fromDetails[0]['ListCode']); $this->db->where('PLD.ListCode', $fromDetails[0]['ListCode']);
$this->db->where('PLD.IsActive','1'); $this->db->where('PLD.IsActive', '1');
$checkStatus=$this->db->get()->last_row(); $checkStatus = $this->db->get()->last_row();
if($checkStatus){ if ($checkStatus) {
$studentDetails = $this->studentInfo($fromDetails); $studentDetails = $this->studentInfo($fromDetails);
if($studentDetails){ if ($studentDetails) {
$arrayDetails['MobileNumber']=$studentDetails->MobileNumber; $arrayDetails['MobileNumber'] = $studentDetails->MobileNumber;
$arrayDetails['LeadName']=$studentDetails->Firstname; $arrayDetails['LeadName'] = $studentDetails->Firstname;
$arrayDetails['University']=$studentDetails->UniversityName; $arrayDetails['University'] = $studentDetails->UniversityName;
$arrayDetails['Course']=$studentDetails->CourseName; $arrayDetails['Course'] = $studentDetails->CourseName;
$arrayDetails['StatusCode']=$fromDetails[0]['ListCode']; $arrayDetails['StatusCode'] = $fromDetails[0]['ListCode'];
$arrayDetails['CreatedBranch']=$fromDetails[0]['BranchCode']; $arrayDetails['CreatedBranch'] = $fromDetails[0]['BranchCode'];
$arrayDetails['CreatedOn']=$fromDetails[0]['CreatedOn']; $arrayDetails['CreatedOn'] = $fromDetails[0]['CreatedOn'];
$arrayDetails['FollowupOn']=$fromDetails[0]['AnsDate']; $arrayDetails['FollowupOn'] = $fromDetails[0]['AnsDate'];
$arrayDetails['FollowupComments']=$fromDetails[0]['Comments']; $arrayDetails['FollowupComments'] = $fromDetails[0]['Comments'];
if($reqDetails['localType']==SUPER_ADMIN){ if ($reqDetails['localType'] == SUPER_ADMIN) {
$this->db->select('LO.ID'); $this->db->select('LO.ID');
$this->db->from(STAFF_BRANCH.' as STB'); $this->db->from(STAFF_BRANCH . ' as STB');
$this->db->join(LOGIN.' as LO', 'LO.StaffID = STB.StaffID'); $this->db->join(LOGIN . ' as LO', 'LO.StaffID = STB.StaffID');
$this->db->where('STB.BranchCode',$fromDetails[0]['BranchCode']); $this->db->where('STB.BranchCode', $fromDetails[0]['BranchCode']);
$this->db->where('LO.ListCode',ADMIN); $this->db->where('LO.ListCode', ADMIN);
$this->db->where('STB.IsActive','1'); $this->db->where('STB.IsActive', '1');
$this->db->where('LO.IsActive','1'); $this->db->where('LO.IsActive', '1');
$assignDet=$this->db->get()->last_row(); $assignDet = $this->db->get()->last_row();
if($assignDet){ if ($assignDet) {
$arrayDetails['CreatedBy']=$assignDet->ID; $arrayDetails['CreatedBy'] = $assignDet->ID;
} else {
$arrayDetails['CreatedBy'] = $fromDetails[0]['CreatedBy'];
} }
else{ } else {
$arrayDetails['CreatedBy']=$fromDetails[0]['CreatedBy']; $arrayDetails['CreatedBy'] = $fromDetails[0]['CreatedBy'];
} }
}
else{
$arrayDetails['CreatedBy']=$fromDetails[0]['CreatedBy'];
}
// create activity in call tracking // create activity in call tracking
$this->db->select('ActivityID,ActivityName'); $this->db->select('ActivityID,ActivityName');
$this->db->like('ActivityName', 'Answer Booklet', 'after'); $this->db->like('ActivityName', 'Answer Booklet', 'after');
$this->db->where('IsActive', '1'); $this->db->where('IsActive', '1');
$activityDetails=$this->db->get(ACTIVITY)->last_row(); $activityDetails = $this->db->get(ACTIVITY)->last_row();
if($activityDetails){ if ($activityDetails) {
$newLeadDetails['MobileNumber'] = $arrayDetails['MobileNumber']; $newLeadDetails['MobileNumber'] = $arrayDetails['MobileNumber'];
$newLeadDetails['LeadName'] = $arrayDetails['LeadName']; $newLeadDetails['LeadName'] = $arrayDetails['LeadName'];
$newLeadDetails['CreatedBy'] = $arrayDetails['CreatedBy']; $newLeadDetails['CreatedBy'] = $arrayDetails['CreatedBy'];
$newLeadDetails['CreatedOn'] = $arrayDetails['CreatedOn']; $newLeadDetails['CreatedOn'] = $arrayDetails['CreatedOn'];
$this->db->insert(LEAD_DETAILS, $newLeadDetails); $this->db->insert(LEAD_DETAILS, $newLeadDetails);
// this if for insert lead details // this if for insert lead details
if($this->db->affected_rows() == '1'){ if ($this->db->affected_rows() == '1') {
// get and store insert id from db // get and store insert id from db
$track_Details['LeadID']=$this->db->insert_id(); $track_Details['LeadID'] = $this->db->insert_id();
$track_Details['ActivityStatus'] = $activityDetails->ActivityID; $track_Details['ActivityStatus'] = $activityDetails->ActivityID;
$track_Details['University'] = $arrayDetails['University']; $track_Details['University'] = $arrayDetails['University'];
$track_Details['Course'] = $arrayDetails['Course']; $track_Details['Course'] = $arrayDetails['Course'];
@ -678,25 +568,21 @@ class StatusUpdation_model extends CI_Model
$track_Details['StatusCode'] = $arrayDetails['StatusCode']; $track_Details['StatusCode'] = $arrayDetails['StatusCode'];
$track_Details['CreatedBy'] = $arrayDetails['CreatedBy']; $track_Details['CreatedBy'] = $arrayDetails['CreatedBy'];
$track_Details['CreatedOn'] = $arrayDetails['CreatedOn']; $track_Details['CreatedOn'] = $arrayDetails['CreatedOn'];
$track_Details['CreatedBranch']=$arrayDetails['CreatedBranch']; $track_Details['CreatedBranch'] = $arrayDetails['CreatedBranch'];
$this->db->insert(LEAD_TRACKING, $track_Details); $this->db->insert(LEAD_TRACKING, $track_Details);
// this if for insert tracking details // this if for insert tracking details
if($this->db->affected_rows() == '1'){ if ($this->db->affected_rows() == '1') {
$insertfollowup_Details['TrackingID']=$this->db->insert_id(); $insertfollowup_Details['TrackingID'] = $this->db->insert_id();
$insertfollowup_Details['FollowupOn']=$arrayDetails['FollowupOn']; $insertfollowup_Details['FollowupOn'] = $arrayDetails['FollowupOn'];
$insertfollowup_Details['FollowupComments']=$arrayDetails['FollowupComments']; $insertfollowup_Details['FollowupComments'] = $arrayDetails['FollowupComments'];
$insertfollowup_Details['CreatedBy'] = $arrayDetails['CreatedBy']; $insertfollowup_Details['CreatedBy'] = $arrayDetails['CreatedBy'];
$insertfollowup_Details['CreatedOn'] = $arrayDetails['CreatedOn']; $insertfollowup_Details['CreatedOn'] = $arrayDetails['CreatedOn'];
$this->db->insert(LEAD_TRACKING_FOLLOWUP, $insertfollowup_Details); $this->db->insert(LEAD_TRACKING_FOLLOWUP, $insertfollowup_Details);
// this if for insert follow up details // this if for insert follow up details
} }
} }
// hide tracking updated code // hide tracking updated code
/*$this->db->select('LD.LeadID,LT.TrackingID'); /*$this->db->select('LD.LeadID,LT.TrackingID');
$this->db->from(LEAD_DETAILS.' as LD'); $this->db->from(LEAD_DETAILS.' as LD');
$this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID');
@ -795,90 +681,77 @@ class StatusUpdation_model extends CI_Model
}*/ }*/
} }
} }
return true; return true;
} } else {
else{
return false; return false;
} }
} }
/* /*
* update followup details for application status in call tracking * update followup details for application status in call tracking
* created by kms * created by kms
* */ * */
public function updateDocumentStatusInCallTrack($fromDetails=null,$reqDetails=null){ public function updateDocumentStatusInCallTrack($fromDetails = null, $reqDetails = null) {
// check certificate type // check certificate type
$this->db->select('CFM.CertificationID'); $this->db->select('CFM.CertificationID');
$this->db->from(CERTIFICATION_MASTER.' as CFM'); $this->db->from(CERTIFICATION_MASTER . ' as CFM');
$this->db->where('CFM.CertificateName','APPLICATION'); $this->db->where('CFM.CertificateName', 'APPLICATION');
$this->db->where('CFM.CertificationID',$fromDetails[0]['CertificationType']); $this->db->where('CFM.CertificationID', $fromDetails[0]['CertificationType']);
$this->db->where('CFM.IsActive','1'); $this->db->where('CFM.IsActive', '1');
$checkApplicationStatus=$this->db->get()->last_row(); $checkApplicationStatus = $this->db->get()->last_row();
if($checkApplicationStatus){ if ($checkApplicationStatus) {
// get student details // get student details
$this->db->select('PLD.ListCode'); $this->db->select('PLD.ListCode');
$this->db->from(PICK_LIST_DETAILS.' as PLD'); $this->db->from(PICK_LIST_DETAILS . ' as PLD');
$this->db->where('PLD.ListName','PENDING'); $this->db->where('PLD.ListName', 'PENDING');
$this->db->where('PLD.ListCode',$fromDetails[0]['ListCode']); $this->db->where('PLD.ListCode', $fromDetails[0]['ListCode']);
$this->db->where('PLD.IsActive','1'); $this->db->where('PLD.IsActive', '1');
$checkStatus=$this->db->get()->last_row(); $checkStatus = $this->db->get()->last_row();
if($checkStatus){ if ($checkStatus) {
$studentDetails = $this->studentInfoForDocumentStatus($fromDetails); $studentDetails = $this->studentInfoForDocumentStatus($fromDetails);
if($studentDetails){ if ($studentDetails) {
$arrayDetails['MobileNumber']=$studentDetails->MobileNumber; $arrayDetails['MobileNumber'] = $studentDetails->MobileNumber;
$arrayDetails['LeadName']=$studentDetails->Firstname; $arrayDetails['LeadName'] = $studentDetails->Firstname;
$arrayDetails['University']=$studentDetails->UniversityName; $arrayDetails['University'] = $studentDetails->UniversityName;
$arrayDetails['Course']=$studentDetails->CourseName; $arrayDetails['Course'] = $studentDetails->CourseName;
$arrayDetails['StatusCode']=$fromDetails[0]['ListCode']; $arrayDetails['StatusCode'] = $fromDetails[0]['ListCode'];
$arrayDetails['CreatedBranch']=$fromDetails[0]['BranchCode']; $arrayDetails['CreatedBranch'] = $fromDetails[0]['BranchCode'];
$arrayDetails['CreatedOn']=$fromDetails[0]['CreatedOn']; $arrayDetails['CreatedOn'] = $fromDetails[0]['CreatedOn'];
$arrayDetails['FollowupOn']=$fromDetails[0]['AppDate']; $arrayDetails['FollowupOn'] = $fromDetails[0]['AppDate'];
$arrayDetails['FollowupComments']=$fromDetails[0]['Comments']; $arrayDetails['FollowupComments'] = $fromDetails[0]['Comments'];
if($reqDetails['localType']==SUPER_ADMIN){ if ($reqDetails['localType'] == SUPER_ADMIN) {
$this->db->select('LO.ID'); $this->db->select('LO.ID');
$this->db->from(STAFF_BRANCH.' as STB'); $this->db->from(STAFF_BRANCH . ' as STB');
$this->db->join(LOGIN.' as LO', 'LO.StaffID = STB.StaffID'); $this->db->join(LOGIN . ' as LO', 'LO.StaffID = STB.StaffID');
$this->db->where('STB.BranchCode',$fromDetails[0]['BranchCode']); $this->db->where('STB.BranchCode', $fromDetails[0]['BranchCode']);
$this->db->where('LO.ListCode',ADMIN); $this->db->where('LO.ListCode', ADMIN);
$this->db->where('STB.IsActive','1'); $this->db->where('STB.IsActive', '1');
$this->db->where('LO.IsActive','1'); $this->db->where('LO.IsActive', '1');
$assignDet=$this->db->get()->last_row(); $assignDet = $this->db->get()->last_row();
if($assignDet){ if ($assignDet) {
$arrayDetails['CreatedBy']=$assignDet->ID; $arrayDetails['CreatedBy'] = $assignDet->ID;
} else {
$arrayDetails['CreatedBy'] = $fromDetails[0]['CreatedBy'];
} }
else{ } else {
$arrayDetails['CreatedBy']=$fromDetails[0]['CreatedBy']; $arrayDetails['CreatedBy'] = $fromDetails[0]['CreatedBy'];
} }
}
else{
$arrayDetails['CreatedBy']=$fromDetails[0]['CreatedBy'];
}
// create activity in call tracking // create activity in call tracking
$this->db->select('ActivityID,ActivityName'); $this->db->select('ActivityID,ActivityName');
$this->db->like('ActivityName', 'Application', 'after'); $this->db->like('ActivityName', 'Application', 'after');
$this->db->where('IsActive', '1'); $this->db->where('IsActive', '1');
$activityDetails=$this->db->get(ACTIVITY)->last_row(); $activityDetails = $this->db->get(ACTIVITY)->last_row();
if($activityDetails){ if ($activityDetails) {
$newLeadDetails['MobileNumber'] = $arrayDetails['MobileNumber']; $newLeadDetails['MobileNumber'] = $arrayDetails['MobileNumber'];
$newLeadDetails['LeadName'] = $arrayDetails['LeadName']; $newLeadDetails['LeadName'] = $arrayDetails['LeadName'];
$newLeadDetails['CreatedBy'] = $arrayDetails['CreatedBy']; $newLeadDetails['CreatedBy'] = $arrayDetails['CreatedBy'];
$newLeadDetails['CreatedOn'] = $arrayDetails['CreatedOn']; $newLeadDetails['CreatedOn'] = $arrayDetails['CreatedOn'];
$this->db->insert(LEAD_DETAILS, $newLeadDetails); $this->db->insert(LEAD_DETAILS, $newLeadDetails);
// this if for insert lead details // this if for insert lead details
if($this->db->affected_rows() == '1'){ if ($this->db->affected_rows() == '1') {
// get and store insert id from db // get and store insert id from db
$track_Details['LeadID']=$this->db->insert_id(); $track_Details['LeadID'] = $this->db->insert_id();
$track_Details['ActivityStatus'] = $activityDetails->ActivityID; $track_Details['ActivityStatus'] = $activityDetails->ActivityID;
$track_Details['University'] = $arrayDetails['University']; $track_Details['University'] = $arrayDetails['University'];
$track_Details['Course'] = $arrayDetails['Course']; $track_Details['Course'] = $arrayDetails['Course'];
@ -886,25 +759,21 @@ class StatusUpdation_model extends CI_Model
$track_Details['StatusCode'] = $arrayDetails['StatusCode']; $track_Details['StatusCode'] = $arrayDetails['StatusCode'];
$track_Details['CreatedBy'] = $arrayDetails['CreatedBy']; $track_Details['CreatedBy'] = $arrayDetails['CreatedBy'];
$track_Details['CreatedOn'] = $arrayDetails['CreatedOn']; $track_Details['CreatedOn'] = $arrayDetails['CreatedOn'];
$track_Details['CreatedBranch']=$arrayDetails['CreatedBranch']; $track_Details['CreatedBranch'] = $arrayDetails['CreatedBranch'];
$this->db->insert(LEAD_TRACKING, $track_Details); $this->db->insert(LEAD_TRACKING, $track_Details);
// this if for insert tracking details // this if for insert tracking details
if($this->db->affected_rows() == '1'){ if ($this->db->affected_rows() == '1') {
$insertfollowup_Details['TrackingID']=$this->db->insert_id(); $insertfollowup_Details['TrackingID'] = $this->db->insert_id();
$insertfollowup_Details['FollowupOn']=$arrayDetails['FollowupOn']; $insertfollowup_Details['FollowupOn'] = $arrayDetails['FollowupOn'];
$insertfollowup_Details['FollowupComments']=$arrayDetails['FollowupComments']; $insertfollowup_Details['FollowupComments'] = $arrayDetails['FollowupComments'];
$insertfollowup_Details['CreatedBy'] = $arrayDetails['CreatedBy']; $insertfollowup_Details['CreatedBy'] = $arrayDetails['CreatedBy'];
$insertfollowup_Details['CreatedOn'] = $arrayDetails['CreatedOn']; $insertfollowup_Details['CreatedOn'] = $arrayDetails['CreatedOn'];
$this->db->insert(LEAD_TRACKING_FOLLOWUP, $insertfollowup_Details); $this->db->insert(LEAD_TRACKING_FOLLOWUP, $insertfollowup_Details);
// this if for insert follow up details // this if for insert follow up details
} }
} }
/// hide seperate track id /// hide seperate track id
/* $this->db->select('LD.LeadID,LT.TrackingID'); /* $this->db->select('LD.LeadID,LT.TrackingID');
$this->db->from(LEAD_DETAILS.' as LD'); $this->db->from(LEAD_DETAILS.' as LD');
$this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID');
@ -1003,70 +872,53 @@ class StatusUpdation_model extends CI_Model
}*/ }*/
} }
} }
return true; return true;
} else {
return false;
} }
else{ } else {
return false; return false;
} }
} }
else{
return false;
}
}
/* /*
* get student info * get student info
* created by kms * created by kms
* */ * */
public function studentInfo($details=null){ public function studentInfo($details = null) {
$this->db->select('ST.Firstname,ST.MobileNumber,US.UniversityName,CU.CourseName'); $this->db->select('ST.Firstname,ST.MobileNumber,US.UniversityName,CU.CourseName');
$this->db->from(COURSE_FEES.' as CF'); $this->db->from(COURSE_FEES . ' as CF');
$this->db->join(STUDENTCOURSE.' as STC', 'STC.CourseID = CF.CourseID'); $this->db->join(STUDENTCOURSE . ' as STC', 'STC.CourseID = CF.CourseID');
$this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID'); $this->db->join(STUDENTS . ' as ST', 'ST.StudentID = STC.StudentID');
$this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID'); $this->db->join(COURSE . ' as CU', 'CU.CourseID = STC.CourseID');
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID'); $this->db->join(UNIVERSITY . ' as US', 'US.UniversityID = STC.UniversityID');
$this->db->where('ST.StudentID',$details[0]['StudentID']); $this->db->where('ST.StudentID', $details[0]['StudentID']);
$this->db->where('CF.ID',$details[0]['CourseID']); $this->db->where('CF.ID', $details[0]['CourseID']);
$leadDet=$this->db->get()->last_row(); $leadDet = $this->db->get()->last_row();
if($leadDet){ if ($leadDet) {
return $leadDet; return $leadDet;
} } else {
else{
return false; return false;
} }
} }
/* /*
* get student info for documet updates * get student info for documet updates
* created by kms * created by kms
* */ * */
public function studentInfoForDocumentStatus($details=null){ public function studentInfoForDocumentStatus($details = null) {
$this->db->select('ST.Firstname,ST.MobileNumber,US.UniversityName,CU.CourseName'); $this->db->select('ST.Firstname,ST.MobileNumber,US.UniversityName,CU.CourseName');
$this->db->from(STUDENTCOURSE.' as STC'); $this->db->from(STUDENTCOURSE . ' as STC');
$this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID'); $this->db->join(STUDENTS . ' as ST', 'ST.StudentID = STC.StudentID');
$this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID'); $this->db->join(COURSE . ' as CU', 'CU.CourseID = STC.CourseID');
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID'); $this->db->join(UNIVERSITY . ' as US', 'US.UniversityID = STC.UniversityID');
$this->db->where('ST.StudentID',$details[0]['StudentID']); $this->db->where('ST.StudentID', $details[0]['StudentID']);
$this->db->where('STC.CourseID',$details[0]['CourseID']); $this->db->where('STC.CourseID', $details[0]['CourseID']);
$leadDet=$this->db->get()->last_row(); $leadDet = $this->db->get()->last_row();
if($leadDet){ if ($leadDet) {
return $leadDet; return $leadDet;
} } else {
else{
return false; return false;
} }
} }
} }

File diff suppressed because it is too large Load Diff