2023-01-10 09:41:20 +00:00
|
|
|
<?php
|
|
|
|
if (!defined('BASEPATH'))
|
|
|
|
exit('No direct script access allowed');
|
|
|
|
|
|
|
|
class Faculty_model extends CI_Model {
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
function list_fa()
|
|
|
|
{
|
|
|
|
$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;
|
|
|
|
}
|
|
|
|
|
2023-01-21 13:41:47 +00:00
|
|
|
function get_fac($id)
|
2023-01-10 09:41:20 +00:00
|
|
|
{
|
2023-02-07 13:11:26 +00:00
|
|
|
$this->db->select('f.*,e.id as employeeId');
|
|
|
|
$this->db->from('faculty as f');
|
|
|
|
$this->db->join('employee as e','e.typeId=f.id','INNER');
|
|
|
|
$this->db->where(array('f.status'=>1,'f.id'=>$id,'e.roleId'=>3));
|
2023-01-10 09:41:20 +00:00
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
2023-01-21 13:41:47 +00:00
|
|
|
|
|
|
|
function viewFaculty($id)
|
|
|
|
{
|
|
|
|
$this->db->select('*');
|
|
|
|
$this->db->from('faculty');
|
|
|
|
$this->db->where(array('status'=>1,'id'=>$id));
|
|
|
|
$query = $this->db->get();
|
|
|
|
//echo $this->db->last_query();exit;
|
|
|
|
return $query;
|
|
|
|
}
|
2023-01-10 09:41:20 +00:00
|
|
|
|
|
|
|
}
|