2023-01-21 13:41:47 +00:00
|
|
|
<?php
|
|
|
|
if (!defined('BASEPATH'))
|
|
|
|
exit('No direct script access allowed');
|
|
|
|
|
|
|
|
class WelcomeModel extends CI_Model {
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
function dep_list()
|
|
|
|
{
|
|
|
|
$this->db->select('*');
|
|
|
|
$this->db->from('department');
|
|
|
|
$this->db->where(array('status'=>1));
|
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
function getName($depId)
|
|
|
|
{
|
2023-01-24 10:05:16 +00:00
|
|
|
$this->db->select('id,name');
|
|
|
|
$this->db->from('degree');
|
|
|
|
$this->db->where(array('status'=>1,'departmentId'=>$depId));
|
2023-01-21 13:41:47 +00:00
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
function semesterList()
|
|
|
|
{
|
|
|
|
$this->db->select('*');
|
|
|
|
$this->db->from('semester');
|
2023-02-07 13:11:26 +00:00
|
|
|
$this->db->order_by('id', 'desc');
|
2023-01-21 13:41:47 +00:00
|
|
|
$this->db->where(array('status'=>1));
|
|
|
|
$query = $this->db->get();
|
2023-01-24 10:05:16 +00:00
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
function getSubjectImage($id)
|
|
|
|
{
|
|
|
|
$this->db->select('id,title,image');
|
|
|
|
$this->db->from('subjectdetail');
|
|
|
|
$this->db->where(array('status'=>1,'subjectId'=>$id));
|
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
2023-01-21 13:41:47 +00:00
|
|
|
return $query;
|
|
|
|
}
|
2023-01-24 10:05:16 +00:00
|
|
|
//have to remove below function
|
2023-01-21 13:41:47 +00:00
|
|
|
function subject_list($id)
|
|
|
|
{
|
|
|
|
$this->db->select('s.code,s.name,s.id,d.name as degName,s.facultyId');
|
|
|
|
$this->db->from('subject as s');
|
|
|
|
$this->db->join('degree as d','d.id=s.degreeId','INNER');
|
|
|
|
$this->db->where(array('s.status'=>1,'degreeId'=>$id));
|
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
2023-01-24 10:05:16 +00:00
|
|
|
function getSubject($id)
|
|
|
|
{
|
|
|
|
$this->db->select('s.image,s.code,s.name,s.id,d.name as degName,s.facultyId');
|
|
|
|
$this->db->from('subject as s');
|
|
|
|
$this->db->join('degree as d','d.id=s.degreeId','INNER');
|
|
|
|
$this->db->where(array('s.status'=>1,'degreeId'=>$id));
|
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
2023-01-21 13:41:47 +00:00
|
|
|
function subject_Detail($id)
|
|
|
|
{
|
2023-02-07 13:11:26 +00:00
|
|
|
$this->db->select('id,code,name,facultyId,description,subtitle,teachingAssistant');
|
2023-01-21 13:41:47 +00:00
|
|
|
$this->db->from('subject');
|
|
|
|
//$this->db->join('degree as d','d.id=s.degreeId','INNER');
|
|
|
|
$this->db->where(array('status'=>1,'id'=>$id));
|
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
function get_faculty($id)
|
|
|
|
{
|
|
|
|
$this->db->select('*');
|
|
|
|
$this->db->from('faculty');
|
|
|
|
$this->db->where(array('id'=>$id));
|
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
function getProjectList($subjectId)
|
|
|
|
{
|
|
|
|
$this->db->select('p.id,p.projectName,s.name as studentName,p.image');
|
|
|
|
$this->db->from('project as p');
|
|
|
|
$this->db->join('student as s','s.id=p.studentId','INNER');
|
|
|
|
$this->db->where(array('p.status'=>1,'p.subjectId'=>$subjectId));
|
|
|
|
$query = $this->db->get();
|
|
|
|
///echo $this->db->last_query();
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
function project_details($subjectId)
|
|
|
|
{
|
|
|
|
$this->db->select('p.id,p.projectName,s.name as studentName');
|
|
|
|
$this->db->from('project as p');
|
|
|
|
$this->db->join('student as s','s.id=p.studentId','INNER');
|
|
|
|
$this->db->where(array('p.status'=>1,'p.subjectId'=>$subjectId));
|
|
|
|
$query = $this->db->get();
|
|
|
|
///echo $this->db->last_query();
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
function projectDetail($projectId)
|
|
|
|
{
|
2023-02-07 13:11:26 +00:00
|
|
|
$this->db->select('p.id,p.projectName,p.description,s.name as studentName,p.vedio,p.drivelink');
|
2023-01-21 13:41:47 +00:00
|
|
|
$this->db->from('project as p');
|
|
|
|
$this->db->join('student as s','s.id=p.studentId','INNER');
|
|
|
|
$this->db->where(array('p.status'=>1,'p.id'=>$projectId));
|
|
|
|
$query = $this->db->get();
|
|
|
|
///echo $this->db->last_query();
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
function getGalleryList($projectId)
|
|
|
|
{
|
2023-02-07 13:11:26 +00:00
|
|
|
$this->db->select('id,title,image,description');
|
2023-01-21 13:41:47 +00:00
|
|
|
$this->db->from('projectdetail');
|
|
|
|
$this->db->where(array('status'=>1,'projectId'=>$projectId));
|
|
|
|
$query = $this->db->get();
|
|
|
|
///echo $this->db->last_query();
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getLastId()
|
|
|
|
{
|
|
|
|
$this->db->select('id,name,year');
|
|
|
|
$this->db->from('semester');
|
|
|
|
$this->db->order_by('id', 'desc');
|
|
|
|
$this->db->limit(1);
|
|
|
|
$this->db->where(array('status'=>1));
|
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
2023-02-07 13:11:26 +00:00
|
|
|
function getDepartment($id)
|
|
|
|
{
|
|
|
|
$this->db->select('SD.id,dep.id as depId,dep.name as depName,dep.code as depCode,dep.image as depImage');
|
|
|
|
$this->db->from('semesterdetail as SD');
|
|
|
|
$this->db->join('degree as d','d.id=SD.degreeId','INNER');
|
|
|
|
$this->db->join('department as dep','dep.id=d.departmentId','INNER');
|
|
|
|
$this->db->where(array('SD.status'=>1,'SD.semesterId'=>$id));
|
|
|
|
$this->db->group_by('dep.name');
|
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
2023-01-21 13:41:47 +00:00
|
|
|
|
|
|
|
}
|