McGansWebsite/application/models/Project_model.php
Sasikala f00ec323cb 20230109
New File Updated
2023-01-09 02:16:58 +05:30

64 lines
1.5 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->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;
}
}