Merge branch 'application_form' into 'develop'

front-end sweepping. Deleted unneeded code. Various fixes

See merge request !171
parents f3fcbb25 47d7ec3a
...@@ -28,7 +28,7 @@ import { ...@@ -28,7 +28,7 @@ import {
<div style="min-height: 500px;"> <div style="min-height: 500px;">
<form [formGroup]="formGroup"> <form [formGroup]="formGroup">
<p style="margin-top: 20px; line-height: 2em;"> Στην παρακάτω λίστα βλέπετε τα τμήματα του σχολείου σας με την αντίστοιχη δυναμίκη τους σε αίθουσες. Παρακαλώ για να τροποποποιήσετε τη δυναμικήαυτή κάντε κλικ στον αντίστοιχο σύμβολο, <p style="margin-top: 20px; line-height: 2em;"> Στην παρακάτω λίστα βλέπετε τα τμήματα του σχολείου σας με την αντίστοιχη δυναμίκη τους σε αίθουσες. Παρακαλώ για να τροποποποιήσετε τη δυναμικήαυτή κάντε κλικ στον αντίστοιχο σύμβολο,
επιλέξτε τη νέα δυναμική και πατήστε το σύμβολο <i>ok</i>. Προσοχή! Κανένα τμήμα δεν πρέπει να έχει δυναμική 0.</p> επιλέξτε τη νέα δυναμική και πατήστε το σύμβολο <i>ok</i>. Προσοχή! Κανένα τμήμα δεν πρέπει να έχει δυναμική 0.</p>
<div class="row" style="margin-top: 20px; line-height: 2em;" > <b> Οι δηλώσεις σας </b></div> <div class="row" style="margin-top: 20px; line-height: 2em;" > <b> Οι δηλώσεις σας </b></div>
...@@ -42,17 +42,17 @@ import { ...@@ -42,17 +42,17 @@ import {
<label style="font-weight:bold!important" *ngIf="!isEdit || CapacityPerCourses$.globalindex !== courseActive" > {{CapacityPerCourses$.capacity}} </label> <label style="font-weight:bold!important" *ngIf="!isEdit || CapacityPerCourses$.globalindex !== courseActive" > {{CapacityPerCourses$.capacity}} </label>
<i *ngIf="!isEdit || CapacityPerCourses$.globalindex !== courseActive" (click)= "modifycapc(i,$event)" class="fa fa-pencil isclickable pull-right" style="font-size: 1.5em;"></i> <i *ngIf="!isEdit || CapacityPerCourses$.globalindex !== courseActive" (click)= "modifycapc(i,$event)" class="fa fa-pencil isclickable pull-right" style="font-size: 1.5em;"></i>
<input *ngIf="isEdit && CapacityPerCourses$.globalindex === courseActive" <input *ngIf="isEdit && CapacityPerCourses$.globalindex === courseActive"
id="{{CapacityPerCourses$.globalindex}}" type="number" id="{{CapacityPerCourses$.globalindex}}" type="number"
name="{{CapacityPerCourses$.globalindex}}" value ={{CapacityPerCourses$.capacity}} (change)="handleChange($event)"> name="{{CapacityPerCourses$.globalindex}}" value ={{CapacityPerCourses$.capacity}} (change)="handleChange($event)">
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
<i *ngIf="isEdit && CapacityPerCourses$.globalindex === courseActive" (click)= "isEdit = false" class="fa fa-ban isclickable" style="font-size: 1.5em;"></i> <i *ngIf="isEdit && CapacityPerCourses$.globalindex === courseActive" (click)= "isEdit = false" class="fa fa-ban isclickable" style="font-size: 1.5em;"></i>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<button *ngIf="isEdit && CapacityPerCourses$.globalindex === courseActive" type="button" class="btn-primary pull-right" <button *ngIf="isEdit && CapacityPerCourses$.globalindex === courseActive" type="button" class="btn-primary pull-right"
(click)="isEdit=false" (click) ="saveCapacity(CapacityPerCourses$.newspecialit, CapacityPerCourses$.newsector, CapacityPerCourses$.class, CapacityPerCourses$.capacity, CapacityPerCourses$.globalindex )"> (click)="isEdit=false" (click) ="saveCapacity(CapacityPerCourses$.newspecialit, CapacityPerCourses$.newsector, CapacityPerCourses$.class, CapacityPerCourses$.capacity, CapacityPerCourses$.globalindex )">
...@@ -97,12 +97,12 @@ import { ...@@ -97,12 +97,12 @@ import {
private CapacityPerCourse$: BehaviorSubject<any>; private CapacityPerCourse$: BehaviorSubject<any>;
private CapacityPerCourseSub: Subscription; private CapacityPerCourseSub: Subscription;
private saveCapacitySub: Subscription; private saveCapacitySub: Subscription;
private newvalue:number; private newvalue: number;
private isEdit: boolean; private isEdit: boolean;
private courseActive = <number>-1; private courseActive = <number>-1;
private showLoader: BehaviorSubject<boolean>; private showLoader: BehaviorSubject<boolean>;
...@@ -114,27 +114,25 @@ import { ...@@ -114,27 +114,25 @@ import {
this.CapacityPerCourse$ = new BehaviorSubject([{}]); this.CapacityPerCourse$ = new BehaviorSubject([{}]);
this.showLoader = new BehaviorSubject(false); this.showLoader = new BehaviorSubject(false);
this.isEdit = false; this.isEdit = false;
this.formGroup = this.fb.group({ this.formGroup = this.fb.group({
}); });
} }
public showModal(popupMsgId):void { public showModal(popupMsgId): void {
console.log("about to show modal",popupMsgId);
//(<any>$('#distributionWaitingNotice')).modal('show');
(<any>$(popupMsgId)).modal('show'); (<any>$(popupMsgId)).modal('show');
} }
public hideModal(popupMsgId):void { public hideModal(popupMsgId): void {
//(<any>$('#distributionWaitingNotice')).modal('hide'); //(<any>$('#distributionWaitingNotice')).modal('hide');
(<any>$(popupMsgId)).modal('hide'); (<any>$(popupMsgId)).modal('hide');
} }
public onHidden(popupMsgId):void { public onHidden(popupMsgId): void {
} }
...@@ -144,89 +142,64 @@ import { ...@@ -144,89 +142,64 @@ import {
} }
ngOnInit() { ngOnInit() {
(<any>$('#checksaved1')).appendTo("body"); (<any>$('#checksaved1')).appendTo("body");
this.CapacityPerCourseSub = this._hds.FindCapacityPerSchool().subscribe(x => {
this.CapacityPerCourse$.next(x);
},
error => {
this.CapacityPerCourse$.next([{}]);
console.log("Error Getting Capacity perSchool");
},
() => console.log("Getting School "));
this.CapacityPerCourseSub = this._hds.FindCapacityPerSchool().subscribe(x => {
this.CapacityPerCourse$.next(x);
},
error => {
this.CapacityPerCourse$.next([{}]);
console.log("Error Getting Capacity perSchool");
});
} }
handleChange ( e: Event) { handleChange(e: Event) {
this.newvalue = e.target['value']; this.newvalue = e.target['value'];
} }
saveCapacity(spec,sect,taxi,oldvalue,ind){ saveCapacity(spec, sect, taxi, oldvalue, ind) {
if (this.newvalue != null) {
if (this.newvalue <= 0 || this.newvalue > 10) {
console.log(taxi, sect, spec); this.showModal("#checksaved1");
console.log(this.newvalue,"newvalue", oldvalue); }
if (this.newvalue!= null) else {
{ this.showLoader.next(true);
if (this.newvalue <=0 || this.newvalue >10)
{
this.showModal("#checksaved1"); let std = this.CapacityPerCourse$.getValue();
} std[ind].capacity = this.newvalue;
else this.saveCapacitySub = this._hds.saveCapacity(taxi, sect, spec, this.newvalue).subscribe(data => {
{
this.showLoader.next(true);
let std = this.CapacityPerCourse$.getValue();
std[ind].capacity = this.newvalue;
this.saveCapacitySub = this._hds.saveCapacity(taxi, sect, spec, this.newvalue).subscribe(data => {
this.showLoader.next(false);
this.CapacityPerCourse$.next(std);
},
error => {
std[ind].capacity = oldvalue;
this.CapacityPerCourse$.next(std);
this.showLoader.next(false); this.showLoader.next(false);
console.log("Error Saving Capacity"); this.CapacityPerCourse$.next(std);
}, },
() =>{ error => {
console.log("Saved Capacity"); std[ind].capacity = oldvalue;
this.CapacityPerCourse$.next(std);
this.showLoader.next(false);
console.log("Error Saving Capacity");
}); });
}
}
}
else
{
if (oldvalue === null)
this.showModal("#checksaved1");
}
} }
else {
if (oldvalue === null)
this.showModal("#checksaved1");
}
}
setActive(ind) { setActive(ind) {
this.courseActive = ind;
this.courseActive = ind;
console.log(this.courseActive, ind, "ind");
} }
modifycapc(ind, e:Event) modifycapc(ind, e: Event) {
{ this.isEdit = true;
this.isEdit=true; this.setActive(ind);
this.setActive(ind); this.handleChange(e);
this.handleChange(e); }
}
} }
...@@ -112,8 +112,9 @@ import { ...@@ -112,8 +112,9 @@ import {
</div> </div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Ημερομηνία Γέννησης</div> <div class="col-md-3" style="font-size: 0.8em;">Ημερομηνία Γέννησης</div>
<div class="col-md-9" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.birthdate}}</div> <div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.birthdate}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Τηλέφωνο Επικοινωνίας</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.telnum}}</div>
</div> </div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
...@@ -121,20 +122,24 @@ import { ...@@ -121,20 +122,24 @@ import {
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.lastschool_schoolname}}</div> <div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.lastschool_schoolname}}</div>
<div class="col-md-3" style="font-size: 0.8em;">Σχολικό έτος τελευταίας φοίτησης</div> <div class="col-md-3" style="font-size: 0.8em;">Σχολικό έτος τελευταίας φοίτησης</div>
<div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.lastschool_schoolyear}}</div> <div class="col-md-3" style="font-size: 0.8em; font-weight: bold">{{StudentDetails$.lastschool_schoolyear}}</div>
</div> </div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Τάξη τελευταίας φοίτησης</div> <div class="col-md-3" style="font-size: 0.8em;">Τάξη τελευταίας φοίτησης</div>
<div *ngIf="StudentDetails$.lastschool_class === '1'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Α</div> <div *ngIf="StudentDetails$.lastschool_class === '1'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Α</div>
<div *ngIf="StudentDetails$.lastschool_class === '2'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Β</div> <div *ngIf="StudentDetails$.lastschool_class === '2'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Β</div>
<div *ngIf="StudentDetails$.lastschool_class === '3'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Γ</div> <div *ngIf="StudentDetails$.lastschool_class === '3'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.lastschool_class === '4'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Δ</div> <div *ngIf="StudentDetails$.lastschool_class === '4'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Δ</div>
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Δήλωση από:</div>
<div class="col-md-9" style="font-size: 0.8em; font-weight: bold">{{ StudentDetails$.relationtostudent }}</div>
</div>
<div class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Τάξη φοίτησης για το νέο σχολικό έτος</div> <div class="col-md-3" style="font-size: 0.8em;">Τάξη φοίτησης για το νέο σχολικό έτος</div>
<div *ngIf="StudentDetails$.currentclass === '1'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Α</div> <div *ngIf="StudentDetails$.currentclass === '1'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Α</div>
<div *ngIf="StudentDetails$.currentclass === '2'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Β</div> <div *ngIf="StudentDetails$.currentclass === '2'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Β</div>
<div *ngIf="StudentDetails$.currentclass === '3'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Γ</div> <div *ngIf="StudentDetails$.currentclass === '3'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Γ</div>
<div *ngIf="StudentDetails$.currentclass === '4'" class="col-md-3" style="font-size: 0.8em; font-weight: bold">Δ</div> <div *ngIf="StudentDetails$.currentclass === '4'" class="col-md-9" style="font-size: 0.8em; font-weight: bold">Δ</div>
</div> </div>
<div *ngIf="StudentDetails$.currentclass === '2'" class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;"> <div *ngIf="StudentDetails$.currentclass === '2'" class="row oddin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
<div class="col-md-3" style="font-size: 0.8em;">Τομέας φοίτησης για το νέο σχολικό έτος</div> <div class="col-md-3" style="font-size: 0.8em;">Τομέας φοίτησης για το νέο σχολικό έτος</div>
...@@ -260,8 +265,6 @@ import { ...@@ -260,8 +265,6 @@ import {
public showModal(popupMsgId): void { public showModal(popupMsgId): void {
console.log("about to show modal", popupMsgId);
(<any>$(popupMsgId)).modal('show'); (<any>$(popupMsgId)).modal('show');
} }
...@@ -293,8 +296,7 @@ import { ...@@ -293,8 +296,7 @@ import {
this.CoursesPerSchool$.next([{}]); this.CoursesPerSchool$.next([{}]);
console.log("Error Getting courses perSchool"); console.log("Error Getting courses perSchool");
this.showLoader.next(false); this.showLoader.next(false);
}, });
() => console.log("Getting School "));
} }
...@@ -313,8 +315,7 @@ import { ...@@ -313,8 +315,7 @@ import {
console.log("Error Getting Students"); console.log("Error Getting Students");
this.showLoader.next(false); this.showLoader.next(false);
this.showModal("#emptyselection"); this.showModal("#emptyselection");
}, });
() => console.log("Getting Students"));
} }
...@@ -325,7 +326,6 @@ import { ...@@ -325,7 +326,6 @@ import {
ind = -1; ind = -1;
} }
this.courseActive = ind; this.courseActive = ind;
console.log(this.courseActive, ind, "ind");
} }
setActiveStudent(ind) { setActiveStudent(ind) {
...@@ -334,7 +334,6 @@ import { ...@@ -334,7 +334,6 @@ import {
ind = -1; ind = -1;
} }
this.StudentActive = ind; this.StudentActive = ind;
console.log(this.courseActive, ind, "ind");
} }
setActiveStudentnew(ind) { setActiveStudentnew(ind) {
...@@ -343,7 +342,6 @@ import { ...@@ -343,7 +342,6 @@ import {
ind = -1; ind = -1;
} }
this.StudentActive = ind; this.StudentActive = ind;
console.log(this.courseActive, ind, "ind");
} }
...@@ -357,7 +355,6 @@ import { ...@@ -357,7 +355,6 @@ import {
if (cb.value == 3) if (cb.value == 3)
rtype = null; rtype = null;
var type = cb.value; var type = cb.value;
console.log(type, "aaa");
this.showLoader.next(true); this.showLoader.next(true);
let std = this.StudentInfo$.getValue(); let std = this.StudentInfo$.getValue();
...@@ -367,19 +364,14 @@ import { ...@@ -367,19 +364,14 @@ import {
this.SavedStudents$.next(data); this.SavedStudents$.next(data);
this.StudentInfo$.next(std); this.StudentInfo$.next(std);
this.showLoader.next(false); this.showLoader.next(false);
this.showModal("#checksaved");
}, },
error => { error => {
this.SavedStudents$.next([{}]); this.SavedStudents$.next([{}]);
console.log("Error saving Students"); console.log("Error saving Students");
this.showLoader.next(false); this.showLoader.next(false);
this.showModal("#dangermodal"); this.showModal("#dangermodal");
},
() => {
console.log("saved Students");
this.showModal("#checksaved");
}); });
} }
} }
...@@ -32,16 +32,16 @@ import { ...@@ -32,16 +32,16 @@ import {
[class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id" > [class.evenout]="isEven" [class.selectedout]="regionActive === SchoolNames$.id" >
<div class="col-md-12" style="font-size: 0.8em; font-weight: bold;" >{{SchoolNames$.name}}</div> <div class="col-md-12" style="font-size: 0.8em; font-weight: bold;" >{{SchoolNames$.name}}</div>
</li> </li>
<div class = "row" *ngFor="let CoursesNames$ of CoursesPerPerf$ | async; let j=index; let isOdd2=odd; let isEven2=even" <div class = "row" *ngFor="let CoursesNames$ of CoursesPerPerf$ | async; let j=index; let isOdd2=odd; let isEven2=even"
[class.oddin]="isOdd2" [class.evenin]="isEven2" [class.changecolor]="calccolor(CoursesNames$.size,CoursesNames$.limitdown)" [class.oddin]="isOdd2" [class.evenin]="isEven2" [class.changecolor]="calccolor(CoursesNames$.size,CoursesNames$.limitdown)"
[class.selectedappout]="regionActive === j" [class.selectedappout]="regionActive === j"
[hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;"> [hidden]="SchoolNames$.id !== regionActive" style="margin: 0px 2px 0px 2px;">
<div class="col-md-6" style="font-size: 0.8em; font-weight: bold;" >{{CoursesNames$.name}}</div> <div class="col-md-6" style="font-size: 0.8em; font-weight: bold;" >{{CoursesNames$.name}}</div>
<div class="col-md-6" style="font-size: 0.8em; font-weight: bold;" >{{CoursesNames$.size}}</div> <div class="col-md-6" style="font-size: 0.8em; font-weight: bold;" >{{CoursesNames$.size}}</div>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
...@@ -61,7 +61,7 @@ import { ...@@ -61,7 +61,7 @@ import {
private StudentsSize$: BehaviorSubject<any>; private StudentsSize$: BehaviorSubject<any>;
private StudentsSizeSub: Subscription; private StudentsSizeSub: Subscription;
private showLoader: BehaviorSubject<boolean>; private showLoader: BehaviorSubject<boolean>;
public perfecture ; public perfecture;
private regionActive = <number>-1; private regionActive = <number>-1;
private School$: BehaviorSubject<any>; private School$: BehaviorSubject<any>;
private SchoolSub: Subscription; private SchoolSub: Subscription;
...@@ -69,9 +69,9 @@ import { ...@@ -69,9 +69,9 @@ import {
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
private router: Router, private router: Router,
private _hds: HelperDataService, private _hds: HelperDataService,
) { ) {
this.SchoolsPerPerf$ = new BehaviorSubject([{}]); this.SchoolsPerPerf$ = new BehaviorSubject([{}]);
this.LimitPerCateg$ = new BehaviorSubject([{}]); this.LimitPerCateg$ = new BehaviorSubject([{}]);
this.CoursesPerPerf$ = new BehaviorSubject([{}]); this.CoursesPerPerf$ = new BehaviorSubject([{}]);
...@@ -84,65 +84,56 @@ import { ...@@ -84,65 +84,56 @@ import {
} }
ngOnDestroy() { ngOnDestroy() {
} }
ngOnInit() { ngOnInit() {
this.showLoader.next(true);
this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => {
this.SchoolsPerPerf$.next(data);
this.showLoader.next(false);
},
error => {
this.SchoolsPerPerf$.next([{}]);
console.log("Error Getting Schools");
},
() => console.log("Getting Schools"));
this.showLoader.next(true);
this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => {
this.SchoolsPerPerf$.next(data);
this.showLoader.next(false);
},
error => {
this.SchoolsPerPerf$.next([{}]);
console.log("Error Getting Schools");
});
} }
calccolor(size, limit) calccolor(size, limit) {
{
if (size < limit) if (size < limit)
return true; return true;
else else
return false; return false;
} }
setActiveRegion(ind) { setActiveRegion(ind) {
console.log(ind, this.regionActive,"ind"); if (ind === this.regionActive) {
if (ind === this.regionActive){ ind = -1;
ind = -1; this.regionActive = ind;
this.regionActive = ind; }
}
else {
else this.regionActive = ind;
{ this.showLoader.next(true);
this.regionActive = ind; this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.showLoader.next(true); this.CoursesPerPerf$.next(data);
this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.CoursesPerPerf$.next(data);
this.showLoader.next(false);
},
error => {
this.CoursesPerPerf$.next([{}]);
console.log("Error Getting Courses");
this.showLoader.next(false); this.showLoader.next(false);
}, },
() => console.log("Getting Courses Per Perf")); error => {
} this.CoursesPerPerf$.next([{}]);
this.regionActive = ind; console.log("Error Getting Courses");
this.showLoader.next(false);
});
}
this.regionActive = ind;
} }
......
...@@ -55,7 +55,7 @@ import { ...@@ -55,7 +55,7 @@ import {
private CoursesPerPerfSub: Subscription; private CoursesPerPerfSub: Subscription;
private StudentsSize$: BehaviorSubject<any>; private StudentsSize$: BehaviorSubject<any>;
private StudentsSizeSub: Subscription; private StudentsSizeSub: Subscription;
public perfecture ; public perfecture;
private regionActive = <number>-1; private regionActive = <number>-1;
private School$: BehaviorSubject<any>; private School$: BehaviorSubject<any>;
private SchoolSub: Subscription; private SchoolSub: Subscription;
...@@ -63,9 +63,9 @@ import { ...@@ -63,9 +63,9 @@ import {
constructor(private fb: FormBuilder, constructor(private fb: FormBuilder,
private router: Router, private router: Router,
private _hds: HelperDataService, private _hds: HelperDataService,
) { ) {
this.SchoolsPerPerf$ = new BehaviorSubject([{}]); this.SchoolsPerPerf$ = new BehaviorSubject([{}]);
this.LimitPerCateg$ = new BehaviorSubject([{}]); this.LimitPerCateg$ = new BehaviorSubject([{}]);
this.CoursesPerPerf$ = new BehaviorSubject([{}]); this.CoursesPerPerf$ = new BehaviorSubject([{}]);
...@@ -77,59 +77,50 @@ import { ...@@ -77,59 +77,50 @@ import {
} }
ngOnDestroy() { ngOnDestroy() {
} }
ngOnInit() { ngOnInit() {
this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => { this.SchoolPerPerfSub = this._hds.getSchools().subscribe(data => {
this.SchoolsPerPerf$.next(data); this.SchoolsPerPerf$.next(data);
}, },
error => { error => {
this.SchoolsPerPerf$.next([{}]); this.SchoolsPerPerf$.next([{}]);
console.log("Error Getting Schools"); console.log("Error Getting Schools");
}, });
() => console.log("Getting Schools"));
} }
setActiveRegion(ind) {
setActiveRegion(ind) { if (ind === this.regionActive)
ind = -1;
if (ind === this.regionActive) this.regionActive = ind;
ind = -1; this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.regionActive = ind;
this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.CoursesPerPerf$.next(data); this.CoursesPerPerf$.next(data);
}, },
error => {