added dynamic count in directorgel view

parent 83474ead
......@@ -2528,7 +2528,7 @@ class ReportsCreator extends ControllerBase
}
$schoolid = $user->init->value;
//hard
//$schoolid = 2420;
//$schoolid = 1573;
//user role validation
$roles = $user->getRoles();
......@@ -2561,6 +2561,13 @@ class ReportsCreator extends ControllerBase
$crypt = new Crypt();
$sCon = $this->connection
->select('gel_school', 'eSchool')
->fields('eSchool', array('operation_shift', 'registry_no'))
->condition('eSchool.id', $schoolid, '=');
$gelSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$gelSchool = reset($gelSchools);
$classNames = array("Α", "Β", "Γ", "Δ");
$classLogos = array("Α' Λυκείου (τοποθέτηση)", "Β' Λυκείου (τοποθέτηση)", "Γ' Λυκείου (τοποθέτηση)", "Δ' Λυκείου (τοποθέτηση)");
$hgids = array();
......@@ -2596,7 +2603,11 @@ class ReportsCreator extends ControllerBase
$stChoice = reset($stChoices);
//να αλλαχθεί σε ανάκτηση του ονόματος της ΟΠ από τη βάση με INNER JOIN
array_push($opColumn, $this->retrieveChoiceName($stChoice->choice_id));
array_push($classColumn, $classLogos[$l]);
//προσωρινή "θεραπεία" για Εσπερινά (αντιμετώπιση λάθους καταχώρησης πεδίου taxi)
if ($gelSchool->operation_shift == "ΕΣΠΕΡΙΝΟ" && $stChoice->choice_id != null && $classLogos[$l] == "Β' Λυκείου (τοποθέτηση)")
array_push($classColumn, $classLogos[$l+1]);
else
array_push($classColumn, $classLogos[$l]);
array_push($firstnameColumn, $crypt->decrypt($gelStudent->name));
array_push($surnameColumn, $crypt->decrypt($gelStudent->studentsurname));
$addr = $crypt->decrypt($gelStudent->regionaddress);
......@@ -2623,12 +2634,14 @@ class ReportsCreator extends ControllerBase
//βρες τους αυτοδίκαια
/*
$sCon = $this->connection
->select('gel_school', 'eSchool')
->fields('eSchool', array('operation_shift', 'registry_no'))
->condition('eSchool.id', $schoolid, '=');
$gelSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$gelSchool = reset($gelSchools);
*/
if ($gelSchool->operation_shift == "ΕΣΠΕΡΙΝΟ") {
$startIndex = 4; $endIndex = 7;
......@@ -2739,7 +2752,7 @@ class ReportsCreator extends ControllerBase
], Response::HTTP_FORBIDDEN);
}
$schoolid = $user->init->value;
//$schoolid = 2420;
//$schoolid = 1573;
//user role validation
$roles = $user->getRoles();
......@@ -2769,6 +2782,13 @@ class ReportsCreator extends ControllerBase
$crypt = new Crypt();
$sCon = $this->connection
->select('gel_school', 'eSchool')
->fields('eSchool', array('operation_shift', 'registry_no'))
->condition('eSchool.id', $schoolid, '=');
$gelSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$gelSchool = reset($gelSchools);
$classNames = array("Α", "Β", "Γ", "Δ");
$classLogos = array("Α' Λυκείου (τοποθέτηση)", "Β' Λυκείου (τοποθέτηση)", "Γ' Λυκείου (τοποθέτηση)", "Δ' Λυκείου (τοποθέτηση)");
$hgids = array();
......@@ -2805,7 +2825,12 @@ class ReportsCreator extends ControllerBase
array_push($idColumn, $gelStudent->id);
array_push($choiceColumn, $this->retrieveChoiceName($stChoice->choice_id));
array_push($orderidColumn, $stChoice->order_id);
array_push($classColumn, $classLogos[$l]);
//array_push($classColumn, $classLogos[$l]);
//προσωρινή "θεραπεία" για Εσπερινά (αντιμετώπιση λάθους καταχώρησης πεδίου taxi)
if ($gelSchool->operation_shift == "ΕΣΠΕΡΙΝΟ" && $stChoice->choice_id != null && $classLogos[$l] == "Β' Λυκείου (τοποθέτηση)")
array_push($classColumn, $classLogos[$l+1]);
else
array_push($classColumn, $classLogos[$l]);
array_push($categoryColumn, $this->retrieveCategoryName($stChoice->choice_id));
array_push($firstnameColumn, $crypt->decrypt($gelStudent->name));
array_push($surnameColumn, $crypt->decrypt($gelStudent->studentsurname));
......@@ -2816,12 +2841,14 @@ class ReportsCreator extends ControllerBase
//βρες τους αυτοδίκαια
/*
$sCon = $this->connection
->select('gel_school', 'eSchool')
->fields('eSchool', array('operation_shift', 'registry_no'))
->condition('eSchool.id', $schoolid, '=');
$gelSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$gelSchool = reset($gelSchools);
*/
if ($gelSchool->operation_shift == "ΕΣΠΕΡΙΝΟ") {
$startIndex = 4; $endIndex = 7;
......
......@@ -2735,7 +2735,8 @@ public function FindCoursesPerSchoolGel(Request $request)
$user = reset($users);
if ($user) {
$schoolid = $user->init->value;
//$schoolid = 2246;
//hard
//$schoolid = 1573;
$schools = $this->entityTypeManager->getStorage('gel_school')->loadByProperties(array('id' => $schoolid));
$school = reset($schools);
if (!$school) {
......@@ -2782,7 +2783,7 @@ public function FindCoursesPerSchoolGel(Request $request)
->condition('gStudent.delapp', '0' , '=');
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
/*
/*
$sCon = $this->connection->select('gel_student', 'gStudent');
$sCon->leftJoin('gel_school', 'gSchool', 'gSchool.registry_no = gStudent.lastschool_registrynumber');
$sCon->fields('gStudent', array('id','lastschool_registrynumber','nextclass', 'delapp','name','studentsurname' ,'fatherfirstname' ,'motherfirstname' ,'regionaddress' ,'regiontk' ,'regionarea','telnum' ,'guardian_name' ,'guardian_surname','guardian_fathername ','guardian_mothername', 'birthdate', 'lastschool_schoolname','lastschool_class','lastschool_schoolyear','directorconfirm', 'created' ))
......@@ -2790,9 +2791,9 @@ public function FindCoursesPerSchoolGel(Request $request)
->condition('gSchool.id', $schoolid , '=')
->condition('gStudent.nextclass', '1' , '=')
->condition('gStudent.delapp', '0' , '=')
->condition(db_or()->condition('myschool_promoted', 1)->condition('myschool_promoted', 2)->condition('myschool_promoted', 6)->condition('myschool_promoted', 7));
$existingstudentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); */
$list[] = array(
......@@ -3102,7 +3103,8 @@ public function getStudentPerSchoolGel(Request $request, $classId)
$user = reset($users);
if ($user) {
$gelId = $user->init->value;
//$gelId = 2246;
//hard
//$gelId = 1573;
//$this->logger->warning($gelId."kvdikos sxoleiou".$classId);
$schools = $this->entityTypeManager->getStorage('gel_school')->loadByProperties(array('id' => $gelId));
$school = reset($schools);
......@@ -3219,7 +3221,7 @@ public function getStudentPerSchoolGel(Request $request, $classId)
$existingstudents_non_prom = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
}
}
if ($studentPerSchool || $existingstudents_prom || existingstudents_non_prom) {
$list = array();
......@@ -3351,7 +3353,7 @@ public function getStudentPerSchoolGel(Request $request, $classId)
}
}
foreach ($existingstudents_prom as $object) {
......
......@@ -66,7 +66,8 @@ import { HelperDataService } from "../../services/helper-data-service";
[class.oddout]="isOdd" [class.evenout]="isEven" [class.selectedout]="courseActive === i" >
<div class="row" style="line-height: 2em;">
<div class="col-md-10" style="font-weight: bold;" >{{CoursesPerSchools$.taxi}}</div>
<div class="col-md-2" style="font-weight: bold;" ><span class="pull-right" style="text-align: right; padding-right: 2px;">{{CoursesPerSchools$.size}}</span></div>
<!--<div class="col-md-2" style="font-weight: bold;" ><span class="pull-right" style="text-align: right; padding-right: 2px;">{{CoursesPerSchools$.size}}</span></div>-->
<div *ngIf = "courseActive == i" class="col-md-2" style="font-weight: bold;" ><span class="pull-right" style="text-align: right; padding-right: 2px;">{{dynamicCount | async}}</span></div>
</div>
</li>
......@@ -290,6 +291,8 @@ import { HelperDataService } from "../../services/helper-data-service";
private sector = <number>0;
private special = <number>0;
private dynamicCount: BehaviorSubject<string>;
constructor(
private _hds: HelperDataService,
private activatedRoute: ActivatedRoute,
......@@ -301,6 +304,8 @@ import { HelperDataService } from "../../services/helper-data-service";
this.retrievedStudent = new BehaviorSubject(false);
this.SavedStudents$ = new BehaviorSubject({});
this.opened = false;
this.dynamicCount = new BehaviorSubject("");
}
public showConfirmModal(): void {
......@@ -357,12 +362,14 @@ import { HelperDataService } from "../../services/helper-data-service";
findstudent(taxi) {
this.showLoader.next(true);
this.dynamicCount.next("");
this.retrievedStudent.next(false);
this.StudentInfoSub = this._hds.getStudentPerSchoolGel(taxi)
.subscribe(data => {
this.StudentInfo$.next(data);
this.retrievedStudent.next(true);
this.showLoader.next(false);
this.dynamicCount.next(data.length);
},
error => {
this.StudentInfo$.next([{}]);
......
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