Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 41 |
CRAP | |
0.00% |
0 / 732 |
AdmissionInputFieldsService | |
0.00% |
0 / 1 |
|
0.00% |
0 / 41 |
18906.00 | |
0.00% |
0 / 732 |
__construct | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 4 |
|||
__clone | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
getInstance | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 5 |
|||
getSectionFields | |
0.00% |
0 / 1 |
272.00 | |
0.00% |
0 / 87 |
|||
foreignTableDatas | |
0.00% |
0 / 1 |
132.00 | |
0.00% |
0 / 52 |
|||
getCaste | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getSubCaste | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getValuesofStudents | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
FormSubmit | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 26 |
|||
getNextSectionID | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 23 |
|||
setCurrentSection | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 22 |
|||
getCasteDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 16 |
|||
getIncomeofStudent | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getFeeReservation | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getseatReservationValuesForStudents | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
validatechangeSection | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 16 |
|||
gethssExamStream | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 20 |
|||
gethssSubjects | |
0.00% |
0 / 1 |
20.00 | |
0.00% |
0 / 22 |
|||
submithssExamMarks | |
0.00% |
0 / 1 |
72.00 | |
0.00% |
0 / 44 |
|||
getChoiceofStudent | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getChoiceSubjects | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 40 |
|||
submitChoice | |
0.00% |
0 / 1 |
56.00 | |
0.00% |
0 / 23 |
|||
submitWeightage | |
0.00% |
0 / 1 |
30.00 | |
0.00% |
0 / 21 |
|||
getSubMenuofWeightages | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
submitquotasubmenus | |
0.00% |
0 / 1 |
72.00 | |
0.00% |
0 / 38 |
|||
getweightageofStudent | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getallSubjects | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 9 |
|||
getsubjectNos | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getStudentMarks | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
getAllStudentDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
getAdmissionPrintTemplates | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getDistrictAndTaluks | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 27 |
|||
getIndianStates | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
isAdmissionEnabled | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 12 |
|||
getStreamTypes | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
saveStreamType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
updateStreamType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
deleteStreamType | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getStreamTypeDetails | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 10 |
|||
groupIDsForAStream | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 11 |
|||
getCasteForDataImport | |
0.00% |
0 / 1 |
12.00 | |
0.00% |
0 / 14 |
<?php | |
namespace com\linways\core\ams\professional\service; | |
use com\linways\core\ams\professional\exception\ProfessionalException; | |
use com\linways\core\ams\professional\dto\AdmissionApplicationFormFields; | |
use com\linways\core\ams\professional\mapper\AdmissionInputFieldsMapper; | |
use com\linways\core\ams\professional\mapper\DistrictMapper; | |
use com\linways\core\ams\professional\dto\StreamType; | |
class AdmissionInputFieldsService extends BaseService | |
{ | |
private static $_instance = null; | |
private $mapper1 = []; | |
private $mapper = []; | |
// /Condition 2 - Locked down the constructor | |
private function __construct() | |
{ | |
$this->mapper = AdmissionInputFieldsMapper::getInstance()->getMapper(); | |
$this->mapper1 = DistrictMapper::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 section fields by sectionID | |
* | |
* @author Aswin | |
* @param int $sectionID | |
* @throws ProfessionalException | |
* @return \com\linways\core\ams\autonomous\dto\AdmissionApplicationFormFields[] | |
*/ | |
public function getSectionFields($sectionID, $studentID) | |
{ | |
$formFields = []; | |
$studentID = $this->realEscapeString($studentID); | |
try { | |
$studentDetails = AdmissionInputFieldsService::getAllStudentDetails($studentID); | |
} catch (ProfessionalException $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
$sectionID = $this->realEscapeString($sectionID); | |
$query = "SELECT id AS fieldID,name AS fieldName,label AS fieldLabel,type AS fieldType, | |
description,required,validator,foreign_key,table_name,value,display_name, | |
default_value,field_relation,event_handlers,field_priority,user_query,groupname FROM admission_appln_forms_fields | |
WHERE sectionID = $sectionID ORDER BY field_priority"; | |
try { | |
$response = $this->executeQueryForList($query); | |
if ($response == null) { | |
throw new ProfessionalException(ProfessionalException::ARRAY_EMPTY, "No fields assigned to Section"); | |
} | |
$i = 0; | |
foreach ($response as $r) { | |
$formFields[$i] = new AdmissionApplicationFormFields(); | |
$formFields[$i]->fieldID = $r->fieldID; | |
$formFields[$i]->fieldName = $r->fieldName; | |
$formFields[$i]->fieldLabel = $r->fieldLabel; | |
$formFields[$i]->fieldType = $r->fieldType; | |
$formFields[$i]->description = $r->description; | |
$formFields[$i]->required = $r->required; | |
$formFields[$i]->validator = $r->validator; | |
$formFields[$i]->foreign_key = $r->foreign_key; | |
$formFields[$i]->table_name = $r->table_name; | |
$formFields[$i]->value = $r->value; | |
$formFields[$i]->display_name = $r->display_name; | |
$formFields[$i]->default_value = $r->default_value; | |
$formFields[$i]->field_relation = $r->field_relation; | |
$formFields[$i]->event_handlers = $r->event_handlers; | |
$formFields[$i]->field_priority = $r->field_priority; | |
$formFields[$i]->userquery = $r->user_query; | |
$formFields[$i]->groupname = $r->groupname; | |
$formFields[$i]->sectionID = $sectionID; | |
if ($formFields[$i]->foreign_key == 1) { | |
try { | |
$response2 = AdmissionInputFieldsService::getInstance()->foreignTableDatas($formFields[$i]->value, $formFields[$i]->display_name, $formFields[$i]->table_name, $formFields[$i]->userquery, $studentID); | |
if ($response2 !== null) | |
$formFields[$i]->foreign_key_values = $response2; | |
} catch (ProfessionalException $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} else { | |
$formFields[$i]->foreign_key_values = []; | |
} | |
try { | |
switch ($formFields[$i]->fieldName) { | |
case "reservation": | |
{ | |
$response3 = AdmissionInputFieldsService::getInstance()->getseatReservationValuesForStudents($studentID); | |
break; | |
} | |
case "choice5": | |
case "choice4": | |
case "choice3": | |
case "choice2": | |
case "choice1": | |
{ | |
break; | |
} | |
case "admission_weightage": | |
{ | |
break; | |
} | |
default: | |
{ | |
$fieldName = $formFields[$i]->fieldName; | |
$response3->fieldName = $studentDetails->$fieldName; | |
} | |
} | |
$formFields[$i]->studentvalue = $response3->fieldName; | |
$response3 = null; | |
} catch (ProfessionalException $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
$i ++; | |
} | |
return $formFields; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getCode()); | |
} | |
} | |
/** | |
* \ | |
* Get foreign table datas | |
* | |
* @param unknown $value | |
* @param unknown $displayName | |
* @param unknown $table_name | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function foreignTableDatas($value, $displayName, $table_name, $userquery, $studentID) | |
{ | |
$value = $this->realEscapeString($value); | |
$displayName = $this->realEscapeString($displayName); | |
$table_name = $this->realEscapeString($table_name); | |
$userquery = $this->realEscapeString($userquery); | |
$studentID = $this->realEscapeString($studentID); | |
$q = null; | |
if ($table_name == "reservation_students") { | |
$q = "SELECT rs.reservationName as foreign_key_display_name, rs.reservationID as foreign_key_value FROM application_fee_category afc INNER JOIN reservation_students rs ON afc.reservation_students_id = rs.reservationID WHERE afc.id = (SELECT application_fee_category_id | |
FROM admission_student_details WHERE studentID = $studentID)"; | |
} else if ($table_name == "student_reservation") { | |
$q = "SELECT rs.reservName as foreign_key_display_name, rs.reservID as foreign_key_value | |
FROM application_fee_category afc INNER JOIN student_reservation rs ON afc.student_reservation_id = rs.reservID WHERE afc.id = (SELECT application_fee_category_id FROM | |
admission_student_details WHERE studentID = $studentID)"; | |
} else if ($table_name == "admission_weightage_quotas") { | |
$q = "SELECT awq.weightageID AS foreign_key_value,awq.weightageName AS foreign_key_display_name,awq.weightageDesc as foreign_key_description, | |
asw.studentID AS studentvalue FROM admission_weightage_quotas awq LEFT JOIN admission_student_weightages asw ON awq.weightageID = asw.weightageID | |
AND asw.studentID = $studentID where awq.isUG=1"; | |
} | |
if ($q != null) { | |
try { | |
$response = $this->executeQueryForList($q); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
if (! $response) { | |
if($table_name=="student_reservation") | |
{ | |
$query="select reservID as foreign_key_value,reservName as foreign_key_display_name,reservDesc as foreign_key_description from student_reservation"; | |
} | |
else | |
{ | |
$query = "select $value as foreign_key_value,$displayName as foreign_key_display_name from $table_name"; | |
} | |
if ($userquery == 1) { | |
$q = "select user_query from admission_appln_user_query where table_name='$table_name'"; | |
try { | |
$user_query = $this->executeQueryForObject($q); | |
$query .= " " . $user_query->user_query; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
try { | |
$response = $this->executeQueryForList($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
return $response; | |
} | |
/** | |
* Get castes from religionID | |
* | |
* @author Aswin | |
* @param unknown $religionID | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getCaste($religionID) | |
{ | |
$religionID = $this->realEscapeString($religionID); | |
$query = "select casteID,casteName,student_specify,sub_caste_label,sub_caste_description from student_caste where religionID=$religionID"; | |
try { | |
$response = $this->executeQueryForList($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get sub caste using casteID | |
* | |
* @param unknown $casteId | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getSubCaste($casteId) | |
{ | |
$casteId = $this->realEscapeString($casteId); | |
$query = "select id as subCasteID,subcaste_name,student_reservation_id from student_subcaste where student_caste_id=$casteId"; | |
try { | |
$response = $this->executeQueryForList($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($query, $e->getMessage()); | |
} | |
} | |
/** | |
* Get details of Students | |
* | |
* @author Aswin | |
* @param unknown $fieldName | |
* @param unknown $studentID | |
* @throws ProfessionalException | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
*/ | |
public function getValuesofStudents($fieldName, $studentID) | |
{ | |
$fieldName = $this->realEscapeString($fieldName); | |
$studentID = $this->realEscapeString($studentID); | |
$query = "select $fieldName as fieldName from admission_student_details where studentID=$studentID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* Form submit field values | |
* | |
* @author Aswin | |
* @param unknown $fields | |
* @param unknown $studentID | |
* @return string | |
*/ | |
public function FormSubmit($fields, $studentID, $sectionID,$save_only=null) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$sectionID = $this->realEscapeString($sectionID); | |
$save_only=$this->realEscapeString($save_only); | |
$query = "UPDATE admission_student_details SET "; | |
foreach ($fields as $fieldName => $fieldValue) { | |
$fieldName = $this->realEscapeString($fieldName); | |
$fieldValue = $this->realEscapeString($fieldValue); | |
$query .= "$fieldName=".($fieldValue==NULL?"NULL":"'$fieldValue'").","; | |
} | |
$query = rtrim($query, ","); | |
$query .= " WHERE studentID=$studentID"; | |
try { | |
$response = $this->executeQuery($query); | |
$response = null; | |
if(!$save_only) | |
{ | |
$response = AdmissionInputFieldsService::setCurrentSection($sectionID, $studentID); | |
} | |
$response = null; | |
$response = AdmissionInputFieldsService::getInstance()->getNextSectionID($studentID); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* Get next Sectiom | |
* | |
* @author Aswin | |
* @param unknown $sectionID | |
* @throws ProfessionalException | |
* @return unknown | |
*/ | |
public function getNextSectionID($studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$query = "select sectionID from admission_appln_current_section where studentID=$studentID"; | |
try { | |
$sectionID = $this->executeQueryForList($query)[0]->sectionID; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
$query = "SELECT * FROM admission_appln_forms_section "; | |
if ($sectionID != "") { | |
$query .= "where priority > (SELECT priority FROM admission_appln_forms_section WHERE id = '$sectionID')"; | |
} | |
$query .= " ORDER BY priority"; | |
try { | |
$response = $this->executeQueryForList($query); | |
if ($response[0]->id == null) { | |
$response[0]->id = "0"; | |
} | |
return $response[0]; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* Set current Section | |
* | |
* @author Aswins | |
* @param unknown $sectionID | |
* @param unknown $studentID | |
* @throws ProfessionalException | |
* @return string | |
*/ | |
public function setCurrentSection($sectionID, $studentID) | |
{ | |
$sectionID = $this->realEscapeString($sectionID); | |
$studentID = $this->realEscapeString($studentID); | |
$response = null; | |
try { | |
$query = "select * from admission_appln_current_section where studentID=$studentID"; | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
if ($response == null) { | |
$query = "insert into admission_appln_current_section (studentID,sectionID) values ($studentID,$sectionID)"; | |
} else { | |
$query = "update admission_appln_current_section set sectionID=$sectionID where studentID=$studentID"; | |
} | |
try { | |
$response = $this->executeQuery($query); | |
return "success"; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
// public function getStudentDetails($studentID) | |
// { | |
// $studentID = $this->realEscapeString($studentID); | |
// $query = "SELECT aafs.id AS sectionID,aafs.section AS sectionName,aaff.name AS fieldName | |
// FROM admission_appln_forms_section aafs INNER JOIN | |
// admission_appln_forms_fields aaff ON aafs.id = aaff.sectionID | |
// ORDER BY aafs.priority , aaff.field_priority"; | |
// try{ | |
// $response=$this->executeQueryForList($query); | |
// $formFields=[]; | |
// }catch(\Exception $e) | |
// { | |
// throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
// } | |
// } | |
/** | |
* Get caste of Student | |
* | |
* @author Aswin | |
* @param unknown $studentID | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getCasteDetails($studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$query = "SELECT asd.studentName,asd.otherCaste,sc.casteName,ss.subcaste_name | |
FROM admission_student_details asd INNER JOIN | |
student_caste sc ON asd.caste = sc.casteID | |
LEFT JOIN | |
student_subcaste ss ON asd.caste = ss.student_caste_id | |
WHERE | |
asd.studentID =$studentID"; | |
try { | |
$response = $this->executeQueryForList($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $response; | |
} | |
public function getIncomeofStudent($studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$query = "select annualIncome from admission_student_details where studentID=$studentID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function getFeeReservation($admission_quotasID) | |
{ | |
$admission_quotasID = $this->realEscapeString($admission_quotasID); | |
$query = "select admission_quotas_id,fee_concession_limit,msg_description from fee_reservation_concession where admission_quotas_id=$admission_quotasID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function getseatReservationValuesForStudents($studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$query = "select sr.reservID as fieldName from student_subcaste ss inner join student_reservation sr on ss.student_reservation_id=sr.reservID where ss.id=(select student_subcaste_id from admission_student_details asd where asd.studentID=$studentID) union all select reservation as fieldName from admission_student_details where studentID=$studentID and not exists (select sr.reservID as fieldName from student_subcaste ss inner join student_reservation sr on ss.student_reservation_id=sr.reservID where ss.id=(select student_subcaste_id from admission_student_details asd where asd.studentID=$studentID))"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function validatechangeSection($studentID,$sid) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$sid=$this->realEscapeString($sid); | |
try { | |
$sectionID = AdmissionInputFieldsService::getInstance()->getNextSectionID($studentID)->id; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
$query = "select id as sectionID,isPayment from admission_appln_forms_section where priority <= (select priority from admission_appln_forms_section where id='$sectionID') and id=$sid"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function gethssExamStream($hssExamNameID) | |
{ | |
$hssExamNameID = $this->realEscapeString($hssExamNameID); | |
$query = "select unknown from admission_boardexam_type where typeID=$hssExamNameID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
if ($response->unknown == "1") { | |
$query = "select streamID,streamName,streamDesc from twelth_streams where unknown=1 order by streamName ASC"; | |
} else { | |
$query = "select streamID,streamName,streamDesc from twelth_streams where streamID in (select distinct streamID from admission_exam_subjects where typeID=$hssExamNameID) order by streamName ASC"; | |
} | |
try { | |
$response = $this->executeQueryForList($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $response; | |
} | |
public function gethssSubjects($hssExamNameID, $hssExamStreamID, $studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$hssExamNameID = $this->realEscapeString($hssExamNameID); | |
$hssExamStreamID = $this->realEscapeString($hssExamStreamID); | |
$query = "select unknown,subjectNos from admission_boardexam_type where typeID=$hssExamNameID"; | |
try { | |
$responseunknown = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
if ($responseunknown->unknown == 1) { | |
$query = "select unknown from admission_boardexam_type where typeID=$hssExamNameID"; | |
} else { | |
$query = "select a.subjectID,a_s.subjectName,a_s.subjectDesc,a.minMark,a.maxMark,am.mark from admission_exam_subjects a inner join admission_subjects a_s on a.subjectID=a_s.subjectID left join admission_student_marks am on am.studentID=$studentID and am.typeID=$hssExamNameID and am.streamID=$hssExamStreamID and a.subjectID=am.subjectID where a.typeID=$hssExamNameID and a.streamID=$hssExamStreamID"; | |
} | |
try { | |
$response2 = $this->executeQueryForList($query); | |
return $response2; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
public function submithssExamMarks($studentID, $hssExamName, $hssExamStream, $fieldExamMarks, $hss) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$fieldExamMarks = $this->realEscapeArray($fieldExamMarks); | |
$hssExamName = $this->realEscapeString($hssExamName); | |
$hssExamStream = $this->realEscapeString($hssExamStream); | |
$hss = $this->realEscapeString($hss); | |
$query = "delete from admission_student_marks where studentID=$studentID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
if ($hss == "hss") { | |
$query = "insert into admission_student_marks (studentID,typeID,streamID,subjectID,mark) values "; | |
foreach ($fieldExamMarks as $subjectID => $marks) { | |
$subjectID = $this->realEscapeString($subjectID); | |
$marks = $this->realEscapeString($marks); | |
$query.="($studentID,$hssExamName,$hssExamStream,$subjectID,$marks),"; | |
} | |
$query=rtrim($query,","); | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} else { | |
$query = "insert into admission_student_marks (studentID,typeID,streamID,subjectID,mark,maxmark,part3Optional) values "; | |
foreach ($fieldExamMarks as $submarks => $maxpart3) { | |
$submarks = $this->realEscapeString($submarks); | |
$maxpart3 = $this->realEscapeString($maxpart3); | |
list ($subjectID, $mark) = explode("_", $submarks); | |
list ($maxmark, $part3Optional) = explode("_", $maxpart3); | |
$query.="($studentID,$hssExamName,$hssExamStream,$subjectID,$mark,$maxmark,'$part3Optional'),"; | |
} | |
$query=rtrim($query,","); | |
if(substr($query,-1)==")") | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
return "succes"; | |
} | |
public function getChoiceofStudent($choice, $studentID) | |
{ | |
$choice = $this->realEscapeString($choice); | |
$studentID = $this->realEscapeString($studentID); | |
$query = "select patternCourseID,prefNo from admission_student_branch_preference where prefNo=" . substr($choice, 6) . " and studentID=$studentID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $response->patternCourseID; | |
} | |
public function getChoiceSubjects($hssStream,$studentID) | |
{ | |
$hssStream = $this->realEscapeString($hssStream); | |
$studentID=$this->realEscapeString($studentID); | |
$query = "SELECT | |
pd.patterncourseID, | |
pd.patterncourseName, | |
sc.subsiderycoursename, | |
ct.name, | |
ct.descrption, | |
btch.batchID, | |
btch.batchStartYear, | |
asbp.prefNo, | |
at.name as campus_type | |
FROM | |
pattern_deptcourses pd | |
LEFT JOIN | |
subsiderycourse sc ON pd.patterncourseID = sc.pattern_deptcourses_id | |
LEFT JOIN | |
batches btch ON pd.patterncourseID = btch.patterncourseID | |
LEFT JOIN | |
campus_type ct ON btch.campus_typeID = ct.id | |
LEFT JOIN | |
twelthstreams_patterncourses tspc ON pd.patterncourseID = tspc.patterncourseID | |
LEFT JOIN | |
admission_campus_type at ON at.patterncourseID = pd.patterncourseID | |
LEFT JOIN | |
admission_student_branch_preference asbp ON asbp.patterncourseID = tspc.patterncourseID | |
AND asbp.studentID = '$studentID' | |
WHERE | |
pd.patterncourseID in (select patterncourseID from admission_pg_course_open) and | |
tspc.streamID = '$hssStream' | |
GROUP BY pd.patterncourseID | |
ORDER BY pd.patterncourseName"; | |
try { | |
$response = $this->executeQueryForList($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $response; | |
} | |
/** | |
* submit choices of student | |
* | |
* @author Aswin | |
* @param unknown $choiceFields | |
* @param unknown $studentID | |
* @throws ProfessionalException | |
* @return string | |
*/ | |
public function submitChoice($choiceFields, $studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$choiceFields=$this->realEscapeArray($choiceFields); | |
$query = "delete from admission_student_branch_preference where studentID=$studentID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
$query = "insert into admission_student_branch_preference (studentID,prefNo,patterncourseID) values "; | |
foreach ($choiceFields as $prefNo => $patterncourseid) { | |
if($prefNo && $patterncourseid) | |
$query.="($studentID,$prefNo,$patterncourseid),"; | |
} | |
$query=rtrim($query,","); | |
if(substr($query,-1)==")") | |
try { | |
$response = $this->executeQueryForList($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return "succes"; | |
} | |
/** | |
* submit weightages of student | |
* | |
* @author Aswin | |
* @param unknown $studentID | |
* @param unknown $otherWeightages | |
* @throws ProfessionalException | |
*/ | |
public function submitWeightage($studentID, $otherWeightages) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$otherWeightages = $this->realEscapeArray($otherWeightages); | |
$query = "delete from admission_student_weightages where studentID=$studentID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
$query = "insert into admission_student_weightages (studentID,weightageID) values "; | |
foreach ($otherWeightages as $wts) { | |
$query.="($studentID,$wts),"; | |
} | |
$query=rtrim($query,","); | |
if(substr($query,-1)==")") | |
try { | |
$response = $this->executeQuery($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get submenu of weightage quotas | |
* | |
* @author Aswin | |
* @param unknown $weightageID | |
* @param unknown $studentID | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getSubMenuofWeightages($weightageID, $studentID) | |
{ | |
$weightageID = $this->realEscapeString($weightageID); | |
$studentID = $this->realEscapeString($studentID); | |
$query = "SELECT awq.subdivID,awq.subdivName,awq.isdropdown,swq.subdivpartId as studentpartID,swq.subdivTextVal,awqp.subdivpartID,awqp.partname FROM admission_weightage_quotasubdiv awq LEFT JOIN student_weightage_quotasubdiv swq ON awq.subdivID = swq.subdivID AND swq.studentID = $studentID left join admission_weightage_quotasubdiv_parts awqp on awq.subdivID=awqp.subdivID WHERE awq.weightageID = $weightageID"; | |
try { | |
$response = $this->executeQueryForList($query, $this->mapper[AdmissionInputFieldsMapper::GET_SUBDIV_WEIGHTAGES]); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $query); | |
} | |
return $response; | |
} | |
/** | |
* submit submenu of quotas | |
* | |
* @author Aswin | |
* @param unknown $subdivpartids | |
* @param unknown $subdivtextvals | |
* @param unknown $studentID | |
* @throws ProfessionalException | |
* @return string | |
*/ | |
public function submitquotasubmenus($subdivpartids, $subdivtextvals, $studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$subdivpartids = $this->realEscapeArray($subdivpartids); | |
$subdivtextvals = $this->realEscapeArray($subdivtextvals); | |
$query = "delete from student_weightage_quotasubdiv where studentID=$studentID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $query); | |
} | |
$query = "insert into student_weightage_quotasubdiv (subdivID,subdivpartID,studentID) values "; | |
foreach ($subdivpartids as $subdivID => $subdivpartID) { | |
$query.="($subdivID,$subdivpartID,$studentID),"; | |
} | |
$query=rtrim($query,","); | |
if(substr($query,-1)==")") | |
{ | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $query); | |
} | |
} | |
$query = "insert into student_weightage_quotasubdiv (subdivID,subdivTextVal,studentID) values "; | |
foreach ($subdivtextvals as $subdivID => $subdivTextVal) { | |
$query.="($subdivID,'$subdivTextVal',$studentID),"; | |
} | |
$query=rtrim($query,","); | |
if(substr($query,-1)==")") | |
{ | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $query); | |
} | |
} | |
return "success"; | |
} | |
/** | |
* get weightage of students | |
* | |
* @author Aswin | |
* @param unknown $studentID | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getweightageofStudent($studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$query = "select weightageID as fieldName from admission_student_weightages where studentID=$studentID"; | |
try { | |
$response = $this->executeQueryForList($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get all admission subjects for hss | |
* | |
* @author Aswin | |
* @param unknown $studentID | |
* @param unknown $hssExamNameID | |
* @param unknown $hssStreamID | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getallSubjects($studentID, $hssExamNameID, $hssStreamID) | |
{ | |
// $query="select asubs.subjectID,asubs.subjectDesc,asubs.subjectName,asm.mark,asm.maxmark,asm.part3Optional from admission_subjects asubs left join admission_student_marks asm on asubs.subjectID=asm.subjectID and asm.studentID=$studentID and asm.streamID=$hssStreamID and asm.typeID=$hssExamNameID order by subjectName ASC"; | |
$query = "select subjectID,subjectDesc,subjectName from admission_subjects order by subjectID ASC"; | |
try { | |
$response = $this->executeQueryForList($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get number of subjects for other hss | |
* | |
* @author Aswin | |
* @param unknown $hssExamNameID | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getsubjectNos($hssExamNameID) | |
{ | |
$hssExamNameID = $this->realEscapeString($hssExamNameID); | |
$query = "select unknown,subjectNos from admission_boardexam_type where typeID=$hssExamNameID"; | |
try { | |
$response = $this->executeQueryForList($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get hss marks of students | |
* | |
* @author Aswin | |
* @param unknown $hssExamNameID | |
* @param unknown $hssStreamID | |
* @param unknown $studentID | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getStudentMarks($hssExamNameID, $hssStreamID, $studentID) | |
{ | |
$hssExamNameID = $this->realEscapeString($hssExamNameID); | |
$hssStreamID = $this->realEscapeString($hssStreamID); | |
$studentID = $this->realEscapeString($studentID); | |
$query = "select subjectID,mark,maxmark,part3Optional from admission_student_marks where studentID=$studentID and typeID=$hssExamNameID and streamID=$hssStreamID"; | |
try { | |
$response = $this->executeQueryForList($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
/** | |
* get all details of student | |
* | |
* @param unknown $studentID | |
* @throws ProfessionalException | |
* @return unknown | |
*/ | |
public function getAllStudentDetails($studentID) | |
{ | |
$studentID = $this->realEscapeString($studentID); | |
$query = "select * from admission_student_details where studentID=$studentID"; | |
try { | |
$response = $this->executeQueryForObject($query); | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
return $response; | |
} | |
/** | |
* Method for getting admission print template details | |
* @throws ProfessionalException | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @author Ranjith Balachandran | |
*/ | |
public function getAdmissionPrintTemplates() | |
{ | |
$sql = ''; | |
$templateDetails = null; | |
try{ | |
$sql = 'SELECT id AS templateId, templatePrintUrl FROM admissionPrintTemplates'; | |
$templateDetails = $this->executeQueryForObject($sql); | |
}catch (\Exception $e){ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
return $templateDetails; | |
} | |
/** | |
* get taluks and districts | |
* @author Aswin | |
* @param $stateID | |
* @param $studentID | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getDistrictAndTaluks($stateID,$studentID) | |
{ | |
$stateID=$this->realEscapeString($stateID); | |
$studentID=$this->realEscapeString($studentID); | |
try{ | |
$query="SELECT s.id AS stateID,d.id AS distID,d.districtName,t.id AS tlkID, | |
t.talukName,t.student_specify,asd.state,asd.districtID,asd.talukID,asd.taluk | |
FROM | |
admission_indian_states s | |
INNER JOIN | |
districts d ON s.id = d.admission_indian_states_id | |
LEFT JOIN | |
taluks t ON d.id = t.districts_id | |
LEFT JOIN | |
admission_student_details asd ON s.id = asd.state | |
AND d.id = asd.districtID | |
AND t.id = asd.talukID | |
AND asd.studentID = '$studentID' | |
WHERE | |
s.id = '$stateID' | |
ORDER BY districtName ASC;"; | |
$response=$this->executeQueryForList($query,$this->mapper1[DistrictMapper::GET_DISTRICTS]); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function getIndianStates() | |
{ | |
$query="select id,state_name from state order by state_name asc"; | |
try{ | |
$response=$this->executeQueryForList($query); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* Method for checking whether admission is enabled for this college | |
* @throws ProfessionalException | |
* @return object|NULL|\com\linways\base\util\$objectList[] | |
* @author Kishan Suresh | |
*/ | |
public function isAdmissionEnabled($courseType) | |
{ | |
$sql = ''; | |
$courseType = $this->realEscapeObject($courseType); | |
$admissionEnabled = null; | |
try{ | |
$sql = "SELECT * FROM admission_enabled where courseType = '$courseType'"; | |
$admissionEnabled = $this->executeQueryForObject($sql); | |
}catch (\Exception $e){ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
return $admissionEnabled; | |
} | |
/** | |
* get stream type | |
* @author Kishan | |
* @throws ProfessionalException | |
* @return object|array|\com\linways\base\util\$objectList[] | |
*/ | |
public function getStreamTypes() | |
{ | |
$query="select * from pg_admission_streams order by streamType"; | |
try{ | |
$response=$this->executeQueryForList($query); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* save stream type | |
* @author Kishan | |
* @param StreamType | |
* @throws ProfessionalException | |
* @return id | |
*/ | |
public function saveStreamType($streamType) | |
{ | |
$streamType=$this->realEscapeObject($streamType); | |
$query="insert into pg_admission_streams (streamType,enterMarkFlag,enterGradeFlag,semesterWise,markOldScheme,streamDesc,noValidation) values ('$streamType->streamType','$streamType->enterMarkFlag','$streamType->enterGradeFlag', '$streamType->semesterWise','$streamType->markOldScheme','$streamType->streamDesc','$streamType->noValidation')"; | |
try{ | |
$response=$this->executeQueryForObject($query); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* update stream type | |
* @author Kishan | |
* @param StreamType | |
* @throws ProfessionalException | |
* @return id | |
*/ | |
public function updateStreamType($streamType) | |
{ | |
$streamType=$this->realEscapeObject($streamType); | |
$query="update pg_admission_streams set streamType= '$streamType->streamType', enterMarkFlag='$streamType->enterMarkFlag', enterGradeFlag='$streamType->enterGradeFlag', semesterWise = '$streamType->semesterWise',markOldScheme='$streamType->markOldScheme',streamDesc='$streamType->streamDesc',noValidation='$streamType->noValidation' where id='$streamType->id'"; | |
try{ | |
$response=$this->executeQueryForObject($query); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* delete Stream Type | |
* @author Kishan | |
* @param StreamType | |
* @throws ProfessionalException | |
* @return string | |
*/ | |
public function deleteStreamType($id) | |
{ | |
$id=$this->realEscapeString($id); | |
$query="delete from pg_admission_streams where id=$id"; | |
try{ | |
$response=$this->executeQueryForList($query); | |
return "deleted"; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* get stream type details by id | |
* @author Aswin | |
* @param $streamTypeID | |
* @throws ProfessionalException | |
* @return object | |
*/ | |
public function getStreamTypeDetails($streamTypeID) | |
{ | |
$query="select * from pg_admission_streams where id=$streamTypeID"; | |
try{ | |
$response=$this->executeQueryForObject($query); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
/** | |
* validated admission_group_ids of a stream | |
* @author Aswin | |
* @param unknown $streamID | |
* @throws ProfessionalException | |
* @return unknown | |
*/ | |
public function groupIDsForAStream($streamID) | |
{ | |
$streamID=$this->realEscapeString($streamID); | |
try{ | |
$query="select admission_complementary_group_id from pg_admission_stream_validation where stream_id=$streamID"; | |
$response=$this->executeQueryForList($query); | |
return $response; | |
}catch(\Exception $e) | |
{ | |
throw new ProfessionalException($e->getCode(),$e->getMessage()); | |
} | |
} | |
public function getCasteForDataImport($religionID) | |
{ | |
$religionID = $this->realEscapeString($religionID); | |
$cond = ''; | |
if($religionID){ | |
$cond .=" AND religionID=$religionID "; | |
} | |
$query = "select casteID as id,casteName as name,student_specify,sub_caste_label,sub_caste_description from student_caste where 1=1 $cond"; | |
try { | |
$response = $this->executeQueryForList($query); | |
return $response; | |
} catch (\Exception $e) { | |
throw new ProfessionalException($e->getCode(), $e->getMessage()); | |
} | |
} | |
} | |