student listing screen changes : kdk
This commit is contained in:
parent
ec9e181f6a
commit
876bcf6c87
@ -40,13 +40,16 @@ class Student_model extends CI_Model {
|
||||
public function get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $getSearchData) {
|
||||
if ($loginUserType == SUPER_ADMIN) {
|
||||
// list for super admin based on branch
|
||||
|
||||
if ($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') {
|
||||
$this->db->select('t1.*');
|
||||
$this->db->from('' . STUDENTS . ' as t1');
|
||||
$this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT');
|
||||
$this->db->where('t2.BranchID', $loginUserBranchId);
|
||||
$this->db->group_by('t2.StudentID');
|
||||
$this->db->order_by('t2.CreatedOn', 'DESC');
|
||||
$this->db->select('S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName');
|
||||
$this->db->from('' . STUDENTCOURSE . ' as SC');
|
||||
$this->db->join('' . STUDENTS . ' as S', 'S.StudentID = SC.StudentID', 'LEFT');
|
||||
$this->db->join('' . UNIVERSITY . ' as U', 'SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode', 'LEFT');
|
||||
$this->db->join('' . COURSE . ' as C', 'SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode', 'LEFT');
|
||||
$this->db->where('SC.BranchID', $loginUserBranchId);
|
||||
// $this->db->group_by('t2.StudentID');
|
||||
$this->db->order_by('SC.CreatedOn', 'DESC');
|
||||
$stuDetails = $this->db->get();
|
||||
$checkArr = $stuDetails->result();
|
||||
if (count($checkArr) > 0) {
|
||||
@ -56,68 +59,76 @@ class Student_model extends CI_Model {
|
||||
$results['studentList'] = false;
|
||||
}
|
||||
} else {
|
||||
// echo 'hi';
|
||||
// exit();
|
||||
$University = $getSearchData['University'];
|
||||
$Course = $getSearchData['Course'];
|
||||
$Batch = '';
|
||||
$StuStatus = $getSearchData['Status'];
|
||||
if ($StuStatus == '') {
|
||||
if ($University != '' && $Course == '') {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
GROUP BY SC.StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
// GROUP BY SC.StudentID
|
||||
} else if ($University != '' && $Course != '') {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
GROUP BY SC.StudentID
|
||||
|
||||
ORDER BY S.CreatedOn";
|
||||
|
||||
// $subStudentCourse = "SELECT S.StudentID,
|
||||
// FROM " . STUDENTCOURSE . " as S
|
||||
// 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
|
||||
// "
|
||||
}
|
||||
} else {
|
||||
if ($University != '' && $Course == '') {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
GROUP BY SC.StudentID
|
||||
|
||||
ORDER BY S.CreatedOn";
|
||||
} else if ($University != '' && $Course != '') {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
GROUP BY SC.StudentID
|
||||
|
||||
ORDER BY S.CreatedOn";
|
||||
} else {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
GROUP BY SC.StudentID
|
||||
|
||||
ORDER BY S.CreatedOn";
|
||||
}
|
||||
}
|
||||
@ -133,12 +144,14 @@ class Student_model extends CI_Model {
|
||||
} else if ($loginUserType == ADMIN) {
|
||||
// list for admin
|
||||
if ($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') {
|
||||
$this->db->select('t1.*');
|
||||
$this->db->from('' . STUDENTS . ' as t1');
|
||||
$this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT');
|
||||
$this->db->where('t2.BranchID', $loginUserBranchId);
|
||||
$this->db->group_by('t2.StudentID');
|
||||
$this->db->order_by('t2.CreatedOn', 'DESC');
|
||||
$this->db->select('S.*, SC.id as Student_Course_id , U.UniversityName, C.CourseName');
|
||||
$this->db->from('' . STUDENTCOURSE . ' as SC');
|
||||
$this->db->join('' . STUDENTS . ' as S', 'S.StudentID = SC.StudentID', 'LEFT');
|
||||
$this->db->join('' . UNIVERSITY . ' as U', 'SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode', 'LEFT');
|
||||
$this->db->join('' . COURSE . ' as C', 'SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode', 'LEFT');
|
||||
$this->db->where('SC.BranchID', $loginUserBranchId);
|
||||
// $this->db->group_by('t2.StudentID');
|
||||
$this->db->order_by('SC.CreatedOn', 'DESC');
|
||||
$stuDetails = $this->db->get();
|
||||
$checkArr = $stuDetails->result();
|
||||
if (count($checkArr) > 0) {
|
||||
@ -154,63 +167,59 @@ class Student_model extends CI_Model {
|
||||
$StuStatus = $getSearchData['Status'];
|
||||
if ($StuStatus == '') {
|
||||
if ($University != '' && $Course == '') {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
GROUP BY SC.StudentID
|
||||
|
||||
ORDER BY S.CreatedOn";
|
||||
} else if ($University != '' && $Course != '') {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
GROUP BY SC.StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
}
|
||||
} else {
|
||||
if ($University != '' && $Course == '') {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
GROUP BY SC.StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
} else if ($University != '' && $Course != '') {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
GROUP BY SC.StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
} else {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$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
|
||||
WHERE
|
||||
SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
GROUP BY SC.StudentID
|
||||
ORDER BY S.CreatedOn";
|
||||
}
|
||||
}
|
||||
@ -226,13 +235,15 @@ class Student_model extends CI_Model {
|
||||
} else if ($loginUserType == EMPLOYEE) {
|
||||
// list for staff
|
||||
if ($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') {
|
||||
$this->db->select("t1.*, IF(t3.ID > 0, '1' , '0') as Fee_paid_exist");
|
||||
$this->db->from('' . STUDENTS . ' as t1');
|
||||
$this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT');
|
||||
$this->db->join('' . STUDENTS_FEES_PAID . ' as t3', 't3.StudentID = t1.StudentID', 'LEFT');
|
||||
$this->db->where('t2.BranchID', $loginUserBranchId);
|
||||
$this->db->group_by('t2.StudentID');
|
||||
$this->db->order_by('t2.CreatedOn', 'DESC');
|
||||
$this->db->select("S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist , SC.id as Student_Course_id , U.UniversityName, C.CourseName");
|
||||
$this->db->from('' . STUDENTCOURSE . ' as SC');
|
||||
$this->db->join('' . STUDENTS . ' as S', 'S.StudentID = SC.StudentID', 'LEFT');
|
||||
$this->db->join('' . UNIVERSITY . ' as U', 'SC.UniversityID = U.UniversityID AND SC.BranchID = U.BranchCode', 'LEFT');
|
||||
$this->db->join('' . COURSE . ' as C', 'SC.CourseID = C.CourseID AND SC.BranchID = C.BranchCode', 'LEFT');
|
||||
$this->db->join('' . STUDENTS_FEES_PAID . ' as SFP', 'SFP.StudentID = S.StudentID', 'LEFT');
|
||||
$this->db->where('SC.BranchID', $loginUserBranchId);
|
||||
$this->db->group_by('SC.id');
|
||||
$this->db->order_by('SC.CreatedOn', 'DESC');
|
||||
$stuDetails = $this->db->get();
|
||||
$checkArr = $stuDetails->result();
|
||||
if (count($checkArr) > 0) {
|
||||
@ -248,28 +259,28 @@ class Student_model extends CI_Model {
|
||||
$StuStatus = $getSearchData['Status'];
|
||||
if ($StuStatus == '') {
|
||||
if ($University != '' && $Course == '') {
|
||||
$subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist , 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_PAID . " as SFP ON SFP.StudentID = S.StudentID
|
||||
WHERE
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
GROUP BY SC.StudentID
|
||||
GROUP BY SC.id
|
||||
ORDER BY S.CreatedOn";
|
||||
} else if ($University != '' && $Course != '') {
|
||||
$subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist , 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_PAID . " as SFP ON SFP.StudentID = S.StudentID
|
||||
WHERE
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
GROUP BY SC.StudentID
|
||||
GROUP BY SC.id
|
||||
ORDER BY S.CreatedOn";
|
||||
} // ### query branch code changed from student branch code to student course branch code
|
||||
// AND S.BranchCode = '$loginUserBranchId' -> SC.BranchCode = '$loginUserBranchId'
|
||||
@ -277,9 +288,9 @@ class Student_model extends CI_Model {
|
||||
// OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University'))
|
||||
} else {
|
||||
if ($University != '' && $Course == '') {
|
||||
$subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist , 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_PAID . " as SFP ON SFP.StudentID = S.StudentID
|
||||
@ -287,12 +298,12 @@ class Student_model extends CI_Model {
|
||||
SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
GROUP BY SC.StudentID
|
||||
GROUP BY SC.id
|
||||
ORDER BY S.CreatedOn";
|
||||
} else if ($University != '' && $Course != '') {
|
||||
$subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist , 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_PAID . " as SFP ON SFP.StudentID = S.StudentID
|
||||
@ -300,18 +311,18 @@ class Student_model extends CI_Model {
|
||||
SC.CourseID = '$Course' AND SC.UniversityID = '$University'
|
||||
AND SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
GROUP BY SC.StudentID
|
||||
GROUP BY SC.id
|
||||
ORDER BY S.CreatedOn";
|
||||
} else {
|
||||
$subQuery = "SELECT S.*
|
||||
FROM " . STUDENTS . " as S
|
||||
LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID
|
||||
$subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist , 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
|
||||
WHERE
|
||||
SC.BranchID = '$loginUserBranchId'
|
||||
AND S.IsActive = '$StuStatus'
|
||||
GROUP BY SC.StudentID
|
||||
GROUP BY SC.id
|
||||
ORDER BY S.CreatedOn";
|
||||
}
|
||||
// ### query branch code changed from student branch code to student course branch code
|
||||
@ -357,9 +368,12 @@ class Student_model extends CI_Model {
|
||||
|
||||
// get student course details
|
||||
public function get_student_course($studentcourseId) {
|
||||
$this->db->select('*');
|
||||
$this->db->from(STUDENTCOURSE);
|
||||
$this->db->where('ID', $studentcourseId);
|
||||
$this->db->select('SC.* ,IF(SFP.ID > 0, '.'1'.' , '.'0'.') as Fee_paid_exist');
|
||||
$this->db->from('' . STUDENTCOURSE . ' as SC');
|
||||
$this->db->join('' . STUDENTS_FEES_STATUS . ' as SFS', 'SFS.StudentID = SC.StudentID AND SFS.CourseID = SC.CourseID AND SFS.BranchCode = SC.BranchID', 'LEFT');
|
||||
$this->db->join('' . STUDENTS_FEES_PAID . ' as SFP', 'SFP.FeesId = SFS.FeesID', 'LEFT');
|
||||
$this->db->group_by('SC.id');
|
||||
$this->db->where('SC.ID', $studentcourseId);
|
||||
$courseDetails = $this->db->get();
|
||||
$checkArr = $courseDetails->result();
|
||||
if (count($checkArr) > 0) {
|
||||
|
||||
@ -669,17 +669,17 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
||||
|
||||
$scope.editId = -1;
|
||||
$scope.editCourseId = -1;
|
||||
$scope.setEditId = function (id) {
|
||||
$scope.editId = id;
|
||||
$scope.setEditId = function (unique_id, id) {
|
||||
$scope.editId = unique_id;
|
||||
$scope.editCourseId = -1;
|
||||
$scope.studentViewPage = -1;
|
||||
}
|
||||
|
||||
$scope.setEditCourseId = function (id) {
|
||||
$scope.setEditCourseId = function (unique_id,id) {
|
||||
$scope.list = false;
|
||||
$scope.getStudentCourseList(id);
|
||||
$scope.currentStudentId = id;
|
||||
$scope.editCourseId = id;
|
||||
$scope.editCourseId = unique_id;
|
||||
$scope.editId = -1;
|
||||
$scope.courseEditLoading = true;
|
||||
}
|
||||
@ -1662,17 +1662,17 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl
|
||||
|
||||
$scope.editId = -1;
|
||||
$scope.editCourseId = -1;
|
||||
$scope.setEditId = function (id) {
|
||||
$scope.editId = id;
|
||||
$scope.setEditId = function (uniqe_id ,id) {
|
||||
$scope.editId = uniqe_id;
|
||||
$scope.editCourseId = -1;
|
||||
}
|
||||
|
||||
$scope.setEditCourseId = function (id) {
|
||||
$scope.setEditCourseId = function (uniqe_id ,id) {
|
||||
$scope.list = false;
|
||||
$scope.getStudentCourseList(id);
|
||||
$scope.currentStudentId = id;
|
||||
// $scope.getStudentCourseDetails(id);
|
||||
$scope.editCourseId = id;
|
||||
$scope.editCourseId = uniqe_id;
|
||||
$scope.editId = -1;
|
||||
$scope.courseEditLoading = true;
|
||||
}
|
||||
|
||||
@ -44,7 +44,8 @@
|
||||
<td>{{s.Specilization2}}</td>
|
||||
<!--<td>{{s.SessionName}}</td>-->
|
||||
<td>{{s.DOJ}}</td>
|
||||
<td ng-hide="s.Fee_paid_exist == 1 && localUserType == 'R002'" ng-click="getStudentCourseDetails(s.ID)"><i class="fa fa-edit"></i></td>
|
||||
<td ng-click="getStudentCourseDetails(s.ID)"><i class="fa fa-edit"></i></td>
|
||||
<!--ng-hide="s.Fee_paid_exist == 1 && localUserType == 'R002'"-->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -73,7 +74,7 @@
|
||||
</label>
|
||||
<select ng-init="onSlecetUnivEdit(stucour.UniversityID, stucour.CourseID)" class="form-control" name="univ" ng-model="stucour.UniversityID"
|
||||
class="cs-select cs-skin-elastic" ng-change="onChangeSlecetUnivEdit(stucour.UniversityID)"
|
||||
required>
|
||||
ng-disabled="stucour.Fee_paid_exist == 1 && localUserType == 'R002'" required>
|
||||
|
||||
<option value="" disabled selected>Select University</option>
|
||||
<option ng-repeat="items in universityData" value="{{items.UniversityID}}" ng-selected="stucour.UniversityID == items.UniversityID">{{items.UniversityName}}</option>
|
||||
@ -102,8 +103,8 @@
|
||||
<label>
|
||||
Course<span class="symbol required"></span>
|
||||
</label>
|
||||
<ui-select ng-model="stuCourseEditDetailsObj.selected" name="course" theme="bootstrap" ng-required="true" ng-change="editStudentCourseDetailsChanges(stuCourseEditDetailsObj)">
|
||||
<ui-select-match placeholder="Select Course">
|
||||
<ui-select ng-model="stuCourseEditDetailsObj.selected" name="course" ng-disabled="stucour.Fee_paid_exist == 1 && localUserType == 'R002'" theme="bootstrap" ng-required="true" ng-change="editStudentCourseDetailsChanges(stuCourseEditDetailsObj)">
|
||||
<ui-select-match placeholder="Select Course" >
|
||||
{{$select.selected.CourseName}}
|
||||
</ui-select-match>
|
||||
<ui-select-choices value repeat="item in courseDataEditScrn | filter: $select.search">
|
||||
@ -127,7 +128,7 @@
|
||||
|
||||
<input type="text" placeholder="Enter Specilization 1"
|
||||
tabindex="30" class="form-control" name="specilization1"
|
||||
ng-model="stucour.Specilization1" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" />
|
||||
ng-disabled="stucour.Fee_paid_exist == 1 && localUserType == 'R002'" ng-model="stucour.Specilization1" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" />
|
||||
<span class="error text-small block"
|
||||
ng-if="Form.specilization1.$dirty && Form.specilization1.$error.pattern">Invalid Specilization 1 </span>
|
||||
</div>
|
||||
@ -139,7 +140,7 @@
|
||||
|
||||
<input type="text" placeholder="Enter Specilization 2"
|
||||
tabindex="31" class="form-control" name="specilization2"
|
||||
ng-model="stucour.Specilization2" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" />
|
||||
ng-disabled="stucour.Fee_paid_exist == 1 && localUserType == 'R002'" ng-model="stucour.Specilization2" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" />
|
||||
<span class="error text-small block"
|
||||
ng-if="Form.specilization2.$dirty && Form.specilization2.$error.pattern">Invalid Specilization 2 </span>
|
||||
</div>
|
||||
@ -161,12 +162,12 @@
|
||||
</label>
|
||||
<input type="text" tabindex="8" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="stucour.DOJ"
|
||||
is-open="startOpen" ng-init="startOpen = false" name="dateofjoining" datepicker-options="dateOptions"
|
||||
placeholder="Select Date of Joining" close-text="Close" required="required" max-date="todayDate"/>
|
||||
ng-disabled="stucour.Fee_paid_exist == 1 && localUserType == 'R002'" placeholder="Select Date of Joining" close-text="Close" required="required" max-date="todayDate"/>
|
||||
|
||||
<span class="error text-small block" ng-if="Form.dateofjoining.$dirty && Form.dateofjoining.$error.required">Date of Joining is required</span>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div ng-hide="stucour.Fee_paid_exist == 1 && localUserType == 'R002'">
|
||||
<div class="col-md-4" >
|
||||
<label>
|
||||
Active/De-Active
|
||||
</label>
|
||||
@ -186,7 +187,22 @@
|
||||
<span class="error text-small block" ng-if="Form.DeactiveComments.$dirty && Form.DeactiveComments.$invalid">De-Active Comments is required</span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div ng-show="stucour.Fee_paid_exist == 1 && localUserType == 'R002'">
|
||||
<div class="col-md-4" >
|
||||
<label>
|
||||
Active/De-Active
|
||||
</label>
|
||||
<div ng-if="stucour.IsActive==true">
|
||||
<label ng-init="stucour.IsActive = true"> Active </label>
|
||||
<!--<switch ng-model="stucour.IsActive" ng-init="stucour.IsActive = true" class="green"></switch>-->
|
||||
</div>
|
||||
<div ng-if="stucour.IsActive==false">
|
||||
<label ng-init="stucour.IsActive = false"> In-Active </label>
|
||||
<!--<switch ng-model="stucour.IsActive" ng-init="stucour.IsActive = false" class="green"></switch>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -175,6 +175,12 @@
|
||||
</th>
|
||||
<th ng-click="sort('Fathername')">Father Name
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Fathername'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th>University
|
||||
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='UniversityName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
|
||||
</th>
|
||||
<th>Course
|
||||
<!--<span class="glyphicon so/rt-icon" ng-show="sortKey=='CourseName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
|
||||
</th>
|
||||
<th ng-click="sort('Fathername')">Status
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Fathername'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
@ -195,14 +201,13 @@
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<a tooltip="View Student" ng-click="open(p);" class="text-dark">
|
||||
{{p.Firstname}} {{p.Lastname}}
|
||||
</a>
|
||||
|
||||
</td>
|
||||
<td>{{p.Fathername}}</td>
|
||||
|
||||
<td>{{p.UniversityName}}</td>
|
||||
<td>{{p.CourseName}}</td>
|
||||
<td><span ng-if="p.IsActive == true" style="text-transform: uppercase; text-shadow: 1px 1px #166307; color: #2be209 ">ACTIVE</span>
|
||||
<span tooltip="{{p.DeactiveComments}}" ng-if="p.IsActive == false" style="text-transform: uppercase; text-shadow: 1px 1px rgb(167, 88, 15); color: rgba(236, 24, 24, 0.98823529);">DEACTIVE</span></td>
|
||||
<td>
|
||||
@ -211,16 +216,16 @@
|
||||
<td style="text-align: center;">
|
||||
<!--<input type=button class="btn btn-info btn-xs" ladda="ldloading1.zoom_in" id="editRowBtn{{p.StudentID}}" value="Personal Details"
|
||||
ng-click="setEditId(p.StudentID);">-->
|
||||
<i class="ti-user" tooltip="Personal Details" ng-click="setEditId(p.StudentID);"></i>
|
||||
<i class="ti-user" tooltip="Personal Details" ng-click="setEditId(p.Student_Course_id, p.StudentID);"></i>
|
||||
<!--<input type=button class="btn btn-blue btn-xs" id="editCourseRowBtn{{p.StaffID}}" value="Course Details" ng-click="setEditCourseId(p.StudentID);">-->
|
||||
<i class="ti-write" tooltip="Course Details" ng-click="setEditCourseId(p.StudentID);"></i>
|
||||
<i class="ti-write" tooltip="Course Details" ng-click="setEditCourseId(p.Student_Course_id, p.StudentID);"></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-show="editId === p.StudentID" ng-if="editId === p.StudentID">
|
||||
<td colspan="6" ng-include src="'assets/views/student/editStudentDetails.html'"></td>
|
||||
<tr ng-show="editId === p.Student_Course_id" ng-if="editId === p.Student_Course_id">
|
||||
<td colspan="8" ng-include src="'assets/views/student/editStudentDetails.html'"></td>
|
||||
</tr>
|
||||
<tr ng-show="editCourseId === p.StudentID" ng-if="editCourseId === p.StudentID">
|
||||
<td colspan="6" ng-include src="'assets/views/student/editStudentCourseDetails.html'"></td>
|
||||
<tr ng-show="editCourseId === p.Student_Course_id" ng-if="editCourseId === p.Student_Course_id">
|
||||
<td colspan="8" ng-include src="'assets/views/student/editStudentCourseDetails.html'"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -211,6 +211,12 @@
|
||||
</th>
|
||||
<th ng-click="sort('Fathername')">Father Name
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Fathername'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
</th>
|
||||
<th>University
|
||||
<!--<span class="glyphicon sort-icon" ng-show="sortKey=='UniversityName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
|
||||
</th>
|
||||
<th>Course
|
||||
<!--<span class="glyphicon so/rt-icon" ng-show="sortKey=='CourseName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>-->
|
||||
</th>
|
||||
<th ng-click="sort('Fathername')">Status
|
||||
<span class="glyphicon sort-icon" ng-show="sortKey=='Fathername'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
|
||||
@ -237,22 +243,24 @@
|
||||
|
||||
</td>
|
||||
<td>{{p.Fathername}}</td>
|
||||
<td>{{p.UniversityName}}</td>
|
||||
<td>{{p.CourseName}}</td>
|
||||
<td><span ng-if="p.IsActive == true" style="text-transform: uppercase; text-shadow: 1px 1px #166307; color: #2be209 ">ACTIVE</span>
|
||||
<span tooltip="{{p.DeactiveComments}}" ng-if="p.IsActive == false" style="text-transform: uppercase; text-shadow: 1px 1px rgb(167, 88, 15); color: rgba(236, 24, 24, 0.98823529);">DEACTIVE</span></td>
|
||||
<td><div id="containersPara">{{p.Comments}}</div></td>
|
||||
<td style="text-align: center;">
|
||||
<!--<input type=button class="btn btn-info btn-xs" ladda="ldloading1.zoom_in" id="editRowBtn{{p.StudentID}}" value="Personal Details"
|
||||
ng-click="setEditId(p.StudentID);">-->
|
||||
<i class="ti-user" tooltip="Personal Details" id="personalDetailButton" ng-click="setEditId(p.StudentID);"></i>
|
||||
<i class="ti-user" tooltip="Personal Details" id="personalDetailButton" ng-click="setEditId(p.Student_Course_id, p.StudentID);"></i>
|
||||
<!--<input type=button class="btn btn-blue btn-xs" id="editCourseRowBtn{{p.StaffID}}" value="Course Details" ng-click="setEditCourseId(p.StudentID);">-->
|
||||
<i class="ti-write" tooltip="Course Details" ng-click="setEditCourseId(p.StudentID);"></i>
|
||||
<i class="ti-write" tooltip="Course Details" ng-click="setEditCourseId(p.Student_Course_id, p.StudentID);"></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-show="editId === p.StudentID" ng-if="editId === p.StudentID">
|
||||
<td colspan="6" ng-include src="'assets/views/student/editStudentDetails.html'"></td>
|
||||
<tr ng-show="editId === p.Student_Course_id" ng-if="editId === p.Student_Course_id">
|
||||
<td colspan="8" ng-include src="'assets/views/student/editStudentDetails.html'"></td>
|
||||
</tr>
|
||||
<tr ng-show="editCourseId === p.StudentID" ng-if="editCourseId === p.StudentID">
|
||||
<td colspan="6" ng-include src="'assets/views/student/editStudentCourseDetails.html'"></td>
|
||||
<tr ng-show="editCourseId === p.Student_Course_id" ng-if="editCourseId === p.Student_Course_id">
|
||||
<td colspan="8" ng-include src="'assets/views/student/editStudentCourseDetails.html'"></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user