Viewing file: regist_model.php (2.84 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once("sa_model.php");
class Regist_model extends Sa_model {
// PK is cl_id
public $CurId;
public $AcY;
public $SyId;
public $rgCurId;
public $rgSyId;
function Regist_model() {
parent::__construct();
}
function get_rgCur(){
/*
$con = '';
$con.=($this->AcY!='')? " AND rgAcY = $this->AcY" :'';
$con.=($this->CurId!='')? " AND rgCurId = $this->CurId" :'';
$con.=($this->SyId!='')? " AND rgSyId = $this->SyId" :'';
$sql = "
SELECT cur.*
FROM $this->rg_dbname.rg_Regist
INNER join $this->rg_dbname.rg_Curriculum cur ON rgCurId = curId
where 1=1
$con
group by rgAcY, rgCurId
order by rgAcY, rgCurId
";
*/
$sql = "
SELECT *
FROM $this->rg_dbname.rg_Curriculum
where 1=1
";
$query = $this->db->query($sql);
return $query;
}
function get_rgSy(){
/*
$con = '';
$con.=($this->AcY!='')? " AND rgAcY = $this->AcY" :'';
$con.=($this->CurId!='')? " AND rgCurId = $this->CurId" :'';
$con.=($this->SyId!='')? " AND rgSyId = $this->SyId" :'';
$sql = "
SELECT sy.*
FROM $this->rg_dbname.rg_Regist
INNER JOIN $this->rg_dbname.rg_StudyYear sy ON rgSyId = syId
where 1=1
$con
group by rgAcY, rgSyId
order by rgAcY, rgSyId
";
*/
$sql = "
SELECT *
FROM $this->rg_dbname.rg_StudyYear
where 1=1
";
$query = $this->db->query($sql);
return $query;
}
// 25/8/2554
function list_std($q=""){
/*
$con = '';
$con.=($this->rgAcY!='')?" AND rgAcY = $this->rgAcY":'';
$con.=($this->rgCurId!='')?" AND rgCurId = $this->rgCurId":'';
$con.=($this->rgSyId!='')?" AND rgSyId = $this->rgSyId":'';
$sql = "
SELECT std . *, rgSyId
FROM $this->rg_dbname.rg_Regist
INNER JOIN $this->rg_dbname.rg_Student std ON rgStdId = stdId
WHERE 1=1 AND stdSstId = 1
$con
GROUP BY rgStdId
";
inner join $this->rg_dbname.rg_RegistDetails
on stdId = rdStdId
*/
$sql = "
SELECT *
FROM $this->rg_dbname.rg_Student
WHERE 1=1 AND stdSstId = 1
";
$query = $this->db->query($sql);
return $query;
}
function get_acY(){
$sql = "
SELECT *
FROM $this->rg_dbname.rg_TermConfig
WHERE 1=1
GROUP BY tmcAcY
";
$query = $this->db->query($sql);
return $query;
}
}
|