Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 25 |
CRAP | |
0.00% |
0 / 415 |
StudentQualificationsMarkService | |
0.00% |
0 / 1 |
|
0.00% |
0 / 25 |
5550.00 | |
0.00% |
0 / 415 |
__construct | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
__clone | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 2 |
|||
getInstance | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 5 |
|||
getStudentTenthSubjects | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 18 |
|||
saveStudentTenthMarks | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 14 |
|||
createStudentTenthMarks | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
deleteStudentTenthMarks | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getStudentTenthMarks | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 40 |
|||
getStudentHseSubjects | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 18 |
|||
saveStudentEleventhMarks | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 14 |
|||
createStudentEleventhMarks | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
deleteStudentEleventhMarks | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getStudentEleventhMarks | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 44 |
|||
saveStudentTwelfthMarks | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 14 |
|||
createStudentTwelfthMarks | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
deleteStudentTwelfthMarks | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getStudentTwelfthMarks | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 48 |
|||
saveStudentUgMarks | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 14 |
|||
createStudentUgMarks | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
|||
deleteStudentUgMarks | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getStudentUgMarks | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 45 |
|||
getTenthStudentTotalMarksAndPercentage | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getEleventhStudentTotalMarksAndPercentage | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getTwelfthStudentTotalMarksAndPercentage | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getUgStudentTotalMarksAndPercentage | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
<?php | |
namespace com\linways\core\ams\professional\service; | |
use com\linways\core\ams\professional\dto\StudentHseSubjects; | |
use com\linways\core\ams\professional\dto\StudentTenthSubjects; | |
use com\linways\core\ams\professional\exception\ProfessionalException; | |
use com\linways\core\ams\professional\request\GetStudentTenthMarksRequest; | |
use com\linways\core\ams\professional\request\GetStudentTwelfthMarksRequest; | |
use com\linways\core\ams\professional\request\CreateStudentTenthMarksRequest; | |
use com\linways\core\ams\professional\request\GetStudentEleventhMarksRequest; | |
use com\linways\core\ams\professional\request\CreateStudentTwelfthMarksRequest; | |
use com\linways\core\ams\professional\request\CreateStudentEleventhMarksRequest; | |
use com\linways\core\ams\professional\mapper\StudentQualificationsMarkServiceMapper; | |
use com\linways\core\ams\professional\request\GetStudentQualificationUgMarksRequest; | |
use com\linways\core\ams\professional\request\CreateStudentQualificationUgMarksRequest; | |
class StudentQualificationsMarkService extends BaseService | |
{ | |
// /Condition 1 - Presence of a static member variable | |
private static $_instance = null; | |
private $mapper = []; | |
// /Condition 2 - Locked down the constructor | |
private function __construct() | |
{ | |
$this->mapper = StudentQualificationsMarkServiceMapper::getInstance()->getMapper(); | |
} | |
// Prevent any oustide instantiation of this class | |
// /Condition 3 - Prevent any object or instance of that class to be cloned | |
private function __clone() | |
{ | |
} | |
// Prevent any copy of this object | |
// /Condition 4 - Have a single globally accessible static method | |
public static function getInstance() | |
{ | |
if (!is_object(self::$_instance)) // or if( is_null(self::$_instance) ) or if( self::$_instance == null ) | |
self::$_instance = new self(); | |
return self::$_instance; | |
} | |
/** | |
* get student tenth subjects | |
* @param StudentTenthSubjects $request | |
* @return array StudentTenthSubjects $response | |
*/ | |
public function getStudentTenthSubjects (StudentTenthSubjects $request) | |
{ | |
$request = $this->realeScapeObject($request); | |
if(!empty($request->subjectId)) | |
{ | |
$condQuery .= " AND id='$request->subjectId'"; | |
} | |
if(!empty($request->subjectName)) | |
{ | |
$condQuery .= " AND subject_name LIKE '%$request->subjectName%'"; | |
} | |
$query = "SELECT id AS subjectId,subject_name AS subjectName,subject_desc AS subjectDescription,isOther FROM admission_subjects_tenth WHERE 1=1"; | |
try{ | |
$response = $this->executeQueryForList($query.$condQuery);return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::SUBJECT_NOT_FOUND,"Cannot fetch subjects! Please contact administrator"); | |
} | |
} | |
/** | |
* save student tenth marks | |
* @param CreateStudentTenthMarksRequest $request | |
* @return null | |
*/ | |
public function saveStudentTenthMarks(CreateStudentTenthMarksRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if(!is_array($request->subjects) || count($request->subjects) === 0) | |
{ | |
throw new ProfessionalException(ProfessionalException::ARRAY_EMPTY,"Please enter subject marks"); | |
} | |
try{ | |
$this->deleteStudentTenthMarks($request->studentId); | |
$this->createStudentTenthMarks($request); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::ERROR_IN_ENTERING_MARKS,"Cannot save student tenth marks! Please contact administrator"); | |
} | |
} | |
/** | |
* insert student tenth marks | |
* @param array StudentTenthMarks | |
* @return null | |
*/ | |
public function createStudentTenthMarks($request) | |
{ | |
$query = "INSERT INTO student_marks_tenth (studentID,admission_subjects_tenth_id,mark,max_mark,min_mark,subject_other_name) VALUES "; | |
foreach($request->subjects as $subject) | |
{ | |
$query .= "('$request->studentId','$subject->subjectId','$subject->mark','$subject->maxMark','$subject->minMark','$subject->subjectOtherName'),"; | |
} | |
try{ | |
$query = rtrim($query,","); | |
$this->executeQuery($query); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* delete student tenth marks | |
* @param int studentId | |
* @return null | |
*/ | |
public function deleteStudentTenthMarks($studentId) | |
{ | |
$query = "DELETE FROM student_marks_tenth WHERE studentID='$studentId'"; | |
try{ | |
$this->executeQuery($query); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function getStudentTenthMarks(GetStudentTenthMarksRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if(!empty($request->studentId)) | |
{ | |
$condQuery .= " AND smt.studentID='$request->studentId'"; | |
} | |
if($request->startIndex !== "") { | |
$limit = "INNER JOIN (SELECT DISTINCT smt.studentID | |
FROM | |
student_marks_tenth smt | |
INNER JOIN studentaccount sa ON | |
smt.studentID = sa.studentID | |
INNER JOIN batches b ON | |
sa.batchID = b.batchID | |
INNER JOIN semesters s ON | |
b.semID = s.semID INNER JOIN admission_subjects_tenth ast ON smt.admission_subjects_tenth_id=ast.id WHERE 1=1 $condQuery LIMIT $request->startIndex,$request->endIndex) limitStudents ON smt.studentID=limitStudents.studentID"; | |
} | |
$query = "SELECT smt.studentID,sa.admissionNo,sa.studentName,sa.batchID, | |
b.batchName,b.semID,s.semName,smt.admission_subjects_tenth_id, | |
smt.mark,smt.mark,smt.max_mark,smt.min_mark,smt.subject_other_name, | |
ast.subject_name,ast.subject_desc,ast.isOther | |
FROM | |
student_marks_tenth smt | |
INNER JOIN studentaccount sa ON | |
smt.studentID = sa.studentID | |
INNER JOIN batches b ON | |
sa.batchID = b.batchID | |
INNER JOIN semesters s ON | |
b.semID = s.semID | |
INNER JOIN admission_subjects_tenth ast ON smt.admission_subjects_tenth_id=ast.id | |
$limit | |
$condQuery"; | |
try{ | |
$response = $this->executeQueryForList($query,$this->mapper[StudentQualificationsMarkServiceMapper::GET_STUDENT_TENTH_MARKS]); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::ERROR_IN_FETCHING_MARKS,"Failed to fetch student marks! Please contact administrator"); | |
} | |
} | |
/** | |
* get student subjects | |
* @param StudentHseSubjects $request | |
* @return array StudentHseSubjects $response | |
*/ | |
public function getStudentHseSubjects (StudentHseSubjects $request) | |
{ | |
$request = $this->realeScapeObject($request); | |
if(!empty($request->subjectId)) | |
{ | |
$condQuery .= " AND subjectID='$request->subjectId'"; | |
} | |
if(!empty($request->subjectName)) | |
{ | |
$condQuery .= " AND subjectDesc LIKE '%$request->subjectName%'"; | |
} | |
$query = "SELECT subjectID AS subjectId,subjectName as subjectCode,subjectDesc AS subjectName,isOther FROM admission_subjects WHERE 1=1"; | |
try{ | |
$response = $this->executeQueryForList($query.$condQuery);return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::SUBJECT_NOT_FOUND,"Cannot fetch subjects! Please contact administrator"); | |
} | |
} | |
/** | |
* save student eleventh marks | |
* @param CreateStudentEleventhMarksRequest $request | |
* @return null | |
*/ | |
public function saveStudentEleventhMarks(CreateStudentEleventhMarksRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if(!is_array($request->subjects) || count($request->subjects) === 0) | |
{ | |
throw new ProfessionalException(ProfessionalException::ARRAY_EMPTY,"Please enter subject marks"); | |
} | |
try{ | |
$this->deleteStudentEleventhMarks($request->studentId); | |
$this->createStudentEleventhMarks($request); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::ERROR_IN_ENTERING_MARKS,"Cannot save student eleventh marks! Please contact administrator"); | |
} | |
} | |
/** | |
* insert student eleventh marks | |
* @param array StudentEleventhMarks | |
* @return null | |
*/ | |
public function createStudentEleventhMarks($request) | |
{ | |
$query = "INSERT INTO student_marks_eleventh (studentID,admission_subjects_id,mark,max_mark,min_mark,subject_other_name,is_core) VALUES "; | |
foreach($request->subjects as $subject) | |
{ | |
$query .= "('$request->studentId','$subject->subjectId','$subject->mark','$subject->maxMark','$subject->minMark','$subject->subjectOtherName','$request->isCore'),"; | |
} | |
try{ | |
$query = rtrim($query,","); | |
$this->executeQuery($query); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* delete student eleventh marks | |
* @param int studentId | |
* @return null | |
*/ | |
public function deleteStudentEleventhMarks($studentId) | |
{ | |
$query = "DELETE FROM student_marks_eleventh WHERE studentID='$studentId'"; | |
try{ | |
$this->executeQuery($query); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function getStudentEleventhMarks(GetStudentEleventhMarksRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if(!empty($request->studentId)) | |
{ | |
$condQuery .= " AND sme.studentID='$request->studentId'"; | |
} | |
if($request->startIndex !== "") { | |
$limit = "INNER JOIN (SELECT DISTINCT sme.studentID | |
FROM | |
student_marks_eleventh sme | |
INNER JOIN studentaccount sa ON | |
sme.studentID = sa.studentID | |
INNER JOIN batches b ON | |
sa.batchID = b.batchID | |
INNER JOIN semesters s ON | |
b.semID = s.semID | |
INNER JOIN admission_subjects asub ON | |
sme.admission_subjects_id = asub.subjectID WHERE 1=1 $condQuery LIMIT $request->startIndex,$request->endIndex) limitStudents ON sme.studentID=limitStudents.studentID"; | |
} | |
$query = "SELECT sme.studentID,sa.admissionNo,sa.studentName, | |
sa.batchID,b.batchName,b.semID,s.semName, | |
sme.admission_subjects_id,sme.mark,sme.max_mark, | |
sme.min_mark,sme.is_core,sme.subject_other_name, | |
asub.subjectName,asub.subjectDesc,asub.isOther | |
FROM | |
student_marks_eleventh sme | |
INNER JOIN studentaccount sa ON | |
sme.studentID = sa.studentID | |
INNER JOIN batches b ON | |
sa.batchID = b.batchID | |
INNER JOIN semesters s ON | |
b.semID = s.semID | |
INNER JOIN admission_subjects asub ON | |
sme.admission_subjects_id = asub.subjectID | |
$limit | |
$condQuery"; | |
try{ | |
$response = $this->executeQueryForList($query,$this->mapper[StudentQualificationsMarkServiceMapper::GET_STUDENT_ELEVENTH_MARKS]); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::ERROR_IN_FETCHING_MARKS,"Failed to fetch student marks! Please contact administrator"); | |
} | |
} | |
/** | |
* save student twelfth marks | |
* @param CreateStudentTwelfthMarksRequest $request | |
* @return null | |
*/ | |
public function saveStudentTwelfthMarks(CreateStudentTwelfthMarksRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if(!is_array($request->subjects) || count($request->subjects) === 0) | |
{ | |
throw new ProfessionalException(ProfessionalException::ARRAY_EMPTY,"Please enter subject marks"); | |
} | |
try{ | |
$this->deleteStudentTwelfthMarks($request->studentId); | |
$this->createStudentTwelfthMarks($request); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::ERROR_IN_ENTERING_MARKS,"Cannot save student twelfth marks! Please contact administrator"); | |
} | |
} | |
/** | |
* insert student twelfth marks | |
* @param array StudenttwelfthMarks | |
* @return null | |
*/ | |
public function createStudentTwelfthMarks($request) | |
{ | |
$query = "INSERT INTO student_marks_twelfth (studentID,admission_subjects_id,mark,max_mark,min_mark,subject_other_name,is_core,part3_optional) VALUES "; | |
foreach($request->subjects as $subject) | |
{ | |
$query .= "('$request->studentId','$subject->subjectId','$subject->mark','$subject->maxMark','$subject->minMark','$subject->subjectOtherName','$request->isCore','$request->part3Optional'),"; | |
} | |
try{ | |
$query = rtrim($query,","); | |
$this->executeQuery($query); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* delete student twelfth marks | |
* @param int studentId | |
* @return null | |
*/ | |
public function deleteStudentTwelfthMarks($studentId) | |
{ | |
$query = "DELETE FROM student_marks_twelfth WHERE studentID='$studentId'"; | |
try{ | |
$this->executeQuery($query); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function getStudentTwelfthMarks(GetStudentTwelfthMarksRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if(!empty($request->studentId)) | |
{ | |
$condQuery .= " AND smt.studentID='$request->studentId'"; | |
} | |
if(!empty($request->batchId)) | |
{ | |
$condQuery .= " AND sa.batchID='$request->batchId'"; | |
} | |
if($request->startIndex !== "") { | |
$limit = "INNER JOIN (SELECT DISTINCT smt.studentID | |
FROM | |
student_marks_twelfth smt | |
INNER JOIN studentaccount sa ON | |
smt.studentID = sa.studentID | |
INNER JOIN batches b ON | |
sa.batchID = b.batchID | |
INNER JOIN semesters s ON | |
b.semID = s.semID | |
INNER JOIN admission_subjects asub ON | |
smt.admission_subjects_id = asub.subjectID WHERE 1=1 $condQuery LIMIT $request->startIndex,$request->endIndex) limitStudents ON smt.studentID=limitStudents.studentID"; | |
} | |
$query = "SELECT smt.studentID,sa.admissionNo,sa.studentName, | |
sa.batchID,b.batchName,b.semID,s.semName, | |
smt.admission_subjects_id,smt.mark,smt.max_mark, | |
smt.min_mark,smt.part3_optional,smt.is_core,smt.subject_other_name, | |
asub.subjectName,asub.subjectDesc,asub.isOther | |
FROM | |
student_marks_twelfth smt | |
INNER JOIN studentaccount sa ON | |
smt.studentID = sa.studentID | |
INNER JOIN batches b ON | |
sa.batchID = b.batchID | |
INNER JOIN semesters s ON | |
b.semID = s.semID | |
INNER JOIN admission_subjects asub ON | |
smt.admission_subjects_id = asub.subjectID | |
$limit | |
$condQuery"; | |
try{ | |
$response = $this->executeQueryForList($query,$this->mapper[StudentQualificationsMarkServiceMapper::GET_STUDENT_TWELFTH_MARKS]); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::ERROR_IN_FETCHING_MARKS,"Failed to fetch student marks! Please contact administrator"); | |
} | |
} | |
/** | |
* save student ug marks | |
* @param CreateStudentQualificationUgMarksRequest $request | |
* @return null; | |
*/ | |
public function saveStudentUgMarks(CreateStudentQualificationUgMarksRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if(!is_array($request->subjects) || count($request->subjects) === 0) | |
{ | |
throw new ProfessionalExcpetion(ProfessionalException::ARRAY_EMPTY,"Please enter marks foreach subject"); | |
} | |
try{ | |
$this->deleteStudentUgMarks($request->studentId); | |
$this->createStudentUgMarks($request); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::ERROR_IN_ENTERING_MARKS,"Cannot save marks! Please try again"); | |
} | |
} | |
public function createStudentUgMarks($request) | |
{ | |
$query = "INSERT INTO student_marks_ug (studentID,sem,subject_name,credit,points,mark,max_mark,is_cognate,is_language) VALUES "; | |
foreach($request->subjects as $subject) | |
{ | |
$query .= " ('$request->studentId','$subject->semNo','$subject->subjectName','$subject->credit','$subject->points','$subject->mark','$subject->maxMark','$subject->isCognate','$request->isLanguage'),"; | |
} | |
$query = rtrim($query,","); | |
try{ | |
$this->executeQuery($query); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function deleteStudentUgMarks($studentId) | |
{ | |
$query = "DELETE FROM student_marks_ug WHERE studentID='$studentId'"; | |
try{ | |
$this->executeQuery($query); | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function getStudentUgMarks(GetStudentQualificationUgMarksRequest $request) | |
{ | |
$request = $this->realEscapeObject($request); | |
if(!empty($request->studentId)) | |
{ | |
$condQuery .= " AND smu.studentID='$request->studentId'"; | |
} | |
if(!empty($request->batchId)) | |
{ | |
$condQuery .= " AND sa.batchID='$request->batchId'"; | |
} | |
if($request->startIndex !== "") | |
{ | |
$limit = " INNER JOIN (SELECT DISTINCT smu.studentID | |
FROM | |
student_marks_ug smu | |
INNER JOIN studentaccount sa ON | |
smu.studentID = sa.studentID | |
INNER JOIN batches b ON | |
sa.batchID = b.batchID | |
INNER JOIN semesters s ON | |
b.semID = s.semID WHERE 1=1 $condQuery LIMIT $request->startIndex,$request->endIndex) limitStudents ON smu.studentID=limitStudents.studentID "; | |
} | |
$query = "SELECT smu.id,smu.studentID,sa.admissionNo,sa.studentName, | |
sa.batchID,b.batchName,b.semID,s.semName, | |
smu.sem,smu.subject_name,smu.credit, | |
smu.points,smu.mark,smu.max_mark, | |
smu.is_cognate,smu.is_language | |
FROM | |
student_marks_ug smu | |
INNER JOIN studentaccount sa ON | |
smu.studentID = sa.studentID | |
INNER JOIN batches b ON | |
sa.batchID = b.batchID | |
INNER JOIN semesters s ON | |
b.semID = s.semID | |
$limit | |
$condQuery"; | |
try{ | |
$response = $this->executeQueryForList($query,$this->mapper[StudentQualificationsMarkServiceMapper::GET_STUDENT_UG_MARKS]); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException(ProfessionalException::ERROR_IN_FETCHING_MARKS,"Cannot fetch student marks! Please try again"); | |
} | |
} | |
public function getTenthStudentTotalMarksAndPercentage($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$query = "SELECT SUM(mark) AS totalMark,SUM(max_mark) AS totalMaxMark,SUM(mark)/SUM(max_mark)*100 AS percent FROM student_marks_tenth WHERE studentID='$studentId'"; | |
try{ | |
$markDetails = $this->executeQueryForObject($query); | |
return $markDetails; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function getEleventhStudentTotalMarksAndPercentage($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$query = "SELECT SUM(mark) AS totalMark,SUM(max_mark) AS totalMaxMark,SUM(mark)/SUM(max_mark)*100 AS percent FROM student_marks_eleventh WHERE studentID='$studentId'"; | |
try{ | |
$markDetails = $this->executeQueryForObject($query); | |
return $markDetails; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function getTwelfthStudentTotalMarksAndPercentage($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$query = "SELECT SUM(mark) AS totalMark,SUM(max_mark) AS totalMaxMark,SUM(mark)/SUM(max_mark)*100 AS percent FROM student_marks_twelfth WHERE studentID='$studentId'"; | |
try{ | |
$markDetails = $this->executeQueryForObject($query); | |
return $markDetails; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function getUgStudentTotalMarksAndPercentage($studentId) | |
{ | |
$studentId = $this->realEscapeString($studentId); | |
$query = "SELECT SUM(mark) AS totalMark,SUM(max_mark) AS totalMaxMark,SUM(mark)/SUM(max_mark)*100 AS percent FROM student_marks_ug WHERE studentID='$studentId'"; | |
try{ | |
$markDetails = $this->executeQueryForObject($query); | |
return $markDetails; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
} |