Advertisement
ma39isy

Untitled

Apr 22nd, 2024
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. public function GetFinalGPA($studentId, $fasttrack = "")
  2.     {
  3.         $where = "";
  4.         if ($fasttrack !== '') {
  5.             $where = " AND STATUSFASTRACK='$fasttrack'";
  6.         } else {
  7.             include "db.config.php";
  8.             $studentDB = new DBStudent($academicConfig);
  9.             if ($studentDB->IsExistStudent($studentId)) {
  10.                 $where = " AND STATUSFASTRACK IS NULL";
  11.             }
  12.         }
  13.  
  14.         //Indeks T tidak dihitung 13072016
  15.         $query = " select round(sum(MULTIPLYCREDITCONVERSION)/sum(CREDIT),2) as GPA from FINALGRADE where STUDENTID='$studentId' and (INDEXPOINT is not NULL AND INDEXPOINT<>'T') $where";
  16.         //$query = "SELECT ROUND (SUM (MULTIPLYCREDITCONVERSION) / SUM (CREDIT),2) AS GPA FROM FINALGRADE WHERE STUDENTID = '".$studentId."' AND (INDEXPOINT IS NOT NULL OR INDEXPOINT <> 'T') AND PASS_STATUS = 'Y'";
  17.         //echo "<br>$query";
  18.         $q = $this->ExecuteQuery($query);
  19.         $r = $this->FetchArray($q);
  20.         return (isset($r['GPA'])) ? floatval($r['GPA']) : 0;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement