batch filter
This commit is contained in:
parent
f35f9f471c
commit
c8fb8b1ce7
@ -70,7 +70,9 @@ class Student_Controller extends REST_Controller {
|
||||
$loginUserId = $reqData['localUserID'];
|
||||
$loginUserBranchId = $reqData['localBranchID'];
|
||||
$loginUserType = $reqData['localType'];
|
||||
$studentListDetails = $this->student_model->get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $searchReqData); // Check if the employee exist
|
||||
$batchcode = $searchReqData['Batch'];
|
||||
|
||||
$studentListDetails = $this->student_model->get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $searchReqData,$batchcode); // Check if the employee exist
|
||||
if ($studentListDetails) {
|
||||
$studentListDetails['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
|
||||
@ -37,7 +37,7 @@ class Student_model extends CI_Model {
|
||||
}
|
||||
|
||||
// get student list based on login user
|
||||
public function get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $getSearchData) {
|
||||
public function get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $getSearchData,$batchcode) {
|
||||
if ($loginUserType == SUPER_ADMIN) {
|
||||
// list for super admin based on branch
|
||||
|
||||
@ -63,30 +63,46 @@ class Student_model extends CI_Model {
|
||||
// exit();
|
||||
$University = $getSearchData['University'];
|
||||
$Course = $getSearchData['Course'];
|
||||
$Batch = '';
|
||||
$Batch = $batchcode;
|
||||
$StuStatus = $getSearchData['Status'];
|
||||
if ($StuStatus == '') {
|
||||
if ($University != '' && $Course == '') {
|
||||
if ($University != '' && $Course == '' && $batchcode=='') {
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC
|
||||
LEFT JOIN " . STUDENTS . " as S 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 SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
|
||||
ORDER BY S.CreatedOn";
|
||||
// GROUP BY SC.StudentID
|
||||
} else if ($University != '' && $Course != '') {
|
||||
} else if ($University != '' && $Course != '' && $batchcode=='') {
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC
|
||||
LEFT JOIN " . STUDENTS . " as S 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 SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
|
||||
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
|
||||
// $subStudentCourse = "SELECT S.StudentID,
|
||||
@ -95,45 +111,225 @@ class Student_model extends CI_Model {
|
||||
// LEFT JOIN " . COURSE . " as C ON SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
|
||||
// "
|
||||
}
|
||||
} else {
|
||||
if ($University != '' && $Course == '') {
|
||||
|
||||
|
||||
else if($University !='' && $Course == '' && $batchcode!='')
|
||||
{
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC
|
||||
LEFT JOIN " . STUDENTS . " as S 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 SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND sfs.BatchCode = '$batchcode'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
|
||||
ORDER BY S.CreatedOn";
|
||||
}
|
||||
|
||||
else if($University !=''&&$Course != '' && $batchcode !='')
|
||||
{
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC
|
||||
LEFT JOIN " . STUDENTS . " as S 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 SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
|
||||
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
|
||||
AND sfs.BatchCode = '$batchcode'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($University != '' && $Course == '' && $batchcode=='' ) {
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC LEFT JOIN " . STUDENTS . " as S ON SC.StudentID = S.StudentID
|
||||
LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON
|
||||
SC.CourseID = C.CourseID
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
|
||||
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
} else if ($University != '' && $Course != '') {
|
||||
} else if ($University != '' && $Course != '' && $batchcode=='') {
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC
|
||||
LEFT JOIN " . STUDENTS . " as S 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 SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
|
||||
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
} else {
|
||||
|
||||
|
||||
if ($University != '' && $Course == ''&& $batchcode=='' ) {
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC LEFT JOIN " . STUDENTS . " as S ON SC.StudentID = S.StudentID
|
||||
LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON
|
||||
SC.CourseID = C.CourseID
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
|
||||
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
} else if ($University != '' && $Course != '' && $batchcode=='') {
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC
|
||||
LEFT JOIN " . STUDENTS . " as S 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 SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
|
||||
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
}
|
||||
|
||||
|
||||
else if($University != '' && $Course == '' && $batchcode !='' )
|
||||
{
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC LEFT JOIN " . STUDENTS . " as S ON SC.StudentID = S.StudentID
|
||||
LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON
|
||||
SC.CourseID = C.CourseID
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
|
||||
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
|
||||
AND sfs.BatchCode = '$batchcode'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
|
||||
}
|
||||
|
||||
else if($University != '' && $Course != '' && $batchcode !='')
|
||||
{
|
||||
|
||||
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC
|
||||
LEFT JOIN " . STUDENTS . " as S 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 SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
|
||||
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
AND sfs.BatchCode = '$batchcode'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
else{
|
||||
$subQuery = "SELECT S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName
|
||||
FROM " . STUDENTCOURSE . " as SC
|
||||
LEFT JOIN " . STUDENTS . " as S 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 SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode
|
||||
|
||||
|
||||
LEFT JOIN ".STUDENTS_FEES_STATUS." as sfs on sfs.CourseID=SC.CourseID AND sfs.StudentID=SC.StudentID
|
||||
and C.CourseID=sfs.CourseID
|
||||
|
||||
|
||||
WHERE
|
||||
SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
|
||||
group by Student_Course_id,StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
$stuDetails = $this->db->query($subQuery);
|
||||
$checkArr = $stuDetails->result();
|
||||
|
||||
|
||||
//print_r( $this->db->last_query());
|
||||
//die();
|
||||
|
||||
if (count($checkArr) > 0) {
|
||||
$results['studentList'] = true;
|
||||
$results['student_details'] = $stuDetails->result();
|
||||
|
||||
@ -1709,6 +1709,13 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl
|
||||
};
|
||||
|
||||
|
||||
|
||||
$scope.getValue = function(se)
|
||||
{
|
||||
console.log(se)
|
||||
}
|
||||
|
||||
|
||||
$scope.getValueChange = function () {
|
||||
// $scope.searchData = {
|
||||
// "University": "",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<!-- start: STUDENT TITLE -->
|
||||
<!--start: STUDENT TITLE -->
|
||||
<section id="page-title">
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
@ -162,6 +162,26 @@
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<label for="form-field-select-2">Batch</label>
|
||||
<select ui-select2 class="form-control" tabindex="4" class="cs-select cs-skin-elastic" name="course" ng-model="searchData.Batch" ng-change="getValueChange(searchData)">
|
||||
<option value="" selected>Select Batch</option>
|
||||
<option ng-repeat="item in batchData" value="{{item.BatchCode}}">{{item.BatchName}}<span ng-show="item.BatchCode != ''">(<strong>{{item.BatchCode}}</strong>)</span></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div ng-if="Searchloader == true" class="col-md-12" align="center">
|
||||
<!--<spinner name="html5spinner">
|
||||
@ -1367,4 +1387,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- end: LIST GROUP -->
|
||||
<!-- end: LIST GROUP
|
||||
Loading…
Reference in New Issue
Block a user