Viewing file: clsDoAssessment.php (25.39 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//--Class DoAssessment--------------------------
//--PK of DoAssessment ::
// 1. doid
class DoAssessment extends clsDB{
var $result;
var $status;
var $doid;
var $defineid;
var $studentId;
var $officerId;
var $classId;
var $courseId;
var $section;
var $dateAss;
var $ttId;
var $mepId;
var $sepId;
var $xbar;
var $sd;
var $txbar;
var $tsd;
var $officerName;
var $officerSurname;
var $num1;
var $num2;
var $per;
var $prefixName;
var $courseCode;
function DoAssessment(&$c){
$this->c=$c->c;
$this->DB=$c->db;
}
function Save(){
//--ข้อมูลในอ๊อบเจ๊กเป็นข้อมูลใหม่หรือข้อมูลเดิม --1:ข้อมูลใหม่ 2:ข้อมูลเดิม
if ($this->status==1){
//uncomment a line below if your table use ID as running number
$this->doid=$this->GetNextCode();
$sql = "insert into DoAssessment values(
'$this->doid',
'$this->defineid',
'$this->studentId',
'$this->officerId',
'$this->classId',
'$this->courseId',
'$this->section',
'$this->dateAss',
'$this->ttId',
'$this->mepId',
'$this->sepId'
)";
}else {
$sql = "update DoAssessment set
defineid='$this->defineid',
studentId='$this->studentId',
officerId='$this->officerId',
classId='$this->classId',
courseId='$this->courseId',
section='$this->section',
dateAss='$this->dateAss',
ttId='$this->ttId',
mepId='$this->mepId',
sepId='$this->sepId'
where doid='$this->doid'";
}
return $this->Dml($sql);
}
function Delete(){
//--ลบข้อมูลเดิมในอ๊อบเจ๊ก, เป็นการลบข้อมูลทีละ 1 เรคอร์ด
//--ต้องเรียกเมธอดตามลำดับดังนี้ SearchByKey()-->GetRecord()-->Delete()
return $this->Dml("delete from DoAssessment where doid='$this->doid'");
}
function GetNextCode(){
//--หาค่าสูงสุดของฟิลด์ที่ใช้เป็นคีย์ของตาราง ในลักษณะ auto increment
//--ต้องเป็นฟิลด์ชนิดตัวเลขจำนวนเต็มเท่านั้น และไม่ได้กำหนดรหัสเองทางจอภาพ
$this->SetQuery("select max(doid) as num from DoAssessment");
if ($result=$this->GetResult()) {
return $result['num']+1;
}
}
function RSDoAssessment(){
//--เมธอดที่ขึ้นต้นด้วย RS (ResultSet) มีความหมายว่าจะได้รับข้อมูลกลับมาจากการ select มากกว่า 1 เรคอร์ด
//--จะต้องเรียกเมธอด GetRecord() ด้วยเสมอ นำข้อมูลจาก ResultSet เข้าอ๊อบเจ๊ก
//--โดยสามารถเพิ่มเมธอดได้ตามต้องการ แต่ต้องขึ้นต้นด้วย RS
$this->SetQuery("select * from DoAssessment order by doid");
}
function GetRecord(){
//--นำข้อมูลจาก ResultSet มากำหนดให้กับแอตทริบิวต์ของอ๊อบเจ็ก
//--เรียก GetRecord() หนึ่งครั้ง จะเลื่อนตัวชี้เรคอร์ดไปอีกหนึ่งเรคอร์ด
if ($this->result = $this->GetResult()) {
$this->doid = $this->result['doid'];
$this->defineid = $this->result['defineid'];
$this->studentId = $this->result['studentId'];
$this->officerId = $this->result['officerId'];
$this->classId = $this->result['classId'];
$this->courseId = $this->result['courseId'];
$this->section = $this->result['section'];
$this->dateAss = $this->result['dateAss'];
$this->ttId = $this->result['ttId'];
$this->mepId = $this->result['mepId'];
$this->sepId = $this->result['sepId'];
$this->xbar = $this->result['xbar'];
$this->sd = $this->result['sd'];
$this->txbar = $this->result['txbar'];
$this->tsd = $this->result['tsd'];
$this->officerName = $this->result['officerName'];
$this->officerSurname = $this->result['officerSurname'];
$this->num1 = $this->result['num1'];
$this->num2 = $this->result['num2'];
$this->per = $this->result['per'];
$this->prefixName = $this->result['prefixName'];
$this->courseCode = $this->result['courseCode'];
return 1;
}else {
return 0;
}
}
function SearchByKey($xKey){
//--ค้นหาข้อมูลตาม PK ต้องระบุพารามิเตอร์ด้วย และต้องตามด้วยเมธอด GetRecord() เสมอ
if ($this->SetQuery("select * from DoAssessment where doid= '$xKey'")){
return 1;
}else {
return 0;
}
}
//****************** You can add new functions below **********************//
function getMaxDoid(){
$this->SetQuery("select max(doid) as num from DoAssessment");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function CountCheckAssessment($xdefineid,$xstudentId,$xofficerId,$xclassId,$xsection){
$this->SetQuery("select count(*) as num from DoAssessment where defineid = '$xdefineid' and studentId = '$xstudentId' and officerId = '$xofficerId' and classId = '$xclassId' and section = '$xsection'");
$result = $this->GetResult();
return $result['num'];
}
function CountDoidByDefineid($xdefineid){
$this->SetQuery("select count(doid) as num from DoAssessment where defineid = '$xdefineid'");
$result = $this->GetResult();
return $result['num'];
}
//16/11/2006
function CountDoidByAcadSemDefineIdOfficerIdJoinClass($xacadYear,$xsemester,$xdefineid,$xofficerId){
$this->SetQuery("select count(*) as num from ClassAssess A, DoAssessment B where acadYear = '$xacadYear' and semester = '$xsemester' and defineid = '$xdefineid' and officerId = '$xofficerId' and A.classId = B.classId");
$result = $this->GetResult();
return $result['num'];
}
function CountDoidByDefineIdClassIdOfficeridSection($xdefineid,$xclassId,$xofficerId,$xsection){
$this->SetQuery("select count(*) as num from DoAssessment where defineid= '$xdefineid' and classId= '$xclassId' and officerId = '$xofficerId' and section = '$xsection'");
$result = $this->GetResult();
return $result['num'];
}
function CheckAssessment($xdefineid,$xstudentId,$xofficerId,$xclassId,$xsection){
if ($this->SetQuery("select * from DoAssessment where defineid = '$xdefineid' and studentId = '$xstudentId' and officerId = '$xofficerId' and classId = '$xclassId' and section = '$xsection'")){
return 1;
}else {
return 0;
}
}
function CheckAssessment2($xdefineid,$xstudentId,$xofficerId,$xttId,$xsection){
if ($this->SetQuery("select * from DoAssessment where defineid = '$xdefineid' and studentId = '$xstudentId' and officerId = '$xofficerId' and ttId = '$xttId' and section = '$xsection'")){
return 1;
}else {
return 0;
}
}
function SearchDoidByDefineid($xdefineid){
if ($this->SetQuery("select doid from DoAssessment where defineid= '$xdefineid'")){
return 1;
}else {
return 0;
}
}
function SearchDoidByDefineidOfficeridClassId($xdefineid,$xofficerId,$xclassId){
if ($this->SetQuery("select doid
from DoAssessment
where defineid= '$xdefineid'
and officerId LIKE '$xofficerId'
and classId LIKE '$xclassId'
order by classId,doid
")){
return 1;
}else {
return 0;
}
}
function SearchByDefineidOfficeridClassId($xdefineid,$xofficerId,$xclassId){
if ($this->SetQuery("select * from DoAssessment where defineid= '$xdefineid' and officerId = '$xofficerId' and classId = '$xclassId'")){
return 1;
}else {
return 0;
}
}
function SearchClassIdByDefineidOfficerid($xdefineid,$xofficerId){
if ($this->SetQuery("select classId from DoAssessment where defineid= '$xdefineid' and officerId = '$xofficerId' group by classId")){
return 1;
}else {
return 0;
}
}
function SearchByDefineIdClassIdOfficeridSection($xdefineid,$xclassId,$xofficerId,$xsection){
if ($this->SetQuery("select * from DoAssessment where defineid= '$xdefineid' and classId= '$xclassId' and officerId = '$xofficerId' and section = '$xsection'")){
return 1;
}else {
return 0;
}
}
function SearchByDefineIdClassId($xdefineid,$xclassId){
$sql = "select * from DoAssessment where defineid= '$xdefineid' and classId= '$xclassId'";
if ($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
function CountCheckAssessment2($xdefineid,$xstudentId,$xofficerId,$xttId,$xsection){
$this->SetQuery("select count(*) as num from DoAssessment where defineid = '$xdefineid' and studentId = '$xstudentId' and officerId = '$xofficerId' and ttId = '$xttId' and section = '$xsection'");
$result = $this->GetResult();
return $result['num'];
}
function CountCheckAssessment3($xdefineid,$xstudentId,$xclassId,$xsection){
$this->SetQuery("select count(*) as num from DoAssessment where defineid = '$xdefineid' and studentId = '$xstudentId' and classId = '$xclassId' and section = '$xsection' and ttId = 0");
$result = $this->GetResult();
return $result['num'];
}
function CountCheckAssessmentHP($xdefineid,$xstudentId,$xclassId,$xsection,$xmepId,$xsepId){
$this->SetQuery("select count(*) as num from DoAssessment where defineid = '$xdefineid' and studentId = '$xstudentId' and classId = '$xclassId' and section = '$xsection' and ttId = 0 and mepId = '$xmepId' and sepId = '$xsepId' ");
$result = $this->GetResult();
return $result['num'];
}
function SearchByDefineIdClassIdOfficeridSectionttId($xdefineid,$xclassId,$xofficerId,$xsection,$xttId){
if ($this->SetQuery("select * from DoAssessment where defineid= '$xdefineid' and classId= '$xclassId' and officerId = '$xofficerId' and section = '$xsection' and ttId='$xttId' ")){
return 1;
}else {
return 0;
}
}
function SearchStdIdByDefineIdClassIdOfficeridSection($xdefineid,$xclassId,$xofficerId,$xsection){
if ($this->SetQuery("select distinct studentId from DoAssessment where defineid= '$xdefineid' and classId= '$xclassId' and officerId = '$xofficerId' and section = '$xsection'")){
return 1;
}else {
return 0;
}
}
function SearchDoidByDefineidOfficeridClassIdttId($xdefineid,$xofficerId,$xclassId,$xttId){
if ($this->SetQuery("select doid from DoAssessment where defineid= '$xdefineid' and officerId = '$xofficerId' and classId = '$xclassId' and ttId ='$xttId' order by doid")){
return 1;
}else {
return 0;
}
}
function CountDistinctStdByDefineidOfficeridClassId($xdefineid,$xofficerId,$xclassId){
$this->SetQuery("select count(distinct(studentId)) as num from DoAssessment where defineid = '$xdefineid' and officerId = '$xofficerId' and classId = '$xclassId' ");
$result = $this->GetResult();
return $result['num'];
}
function CountDistinctStdByDefineidOfficeridClassIdttId($xdefineid,$xofficerId,$xclassId,$xttId){
$this->SetQuery("select count(distinct(studentId)) as num from DoAssessment where defineid = '$xdefineid' and officerId = '$xofficerId' and classId = '$xclassId' and ttId = '$xttId' ");
$result = $this->GetResult();
return $result['num'];
}
function RSDistinctOfficeridByDefineid($xdefineid){
if($this->SetQuery("select distinct officerId from DoAssessment where defineid = '$xdefineid' order by officerId")){
return 1;
}else{
return 0;
}
}
function SearchByClassIdOfficeridttId($xclassId,$xofficerId,$xttId){
if ($this->SetQuery("select * from DoAssessment where classId = '$xclassId' and officerId = '$xofficerId' and ttId ='$xttId' ")){
return 1;
}else {
return 0;
}
}
function SearchByClassIdOfficerid($xclassId,$xofficerId){
if ($this->SetQuery("select * from DoAssessment where classId = '$xclassId' and officerId = '$xofficerId' ")){
return 1;
}else {
return 0;
}
}
// sumRe
function RSXbarSDSumReByCourseIdDefineidOfficerId($xCourseId,$xdefineid,$xOfficerId){
if ($this->SetQuery("
select A.sec1 as section,xbar,sd,txbar,tsd
from (
select section as sec1, xbar as txbar, sqrt(sumpow2-(xbar*xbar)) as tsd
from (
SELECT ca.section,avg(point) as xbar,sum(point*point)/count(point) as sumpow2
FROM DoAssessment da
inner JOIN ClassAssess ca ON ca.classId = da.classId
inner JOIN ResultRQ rrq ON rrq.doid = da.doid
WHERE da.defineid = '$xdefineid'
AND da.officerId = '$xOfficerId'
AND ca.courseId = '$xCourseId'
group by ca.section
)inn1
)A,(
select section as sec2,sectionRQid , xbar , sqrt(sumpow2-(xbar*xbar)) as sd
from (
SELECT ca.section as section,rrq.sectionRQid,avg(point) as xbar,sum(point*point)/count(point) as sumpow2
FROM DoAssessment da
inner JOIN ClassAssess ca ON ca.classId = da.classId
inner JOIN ResultRQ rrq ON rrq.doid = da.doid
WHERE da.defineid = '$xdefineid'
AND da.officerId = '$xOfficerId'
AND ca.courseId = '$xCourseId'
group by ca.section,rrq.sectionRQid
)inn2
order by section,sectionRQid
)B
where A.sec1 = B.sec2
order by A.sec1
")){
return 1;
}else {
return 0;
}
}
function getOverviewCourseByCourseIdDefineidOfficerId($xCourseId,$xdefineid,$xOfficerId){
if ($this->SetQuery("
SELECT avg(point) AS xbar, stddev(point) as sd
FROM DoAssessment da
inner JOIN ClassAssess ca ON ca.classId = da.classId
inner JOIN ResultRQ rrq ON rrq.doid = da.doid
WHERE da.defineid = '$xdefineid'
AND da.officerId = '$xOfficerId'
AND ca.courseId = '$xCourseId'
")){
return 1;
}else {
return 0;
}
}
function RSOverviewCourseSectionRQidByCourseIdDefineidOfficerId($xCourseId,$xdefineid,$xOfficerId){
if ($this->SetQuery("
SELECT rrq.sectionRQid, avg(point) AS xbar, stddev(point) as sd
FROM DoAssessment da
inner JOIN ClassAssess ca ON ca.classId = da.classId
inner JOIN ResultRQ rrq ON rrq.doid = da.doid
WHERE da.defineid = '$xdefineid'
AND da.officerId = '$xOfficerId'
AND ca.courseId = '$xCourseId'
GROUP BY rrq.sectionRQid
")){
return 1;
}else {
return 0;
}
}
function CountDoStdOrderSectionByDefineIdCourseIdOfficerid($defineid,$courseId,$officerId){
if($this->SetQuery(" SELECT r1.section, r1.num AS num1, r2.num AS num2, (r1.num/r2.num)*100 AS per
FROM (
SELECT section, count( * ) AS num
FROM DoAssessment
WHERE defineid = '$defineid'
AND courseId = '$courseId'
AND officerId = '$officerId'
GROUP BY section
)r1, (
SELECT section, count( reg.studentId ) AS num
FROM DefineAssessment df
JOIN Registration reg ON df.acadYear = reg.acadYear
AND df.semester = reg.semester
JOIN ClassAssess cl ON cl.classId = reg.classId
WHERE df.defineid = '$defineid'
AND reg.courseId = '$courseId'
GROUP BY cl.section
)r2
WHERE r1.section = r2.section"))
{
return 1;
}else{
return 0;
}
}
// RSXbarSD --/04/2552
function RSXbarSDOverviewCollage($xassid, $xacadYear, $xsemester, $xdefineid, $xOfSitId)
{
$cond = ($xsemester!='%')?"AND df.semester = '$xsemester'":'';
$cond.= ($xdefineid!='%')?"AND df.defineid = '$xdefineid'":'';
$cond.= ($xassid!='%')?"AND df.assid = '$xassid'":'';
$cond2 = ($xOfSitId!='%')?"AND ofSitId = '$xOfSitId'":'';
$sql = "
SELECT B.sectionRQid,C.officerId as officerId, C.officerName as officerName,C.officerSurname as officerSurname,of2,xbar,sd,txbar,tsd
from (
SELECT officerId as of1, xbar as txbar, sqrt(sumpow2-(xbar*xbar)) as tsd
from (
SELECT da.officerId,sum(point)/count(point) as xbar,sum(point*point)/count(point) as sumpow2
FROM DoAssessment da
inner JOIN DefineAssessment df ON df.defineid = da.defineid
inner JOIN ResultRQ rrq ON rrq.doid = da.doid
INNER JOIN `SectionAll` sa ON sa.sectionRQid = rrq.sectionRQid
AND df.assid = sa.assid
WHERE df.acadYear = '$xacadYear'
$cond
group by da.officerId
)inn1
)A
INNER JOIN (
SELECT officerId AS of2,sectionRQid , xbar , sqrt(sumpow2-(xbar*xbar)) AS sd
from (
SELECT da.officerId,rrq.sectionRQid,sum(point)/count(point) AS xbar,sum(point*point)/count(point) AS sumpow2
FROM DoAssessment da
INNER JOIN DefineAssessment df ON df.defineid = da.defineid
INNER JOIN ResultRQ rrq ON rrq.doid = da.doid
INNER JOIN `SectionAll` sa ON sa.sectionRQid = rrq.sectionRQid
AND df.assid = sa.assid
WHERE df.acadYear = '$xacadYear'
$cond
GROUP BY da.officerId,rrq.sectionRQid
)inn2
)B ON of1=of2
INNER JOIN
(
SELECT * FROM OfficerAssess WHERE 1=1 $cond2
)C ON of2=C.officerId
WHERE 1=1
order by txbar desc ,tsd desc ,B.sectionRQid
";
//echo $sql;
if($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
// SumXbarSD --/04/2552
function SumOverviewCollage($xassid, $xacadYear, $xsemester, $xdefineid, $xOfSitId)
{
$cond = ($xsemester!='%')?"AND df.semester = '$xsemester'":'';
$cond.= ($xdefineid!='%')?"AND df.defineid = '$xdefineid'":'';
$cond.= ($xassid!='%')?"AND df.assid = '$xassid'":'';
$cond2 = ($xOfSitId!='%')?"AND ofSitId = '$xOfSitId'":'';
$sql = "
SELECT sectionRQid, xbar,sd
FROM (
SELECT rrq.sectionRQid, sum(point)/count(point) AS xbar, sqrt(sum(point*point)/count(point) - (sum(point)/count(point)*sum(point)/count(point))) AS sd
FROM DefineAssessment df
INNER JOIN DoAssessment da ON df.defineid = da.defineid
INNER JOIN ResultRQ rrq ON rrq.doid = da.doid
INNER JOIN `SectionAll` sa ON sa.sectionRQid = rrq.sectionRQid
AND df.assid = sa.assid
INNER JOIN OfficerAssess oa ON oa.officerId = da.officerId
WHERE df.acadYear LIKE '$xacadYear'
AND sa.sectionRQid != 0
$cond
GROUP BY rrq.sectionRQid
order by rrq.sectionRQid
)inn2
";
if ($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
function CountStdByDefineIdCourseIdClassIdOfficerid($xdefineid,$xcourseId,$xclassId,$xofficerId,$mepId='%',$sepId='%'){
$cond = '';
$cond.= ($xclassId!='%')? " and classId = '$xclassId'" : '' ;
$cond.= ($xofficerId!='%')? " and officerId = '$xofficerId'" : '' ;
$cond.= ($mepId!='%')? " and mepId = '$mepId'" : '' ;
$cond.= ($sepId!='%')? " and sepId = '$sepId'" : '' ;
$sql = "select count(distinct studentId) as num
from DoAssessment
where defineid= '$xdefineid'
and courseId = '$xcourseId'
$cond";
$this->SetQuery($sql);
$result = $this->GetResult();
return $result['num'];
}
function CountDoidByDefineIdCourseIdClassIdOfficerid($xdefineid,$xcourseId,$xclassId,$xofficerId,$mepId='%',$sepId='%'){
$cond = '';
$cond.= ($xclassId!='%')? " and classId = '$xclassId'" : '' ;
$cond.= ($xofficerId!='%')? " and officerId = '$xofficerId'" : '' ;
$cond.= ($mepId!='%')? " and mepId = '$mepId'" : '' ;
$cond.= ($sepId!='%')? " and sepId = '$sepId'" : '' ;
$sql = "select count(doid) as num
from DoAssessment
where defineid= '$xdefineid'
and courseId = '$xcourseId'
$cond";
$this->SetQuery($sql);
$result = $this->GetResult();
return $result['num'];
}
function RSDoidByDefineidOfficeridClassIdCourseId($xdefineid,$xofficerId,$xclassId,$xcourseId){
if ($this->SetQuery("select doid from DoAssessment where defineid= '$xdefineid' and officerId LIKE '$xofficerId' and classId LIKE '$xclassId' and courseId LIKE '$xcourseId' order by classId,doid")){
return 1;
}else {
return 0;
}
}
function SearchDoidByDeOfClCoTtMepSep($xdefineid,$xofficerId,$xclassId,$courseId,$ttId,$mepId,$sepId){
$cond = '';
$cond.= ($xclassId!='%')? " and classId = $xclassId" : '' ;
$cond.= ($xofficerId!='%')? " and officerId = $xofficerId" : '' ;
$cond.= ($courseId!='%')? " and courseId = $courseId" : '' ;
$cond.= ($ttId!='%')? " and ttId = $ttId" : '' ;
$cond.= ($mepId!='%')? " and mepId = $mepId" : '' ;
$cond.= ($sepId!='%')? " and sepId = $sepId" : '' ;
$sql = "select doid
from DoAssessment
where defineid= '$xdefineid'
$cond
order by classId,doid
";
if ($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
// 09 2553
function RSXbarSDAllCrsOf($xassid, $xacadYear, $xsemester, $xdefineid, $xOfSitId)
{
$cond = ($xsemester!='%')?"AND df.semester = '$xsemester'":'';
$cond.= ($xdefineid!='%')?"AND df.defineid = '$xdefineid'":'';
$cond2 = ($xOfSitId!='%')?"AND of.ofSitId = '$xOfSitId'":'';
$sql = "
select of.officerId as officerId,prefixName, officerName, officerSurname,
ca.courseId,courseCode,xbar,sd,txbar,tsd
from OfficerAssess of
inner join
(
SELECT da.officerId , avg( point ) AS txbar, STDDEV(point) AS tsd
FROM DefineAssessment df
INNER JOIN DoAssessment da ON df.defineid = da.defineid
INNER JOIN ResultRQ rrq ON rrq.doid = da.doid
WHERE df.acadYear = '$xacadYear'
AND df.assid = '$xassid'
$cond
group by da.officerId
)rs_sum on rs_sum.officerId = of.officerId
inner join
(
SELECT da.officerId ,da.courseId, avg( point ) AS xbar, STDDEV(point) AS sd
FROM DefineAssessment df
INNER JOIN DoAssessment da ON df.defineid = da.defineid
INNER JOIN ResultRQ rrq ON rrq.doid = da.doid
WHERE df.acadYear = '$xacadYear'
AND df.assid = '$xassid'
$cond
group by da.officerId, da.courseId
)rs on rs.officerId=rs_sum.officerId
inner join CourseAssess ca on rs.courseId = ca.courseId
WHERE 1=1 $cond2
order by txbar desc ,tsd desc ,rs.courseId
";
if ($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
/*
10-2553 BC.
ค้นหารายชื่อรายชื่อผู้ที่ต้องหาแบบประเมิน และทำแบบประเมินหรือยัง flag = 8
*/
function RSNotAssessF8($defineid){
$sql = "SELECT r1 . *
FROM (
SELECT hc.defineid, rg.courseId, cl.section, rg.classId, rg.studentId, hc.officerId
FROM HoldCourse hc
INNER JOIN ClassAssess cl ON hc.classId = cl.classId
INNER JOIN Registration rg ON cl.classId = rg.classId
WHERE hc.defineid = '$defineid'
ORDER BY rg.courseId, cl.section, rg.studentId, hc.officerId
)r1
WHERE concat(r1.classId,'/',r1.officerId,'/',r1.studentId) NOT IN (
SELECT concat(classId,'/',officerId,'/',studentId) FROM DoAssessment da WHERE da.defineid = '$defineid'
)
group by r1.courseId, r1.classId, r1.studentId
";
if ($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
function RSNotAssessF0($defineid){
$sql = "SELECT r1 . *
FROM (
SELECT df.defineid, rg.courseId, cl.section, rg.classId, rg.studentId, cis.officerId
FROM DefineAssessment df
INNER JOIN ClassAssess cl ON df.acadYear = cl.acadYear AND df.semester = cl.semester
INNER JOIN Registration rg ON cl.classId = rg.classId
INNER JOIN ClassInStructorAssess cis ON cis.classId = cl.classId
WHERE df.defineid = '$defineid'
ORDER BY rg.courseId, cl.section, rg.studentId, cis.officerId
)r1
WHERE concat(r1.classId,'/',r1.officerId,'/',r1.studentId) NOT IN (
SELECT concat(classId,'/',officerId,'/',studentId) FROM DoAssessment da WHERE da.defineid = '$defineid'
)
group by r1.courseId, r1.classId, r1.studentId
";
if ($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
function RSNotAssessF5($defineid){
$sql = "SELECT r1 . *
FROM (
SELECT df.defineid, rg.courseId, cl.section, rg.classId, rg.studentId
FROM DefineAssessment df
INNER JOIN ClassAssess cl ON df.acadYear = cl.acadYear AND df.semester = cl.semester
INNER JOIN Registration rg ON cl.classId = rg.classId
WHERE df.defineid = '$defineid'
ORDER BY rg.courseId, cl.section, rg.studentId
)r1
WHERE concat(r1.classId,'/0/',r1.studentId) NOT IN (
SELECT concat(classId,'/',officerId,'/',studentId) FROM DoAssessment da WHERE da.defineid = '$defineid'
)
group by r1.courseId, r1.classId, r1.studentId
";
if ($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
function RSNotAssessF6($defineid){
$sql = "SELECT r1 . *
FROM (
SELECT hc.defineid, rg.courseId, cl.section, rg.classId, rg.studentId
FROM HoldCourse hc
INNER JOIN ClassAssess cl ON hc.classId = cl.classId
INNER JOIN Registration rg ON cl.classId = rg.classId
WHERE hc.defineid = '$defineid'
ORDER BY rg.courseId, cl.section, rg.studentId
)r1
WHERE concat(r1.classId,'/0/',r1.studentId) NOT IN (
SELECT concat(classId,'/',officerId,'/',studentId) FROM DoAssessment da WHERE da.defineid = '$defineid'
)
group by r1.courseId, r1.classId, r1.studentId
";
if ($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
function RSNotAssessF9($defineid){
$sql = "SELECT r1 . *
FROM (
SELECT hp.defineid, rg.courseId, cl.section, rg.classId, rg.studentId, hp.mepId,hp.sepId
FROM HoldPlace hp
INNER JOIN ClassAssess cl ON hp.classId = cl.classId
INNER JOIN Registration rg ON cl.classId = rg.classId
WHERE hp.defineid = '$defineid'
ORDER BY rg.courseId, cl.section, rg.studentId
)r1
WHERE concat(r1.classId,'/0/',r1.studentId,r1.mepId,r1.sepId) NOT IN (
SELECT concat(classId,'/',officerId,'/',studentId,mepId,sepId) FROM DoAssessment da WHERE da.defineid = '$defineid'
)
group by r1.courseId, r1.classId, r1.studentId
";
if ($this->SetQuery($sql)){
return 1;
}else {
return 0;
}
}
} //--End class DoAssessment--
?>
|