Merge branch 'director-view-review' into 'develop'

Fix empty response; fix number issues; fix incorect responses

See merge request !150
parents fed9bbc4 c6dd9332
......@@ -18,9 +18,11 @@ class DirectorView extends ControllerBase
protected $logger;
// protected $testSchoolId='0640050';
public function __construct(EntityTypeManagerInterface $entityTypeManager,
LoggerChannelFactoryInterface $loggerChannel)
{
public function __construct(
EntityTypeManagerInterface $entityTypeManager,
LoggerChannelFactoryInterface $loggerChannel
) {
$this->entityTypeManager = $entityTypeManager;
$this->logger = $loggerChannel->get('epal-school');
}
......@@ -160,170 +162,188 @@ class DirectorView extends ControllerBase
public function getStudentPerSchool(Request $request, $selectId, $classId, $limitdown, $limitup)
{
try {
$authToken = $request->headers->get('PHP_AUTH_USER');
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
if ($user) {
$epalId = $user->init->value;
$schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $epalId));
$school = reset($schools);
if (!$school) {
$this->logger->warning('no access to this school='.$user->id());
$response = new Response();
$response->setContent('No access to this school');
$response->setStatusCode(Response::HTTP_FORBIDDEN);
$response->headers->set('Content-Type', 'application/json');
return $response;
}
$userRoles = $user->getRoles();
$userRole = '';
foreach ($userRoles as $tmpRole) {
if ($tmpRole === 'epal') {
$userRole = $tmpRole;
$authToken = $request->headers->get('PHP_AUTH_USER');
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
if ($user) {
$epalId = $user->init->value;
$schools = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $epalId));
$school = reset($schools);
if (!$school) {
$this->logger->warning('no access to this school='.$user->id());
return $this->respondWithStatus([
"message" => "No access to this school"
], Response::HTTP_FORBIDDEN);
}
}
if ($userRole === '') {
return $this->respondWithStatus([
'error_code' => 4003,
], Response::HTTP_FORBIDDEN);
} elseif ($userRole === 'epal') {
$selectIdNew = $selectId;
if ($classId == 1) {
$selectIdNew = -1;
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id' => $epalId, 'specialization_id' => $selectIdNew, 'currentclass' => $classId));
} else {
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id' => $epalId, 'specialization_id' => $selectIdNew, 'currentclass' => $classId));
$userRoles = $user->getRoles();
$userRole = '';
foreach ($userRoles as $tmpRole) {
if ($tmpRole === 'epal') {
$userRole = $tmpRole;
}
}
$i = 0;
if ($studentPerSchool) {
$list = array();
$i = 0;
if ($limitdown == $limitup && $limitup == 0) {
$list = array(
'id' => sizeof($studentPerSchool),
'up' => $limitup,
'down' => $limitdown,
);
} else {
foreach ($studentPerSchool as $object) {
$studentId = $object->id();
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('id' => $studentId));
$epalStudent = reset($epalStudents);
if ($epalStudents) {
$studentIdNew = $epalStudent->id();
$checkstatus = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('student_id' => $studentIdNew));
$checkstudentstatus = reset($checkstatus);
if ($i >= $limitdown && $i < $limitup) {
$sectorName = '';
$courseName = '';
if ($epalStudent->currentclass->value === '2') {
$sectors = $this->entityTypeManager->getStorage('epal_student_sector_field')->loadByProperties(array('student_id' => $studentIdNew));
$sector = reset($sectors);
if ($sector)
$sectorName = $this->entityTypeManager->getStorage('eepal_sectors')->load($sector->sectorfield_id->target_id)->name->value;
}
else if ($epalStudent->currentclass->value === '3' || $epalStudent->currentclass->value === '4') {
$courses = $this->entityTypeManager->getStorage('epal_student_course_field')->loadByProperties(array('student_id' => $studentIdNew));
$course = reset($courses);
if ($course)
$courseName = $this->entityTypeManager->getStorage('eepal_specialty')->load($course->coursefield_id->target_id)->name->value;
}
$newstatus = $checkstudentstatus->directorconfirm->value;
$crypt = new Crypt();
try {
$name_decoded = $crypt->decrypt($epalStudent->name->value);
$studentsurname_decoded = $crypt->decrypt($epalStudent->studentsurname->value);
$fatherfirstname_decoded = $crypt->decrypt($epalStudent->fatherfirstname->value);
$motherfirstname_decoded = $crypt->decrypt($epalStudent->motherfirstname->value);
$regionaddress_decoded = $crypt->decrypt($epalStudent->regionaddress->value);
$regiontk_decoded = $crypt->decrypt($epalStudent->regiontk->value);
$regionarea_decoded = $crypt->decrypt($epalStudent->regionarea->value);
$certificatetype_decoded = $crypt->decrypt($epalStudent->certificatetype->value);
$relationtostudent_decoded = $crypt->decrypt($epalStudent->relationtostudent->value);
$telnum_decoded = $crypt->decrypt($epalStudent->telnum->value);
$guardian_name_decoded = $crypt->decrypt($epalStudent->guardian_name->value);
$guardian_surname_decoded = $crypt->decrypt($epalStudent->guardian_surname->value);
$guardian_fathername_decoded = $crypt->decrypt($epalStudent->guardian_fathername->value);
$guardian_mothername_decoded = $crypt->decrypt($epalStudent->guardian_mothername->value);
}
catch (\Exception $e) {
//print_r($e->getMessage());
unset($crypt);
$this->logger->warning($e->getMessage());
return $this->respondWithStatus([
"message" => t("An unexpected error occured during DECODING data in getStudentPerSchool Method ")
], Response::HTTP_INTERNAL_SERVER_ERROR);
if ($userRole === '') {
return $this->respondWithStatus([
'error_code' => 4003,
], Response::HTTP_FORBIDDEN);
} elseif ($userRole === 'epal') {
if ($classId == 1) {
$selectId = -1;
}
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id' => $epalId, 'specialization_id' => $selectId, 'currentclass' => $classId));
if ($studentPerSchool) {
$list = array();
if ($limitdown == $limitup && $limitup == 0) {
$list = array(
'id' => sizeof($studentPerSchool),
'up' => $limitup,
'down' => $limitdown,
);
} else {
$i = 0;
foreach ($studentPerSchool as $object) {
$studentId = $object->id();
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('id' => $studentId));
$epalStudent = reset($epalStudents);
if ($epalStudent) {
$studentIdNew = $epalStudent->id();
$checkstatus = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('student_id' => $studentIdNew));
$checkstudentstatus = reset($checkstatus);
if ($i >= $limitdown && $i < $limitup) {
$sectorName = '';
$courseName = '';
if ($epalStudent->currentclass->value === '2') {
$sectors = $this->entityTypeManager->getStorage('epal_student_sector_field')->loadByProperties(array('student_id' => $studentIdNew));
$sector = reset($sectors);
if ($sector) {
$sectorName = $this->entityTypeManager->getStorage('eepal_sectors')->load($sector->sectorfield_id->target_id)->name->value;
}
} elseif ($epalStudent->currentclass->value === '3' || $epalStudent->currentclass->value === '4') {
$courses = $this->entityTypeManager->getStorage('epal_student_course_field')->loadByProperties(array('student_id' => $studentIdNew));
$course = reset($courses);
if ($course) {
$courseName = $this->entityTypeManager->getStorage('eepal_specialty')->load($course->coursefield_id->target_id)->name->value;
}
}
$newstatus = $checkstudentstatus->directorconfirm->value;
$crypt = new Crypt();
try {
$name_decoded = $crypt->decrypt($epalStudent->name->value);
$studentsurname_decoded = $crypt->decrypt($epalStudent->studentsurname->value);
$fatherfirstname_decoded = $crypt->decrypt($epalStudent->fatherfirstname->value);
$motherfirstname_decoded = $crypt->decrypt($epalStudent->motherfirstname->value);
$regionaddress_decoded = $crypt->decrypt($epalStudent->regionaddress->value);
$regiontk_decoded = $crypt->decrypt($epalStudent->regiontk->value);
$regionarea_decoded = $crypt->decrypt($epalStudent->regionarea->value);
$certificatetype_decoded = $crypt->decrypt($epalStudent->certificatetype->value);
$relationtostudent_decoded = $crypt->decrypt($epalStudent->relationtostudent->value);
$telnum_decoded = $crypt->decrypt($epalStudent->telnum->value);
$guardian_name_decoded = $crypt->decrypt($epalStudent->guardian_name->value);
$guardian_surname_decoded = $crypt->decrypt($epalStudent->guardian_surname->value);
$guardian_fathername_decoded = $crypt->decrypt($epalStudent->guardian_fathername->value);
$guardian_mothername_decoded = $crypt->decrypt($epalStudent->guardian_mothername->value);
// $name_decoded = $epalStudent->name->value;
// $studentsurname_decoded = $epalStudent->studentsurname->value;
// $fatherfirstname_decoded = $epalStudent->fatherfirstname->value;
// $motherfirstname_decoded = $epalStudent->motherfirstname->value;
// $regionaddress_decoded = $epalStudent->regionaddress->value;
// $regiontk_decoded = $epalStudent->regiontk->value;
// $regionarea_decoded = $epalStudent->regionarea->value;
// $certificatetype_decoded = $epalStudent->certificatetype->value;
// $relationtostudent_decoded = $epalStudent->relationtostudent->value;
// $telnum_decoded = $epalStudent->telnum->value;
// $guardian_name_decoded = $epalStudent->guardian_name->value;
// $guardian_surname_decoded = $epalStudent->guardian_surname->value;
// $guardian_fathername_decoded = $epalStudent->guardian_fathername->value;
// $guardian_mothername_decoded = $epalStudent->guardian_mothername->value;
} catch (\Exception $e) {
$this->logger->warning(__METHOD__ . ' Decrypt error: ' . $e->getMessage());
return $this->respondWithStatus([
"message" => t("An unexpected error occured during DECODING data in getStudentPerSchool Method ")
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
$list[] = array(
'i' => $i,
'id' => $epalStudent->id(),
'name' => $name_decoded,
'studentsurname' => $studentsurname_decoded,
'fatherfirstname' => $fatherfirstname_decoded,
'fathersurname' => $epalStudent->fathersurname->value,
'motherfirstname' => $motherfirstname_decoded,
'mothersurname' => $epalStudent->mothersurname->value,
'guardian_name' => $guardian_name_decoded,
'guardian_surname' => $guardian_surname_decoded,
'guardian_fathername' => $guardian_fathername_decoded,
'guardian_mothername' => $guardian_mothername_decoded,
'lastschool_schoolname' => $epalStudent->lastschool_schoolname->value,
'lastschool_schoolyear' => $epalStudent->lastschool_schoolyear->value,
'lastschool_class' => $epalStudent->currentclass->value,
'currentclass' => $epalStudent->currentclass->value,
'currentsector' => $sectorName,
'currentcourse' => $courseName,
'regionaddress' => $regionaddress_decoded,
'regiontk' => $regiontk_decoded,
'regionarea' => $regionarea_decoded,
'certificatetype' => $certificatetype_decoded,
'graduation_year' => $epalStudent->graduation_year->value,
'telnum' => $telnum_decoded,
'relationtostudent' => $relationtostudent_decoded,
//'birthdate' => substr($epalStudent->birthdate->value, 8, 10) . '/' . substr($epalStudent->birthdate->value, 6, 8) . '/' . substr($epalStudent->birthdate->value, 0, 4),
'birthdate' => date("d-m-Y", strtotime($epalStudent->birthdate->value)),
'checkstatus' => $newstatus[0][value],
'created' => date('d/m/Y H:i', $epalStudent->created->value)
);
}
unset($crypt);
$list[] = array(
'i' => $i,
'id' => $epalStudent->id(),
'name' => $name_decoded,
'studentsurname' => $studentsurname_decoded,
'fatherfirstname' => $fatherfirstname_decoded,
'fathersurname' => $epalStudent->fathersurname->value,
'motherfirstname' => $motherfirstname_decoded,
'mothersurname' => $epalStudent->mothersurname->value,
'guardian_name' =>$guardian_name_decoded,
'guardian_surname' => $guardian_surname_decoded,
'guardian_fathername' =>$guardian_fathername_decoded,
'guardian_mothername' =>$guardian_mothername_decoded,
'lastschool_schoolname' => $epalStudent->lastschool_schoolname->value,
'lastschool_schoolyear' => $epalStudent->lastschool_schoolyear->value,
'lastschool_class' => $epalStudent->currentclass->value,
'currentclass' =>$epalStudent -> currentclass ->value,
'currentsector' =>$sectorName,
'currentcourse' =>$courseName,
'regionaddress' =>$regionaddress_decoded,
'regiontk' =>$regiontk_decoded,
'regionarea' =>$regionarea_decoded,
'certificatetype' => $certificatetype_decoded,
'graduation_year' => $epalStudent->graduation_year->value,
'telnum' =>$telnum_decoded,
'relationtostudent' => $relationtostudent_decoded,
//'birthdate' => substr($epalStudent->birthdate->value, 8, 10) . '/' . substr($epalStudent->birthdate->value, 6, 8) . '/' . substr($epalStudent->birthdate->value, 0, 4),
'birthdate' => date("d-m-Y", strtotime($epalStudent->birthdate->value)),
'checkstatus' => $newstatus[0][value],
'created' => date('d/m/Y H:i', $epalStudent -> created ->value),
);
++$i;
}
++$i;
}
}
return $this->respondWithStatus(
$list, Response::HTTP_OK);
} else {
if ($limitdown == $limitup && $limitup == 0) {
$list = [
'id' => sizeof($studentPerSchool),
'up' => $limitup,
'down' => $limitdown,
];
} else {
$list = [];
}
return $this->respondWithStatus($list, Response::HTTP_OK);
}
} else {
if ($limitdown == $limitup && $limitup == 0) {
$list = [
'id' => sizeof($studentPerSchool),
'up' => $limitup,
'down' => $limitdown,
];
} else {
$list = [];
}
return $this->respondWithStatus(
$list, Response::HTTP_OK);
return $this->respondWithStatus($list, Response::HTTP_OK);
}
} else {
$list = array();
return $this->respondWithStatus($list, Response::HTTP_OK);
}
} else {
return $this->respondWithStatus([
return $this->respondWithStatus([
'message' => t('User not found!'),
], Response::HTTP_FORBIDDEN);
}
} catch (\Exception $e) {
$this->logger->warning($e->getMessage());
return $this->respondWithStatus([
}
} catch (\Exception $e) {
$this->logger->warning($e->getMessage());
return $this->respondWithStatus([
'message' => t('Unexpected Error'),
], Response::HTTP_FORBIDDEN);
}
}
}
public function ConfirmStudents(Request $request)
......@@ -377,7 +397,7 @@ class DirectorView extends ControllerBase
return $this->respondWithStatus([
'message' => t('saved'),
], Response::HTTP_OK);
], Response::HTTP_OK);
}
} else {
return $this->respondWithStatus([
......@@ -673,10 +693,10 @@ class DirectorView extends ControllerBase
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('currentepal' => $schoolid, 'specialization_id' => -1, 'currentclass' => 1));
//foreach ($CourseA as $object) {
if (sizeof($studentPerSchool) < $limit) {
return false;
if (sizeof($studentPerSchool) < $limit) {
return false;
// exit;
}
}
} // }
$CourseB = $this->entityTypeManager->getStorage('eepal_sectors_in_epal')->loadByProperties(array('epal_id' => $schoolid));
......@@ -902,12 +922,9 @@ class DirectorView extends ControllerBase
$school = reset($schools);
if (!$school) {
$this->logger->warning('no access to this school='.$user->id());
$response = new Response();
$response->setContent('No access to this school');
$response->setStatusCode(Response::HTTP_FORBIDDEN);
$response->headers->set('Content-Type', 'application/json');
return $response;
return $this->respondWithStatus([
'message' => "No access to this school"
], Response::HTTP_FORBIDDEN);
}
$userRoles = $user->getRoles();
$userRole = '';
......@@ -918,8 +935,8 @@ class DirectorView extends ControllerBase
}
if ($userRole === '') {
return $this->respondWithStatus([
'error_code' => 4003,
], Response::HTTP_FORBIDDEN);
'error_code' => 4003,
], Response::HTTP_FORBIDDEN);
} elseif ($userRole === 'epal') {
$list = array();
......@@ -937,12 +954,12 @@ class DirectorView extends ControllerBase
}
$list[] = array(
'id' => '1',
'name' => 'Α Λυκείου',
'categ' => $categ,
'classes' => 1,
'limitdown' => $limit,
);
'id' => '1',
'name' => 'Α Λυκείου',
'categ' => $categ,
'classes' => 1,
'limitdown' => $limit,
);
}
if ($classid == 2) {
......@@ -953,9 +970,7 @@ class DirectorView extends ControllerBase
}
$list[] = array(
'name' => 'Β Λυκείου ',
'categ' => $categ,
'classes' => 2,
'limitdown' => $limit,
......@@ -971,7 +986,6 @@ class DirectorView extends ControllerBase
}
$list[] = array(
'categ' => $categ,
'classes' => 3,
'limitdown' => $limit,
......@@ -979,18 +993,17 @@ class DirectorView extends ControllerBase
);
}
return $this->respondWithStatus(
$list, Response::HTTP_OK);
return $this->respondWithStatus($list, Response::HTTP_OK);
}
} else {
return $this->respondWithStatus([
'message' => t('Perfecture not found!'),
], Response::HTTP_FORBIDDEN);
'message' => t('Perfecture not found!'),
], Response::HTTP_FORBIDDEN);
}
} else {
return $this->respondWithStatus([
'message' => t('User not found!'),
], Response::HTTP_FORBIDDEN);
'message' => t('User not found!'),
], Response::HTTP_FORBIDDEN);
}
}
......
import { Component, OnInit, OnDestroy, ElementRef, ViewChild, Renderer} from "@angular/core";
import { Component, OnInit, OnDestroy, ElementRef, ViewChild, Renderer } from "@angular/core";
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import {Observable} from "rxjs/Observable";
import {Http, Headers, RequestOptions} from '@angular/http';
import { Observable } from "rxjs/Observable";
import { Http, Headers, RequestOptions } from '@angular/http';
import { NgRedux, select } from 'ng2-redux';
import { IAppState } from '../../store/store';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
......@@ -217,7 +217,7 @@ import {
private selectionCClass: BehaviorSubject<boolean>;
private limitsSub: Subscription;
private limits$: BehaviorSubject<any>;
private SchoolId ;
private SchoolId;
private currentclass: Number;
private saved: Array<number> = new Array();
private limitdown = 0;
......@@ -282,29 +282,29 @@ import {
ngOnInit() {
this.SchoolSub = this._hds.gettypeofschool().subscribe(x => {
this.School$.next(x);
console.log(x[0].type, "schoolid!");
this.SchoolId = x[0].type;
if (this.SchoolId == 'ΗΜΕΡΗΣΙΟ'){
this.selectiontype.next(false);
}
this.SchoolSub = this._hds.gettypeofschool().subscribe(x => {
this.School$.next(x);
console.log(x[0].type, "schoolid!");
this.SchoolId = x[0].type;
if (this.SchoolId == 'ΗΜΕΡΗΣΙΟ') {
this.selectiontype.next(false);
}
},
error => {
this.School$.next([{}]);
console.log("Error Getting School");
},
() => console.log("Getting School "));
},
error => {
this.School$.next([{}]);
console.log("Error Getting School");
},
() => console.log("Getting School "));
}
}
verifyclass(txop) {
this.limitdown = 0;
this.limitup = 5;
console.log(this.SchoolId,"schoolida");
this.limitdown = 0;
this.limitup = 5;
console.log(this.SchoolId, "schoolida");
this.pageno = 1;
this.retrievedStudent.next(false);
if (txop.value === "1") {
......@@ -327,7 +327,7 @@ import {
}
else if (txop.value === "3" || txop.value === "4") {
var sectorint = +this.formGroup.value.tomeas;
if (this.formGroup.value.tomeas != '') {
if (this.formGroup.value.tomeas != '') {
var sectorint = +this.formGroup.value.tomeas;
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(sectorint).subscribe(data => {
......@@ -355,7 +355,7 @@ import {
checkbclass(tmop, txop) {
console.log(this.SchoolId,"schoolidn");
console.log(this.SchoolId, "schoolidn");
this.pageno = 1;
this.retrievedStudent.next(false);
var sectorint = +this.formGroup.value.tomeas;
......@@ -376,95 +376,88 @@ import {
findstudent(txop, pageno) {
var sectorint = +this.formGroup.value.tomeas;
let sectorint = +this.formGroup.value.tomeas;
this.currentclass = +txop.value;
this.formGroup.get('pageno').setValue(this.pageno);
if (this.pageno == 1) {
console.log("mphkepage = 1");
this.StudentsSizeSub = this._hds.getStudentPerSchool(sectorint, this.currentclass, 0, 0).subscribe(x => {
this.StudentsSize$.next(x);
this.totallimit = x.id;
this.limitsSub = this._hds.getlimitsofcourse(this.currentclass).subscribe(data => {
this.limits$.next(data);
console.log(this.totallimit, data[0].limitdown, "oria");
this.tot_pages = x.id / 5;
if (x.id % 5 > 0) {
this.tot_pages = (x.id - (x.id % 5)) / 5 + 1;
}
console.log(this.tot_pages,"totpages")
if (isNaN(this.tot_pages)){
this.retrievedStudent.next(false);
this.tot_pages = 0;
}
if ( (x.id < data[0].limitdown) || (isNaN(this.tot_pages)))
{
console.log("mphkeprwto!")
this.retrievedStudent.next(false);
this.tot_pages = 0;
this.formGroup.get('maxpage').setValue(this.tot_pages);
//this.outoflimits.next(true);
}
else
{
// this.outoflimits.next(false);
this.formGroup.get('maxpage').setValue(this.tot_pages);
console.log(this.tot_pages,"mazeuw mathites");
this.StudentInfoSub = this._hds.getStudentPerSchool(sectorint, this.currentclass, this.limitdown, this.limitup).subscribe(data => {
this.StudentInfo$.next(data);
console.log("tot.pages", this.formGroup.value.maxpage, "max1", this.tot_pages);
this.retrievedStudent.next(true);
},
error => {
this.StudentInfo$.next([{}]);
console.log("Error Getting Students");
},
() => console.log("Getting Students"));
}
},
error => {
this.limits$.next([{}]);
console.log("Error Getting limits");
},
() => console.log("Getting limits"));
this.StudentsSizeSub = this._hds.getStudentPerSchool(sectorint, this.currentclass, 0, 0)
.subscribe(x => {
this.StudentsSize$.next(x);
this.totallimit = x.id;
this.limitsSub = this._hds.getlimitsofcourse(this.currentclass).subscribe(data => {
this.limits$.next(data);
console.log(this.totallimit, data[0].limitdown, "oria");
this.tot_pages = Math.floor(x.id / 5);
if (x.id % 5 > 0) {
// this.tot_pages = (x.id - (x.id % 5)) / 5 + 1;
this.tot_pages += 1;
}
console.log(this.tot_pages, "totpages")
if (isNaN(this.tot_pages)) {
this.retrievedStudent.next(false);
this.tot_pages = 0;
}
if ((x.id < parseInt(data[0].limitdown)) || (isNaN(this.tot_pages))) {
console.log("mphkeprwto!")
this.retrievedStudent.next(false);
this.tot_pages = 0;
this.formGroup.get('maxpage').setValue(this.tot_pages);
//this.outoflimits.next(true);
} else {
// this.outoflimits.next(false);
this.formGroup.get('maxpage').setValue(this.tot_pages);
console.log(this.tot_pages, "mazeuw mathites");
this.StudentInfoSub = this._hds.getStudentPerSchool(sectorint, this.currentclass, this.limitdown, this.limitup)
.subscribe(data => {
this.StudentInfo$.next(data);
console.log("tot.pages", this.formGroup.value.maxpage, "max1", this.tot_pages);
this.retrievedStudent.next(true);
},
error => {
this.StudentInfo$.next([{}]);
console.log("Error Getting Students");
},
() => console.log("Getting Students")
);
}
},
error => {
this.limits$.next([{}]);
console.log("Error Getting limits");
},
() => console.log("Getting limits")
);
});
});
}
else{
console.log("eisai edw", this.tot_pages);
else {
console.log("eisai edw", this.tot_pages);
if (this.tot_pages == 0 ){
console.log("mphke1", this.formGroup.value.maxpage, this.tot_pages);
this.retrievedStudent.next(false);