course details changes done
This commit is contained in:
parent
ddea4b3b20
commit
af9f83d3c3
54
Apollo/api/application/models/Studentview_model.php
Normal file
54
Apollo/api/application/models/Studentview_model.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: karthi
|
||||
* Date: 12/21/17
|
||||
* Time: 3:46 PM
|
||||
*/
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Studentview_model extends CI_Model
|
||||
{
|
||||
|
||||
/*
|
||||
* student details
|
||||
* created by kms
|
||||
* */
|
||||
|
||||
// get student list based on login user
|
||||
public function getStudentInfo($requestedBy=null)
|
||||
{
|
||||
$this->db->select('ST.*');
|
||||
$this->db->from( LOGIN . ' as LO');
|
||||
$this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID');
|
||||
$this->db->where('LO.ID', $requestedBy);
|
||||
$studentDetails = $this->db->get()->first_row();
|
||||
if($studentDetails){
|
||||
$result['studentStatus'] = true;
|
||||
$result['studentDetails'] = $studentDetails;
|
||||
// get student course details
|
||||
$result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID);
|
||||
}
|
||||
else{
|
||||
$result['studentStatus'] = false;
|
||||
$result['studentInfo'] = "";
|
||||
}
|
||||
return $result;
|
||||
|
||||
}
|
||||
/*
|
||||
* get student course details
|
||||
* created by kms
|
||||
* */
|
||||
public function getStudentCourse($studentId=null){
|
||||
|
||||
$this->db->select('CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName,BA.BatchName');
|
||||
$this->db->from( STUDENTCOURSE . ' as SCU');
|
||||
$this->db->join( COURSE . ' as CU', 'CU.CourseID = SCU.CourseID');
|
||||
$this->db->join( UNIVERSITY . ' as US', 'US.UniversityID = SCU.UniversityID');
|
||||
$this->db->join( BATCH . ' as BA', 'BA.BatchCode = SCU.BatchCode');
|
||||
$this->db->where('SCU.StudentID', $studentId);
|
||||
$courseDetails = $this->db->get();
|
||||
return $courseDetails->result();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user