submited.aplication.preview.ts 2.45 KB
Newer Older
Open Source Developer's avatar
tranfer    
Open Source Developer committed
1
import { Component, OnInit, OnDestroy,ElementRef, ViewChild} from "@angular/core";
Open Source Developer's avatar
Open Source Developer committed
2
3
4
5
6
7
8
9
10
11
12
let jsPDF = require('jspdf');
import { Injectable } from "@angular/core";
import { AppSettings } from '../../app.settings';
import { HelperDataService } from '../../services/helper-data-service';
import {Observable} from "rxjs/Observable";
import {IStudentDataFields, IStudentDataField} from '../../store/studentdatafields';
import {Http, Headers, RequestOptions} from '@angular/http';
import {Removetags} from '../../pipes/removehtmltags';
import { NgRedux, select } from 'ng2-redux';
import { IAppState } from '../../store/store';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
Open Source Developer's avatar
Open Source Developer committed
13
14
import {Router, ActivatedRoute, Params} from '@angular/router';
import { BehaviorSubject, Subscription } from 'rxjs/Rx';
Open Source Developer's avatar
Open Source Developer committed
15
16
17
18
19


@Component({
    selector: 'submited-preview',
    template: `
Open Source Developer's avatar
commit    
Open Source Developer committed
20
21
22
         <div class="row">
             <breadcrubs></breadcrubs>
        </div>
23
            Έχει υποβληθεί αίτηση για εγγραφή στην Επαγγελματική Εκπαίδευση των παρακάτω ατόμων:
Open Source Developer's avatar
Open Source Developer committed
24
25
26
27
28
29
30
31
32
33
34
35
            <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>
36
37


Open Source Developer's avatar
Open Source Developer committed
38
39
40
   `
})

Open Source Developer's avatar
tranfer    
Open Source Developer committed
41
@Injectable() export default class SubmitedPreview implements OnInit , OnDestroy{
Open Source Developer's avatar
Open Source Developer committed
42

43

Open Source Developer's avatar
Open Source Developer committed
44
45
46
    private SubmitedApplic$: BehaviorSubject<any>;
    private SubmitedUsersSub: Subscription;
    public StudentId;
47
48

    constructor(private _hds: HelperDataService,
Open Source Developer's avatar
Open Source Developer committed
49
50
                private activatedRoute: ActivatedRoute,
                private router: Router )
Open Source Developer's avatar
Open Source Developer committed
51
    {
Open Source Developer's avatar
Open Source Developer committed
52
       this.SubmitedApplic$ = new BehaviorSubject([{}]);
Open Source Developer's avatar
Open Source Developer committed
53
54
    }

Open Source Developer's avatar
tranfer    
Open Source Developer committed
55
56
    ngOnDestroy()
    {
Open Source Developer's avatar
Open Source Developer committed
57
58
        if (this.SubmitedUsersSub)
            this.SubmitedUsersSub.unsubscribe();
59
        this.SubmitedApplic$.unsubscribe();
Open Source Developer's avatar
Open Source Developer committed
60

Open Source Developer's avatar
tranfer    
Open Source Developer committed
61
    }
Open Source Developer's avatar
Open Source Developer committed
62
 
Open Source Developer's avatar
Open Source Developer committed
63
    ngOnInit() {
64

Open Source Developer's avatar
Open Source Developer committed
65

Open Source Developer's avatar
Open Source Developer committed
66
67
        this.SubmitedUsersSub = this._hds.getSubmittedPreviw().subscribe(this.SubmitedApplic$);
        console.log(this.SubmitedApplic$);
68
69


Open Source Developer's avatar
Open Source Developer committed
70
71
72

    }

Open Source Developer's avatar
Open Source Developer committed
73
    studentpreview(StudentId)
Open Source Developer's avatar
Open Source Developer committed
74
    {
Open Source Developer's avatar
Open Source Developer committed
75
      this.router.navigate(['/submited-person', {'id':StudentId}]);
Open Source Developer's avatar
Open Source Developer committed
76
77
78
    }


79
}