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

styles

parent 826c9199
......@@ -41,9 +41,9 @@ class SubmitedApplications extends ControllerBase
$list = array();
foreach ($epalStudents as $object) {
$indexid = intval($object -> id())-1;
$list[] = array(
'id' => $object -> id(),
'id' => $indexid,
'name' => $object -> name ->value,
'studentsurname' => $object -> studentsurname ->value);
$i++;
......@@ -92,7 +92,7 @@ class SubmitedApplications extends ControllerBase
'name' => $object -> name ->value,
'studentsurname' => $object -> studentsurname ->value,
'fatherfirstname' => $object -> fatherfirstname ->value,
'fathersurname' =>$object -> fathersurtname ->value,
'fathersurname' =>$object -> fathersurname ->value,
'motherfirstname' => $object -> motherfirstname ->value,
'mothersurname' =>$object -> mothersurname ->value,
'birthdate' =>$object -> birthdate ->value,
......
......@@ -94,10 +94,10 @@ import {
setActiveRegion(ind) {
console.log(ind,"ind");
if (ind === this.regionActive)
ind = -1;
console.log(this.regionActive,"RA");
this.regionActive = ind;
this.CoursesPerPerfSub = this._hds.getCoursePerPerfecture(this.regionActive).subscribe(data => {
this.CoursesPerPerf$.next(data);
......
......@@ -14,26 +14,50 @@ import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
@Component({
@Component({
selector: 'submited-preview',
template: `
<div class="row">
<div class="row">
<breadcrubs></breadcrubs>
</div>
Έχει υποβληθεί αίτηση για εγγραφή στην Επαγγελματική Εκπαίδευση των παρακάτω ατόμων:
<table class = "submited">
<tr>
<th>Όνομα</th>
<th>Επώνυμο</th>
<th></th>
</tr>
<tr *ngFor="let UserData$ of SubmitedApplic$ | async">
<td>{{UserData$.name}} </td>
<td>{{UserData$.studentsurname}} </td>
<td> <button type="button" (click)="studentpreview(UserData$.id)"> <i class="fa fa-eye" aria-hidden="true"></i> </button> </td>
</tr>
<ul class="list-group main-view">
<div *ngFor="let UserData$ of SubmitedApplic$ | async; let i=index; let isOdd=odd; let isEven=even" >
<li class="list-group-item isclickable" [class.oddout]="isOdd"
[class.evenout]="isEven" (click)="setActiveUser(UserData$.id)" [class.selectedout]="userActive === UserData$.id" >
<h5> {{UserData$.name}}&nbsp;{{UserData$.studentsurname}} </h5>
</li>
<div id = "target">
<div *ngFor="let StudentDetails$ of SubmitedDetails$ | async" [hidden]="UserData$.id !== userActive" >
<strong> Όνομα:</strong> <p style="border:1px solid #eceeef;"> {{StudentDetails$.name}} </p>
<strong> Επώνυμο:</strong> <p style="border:1px solid #eceeef;"> {{StudentDetails$.studentsurname}} </p>
<strong> Όνομα Πατέρα:</strong> <p style="border:1px solid #eceeef;"> {{StudentDetails$.fatherfirstname}}</p>
<strong> Επώνυμο Πατέρα:</strong> <p style="border:1px solid #eceeef;">{{StudentDetails$.fathersurname}}</p>
<strong> Όνομα Μητέρας:</strong> <p style="border:1px solid #eceeef;">{{StudentDetails$.motherfirstname}}</p>
<strong> Επώνυμο Μητέρας:</strong> <p style="border:1px solid #eceeef;">{{StudentDetails$.mothersurname}}</p>
<strong> Ημερομηνία Γέννησης:</strong> <p style="border:1px solid #eceeef;">{{StudentDetails$.birthdate}}</p>
<p><b>Επιλογές ΕΠΑΛ</b> </p>
<br>
</div>
<div *ngFor="let epalChoices$ of EpalChosen$ | async" [hidden]="UserData$.id !== userActive">
Σχολείο: {{epalChoices$.epal_id}}
Σειρά Προτίμισης:{{epalChoices$.choice_no}}
</div>
</div>
</div>
</ul>
<br>
<button type="button" (click)="createPdf()">Εξαγωγή σε PDF</button>
`
})
......@@ -43,19 +67,35 @@ import { BehaviorSubject, Subscription } from 'rxjs/Rx';
private SubmitedApplic$: BehaviorSubject<any>;
private SubmitedUsersSub: Subscription;
private SubmitedDetails$: BehaviorSubject<any>;
private SubmitedDetailsSub: Subscription;
private EpalChosen$: BehaviorSubject<any>;
private EpalChosenSub: Subscription;
public StudentId;
private userActive = <number>-1;
constructor(private _hds: HelperDataService,
private activatedRoute: ActivatedRoute,
private router: Router )
{
this.SubmitedApplic$ = new BehaviorSubject([{}]);
this.SubmitedDetails$ = new BehaviorSubject([{}]);
this.EpalChosen$ = new BehaviorSubject([{}]);
}
ngOnDestroy()
{
if (this.SubmitedUsersSub)
this.SubmitedUsersSub.unsubscribe();
if (this.SubmitedDetailsSub)
this.SubmitedDetailsSub.unsubscribe();
if (this.EpalChosenSub)
this.EpalChosenSub.unsubscribe();
this.SubmitedDetails$.unsubscribe();
this.EpalChosen$.unsubscribe();
this.SubmitedApplic$.unsubscribe();
}
......@@ -63,17 +103,62 @@ import { BehaviorSubject, Subscription } from 'rxjs/Rx';
ngOnInit() {
this.SubmitedUsersSub = this._hds.getSubmittedPreviw().subscribe(this.SubmitedApplic$);
this.SubmitedUsersSub = this._hds.getSubmittedPreviw().subscribe(data => {
this.SubmitedApplic$.next(data)},
error => {
this.SubmitedApplic$.next([{}]);
console.log("Error Getting Schools");
},
() => console.log("Getting Schools"));
console.log(this.SubmitedApplic$);
}
studentpreview(StudentId)
setActiveUser(ind,i)
{
ind = +ind;
console.log(this.userActive,"RA",ind);
if (ind === this.userActive){
ind = -1;
}
ind--;
this.userActive = ind+1 ;
this.SubmitedDetailsSub = this._hds.getStudentDetails(this.userActive+1).subscribe(data => {
this.SubmitedDetails$.next(data)},
error => {
this.SubmitedDetails$.next([{}]);
console.log("Error Getting Schools");
},
() => console.log("Getting Schools"));
this.EpalChosenSub = this._hds.getEpalchosen(this.userActive+1).subscribe(data => {
this.EpalChosen$.next(data)},
error => {
this.EpalChosen$.next([{}]);
console.log("Error Getting Schools");
},
() => console.log("Getting Schools"));
}
createPdf()
{
this.router.navigate(['/submited-person', {'id':StudentId}]);
html2canvas(document.getElementById("target")).then(function(canvas)
{
var img = canvas.toDataURL();
var doc = new jsPDF('p', 'mm');
doc.addImage(img, 'PNG', 10, 10);
doc.save('applications.pdf');
});
}
}
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