Commit c746bffe authored by Open Source Developer's avatar Open Source Developer

ui improvement

parent 674560cc
...@@ -79,7 +79,7 @@ epal.allocation: ...@@ -79,7 +79,7 @@ epal.allocation:
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
sectorperschool: sectorperschool:
path: '/epal/sectorperSchool/{epalId}' path: '/epal/sectorperSchool'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
...@@ -87,7 +87,7 @@ sectorperschool: ...@@ -87,7 +87,7 @@ sectorperschool:
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
specialityperschool: specialityperschool:
path: '/epal/specialityperSchool/{epalId}/{sectorId}' path: '/epal/specialityperSchool/{sectorId}'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
...@@ -103,7 +103,7 @@ confirmstudents: ...@@ -103,7 +103,7 @@ confirmstudents:
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
studentperschool: studentperschool:
path: '/epal/studentperSchool/{epalId}/{selectId}/{classId}/{limitdown}/{limitup}' path: '/epal/studentperSchool/{selectId}/{classId}/{limitdown}/{limitup}'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
...@@ -111,7 +111,7 @@ studentperschool: ...@@ -111,7 +111,7 @@ studentperschool:
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
savecapacity: savecapacity:
path: '/epal/savecapacity/{taxi}/{tomeas}/{specialit}/{schoolid}' path: '/epal/savecapacity/{taxi}/{tomeas}/{specialit}'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
...@@ -207,7 +207,7 @@ critirioschosen: ...@@ -207,7 +207,7 @@ critirioschosen:
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
findcapacity: findcapacity:
path: '/epal/findCapacity/{taxi}/{tomeas}/{specialit}/{schoolid}' path: '/epal/findCapacity/{taxi}/{tomeas}/{specialit}'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
...@@ -222,3 +222,13 @@ findschoolid: ...@@ -222,3 +222,13 @@ findschoolid:
_controller: '\Drupal\epal\Controller\DirectorView::getSchoolID' _controller: '\Drupal\epal\Controller\DirectorView::getSchoolID'
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
gettypeofschool:
path: '/epal/gettypeofschool'
options:
_auth: [ 'basic_auth' ]
defaults:
_controller: '\Drupal\epal\Controller\DirectorView::gettypeofschool'
requirements:
_user_is_logged_in: 'TRUE'
...@@ -28,7 +28,10 @@ import { ...@@ -28,7 +28,10 @@ import {
<option value="1" >Α' Λυκείου</option> <option value="1" >Α' Λυκείου</option>
<option value="2" >Β' Λυκείου</option> <option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option> <option value="3" >Γ' Λυκείου</option>
<option *ngIf="(selectiontype | async)" value="4" >Δ' Λυκείου</option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -86,6 +89,7 @@ import { ...@@ -86,6 +89,7 @@ import {
private StudentSelectedSpecialSub: Subscription; private StudentSelectedSpecialSub: Subscription;
private saveCapacitySub: Subscription; private saveCapacitySub: Subscription;
private selectionBClass: BehaviorSubject<boolean>; private selectionBClass: BehaviorSubject<boolean>;
private selectiontype: BehaviorSubject<boolean>;
private selectionCClass: BehaviorSubject<boolean>; private selectionCClass: BehaviorSubject<boolean>;
private School$: BehaviorSubject<any>; private School$: BehaviorSubject<any>;
private SchoolSub: Subscription; private SchoolSub: Subscription;
...@@ -106,6 +110,7 @@ import { ...@@ -106,6 +110,7 @@ import {
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]); this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.classCapacity$ = new BehaviorSubject([{}]); this.classCapacity$ = new BehaviorSubject([{}]);
this.selectionBClass = new BehaviorSubject(false); this.selectionBClass = new BehaviorSubject(false);
this.selectiontype = new BehaviorSubject(true);
this.selectionCClass = new BehaviorSubject(false); this.selectionCClass = new BehaviorSubject(false);
this.retrievedStudent = new BehaviorSubject(false); this.retrievedStudent = new BehaviorSubject(false);
this.School$ = new BehaviorSubject([{}]); this.School$ = new BehaviorSubject([{}]);
...@@ -118,9 +123,6 @@ import { ...@@ -118,9 +123,6 @@ import {
} }
public showModal(popupMsgId):void { public showModal(popupMsgId):void {
console.log("about to show modal"); console.log("about to show modal");
//(<any>$('#distributionWaitingNotice')).modal('show'); //(<any>$('#distributionWaitingNotice')).modal('show');
...@@ -155,11 +157,13 @@ import { ...@@ -155,11 +157,13 @@ import {
(<any>$('#capacitysaved')).appendTo("body"); (<any>$('#capacitysaved')).appendTo("body");
this.retrievedStudent.next(false); this.retrievedStudent.next(false);
this.SchoolSub = this._hds.getSchoolId().subscribe(x => { this.SchoolSub = this._hds.gettypeofschool().subscribe(x => {
this.School$.next(x); this.School$.next(x);
console.log(x[0].id, "schoolid!"); console.log(x[0].type, "schoolid!");
this.SchoolId = x[0].id; this.SchoolId = x[0].type;
if (this.SchoolId == 'ΗΜΕΡΗΣΙΟ'){
this.selectiontype.next(false);
}
}, },
error => { error => {
...@@ -182,7 +186,7 @@ import { ...@@ -182,7 +186,7 @@ import {
capacity: '', capacity: '',
}); });
console.log("a class"); console.log("a class");
this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi, 0, 0, this.SchoolId).subscribe(data => { this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi, 0, 0).subscribe(data => {
this.classCapacity$.next(data); this.classCapacity$.next(data);
this.retrievedStudent.next(true); this.retrievedStudent.next(true);
this.formGroup.patchValue({ this.formGroup.patchValue({
...@@ -206,9 +210,9 @@ import { ...@@ -206,9 +210,9 @@ import {
this.selectionBClass.next(true); this.selectionBClass.next(true);
this.selectionCClass.next(false); this.selectionCClass.next(false);
this.StudentSelected$ = new BehaviorSubject([{}]); this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$); this.StudentSelectedSub = this._hds.getSectorPerSchool().subscribe(this.StudentSelected$);
} }
else if (txop.value === "3") { else if (txop.value === "3" || txop.value === "4" ) {
this.formGroup.patchValue({ this.formGroup.patchValue({
tomeas: '', tomeas: '',
specialit: '', specialit: '',
...@@ -220,12 +224,12 @@ import { ...@@ -220,12 +224,12 @@ import {
if (this.formGroup.value.tomeas != '') { if (this.formGroup.value.tomeas != '') {
var sectorint = +this.formGroup.value.tomeas; var sectorint = +this.formGroup.value.tomeas;
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]); this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$); this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool( sectorint).subscribe(this.StudentSelectedSpecial$);
} }
this.selectionBClass.next(true); this.selectionBClass.next(true);
this.selectionCClass.next(true); this.selectionCClass.next(true);
this.StudentSelected$ = new BehaviorSubject([{}]); this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$); this.StudentSelectedSub = this._hds.getSectorPerSchool().subscribe(this.StudentSelected$);
} }
...@@ -235,12 +239,13 @@ import { ...@@ -235,12 +239,13 @@ import {
checkbclass(tmop, txop) { checkbclass(tmop, txop) {
var sectorint = +this.formGroup.value.tomeas; var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint, "tomeas"); console.log(tmop, txop, "tomeas!!!!");
if (txop.value === "2") { if (txop.value === "2") {
console.log("b class"); console.log("b class");
this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi, sectorint, 0, this.SchoolId).subscribe(data => { this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi, sectorint, 0).subscribe(data => {
this.classCapacity$.next(data); this.classCapacity$.next(data);
this.retrievedStudent.next(true); this.retrievedStudent.next(true);
this.formGroup.patchValue({ this.formGroup.patchValue({
...@@ -253,9 +258,9 @@ import { ...@@ -253,9 +258,9 @@ import {
}, },
() => console.log("Getting Capacity")); () => console.log("Getting Capacity"));
} }
if (txop.value === "3") { if (txop.value === "3" || txop.value === "4") {
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]); this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$); this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(sectorint).subscribe(this.StudentSelectedSpecial$);
} }
...@@ -267,10 +272,10 @@ import { ...@@ -267,10 +272,10 @@ import {
var sectorint = +this.formGroup.value.tomeas; var sectorint = +this.formGroup.value.tomeas;
var specialint = +this.formGroup.value.specialit; var specialint = +this.formGroup.value.specialit;
if (txop.value === "3") { if (txop.value === "3" || txop.value === "4") {
console.log("c class"); console.log("c class");
console.log(sectorint, specialint, "cclass") console.log(sectorint, specialint, "cclass")
this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi, sectorint, specialint, this.SchoolId).subscribe(data => { this.classCapacitySub = this._hds.getCapacityPerSchool(this.formGroup.value.taxi, sectorint, specialint).subscribe(data => {
this.classCapacity$.next(data); this.classCapacity$.next(data);
this.retrievedStudent.next(true); this.retrievedStudent.next(true);
...@@ -296,15 +301,18 @@ import { ...@@ -296,15 +301,18 @@ import {
var tomeas = +this.formGroup.value.tomeas; var tomeas = +this.formGroup.value.tomeas;
var specialit = +this.formGroup.value.specialit; var specialit = +this.formGroup.value.specialit;
this.saveCapacitySub = this._hds.saveCapacity(this.formGroup.value.taxi, tomeas, specialit, this.formGroup.value.capacity, this.SchoolId).subscribe(data => { this.saveCapacitySub = this._hds.saveCapacity(this.formGroup.value.taxi, tomeas, specialit, this.formGroup.value.capacity).subscribe(data => {
}, },
error => { error => {
console.log("Error Saving Capacity"); console.log("Error Saving Capacity");
}, },
() => console.log("Saved Capacity")); () =>{
console.log("Saved Capacity");
this.showModal("#capacitysaved"); this.showModal("#capacitysaved");
});
} }
......
...@@ -30,6 +30,7 @@ import { ...@@ -30,6 +30,7 @@ import {
<option value="1" >Α' Λυκείου</option> <option value="1" >Α' Λυκείου</option>
<option value="2" >Β' Λυκείου</option> <option value="2" >Β' Λυκείου</option>
<option value="3" >Γ' Λυκείου</option> <option value="3" >Γ' Λυκείου</option>
<option value="4" >Δ' Λυκείου</option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
...@@ -65,7 +66,7 @@ import { ...@@ -65,7 +66,7 @@ import {
<option value=2>Όχι</option> <option value=2>Όχι</option>
<option value=3 selected></option> <option value=3 selected></option>
</select> </select>
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()"> <button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent(txoption)">
Επιβεβαίωση Εγγραφής Επιβεβαίωση Εγγραφής
</button> </button>
...@@ -173,7 +174,7 @@ import { ...@@ -173,7 +174,7 @@ import {
private currentclass: Number; private currentclass: Number;
private saved: Array<number> = new Array(); private saved: Array<number> = new Array();
private limitdown = 0; private limitdown = 0;
private limitup = 25; private limitup = 5;
private pageno = 1; private pageno = 1;
private userActive = <number>-1; private userActive = <number>-1;
private type: Number; private type: Number;
...@@ -251,7 +252,7 @@ import { ...@@ -251,7 +252,7 @@ import {
} }
else if (txop.value === "2") { else if (txop.value === "2") {
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(data => { this.StudentSelectedSub = this._hds.getSectorPerSchool().subscribe(data => {
this.selectionBClass.next(true); this.selectionBClass.next(true);
this.selectionCClass.next(false); this.selectionCClass.next(false);
this.StudentSelected$.next(data); this.StudentSelected$.next(data);
...@@ -263,13 +264,12 @@ import { ...@@ -263,13 +264,12 @@ import {
}, },
() => console.log("Getting StudentSelectedSpecial")); () => console.log("Getting StudentSelectedSpecial"));
} }
else if (txop.value === "3") { else if (txop.value === "3" || txop.value === "4") {
var sectorint = +this.formGroup.value.tomeas; var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint, "test"); if (this.formGroup.value.tomeas != '') {
if (this.formGroup.value.tomeas != '') {
var sectorint = +this.formGroup.value.tomeas; var sectorint = +this.formGroup.value.tomeas;
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(data => { this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(sectorint).subscribe(data => {
this.StudentSelectedSpecial$.next(data); this.StudentSelectedSpecial$.next(data);
}, },
error => { error => {
...@@ -279,7 +279,7 @@ import { ...@@ -279,7 +279,7 @@ import {
() => console.log("Getting StudentSelectedSpecial")); () => console.log("Getting StudentSelectedSpecial"));
} }
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(data => { this.StudentSelectedSub = this._hds.getSectorPerSchool().subscribe(data => {
this.StudentSelected$.next(data); this.StudentSelected$.next(data);
this.selectionBClass.next(true); this.selectionBClass.next(true);
this.selectionCClass.next(true); this.selectionCClass.next(true);
...@@ -299,9 +299,9 @@ import { ...@@ -299,9 +299,9 @@ import {
this.retrievedStudent.next(false); this.retrievedStudent.next(false);
var sectorint = +this.formGroup.value.tomeas; var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint, "tomeas"); console.log(sectorint, "tomeas");
if (txop.value === "3") { if (txop.value === "3" || txop.value === "4") {
// this.StudentSelectedSpecial$ = new BehaviorSubject([{}]); // this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(data => { this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(sectorint).subscribe(data => {
this.StudentSelectedSpecial$.next(data); this.StudentSelectedSpecial$.next(data);
}, },
...@@ -327,10 +327,13 @@ import { ...@@ -327,10 +327,13 @@ import {
this.currentclass = 3; this.currentclass = 3;
} }
else if (txop.value === "4") {
this.currentclass = 4;
}
this.formGroup.get('pageno').setValue(this.pageno); this.formGroup.get('pageno').setValue(this.pageno);
if (this.pageno == 1) { if (this.pageno == 1) {
console.log(this.SchoolId, sectorint, this.currentclass, "test"); console.log(this.SchoolId, sectorint, this.currentclass, "testaaaaaa");
this.StudentsSizeSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass, 0, 0).subscribe(x => { this.StudentsSizeSub = this._hds.getStudentPerSchool(sectorint, this.currentclass, 0, 0).subscribe(x => {
this.StudentsSize$.next(x); this.StudentsSize$.next(x);
tot_pages = x.id / 5; tot_pages = x.id / 5;
if (x.id % 5 > 0) { if (x.id % 5 > 0) {
...@@ -341,7 +344,7 @@ import { ...@@ -341,7 +344,7 @@ import {
} }
this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass, this.limitdown, this.limitup).subscribe(data => { this.StudentInfoSub = this._hds.getStudentPerSchool(sectorint, this.currentclass, this.limitdown, this.limitup).subscribe(data => {
this.StudentInfo$.next(data); this.StudentInfo$.next(data);
this.retrievedStudent.next(true); this.retrievedStudent.next(true);
}, },
...@@ -364,12 +367,7 @@ import { ...@@ -364,12 +367,7 @@ import {
else if (cbvalue.value === '2') { else if (cbvalue.value === '2') {
this.saved[i] = id; this.saved[i] = id;
this.type = 2; this.type = 2;
//var count = this.saved.length;
//for (var j = 0; j < count; j++) {
// if (this.saved[j] === id) {
// this.saved.splice(j, 1);
// }
console.log("not confirmed") console.log("not confirmed")
} }
else if (cbvalue.value === '3') { else if (cbvalue.value === '3') {
...@@ -379,8 +377,10 @@ import { ...@@ -379,8 +377,10 @@ import {
confirmStudent() { confirmStudent(txop) {
this._hds.saveConfirmStudents(this.saved, this.type); this._hds.saveConfirmStudents(this.saved, this.type);
this.findstudent(txop, this.pageno)
console.log(txop, this.pageno, "aaaaaaa");
} }
checkcclass() { checkcclass() {
......
...@@ -85,7 +85,7 @@ import { ...@@ -85,7 +85,7 @@ import {
this.School$.next(x); this.School$.next(x);
console.log(x[0].id, "perfectureID"); console.log(x[0].id, "perfectureID");
this.perfecture = x[0].id; this.perfecture = x[0].id;
this.SchoolPerPerfSub = this._hds.getSchoolPerPerfecture(this.perfecture).subscribe(data => { this.SchoolPerPerfSub = this._hds.getSchoolPerPerfecture().subscribe(data => {
this.SchoolsPerPerf$.next(data); this.SchoolsPerPerf$.next(data);
}, },
error => { error => {
......
...@@ -535,8 +535,8 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -535,8 +535,8 @@ export class HelperDataService implements OnInit, OnDestroy {
} }
getSectorPerSchool(SchoolId) { getSectorPerSchool() {
let SchoolIdNew = SchoolId.toString();
this.loginInfo$.getValue().forEach(loginInfoToken => { this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token; this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role; this.authRole = loginInfoToken.auth_role;
...@@ -546,12 +546,13 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -546,12 +546,13 @@ export class HelperDataService implements OnInit, OnDestroy {
}); });
this.createAuthorizationHeader(headers); this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers }); let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/sectorperSchool/` + SchoolIdNew, options) return this.http.get(`${AppSettings.API_ENDPOINT}/epal/sectorperSchool/` , options)
.map(response => response.json()); .map(response => response.json());
} }
getSpecialityPerSchool(SchoolId, SectorId) {
let SchoolIdNew = SchoolId.toString(); getSpecialityPerSchool( SectorId) {
let SectorIdNew = SectorId.toString(); let SectorIdNew = SectorId.toString();
this.loginInfo$.getValue().forEach(loginInfoToken => { this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token; this.authToken = loginInfoToken.auth_token;
...@@ -562,14 +563,14 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -562,14 +563,14 @@ export class HelperDataService implements OnInit, OnDestroy {
}); });
this.createAuthorizationHeader(headers); this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers }); let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/specialityperSchool/` + SchoolIdNew + '/' + SectorIdNew, options) return this.http.get(`${AppSettings.API_ENDPOINT}/epal/specialityperSchool/` + SectorIdNew, options)
.map(response => response.json()); .map(response => response.json());
} }
getStudentPerSchool(SchoolId, SelectId, classId, limitdown, limitup) { getStudentPerSchool( SelectId, classId, limitdown, limitup) {
let SchoolIdNew = SchoolId.toString();
let SelectIdNew = SelectId.toString(); let SelectIdNew = SelectId.toString();
...@@ -583,7 +584,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -583,7 +584,7 @@ export class HelperDataService implements OnInit, OnDestroy {
}); });
this.createAuthorizationHeader(headers); this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers }); let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/studentperSchool/` + SchoolIdNew + '/' + SelectIdNew + '/' + classId + '/' + limitdown + '/' + limitup, options) return this.http.get(`${AppSettings.API_ENDPOINT}/epal/studentperSchool/` + SelectIdNew + '/' + classId + '/' + limitdown + '/' + limitup, options)
.map(response => response.json()); .map(response => response.json());
} }
...@@ -616,7 +617,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -616,7 +617,7 @@ export class HelperDataService implements OnInit, OnDestroy {
saveCapacity(taxi, tomeas, specialit, capacity, schoolid) { saveCapacity(taxi, tomeas, specialit, capacity) {
this.loginInfo$.getValue().forEach(loginInfoToken => { this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token; this.authToken = loginInfoToken.auth_token;
...@@ -627,7 +628,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -627,7 +628,7 @@ export class HelperDataService implements OnInit, OnDestroy {
}); });
this.createAuthorizationHeader(headers); this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers }); let options = new RequestOptions({ headers: headers });
return this.http.post(`${AppSettings.API_ENDPOINT}/epal/savecapacity/` + taxi + '/' + tomeas + '/' + specialit + '/' + schoolid, { capacity }, options) return this.http.post(`${AppSettings.API_ENDPOINT}/epal/savecapacity/` + taxi + '/' + tomeas + '/' + specialit, { capacity }, options)
.map(response => response.json()); .map(response => response.json());
...@@ -746,10 +747,10 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -746,10 +747,10 @@ export class HelperDataService implements OnInit, OnDestroy {
} }
getSchoolPerPerfecture(PerfectureId) { getSchoolPerPerfecture() {
console.log(PerfectureId,"a");
//let PerfectureIdNew = PerfectureId.toString(); //let PerfectureIdNew = PerfectureId.toString();
let PerfectureIdNew = PerfectureId;
this.loginInfo$.getValue().forEach(loginInfoToken => { this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token; this.authToken = loginInfoToken.auth_token;
...@@ -763,7 +764,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -763,7 +764,7 @@ export class HelperDataService implements OnInit, OnDestroy {
}); });
this.createAuthorizationHeader(headers); this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers }); let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/ScoolperPerf/` + PerfectureIdNew , options) return this.http.get(`${AppSettings.API_ENDPOINT}/epal/ScoolperPerf/` , options)
.map(response => response.json()); .map(response => response.json());
} }
...@@ -915,7 +916,7 @@ getCourses(username, userpassword, sectorid) { ...@@ -915,7 +916,7 @@ getCourses(username, userpassword, sectorid) {
} }
getCapacityPerSchool(taxi, tomeas, specialit, schoolid) { getCapacityPerSchool(taxi, tomeas, specialit) {
console.log(tomeas,specialit,"news") console.log(tomeas,specialit,"news")
...@@ -928,7 +929,7 @@ getCapacityPerSchool(taxi, tomeas, specialit, schoolid) { ...@@ -928,7 +929,7 @@ getCapacityPerSchool(taxi, tomeas, specialit, schoolid) {
}); });
this.createAuthorizationHeader(headers); this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers }); let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/findCapacity/` + taxi + '/' + tomeas + '/' + specialit + '/' + schoolid, options) return this.http.get(`${AppSettings.API_ENDPOINT}/epal/findCapacity/` + taxi + '/' + tomeas + '/' + specialit, options)
.map(response => response.json()); .map(response => response.json());
} }
...@@ -951,6 +952,21 @@ getSchoolId() { ...@@ -951,6 +952,21 @@ getSchoolId() {
} }
gettypeofschool(){
this.loginInfo$.getValue().forEach(loginInfoToken => {
this.authToken = loginInfoToken.auth_token;
this.authRole = loginInfoToken.auth_role;
});
let headers = new Headers({
"Content-Type": "application/json",
});
this.createAuthorizationHeader(headers);
let options = new RequestOptions({ headers: headers });
return this.http.get(`${AppSettings.API_ENDPOINT}/epal/gettypeofschool/`, options)
.map(response => response.json());
}
......
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