McGansWebsite/admin/application/models/Project_model.php
dotwingssoftware e71c4c7872 20230111
20230111
2023-01-11 12:47:57 +05:30

74 lines
1.7 KiB
PHP

<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Project_model extends CI_Model {
public function __construct() {
parent::__construct();
}
function list_pro()
{
$this->db->select('p.*,d.name as deptname,s.name as studentName,f.name as facultyName');
$this->db->from('project as p');
$this->db->join('department as d','d.id=p.department','left' );
$this->db->join('student as s','s.id=p.student','left' );
$this->db->join('faculty as f','f.id=p.faculty','left' );
//$this->db->join('subject as b','b.id=p.subject','left' );
$this->db->where(array('p.status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_pro($id)
{
$this->db->select('*');
$this->db->from('project');
$this->db->where(array('status'=>1,'id'=>$id));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_dep()
{
$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 get_stu()
{
$this->db->select('*');
$this->db->from('student');
$this->db->where(array('status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_fac()
{
$this->db->select('*');
$this->db->from('faculty');
$this->db->where(array('status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
function get_sub()
{
$this->db->select('*');
$this->db->from('subject');
$this->db->where(array('status'=>1));
$query = $this->db->get();
//echo $this->db->last_query();exit;
return $query;
}
}