Commit c8532ec4 authored by Kostas G's avatar Kostas G

Report for Merged Classes v1

parent c2a4488d
...@@ -1180,10 +1180,7 @@ class ReportsCreator extends ControllerBase ...@@ -1180,10 +1180,7 @@ class ReportsCreator extends ControllerBase
$sCon->addField('eSchool1', 'name','schoolAName'); $sCon->addField('eSchool1', 'name','schoolAName');
$sCon->addField('eRegion2', 'name','regionBName'); $sCon->addField('eRegion2', 'name','regionBName');
$sCon->addField('eAdmin2', 'name','adminBName'); $sCon->addField('eAdmin2', 'name','adminBName');
$sCon->addField('eSchool2', 'name','schoolBName'); $sCon->addField('eSchool2', 'name','schoolBName');
if ($classId != 0) { if ($classId != 0) {
$sCon->condition('eStudent.currentclass', $classId, '='); $sCon->condition('eStudent.currentclass', $classId, '=');
} }
...@@ -1225,6 +1222,8 @@ class ReportsCreator extends ControllerBase ...@@ -1225,6 +1222,8 @@ class ReportsCreator extends ControllerBase
$mergedSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); $mergedSchools = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$schoolANameColumn = array(); $schoolANameColumn = array();
$regionAColumn = array(); $regionAColumn = array();
$adminAColumn = array(); $adminAColumn = array();
...@@ -1235,48 +1234,7 @@ class ReportsCreator extends ControllerBase ...@@ -1235,48 +1234,7 @@ class ReportsCreator extends ControllerBase
$adminBColumn = array(); $adminBColumn = array();
$numBColumn = array(); $numBColumn = array();
foreach ($mergedSchools as $mergedSchool) { // για κάθε σχολείο foreach ($mergedSchools as $mergedSchool) {
/*
$schoolANameColumn = array();
$regionAColumn = array();
$adminAColumn = array();
$schoolSectionColumn = array();
$numAColumn = array();
$schoolBNameColumn = array();
$regionBColumn = array();
$adminBColumn = array();
$numBColumn = array();
$sCon = \Drupal::database()->select('eepal_school_field_data', 'eSchool');
$sCon->join('eepal_region_field_data', 'eRegion', 'eRegion.id = eSchool.region_edu_admin_id');
$sCon->join('eepal_admin_area_field_data', 'eAdmin', 'eAdmin.id = eSchool.edu_admin_id');
$sCon->fields('eSchool', array('id', 'name', 'region_edu_admin_id', 'edu_admin_id'));
$sCon->addField('eRegion', 'name', 'regionName');
$sCon->addField('eAdmin', 'name', 'adminName');
if ($regionId != 0) {
$sCon->condition('eSchool.region_edu_admin_id', $regionId, '=');
}
if ($adminId != 0) {
$sCon->condition('eSchool.edu_admin_id', $adminId, '=');
}
if ($schId != 0) {
$sCon->condition('eSchool.id', $schId, '=');
}
$sCon->condition('eSchool.id',$mergedSchool->initial_epal_id , '=');
$results = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
//echo sizeof($results);
//echo $sCon;
*/
//$sCon = \Drupal::database()->select('eepal_specialty_field_data', 'eSectors');
//$sCon->fields('eSectors', array('sector_id', 'id', 'name', ));
//$sCon->condition('eSectors.sector_id', $sectorId, '=');
array_push($regionAColumn, $mergedSchool->regionAName); array_push($regionAColumn, $mergedSchool->regionAName);
array_push($adminAColumn, $mergedSchool->adminAName); array_push($adminAColumn, $mergedSchool->adminAName);
...@@ -1298,8 +1256,6 @@ class ReportsCreator extends ControllerBase ...@@ -1298,8 +1256,6 @@ class ReportsCreator extends ControllerBase
$sCon->addField('eSpecialties', 'name','specialtyName'); $sCon->addField('eSpecialties', 'name','specialtyName');
$sCon->condition('eSpecialties.id', $mergedSchool->specialization_id, '='); $sCon->condition('eSpecialties.id', $mergedSchool->specialization_id, '=');
$sector_specialty = $sCon->execute()->fetchAssoc(); $sector_specialty = $sCon->execute()->fetchAssoc();
// print_r($sector_specialty);
if ($mergedSchool->currentclass==3){ if ($mergedSchool->currentclass==3){
array_push($schoolSectionColumn, 'Γ Tάξη / ' . $sector_specialty['sectorName'].'/'.$sector_specialty['specialtyName']);//->specialization_id); array_push($schoolSectionColumn, 'Γ Tάξη / ' . $sector_specialty['sectorName'].'/'.$sector_specialty['specialtyName']);//->specialization_id);
} }
...@@ -1308,53 +1264,21 @@ class ReportsCreator extends ControllerBase ...@@ -1308,53 +1264,21 @@ class ReportsCreator extends ControllerBase
} }
} }
array_push($numAColumn, $mergedSchool->eStudent_count);
array_push($regionBColumn, $mergedSchool->regionBName);
array_push($adminBColumn, $mergedSchool->adminBName);
array_push($schoolBNameColumn, $mergedSchool->schoolBName);
$numStud = $mergedSchool->eStudent_count;
array_push($numAColumn, $numStud); $sCon = \Drupal::database()->select('epal_student_class', 'eStudent');
array_push($regionBColumn, $mergedSchool->regionBName);//"ΚΩΣΤΑΣ ΠΕΡΙΦΕΡΕΙΑ"); $sCon->condition('eStudent.epal_id', $mergedSchool->epal_id, '=');
array_push($adminBColumn, $mergedSchool->adminBName); //"ΓΚΕΓΚΕ ΔΙΕΥΘΥΝΣΗ"); $sCon->condition('eStudent.currentclass', $mergedSchool->currentclass, '=');
array_push($schoolBNameColumn, $mergedSchool->schoolBName); //"ΓΕΩ ΣΧΟΛΕΙΟ"); $sCon->condition('eStudent.specialization_id', $mergedSchool->specialization_id, '=');
array_push($numBColumn, 100); $sCon->addExpression('count(eStudent.id)', 'eStudent_extra_count');
$sCon->groupBy('eStudent.epal_id');
$sCon->groupBy('eStudent.currentclass');
/* $sCon->groupBy('eStudent.specialization_id');
foreach ($results as $result) { $eStudent_extra_count = $sCon->execute()->fetchAssoc();
array_push($numBColumn, $eStudent_extra_count['eStudent_extra_count']);
//array_push($regionAColumn, $result->regionAName);
//array_push($adminAColumn, $result->adminName);
//array_push($schoolANameColumn, $result->name);
array_push($regionAColumn, $mergedSchool->regionAName);
array_push($adminAColumn, $mergedSchool->adminAName);
array_push($schoolANameColumn, $mergedSchool->schoolAName);
if ($mergedSchool->currentclass==2){
array_push($schoolSectionColumn, 'Β τάξη / ' . $mergedSchool->specialization_id);
}
else if ($mergedSchool->currentclass==3){
array_push($schoolSectionColumn, 'Γ τάξη / ' . $mergedSchool->specialization_id);
}
else if ($mergedSchool->currentclass==4){
array_push($schoolSectionColumn, 'Δ τάξη / ' . $mergedSchool->specialization_id);
}
else if ($mergedSchool->currentclass==1){
array_push($schoolSectionColumn, 'Α τάξη / ');
}
$numStud = $mergedSchool->eStudent_count;
array_push($numAColumn, $numStud);
array_push($regionBColumn, $mergedSchool->regionBName);//"ΚΩΣΤΑΣ ΠΕΡΙΦΕΡΕΙΑ");
array_push($adminBColumn, $mergedSchool->adminBName); //"ΓΚΕΓΚΕ ΔΙΕΥΘΥΝΣΗ");
array_push($schoolBNameColumn, $mergedSchool->schoolBName); //"ΓΕΩ ΣΧΟΛΕΙΟ");
array_push($numBColumn, 100);
}
*/
} }
......
...@@ -410,12 +410,9 @@ import { ReportsSchema, TableColumn } from "./reports-schema"; ...@@ -410,12 +410,9 @@ import { ReportsSchema, TableColumn } from "./reports-schema";
this.classSelected = Number(classId.value); this.classSelected = Number(classId.value);
this.sectorSelected = 0; this.sectorSelected = 0;
this.courseSelected = 0; this.courseSelected = 0;
console.log(this.classSelected);
console.log(this.minedu_userName);
console.log(this.minedu_userPassword);
if (this.classSelected === 2 || this.classSelected === 3 || this.classSelected === 4) { if (this.classSelected === 2 || this.classSelected === 3 || this.classSelected === 4) {
console.log("test=");
this.SectorSelectionsSub = this._hds.getSectors(this.minedu_userName, this.minedu_userPassword, this.classSelected).subscribe(data => { this.SectorSelectionsSub = this._hds.getSectors(this.minedu_userName, this.minedu_userPassword, this.classSelected).subscribe(data => {
this.SectorSelections$.next(data); this.SectorSelections$.next(data);
this.showSectorList.next(true); this.showSectorList.next(true);
......
...@@ -213,12 +213,12 @@ export class ReportsSchema { ...@@ -213,12 +213,12 @@ export class ReportsSchema {
filter: false filter: false
}, },
regionΒ: { regionΒ: {
title: "Π.Δ.Ε. 2", title: "Π.Δ.Ε. Υποδοχής",
width: "6%", width: "6%",
filter: false filter: false
}, },
adminΒ: { adminΒ: {
title: "ΔΙ.Δ.Ε. 2", title: "ΔΙ.Δ.Ε. Υποδοχής",
width: "6%", width: "6%",
filter: false filter: false
}, },
......
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