Commit fbebb3f0 authored by Kostas G's avatar Kostas G

check for invalid apps in gel director view

parent a1ac1820
......@@ -2762,7 +2762,7 @@ public function FindCoursesPerSchoolGel(Request $request)
if ($user) {
$schoolid = $user->init->value;
//hard
//$schoolid = 1573;
$schoolid = 361;
$schools = $this->entityTypeManager->getStorage('gel_school')->loadByProperties(array('id' => $schoolid));
$school = reset($schools);
if (!$school) {
......@@ -3130,7 +3130,7 @@ public function getStudentPerSchoolGel(Request $request, $classId)
if ($user) {
$gelId = $user->init->value;
//hard
//$gelId = 1573;
$gelId = 361;
//$this->logger->warning($gelId."kvdikos sxoleiou".$classId);
$schools = $this->entityTypeManager->getStorage('gel_school')->loadByProperties(array('id' => $gelId));
$school = reset($schools);
......@@ -3249,22 +3249,44 @@ public function getStudentPerSchoolGel(Request $request, $classId)
}
if ($studentPerSchool || $existingstudents_prom || existingstudents_non_prom) {
if ($studentPerSchool || $existingstudents_prom || $existingstudents_non_prom) {
$list = array();
foreach ($studentPerSchool as $object) {
$studentId = $object->student_id->target_id;
//$this->logger->warning($studentId."Aaaaa1");
//$this->logger->warning($studentId."Aaaaa1");
$gelStudents = $this->entityTypeManager->getStorage('gel_student')->loadByProperties(array('id' => $studentId, 'myschool_promoted' => '2','nextclass'=>$classId));
$gelStudent = reset($gelStudents);
if (!$gelStudent) {
//$this->logger->warning($studentId."step1");
$gelStudents = $this->entityTypeManager->getStorage('gel_student')->loadByProperties(array('id' => $studentId, 'myschool_promoted' => '1','nextclass'=>$classId));
$gelStudent = reset($gelStudents);
$gelStudent = reset($gelStudents);
}
if ($gelStudent) {
if (!$gelStudent) {
// $this->logger->warning($studentId."step2");
$gelStudents = $this->entityTypeManager->getStorage('gel_student')->loadByProperties(array('id' => $studentId, 'myschool_promoted' => '6','nextclass'=>$classId));
$gelStudent = reset($gelStudents);
}
if (!$gelStudent) {
//$this->logger->warning($studentId."step3");
$gelStudents = $this->entityTypeManager->getStorage('gel_student')->loadByProperties(array('id' => $studentId, 'myschool_promoted' => '7','nextclass'=>$classId));
$gelStudent = reset($gelStudents);
}
$sCon = $this->connection->select('invalid_apps', 'invalid');
$sCon->fields('invalid', array('id'))
->condition('invalid.id', $studentId , '=');
$existsinvalid = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
if (sizeof($existsinvalid)>0){
$this->logger->warning($studentId." invalid");
}
if ($gelStudent && sizeof($existsinvalid)==0 ) {
//$this->logger->warning($studentId."step2");
$studentIdNew = $gelStudent->id();
$choices = "";
......@@ -3386,7 +3408,17 @@ public function getStudentPerSchoolGel(Request $request, $classId)
$gelStudents = $this->entityTypeManager->getStorage('gelstudenthighschool')->loadByProperties(array('student_id' => $studentId));
$gelStudent = reset($gelStudents);
if (!$gelStudents) {
$sCon = $this->connection->select('invalid_apps', 'invalid');
$sCon->fields('invalid', array('id'))
->condition('invalid.id', $studentId , '=');
$existsinvalid = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
if (sizeof($existsinvalid)>0){
$this->logger->warning($studentId." invalid");
}
if (!$gelStudents && sizeof($existsinvalid)==0) {
//if (!$gelStudents) {
$studentIdNew = $studentId;
$choices = "";
......@@ -3495,7 +3527,17 @@ public function getStudentPerSchoolGel(Request $request, $classId)
$gelStudents = $this->entityTypeManager->getStorage('gelstudenthighschool')->loadByProperties(array('student_id' => $studentId));
$gelStudent = reset($gelStudents);
if (!$gelStudents) {
$sCon = $this->connection->select('invalid_apps', 'invalid');
$sCon->fields('invalid', array('id'))
->condition('invalid.id', $studentId , '=');
$existsinvalid = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
if (sizeof($existsinvalid)>0){
$this->logger->warning($studentId." invalid");
}
if (!$gelStudents && sizeof($existsinvalid)==0) {
//if (!$gelStudents) {
$studentIdNew = $studentId;
$choices = "";
......@@ -4321,7 +4363,8 @@ public function FindStudentsPerSchoolGym(Request $request)
$user = reset($users);
if ($user) {
$gymId = $user->init->value;
//$gymId = 969;
//hard
//$gymId = 1832;
$schools = $this->entityTypeManager->getStorage('gel_school')->loadByProperties(array('id' => $gymId));
$school = reset($schools);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment