updated reports

parent 10958fb2
...@@ -47,11 +47,16 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -47,11 +47,16 @@ import { API_ENDPOINT } from '../../app.settings';
Αριθμός Μαθητών και Πληρότητα σχολικών μονάδων ΕΠΑΛ Αριθμός Μαθητών και Πληρότητα σχολικών μονάδων ΕΠΑΛ
</button> </button>
<br><br> <br><br>
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(4)" [hidden]="minedu_userName == ''" > <button type="button" class="btn btn-alert" (click)="nav_to_reportpath(4)" [hidden]="minedu_userName == '' || userRole == 'pde' || userRole == 'dide' " >
<i class="fa fa-file-text"></i> <i class="fa fa-file-text"></i>
Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων Σχολικές μονάδες που δεν έχουν δηλώσει Χωρητικότητα τμημάτων
</button> </button>
<br><br> <br><br>
<button type="button" class="btn btn-alert" (click)="nav_to_reportpath(5)" [hidden]="minedu_userName == '' " >
<i class="fa fa-file-text"></i>
Ολιγομελή τμήματα (Προσωρινά τοποθετημένοι μαθητές)
</button>
<br><br>
</div> </div>
</div> </div>
...@@ -122,7 +127,7 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -122,7 +127,7 @@ import { API_ENDPOINT } from '../../app.settings';
if (repId == 1) if (repId == 1)
this.router.navigate(['/ministry/report-general', repId]); this.router.navigate(['/ministry/report-general', repId]);
else if (repId == 2 || repId == 3) else if (repId == 2 || repId == 3 || repId == 5)
this.router.navigate(['/ministry/report-all-stat', repId]); this.router.navigate(['/ministry/report-all-stat', repId]);
else if (repId == 4) else if (repId == 4)
this.router.navigate(['/ministry/report-no-capacity', repId]); this.router.navigate(['/ministry/report-no-capacity', repId]);
......
...@@ -67,7 +67,7 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -67,7 +67,7 @@ import { API_ENDPOINT } from '../../app.settings';
</select> </select>
</div> </div>
<button type="button" class="btn-link" (click)="toggleCourseFilter()" *ngIf = "reportId == 3" > <button type="button" class="btn-link" (click)="toggleCourseFilter()" *ngIf = "reportId == 3 || reportId == 5" >
> Φίλτρο Επιλογής Τομέα / Ειδικότητας > Φίλτρο Επιλογής Τομέα / Ειδικότητας
</button> </button>
<br> <br>
...@@ -170,6 +170,7 @@ import { API_ENDPOINT } from '../../app.settings'; ...@@ -170,6 +170,7 @@ import { API_ENDPOINT } from '../../app.settings';
private classSelected: number; private classSelected: number;
private sectorSelected: number; private sectorSelected: number;
private courseSelected: number; private courseSelected: number;
private distribFinalized: number;
private enableRegionFilter: boolean; private enableRegionFilter: boolean;
private enableCourseFilter: boolean; private enableCourseFilter: boolean;
private userLoggedIn: string; private userLoggedIn: string;
...@@ -341,6 +342,12 @@ createReport(regionSel) { ...@@ -341,6 +342,12 @@ createReport(regionSel) {
} }
else if (this.reportId === 3) { else if (this.reportId === 3) {
route = "/ministry/report-all-stat/"; route = "/ministry/report-all-stat/";
this.distribFinalized = 1;
this.settings = this.reportSchema.reportAllStatSchema;
}
else if (this.reportId === 5) {
route = "/ministry/report-all-stat/";
this.distribFinalized = 0;
this.settings = this.reportSchema.reportAllStatSchema; this.settings = this.reportSchema.reportAllStatSchema;
} }
...@@ -368,7 +375,7 @@ createReport(regionSel) { ...@@ -368,7 +375,7 @@ createReport(regionSel) {
else if (this.userLoggedIn == DIDE_ROLE) else if (this.userLoggedIn == DIDE_ROLE)
admSel = this.adminAreaSelected; admSel = this.adminAreaSelected;
this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, regSel, admSel, schSel, clSel, secSel, courSel).subscribe(data => { this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, regSel, admSel, schSel, clSel, secSel, courSel, this.distribFinalized).subscribe(data => {
this.generalReport$.next(data); this.generalReport$.next(data);
this.data = data; this.data = data;
......
...@@ -174,7 +174,7 @@ createReport(regionSel) { ...@@ -174,7 +174,7 @@ createReport(regionSel) {
let regSel = 0; let regSel = 0;
this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, 0, 0, 0, 0, 0,0).subscribe(data => { this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, 0, 0, 0, 0, 0,0, 0).subscribe(data => {
this.generalReport$.next(data); this.generalReport$.next(data);
this.data = data; this.data = data;
}, },
...@@ -238,7 +238,8 @@ generateGraphData() { ...@@ -238,7 +238,8 @@ generateGraphData() {
labelsX.push("2η Προτίμηση"); labelsX.push("2η Προτίμηση");
labelsX.push("3η Προτίμηση"); labelsX.push("3η Προτίμηση");
labelsX.push("Μη τοποθετημένοι"); labelsX.push("Μη τοποθετημένοι");
for (let i = 1; i <= 4; i++) { labelsX.push("Προσωρινά τοποθετημένοι σε ολιγομελή");
for (let i = 1; i <= 5; i++) {
this.d3data.push([ this.d3data.push([
labelsX[i-1], labelsX[i-1],
this.data[i].numStudents / this.data[0].numStudents, this.data[i].numStudents / this.data[0].numStudents,
......
...@@ -168,7 +168,7 @@ createReport() { ...@@ -168,7 +168,7 @@ createReport() {
return; return;
} }
this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, this.enableCapacityFilter, 0, 0, 0, 0,0).subscribe(data => { this.generalReportSub = this._hds.makeReport(this.minedu_userName, this.minedu_userPassword, route, this.enableCapacityFilter, 0, 0, 0, 0, 0, 0).subscribe(data => {
this.generalReport$.next(data); this.generalReport$.next(data);
this.data = data; this.data = data;
}, },
......
...@@ -65,8 +65,8 @@ export const MainRoutes: Routes = [ ...@@ -65,8 +65,8 @@ export const MainRoutes: Routes = [
{ path: 'school/director-buttons', component: DirectorButtons, canActivate: [SchoolAuthGuard] }, { path: 'school/director-buttons', component: DirectorButtons, canActivate: [SchoolAuthGuard] },
{ path: 'school/director-classcapacity', component: DirectorClassCapacity, canActivate: [SchoolAuthGuard] }, { path: 'school/director-classcapacity', component: DirectorClassCapacity, canActivate: [SchoolAuthGuard] },
{ path: 'ministry/minister-view', component: MinisterView, canActivate: [MinistryAuthGuard] }, { path: 'ministry/minister-view', component: MinisterView, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/minister-reports', component: MinisterReports, canActivate: [MinistryAuthGuard] }, { path: 'ministry/minister-reports', component: MinisterReports },
{ path: 'ministry/report-all-stat/:reportId', component: ReportAllStat, canActivate: [MinistryAuthGuard] }, { path: 'ministry/report-all-stat/:reportId', component: ReportAllStat },
{ path: 'ministry/report-general/:reportId', component: ReportGeneral, canActivate: [MinistryAuthGuard] }, { path: 'ministry/report-general/:reportId', component: ReportGeneral, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/report-no-capacity/:reportId', component: ReportNoCapacity, canActivate: [MinistryAuthGuard] }, { path: 'ministry/report-no-capacity/:reportId', component: ReportNoCapacity, canActivate: [MinistryAuthGuard] },
{ path: 'ministry/minister-informstudents', component: InformStudents, canActivate: [MinistryAuthGuard] }, { path: 'ministry/minister-informstudents', component: InformStudents, canActivate: [MinistryAuthGuard] },
......
...@@ -12,7 +12,9 @@ export default class MinistryAuthGuard implements CanActivate { ...@@ -12,7 +12,9 @@ export default class MinistryAuthGuard implements CanActivate {
canActivate() { canActivate() {
return this.authService.isLoggedIn(MINISTRY_ROLE).then(loggedIn => { return this.authService.isLoggedIn(MINISTRY_ROLE).then(loggedIn => {
if (!loggedIn) { if (!loggedIn) {
console.log("I am IN!");
this.router.navigate(['/ministry/logout']); this.router.navigate(['/ministry/logout']);
//this.router.navigate(['/ministy/minister-settings']);
} }
return loggedIn; return loggedIn;
}).catch(err => { }).catch(err => {
......
...@@ -619,7 +619,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -619,7 +619,7 @@ export class HelperDataService implements OnInit, OnDestroy {
} }
makeReport(username, userpassword, routepath, regionsel, adminsel, schsel, clsel, secsel, coursel) { makeReport(username, userpassword, routepath, regionsel, adminsel, schsel, clsel, secsel, coursel, distribfinal) {
let headers = new Headers({ let headers = new Headers({
"Content-Type": "application/json", "Content-Type": "application/json",
...@@ -638,7 +638,7 @@ export class HelperDataService implements OnInit, OnDestroy { ...@@ -638,7 +638,7 @@ export class HelperDataService implements OnInit, OnDestroy {
} }
else if (routepath == "/ministry/report-all-stat/"){ else if (routepath == "/ministry/report-all-stat/"){
return this.http.get(`${AppSettings.API_ENDPOINT}` + routepath + regionsel + "/" + adminsel + "/" + schsel + "/" + return this.http.get(`${AppSettings.API_ENDPOINT}` + routepath + regionsel + "/" + adminsel + "/" + schsel + "/" +
clsel + "/" + secsel + "/" + coursel , options) clsel + "/" + secsel + "/" + coursel + "/" + distribfinal , options)
.map(response => response.json()); .map(response => response.json());
} }
else if (routepath == "/ministry/report-no-capacity/"){ else if (routepath == "/ministry/report-no-capacity/"){
......
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