Commit 4726b0d8 authored by Open Source Developer's avatar Open Source Developer

transfer

parent 14ab6d1e
......@@ -21,6 +21,9 @@
<i class="fa fa-sign-out"></i>
</button>
</div>
<div class="pull-right" class="nav-item" [ngClass]="{active: path=='submited-preview'}">
<a class="nav-link" [routerLink]="['/submited-preview']" [routerLinkActive]="['active']"><b>Υποβληθείσες αιτήσεις</b></a>
</div>
</div>
<!--
<li class="nav-item" [ngClass]="{active: path=='application-preview'}">
......
import { Component, OnInit, ElementRef, ViewChild} from "@angular/core";
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 * as html2canvas from "html2canvas"
import {Removetags} from '../../pipes/removehtmltags';
import { NgRedux, select } from 'ng2-redux';
import { IAppState } from '../../store/store';
import { ILoginInfo } from '../../store/logininfo/logininfo.types';
@Component({
selector: 'submited-preview',
template: `
<div id = "target">
Έχετε ολοκληρώσει την αίτηση για εγγραφή στην επαγγελπατική εκπαίδευση των παρακάτω ατόμων:
<div *ngFor="let userdata$ of submitedusers$ | async; ">
<br>
<br>
<strong>Στοιχεία υποψηφίου μαθητή: </strong> <br>
<br>
</div>
</div>
<button type="button" (click)="createPdf()">Εξαγωγή σε PDF</button>
`
})
@Injectable() export default class SubmitedPreview implements OnInit {
public submitedapplic$: any;
public submitedusers$:any;
public html2canvas: any;
private loginInfo$: Observable<ILoginInfo>;
private user :string;
constructor(private _hds: HelperDataService,
public http: Http,
private _ngRedux: NgRedux<IAppState>,)
{
}
ngOnInit() {
}
createPdf()
{
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');
}
);
}
}
\ No newline at end of file
......@@ -17,6 +17,8 @@ import SectorCoursesSelect from '../components/student-application-form/sector.c
import ApplicationPreview from '../components/student-application-form/application.preview';
import SchoolsOrderSelect from '../components/student-application-form/schools-order-select';
import ApplicationSubmit from '../components/student-application-form/application.submit';
import SubmitedPreview from '../components/student-application-form/submited.aplication.preview';
export const MainRoutes: Routes = [
{ path: '', component: Home },
......@@ -30,7 +32,8 @@ export const MainRoutes: Routes = [
{ path: 'sectorcourses-fields-select', component: SectorCoursesSelect },
{ path: 'application-preview', component: ApplicationPreview },
{ path: 'schools-order-select', component: SchoolsOrderSelect },
{ path: 'application-submit', component: ApplicationSubmit }
{ path: 'application-submit', component: ApplicationSubmit },
{ path: 'submited-preview', component: SubmitedPreview },
];
export const MainDeclarations = [
......@@ -47,5 +50,6 @@ export const MainDeclarations = [
StudentApplicationMain,
ApplicationPreview,
SchoolsOrderSelect,
ApplicationSubmit
ApplicationSubmit,
SubmitedPreview,
];
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({name: 'removetags'})
export class Removetags implements PipeTransform {
transform(text: string) : any {
return text ? String(text).replace(/<[^>]+>/gm, '') : ''
}
}
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