Commit 265becb1 authored by Open Source Developer's avatar Open Source Developer
Browse files

trans

parent 17b44cb3
...@@ -107,7 +107,7 @@ confirmstudents: ...@@ -107,7 +107,7 @@ confirmstudents:
requirements: requirements:
_user_is_logged_in: 'TRUE' _user_is_logged_in: 'TRUE'
studentperschool: studentperschool:
path: '/epal/studentperSchool/{epalId}/{selectId}' path: '/epal/studentperSchool/{epalId}/{selectId}/{classId}'
options: options:
_auth: [ 'basic_auth' ] _auth: [ 'basic_auth' ]
defaults: defaults:
......
...@@ -126,7 +126,7 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId) ...@@ -126,7 +126,7 @@ public function getSpecialPerSchool(Request $request, $epalId , $sectorId)
} }
public function getStudentPerSchool(Request $request, $epalId , $selectId) public function getStudentPerSchool(Request $request, $epalId , $selectId, $classId)
{ {
$authToken = $request->headers->get('PHP_AUTH_USER'); $authToken = $request->headers->get('PHP_AUTH_USER');
...@@ -137,7 +137,16 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId) ...@@ -137,7 +137,16 @@ public function getStudentPerSchool(Request $request, $epalId , $selectId)
$userid = $epalUser -> user_id -> entity -> id(); $userid = $epalUser -> user_id -> entity -> id();
$epalIdNew = intval($epalId); $epalIdNew = intval($epalId);
$selectIdNew = intval($selectId); $selectIdNew = intval($selectId);
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id'=> $epalIdNew, 'specialization_id' => $selectIdNew )); if ($classId == 1)
{
$selectIdNew = -1;
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id'=> $epalIdNew, 'specialization_id' => $selectIdNew, 'currentclass' => $classId ));
}
else
{
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id'=> $epalIdNew, 'specialization_id' => $selectIdNew, 'currentclass' => $classId ));
}
$i = 0; $i = 0;
if ($studentPerSchool) { if ($studentPerSchool) {
......
...@@ -30,24 +30,17 @@ import { ...@@ -30,24 +30,17 @@ import {
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<div *ngIf="(selectionBClass | async)" >
<select #tmop class="form-control" (change)="checkbclass(tmop,txoption)" formControlName="tomeas"> <select #tmop class="form-control" *ngIf="(selectionBClass | async)" (change)="checkbclass(tmop,txoption)" formControlName="tomeas">
<option *ngFor="let SectorSelection$ of StudentSelected$ | async; let i=index" [value] = "SectorSelection$.id"> {{SectorSelection$.sector_id}} </option> <option *ngFor="let SectorSelection$ of StudentSelected$ | async; let i=index" [value] = "SectorSelection$.id"> {{SectorSelection$.sector_id}} </option>
</select> </select>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div *ngIf="(selectionCClass | async)"> <select #spop class="form-control" *ngIf="(selectionCClass | async)" (change) ="checkcclass()" formControlName="specialit">
<select #spop class="form-control" formControlName="specialit"> <option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async; let i=index" [value] = "SpecialSelection$.id"> {{SpecialSelection$.specialty_id}} </option>
<option *ngFor="let SpecialSelection$ of StudentSelectedSpecial$ | async; let i=index"> {{SpecialSelection$.specialty_id}} </option>
</select> </select>
</div>
</div> </div>
<button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent(txoption)">
<button type="button" class="btn-primary btn-sm pull-right" (click)="findstudent(tmop,txoption)">
Αναζήτηση Αναζήτηση
</button> </button>
<div *ngIf="(retrievedStudent | async)"> <div *ngIf="(retrievedStudent | async)">
...@@ -67,8 +60,6 @@ import { ...@@ -67,8 +60,6 @@ import {
<button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()"> <button type="button" class="btn-primary btn-sm pull-right" (click)="confirmStudent()">
Επιβεβαίωση Εγγραφής Επιβεβαίωση Εγγραφής
</button> </button>
` `
}) })
...@@ -85,6 +76,7 @@ import { ...@@ -85,6 +76,7 @@ import {
private selectionBClass: BehaviorSubject<boolean>; private selectionBClass: BehaviorSubject<boolean>;
private selectionCClass: BehaviorSubject<boolean>; private selectionCClass: BehaviorSubject<boolean>;
private SchoolId = 147 ; private SchoolId = 147 ;
private currentclass: Number;
private saved :Array<number> = new Array(); private saved :Array<number> = new Array();
...@@ -117,36 +109,34 @@ import { ...@@ -117,36 +109,34 @@ import {
this.selectionBClass.unsubscribe(); this.selectionBClass.unsubscribe();
if (this.selectionCClass) if (this.selectionCClass)
this.selectionCClass.unsubscribe(); this.selectionCClass.unsubscribe();
} }
ngOnInit() { ngOnInit() {
} }
verifyclass(txop) verifyclass(txop)
{ {
console.log(txop.value,"aaaaa"); this.retrievedStudent.next(false);
if (txop.value === "1") if (txop.value === "1")
{ {
this.selectionBClass.next(false); this.selectionBClass.next(false);
this.selectionCClass.next(false); this.selectionCClass.next(false);
} }
else if (txop.value === "2") else if (txop.value === "2")
{ {
console.log(this.SchoolId, "school_id");
this.selectionBClass.next(true); this.selectionBClass.next(true);
this.selectionCClass.next(false);
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$); this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
} }
else if (txop.value === "3") else if (txop.value === "3")
{ {
console.log("trith");
this.selectionBClass.next(true); this.selectionBClass.next(true);
this.selectionCClass.next(true); this.selectionCClass.next(true);
this.StudentSelected$ = new BehaviorSubject([{}]);
this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$); this.StudentSelectedSub = this._hds.getSectorPerSchool(this.SchoolId).subscribe(this.StudentSelected$);
} }
} }
...@@ -154,23 +144,37 @@ import { ...@@ -154,23 +144,37 @@ import {
checkbclass(tmop,txop) checkbclass(tmop,txop)
{ {
this.retrievedStudent.next(false);
var sectorint = +this.formGroup.value.tomeas;
console.log(tmop.value, "aaaaaaa!!!"); console.log(sectorint,"tomeas");
var sectorint = +tmop.value;
if (txop.value === "3") if (txop.value === "3")
{ {
this.StudentSelectedSpecial$ = new BehaviorSubject([{}]);
this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$); this.StudentSelectedSpecialSub = this._hds.getSpecialityPerSchool(this.SchoolId, sectorint).subscribe(this.StudentSelectedSpecial$);
} }
} }
findstudent(tmop,txop) findstudent(txop)
{ {
var sectorint = document.getElementById(tmop); var sectorint = +this.formGroup.value.tomeas;
console.log(sectorint,"aaaaaa"); if (txop.value === "1")
// this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint).subscribe(this.StudentInfo$); {
// this.retrievedStudent.next(true); this.currentclass = 1;
}
else if (txop.value === "2")
{
this.currentclass = 2;
}
else if (txop.value === "3")
{
this.currentclass = 3;
}
this.retrievedStudent.next(true);
this.retrievedStudent = new BehaviorSubject(false);
this.StudentInfoSub = this._hds.getStudentPerSchool(this.SchoolId, sectorint, this.currentclass).subscribe(this.StudentInfo$);
} }
...@@ -200,9 +204,12 @@ updateCheckedOptions(id, event) ...@@ -200,9 +204,12 @@ updateCheckedOptions(id, event)
confirmStudent() confirmStudent()
{ {
this._hds.saveConfirmStudents(this.saved);
this._hds.saveConfirmStudents(this.saved);
} }
checkcclass()
{
this.retrievedStudent.next(false);
}
} }
\ No newline at end of file
...@@ -491,7 +491,7 @@ export class HelperDataService { ...@@ -491,7 +491,7 @@ export class HelperDataService {
getStudentPerSchool(SchoolId, SelectId) getStudentPerSchool(SchoolId, SelectId, classId)
{ {
let SchoolIdNew = SchoolId.toString(); let SchoolIdNew = SchoolId.toString();
let SelectIdNew = SelectId.toString(); let SelectIdNew = SelectId.toString();
...@@ -503,7 +503,7 @@ export class HelperDataService { ...@@ -503,7 +503,7 @@ export class HelperDataService {
}); });
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, options ) return this.http.get(`${AppSettings.API_ENDPOINT}/epal/studentperSchool/`+SchoolIdNew+'/'+SelectIdNew+'/'+classId, options )
.map(response => response.json()); .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