Viewing file: clsEnrollItemOLD.php (14.79 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//--Class EnrollItem--------------------------
include_once "clsbase_EnrollItem.php";
class EnrollItem extends base_EnrollItem{
function GetSumCr1ByStIdAndAcYAndSe($xKey, $yKey, $zKey){
$this->SetQuery("select sum(credit1) as num from EnrollItem where studentId='$xKey' and acadYear='$yKey' and semester='$zKey'");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function GetSumCr2ByStIdAndAcYAndSe($xKey, $yKey, $zKey){
$this->SetQuery("select sum(credit2) as num from EnrollItem where studentId='$xKey' and acadYear='$yKey' and semester='$zKey'");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function RSEnrollItemByStIdAndAcYAndSe($xKey, $yKey, $zKey){
$this->SetQuery("select * from EnrollItem where studentId='$xKey' and acadYear='$yKey' and semester='$zKey'");
}
function RSEnrollItemByStIdAndAcYAndSeAndCdId($wKey, $xKey, $yKey, $zKey){
$this->SetQuery("select * from EnrollItem where studentId='$wKey' and acadYear='$xKey' and semester='$yKey' and conditionId='$zKey'");
}
function GetSumCrAtByStId($xKey){
$this->SetQuery("select sum(creditAttempt) as num from EnrollItem where studentId='$xKey'");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function GetSumCrAtByStIdAndAcYAndSe($xKey, $yKey, $zKey){
$this->SetQuery("select sum(creditAttempt) as num from EnrollItem where studentId='$xKey' and acadYear='$yKey' and semester='$zKey'");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function RSEnrollItemByStIdAndAcYAndSeAndClId($wKey, $xKey, $yKey, $zKey){
$this->SetQuery("select * from EnrollItem where studentId='$wKey' and acadYear='$xKey' and semester='$yKey' and classId='$zKey'");
}
function GetSumCrAtByStIdAndCdIdAndCdId2($xKey, $yKey, $zKey){
$this->SetQuery("select sum(creditAttempt) as num from EnrollItem where studentId='$xKey' and conditionId='$yKey' and conditionId2='$zKey'");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function RSEnrollItemByStIdAndCdIdAndCdId2($xKey, $yKey, $zKey){
$this->SetQuery("select * from EnrollItem where studentId='$xKey' and conditionId='$yKey' and conditionId2='$zKey'");
}
function GetSumCrAtByStIdAndCdId($xKey, $yKey){
$this->SetQuery("select sum(creditAttempt) as num from EnrollItem where studentId='$xKey' and conditionId='$yKey'");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function RSEnrollItemByStIdAndCdId($xKey, $yKey){
$this->SetQuery("select * from EnrollItem where studentId='$xKey' and conditionId='$yKey' order by semester, acadYear");
}
function RSEnrollItemByStIdAndGradeIsF($xKey){
$this->SetQuery("select * from EnrollItem where studentId='$xKey' and grade='F'");
}
function RSEnrollItemByClId($xKey){
$this->SetQuery("select * from EnrollItem where classId='$xKey'");
}
// Use on page classTable.php
function RSEnrollItemByClassId($cKey, $dKey, $eKey){
$this->SetQuery("select classId from EnrollItem where classId='$cKey' and semester='$dKey' and acadYear='$eKey' group by classId");
// $this->SetQuery("select * from EnrollItem where classId='$cKey' and semester='$dKey' and acadYear='$eKey' group by classId");
}
//-- The end --
// Use on page addGrade.php
function RSEnrollItemByClsIdAcySem($bKey,$cKey,$dKey){
$this->SetQuery("select * from EnrollItem where classId='$bKey' and acadYear='$cKey' and semester='$dKey' order by studentId");
}
function RSEnrollItemCountStIdByGrade($ClsId,$AcY,$SeM,$Gd){
$this->SetQuery("select count(studentId) as num from EnrollItem where classId='$ClsId' and acadYear='$AcY' and semester='$SeM' and grade='$Gd' order by studentId");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function RSEnrollItemCountStIdByAllGrade($ClsId,$AcY,$SeM){
$this->SetQuery("select count(studentId) as num from EnrollItem where classId='$ClsId' and acadYear='$AcY' and semester='$SeM' and grade!='F' and grade!='' order by studentId");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
//-- The end --
// Use on page processSendGrade.php
function SearchByKeyStudIdClsIdAcySem($wKey, $xKey, $yKey, $zKey){
if ($this->SetQuery("select * from EnrollItem where studentId='$wKey' and classId='$xKey' and acadYear='$yKey' and semester='$zKey' order by studentId")){
return 1;
}else {
return 0;
}
}
//-- The End --
// Use on page calGradeProg.php
function RSEnrollItemByAcySem($bKey,$cKey){
$this->SetQuery("select studentId from EnrollItem where acadYear='$bKey' and semester='$cKey' group by studentId");
}
//-- The end --
//-- Use on page calGradeProg.php --
function RSEnrollItemGetStud($aKey, $bKey, $cKey){
$this->SetQuery("select * from EnrollItem where studentId='$aKey' and acadYear='$bKey' and semester='$cKey' and noCalGPA='N'");
}
//-- The end --
//-- Use on page processCalGradeProg.php --
function RSEnrollItemGetGdPXCdAtt($aKey, $AcY, $SeM, $str){
$this->SetQuery("select * from EnrollItem where studentId='$aKey' and acadYear='$AcY' and semester='$SeM' and noCalGPA='N' and grade in ($str)");
}
function RSEnrollItemSemGradeCr($aKey, $AcY, $SeM, $str){
$this->SetQuery("select sum(creditAttempt) as num from EnrollItem where studentId='$aKey' and acadYear='$AcY' and semester='$SeM' and noCalGPA='N' and grade in ($str)");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function RSEnrollItemCumGradeCr($aKey, $AcY, $SeM, $str){
$this->SetQuery("select * from EnrollItem where studentId='$aKey' and concat($AcY, $SeM) >= concat(acadYear,semester) and noCalGPA='N' and grade in ($str)");
}
function RSEnrollItemCumGradeCr2($aKey, $AcY, $SeM, $str){
$this->SetQuery("select sum(creditAttempt) as num from EnrollItem where studentId='$aKey' and concat($AcY, $SeM) >= concat(acadYear,semester) and noCalGPA='N' and grade in ($str)");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function RSEnrollItemCountGrade($AcY, $SeM){
$this->SetQuery("select count(grade) as num from EnrollItem where acadYear='$AcY' and semester='$SeM'");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function RSEnrollItemCountGradeByStId($StId, $AcY, $SeM){
$this->SetQuery("select count(grade) as num from EnrollItem where studentId='$StId', acadYear='$AcY' and semester='$SeM'");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
function RSEnrollItemByStId($StId){
$this->SetQuery("select acadYear, semester from EnrollItem where studentId='$StId' group by acadYear, semester");
}
/*function RSEnrollItemByStIdCoIdAcYSeMNoF($StID,$ClID,$AcY,$SeM){
$this->SetQuery("select * from EnrollItem where studentId='$aKey' and and acadYear='$bKey' and semester='$cKey' and noCalGPA='N' and grade in ($str)");
}*/
function calSemGPA($aKey, $bKey, $cKey){ //-- This function for calculate GPA Current
include_once "clsGradeConfig.php";
include_once "clsClass.php";
$oGc = new GradeConfig();
$oGc2 = new GradeConfig();
$oCl = new Class1();
$oCl2 = new Class1();
$semGPA=0;
$gradeXCreditAttmp=0;
$sumCreditAttmp=0;
$sumTotalCredit=0;
$i=0;
$oGc->RSGradeConfig();
while($oGc->GetRecord()){
if($oGc->calGrade=='Y' && $oGc->calCredit=='Y'){ // GPA term
$strGyy="'".$oGc->grade."',".$strGyy;
}
$i++;
}
// Set varia ble new
$strGyy=$strGyy."''";
$j=0;
$this->RSEnrollItemGetGdPXCdAtt($aKey, $bKey, $cKey, $strGyy);
while($this->GetRecord()){
$oGc2->SearchByKeyGrade($this->grade);
$oGc2->GetRecord();
$gradeXCreditAttmp=($oGc2->gradePoint*$this->creditAttempt) + $gradeXCreditAttmp;
//$sumCreditAttmp=$this->creditAttempt + $sumCreditAttmp;
$j++;
}
$sumCreditAttmp=$this->RSEnrollItemSemGradeCr($aKey, $bKey, $cKey, $strGyy);
$semGPA=$gradeXCreditAttmp/$sumCreditAttmp;
return number_format($semGPA,2);
}
function calCreditAttempt($aKey, $bKey, $cKey){ //-- This function for calculate CreditAttempt Current
include_once "clsGradeConfig.php";
$oGc = new GradeConfig();
$sumCreditAttmp=0;
$i=0;
$oGc->RSGradeConfig();
while($oGc->GetRecord()){
if($oGc->calCredit=='Y'){ // Credit Attempt
$strGay="'".$oGc->grade."',".$strGay;
}
$i++;
}
// Set varia ble new
$strGay=$strGay."''";
$j=0;
//$this->RSEnrollItemGetGdPXCdAtt($aKey, $bKey, $cKey, $strGay);
//while($this->GetRecord()){
// $sumCreditAttmp=$this->creditAttempt + $sumCreditAttmp;
// $j++;
//}
$sumCreditAttmp=$this->RSEnrollItemSemGradeCr($aKey, $bKey, $cKey, $strGay);
return $sumCreditAttmp;
}
function calCreditSatisfy($aKey, $bKey, $cKey){ //-- This function for calculate CreditSatisfy Current
include_once "clsGradeConfig.php";
$oGc = new GradeConfig();
$sumCreditSatisfy=0;
$i=0;
$oGc->RSGradeConfig();
while($oGc->GetRecord()){
if($oGc->grade!='F' && $oGc->calCredit=='Y'){ // Credit Satisfy
$strGnfy="'".$oGc->grade."',".$strGnfy;
}
$i++;
}
// Set varia ble new
$strGnfy=$strGnfy."''";
$j=0;
//$this->RSEnrollItemGetGdPXCdAtt($aKey, $bKey, $cKey, $strGnfy);
//while($this->GetRecord()){
// $sumCreditSatisfy=$this->creditAttempt + $sumCreditSatisfy;
// $j++;
//}
$sumCreditSatisfy=$this->RSEnrollItemSemGradeCr($aKey, $bKey, $cKey, $strGnfy);
return $sumCreditSatisfy;
}
function calCreditPoint($aKey, $bKey, $cKey){ //-- This function for calculate CreditPoint Current
include_once "clsGradeConfig.php";
$oGc = new GradeConfig();
$sumCreditPoint=0;
$i=0;
$oGc->RSGradeConfig();
while($oGc->GetRecord()){
if($oGc->grade!='F' && $oGc->calGrade=='Y' && $oGc->calCredit=='Y'){ // Credit Point
$strGnfyy="'".$oGc->grade."',".$strGnfyy;
}
$i++;
}
// Set varia ble new
$strGnfyy=$strGnfyy."''";
$j=0;
/*$this->RSEnrollItemGetGdPXCdAtt($aKey, $bKey, $cKey, $strGnfyy);
while($this->GetRecord()){
$sumCreditPoint=$this->creditAttempt + $sumCreditPoint;
$j++;
}
*/
$sumCreditPoint=$this->RSEnrollItemSemGradeCr($aKey, $bKey, $cKey, $strGnfyy);
return $sumCreditPoint;
}
function calCumGPA($aKey,$AcY,$SeM){ //-- This function for calculate GPA total grade point average
include_once "clsGradeConfig.php";
$oGc = new GradeConfig();
$oGc2 = new GradeConfig();
$cumGPA=0;
$gradeXCreditAttmp=0;
$cumCreditAttmp=0;
$cumTotalCredit=0;
$i=0;
$oGc->RSGradeConfig();
while($oGc->GetRecord()){
if($oGc->calGrade=='Y' && $oGc->calCredit=='Y'){ // Total GPA term
$strGyy="'".$oGc->grade."',".$strGyy;
}
$i++;
}
// Set varia ble new
$strGyy=$strGyy."''";
$j=0;
$this->RSEnrollItemCumGradeCr($aKey, $AcY, $SeM, $strGyy);
while($this->GetRecord()){
$oGc2->SearchByKeyGrade($this->grade);
$oGc2->Getrecord();
$gradeXCreditAttmp=($oGc2->gradePoint*$this->creditAttempt) + $gradeXCreditAttmp;
// $cumCreditAttmp=$this->creditAttempt + $cumCreditAttmp;
$j++;
}
$cumCreditAttmp=$this->RSEnrollItemCumGradeCr2($aKey, $AcY, $SeM, $strGyy);
$cumGPA=$gradeXCreditAttmp/$cumCreditAttmp;
return number_format($cumGPA,2);
}
function calCumCreditAttempt($aKey, $AcY, $SeM){ //-- This function for calculate CreditAttempt Total
include_once "clsGradeConfig.php";
$oGc = new GradeConfig();
$cumCreditAttmp=0;
$i=0;
$oGc->RSGradeConfig();
while($oGc->GetRecord()){
if($oGc->calCredit=='Y'){ // Total Credit Attempt
$strGay="'".$oGc->grade."',".$strGay;
}
$i++;
}
// Set varia ble new
$strGay=$strGay."''";
$j=0;
/*$this->RSEnrollItemCumGradeCr($aKey, $AcY, $SeM, $strGay);
while($this->GetRecord()){
$cumCreditAttmp=$this->creditAttempt + $cumCreditAttmp;
$j++;
}*/
$cumCreditAttmp=$this->RSEnrollItemCumGradeCr2($aKey, $AcY, $SeM, $strGay);
return $cumCreditAttmp;
}
function calCumCreditSatisfy($aKey, $AcY, $SeM){ //-- This function for calculate CreditSatisfy Total
include_once "clsGradeConfig.php";
$oGc = new GradeConfig();
$cumCreditSatisfy=0;
$i=0;
$oGc->RSGradeConfig();
while($oGc->GetRecord()){
if($oGc->grade!='F' && $oGc->calCredit=='Y'){ // Total Credit Satisfy
$strGnfy="'".$oGc->grade."',".$strGnfy;
}
$i++;
}
// Set varia ble new
$strGnfy=$strGnfy."''";
$j=0;
/*$this->RSEnrollItemCumGradeCr($aKey, $AcY, $SeM, $strGnfy);
while($this->GetRecord()){
$cumCreditSatisfy=$this->creditAttempt + $cumCreditSatisfy;
$j++;
}*/
$cumCreditSatisfy=$this->RSEnrollItemCumGradeCr2($aKey, $AcY, $SeM, $strGnfy);
return $cumCreditSatisfy;
}
function calCumCreditPoint($aKey, $AcY, $SeM){ //-- This function for calculate CreditPoint Total
include_once "clsGradeConfig.php";
$oGc = new GradeConfig();
$cumCreditPoint=0;
$i=0;
$oGc->RSGradeConfig();
while($oGc->GetRecord()){
if($oGc->grade!='F' && $oGc->calGrade=='Y' && $oGc->calCredit=='Y'){ // Total Credit Point
$strGnfyy="'".$oGc->grade."',".$strGnfyy;
}
$i++;
}
// Set varia ble new
$strGnfyy=$strGnfyy."''";
$j=0;
/*$this->RSEnrollItemCumGradeCr($aKey, $AcY, $SeM, $strGnfyy);
while($this->GetRecord()){
$cumCreditPoint=$this->creditAttempt + $cumCreditPoint;
$j++;
}*/
$cumCreditPoint=$this->RSEnrollItemCumGradeCr2($aKey, $AcY, $SeM, $strGnfyy);
return $cumCreditPoint;
}
//-- The end --
//-- Use on page processChgStudYProg.php --
function RSEnrollItemCountCoIdNoF($StID){
$this->SetQuery("select count(grade) as num from EnrollItem where studentId='$StID' and noCalGPA='N' and grade='F' ");
if ($result=$this->GetResult()) {
return $result['num'];
}
}
//-- The end --
// Use on page beforeShowClassTeach.php
function RSEnrollItemByAcySem2($bKey,$cKey){
$this->SetQuery("select * from EnrollItem where acadYear='$bKey' and semester='$cKey' order by studentId");
}
function SearchByKeyClsId($ClsId){
if($this->SetQuery("select count(classId) as num from EnrollItem where classId='$ClsId' order by classId")){
return 1;
}else{
return 0;
}
}
//-- The end --
//----
function SearchCourseByStIdAcYSemTssDay($StId,$AcY,$SeM,$Tss,$Dy){
$this->setQuery("select cr.courseCode, e.section, r.roomNo, t.timeSlotStart, t.timeSlotEnd
from EnrollItem e, Class c, ClassTimeTable t, Course cr, Room r
where e.studentId='$StId' and e.acadYear='$AcY' and e.semester='$SeM' and
e.classId=c.classId and c.classId=t.classId and c.courseId=cr.courseId and
t.roomId=r.roomId and t.timeSlotStart='$Tss' and t.weekDay='$Dy'");
}
function ClearData(){
$this->tcourseCode ='';
$this->tsection ='';
$this->troomNo ='';
$this->tTimeSlotStart ='';
$this->tTimeSlotEnd ='';
}
//----
// Use on page showCourseSendGrade.php
function RSEnrollItemBySeMAcY($aKey,$bKey){
if($this->SetQuery("select classId from EnrollItem where semester='$aKey' and acadYear='$bKey' group by classId")){
return 1;
}else{
return 0;
}
}
//-- The end --
} //--End class EnrollItem--
?>
|