Commit 6d3b14d4 authored by Ασπασία Κατσή's avatar Ασπασία Κατσή

Merge branch 'updatedReportSmallClasses' into 'develop'

Insert limit_down to Report for Small Classes

See merge request !283
parents e62d2e2d 65924e78
......@@ -480,7 +480,7 @@ class ReportsCreator extends ControllerBase
], Response::HTTP_FORBIDDEN);
}
$limitup = $this->retrieveUpLimit();
$limitup = $this->retrieveUpLimit();
$list = array();
......@@ -511,7 +511,8 @@ class ReportsCreator extends ControllerBase
$numColumn = array();
$capacityColumn = array();
$percColumn = array();
$limitDownColumn = array();
$smallClass = array();
$numClassSec = 0;
......@@ -552,6 +553,7 @@ class ReportsCreator extends ControllerBase
array_push($numColumn, $numStud);
$capacityColumnValue = $sectorsInEpal->capacity_class_sector * $limitup;
array_push($capacityColumn, $capacityColumnValue);
array_push($limitDownColumn,$this->retrieveDownLimit($epalSchool->metathesis_region));
array_push($percColumn, $capacityColumnValue > 0 ? number_format($numStud / $capacityColumnValue * 100, 2) : 0);
$numClassSec += $sectorsInEpal->capacity_class_sector;
......@@ -593,6 +595,7 @@ class ReportsCreator extends ControllerBase
array_push($numColumn, $numStud);
$capacityColumnValue = $specialtiesInEpal->capacity_class_specialty * $limitup;
array_push($capacityColumn, $capacityColumnValue);
array_push($limitDownColumn,$this->retrieveDownLimit($epalSchool->metathesis_region));
array_push($percColumn, $capacityColumnValue > 0 ? number_format($numStud / $capacityColumnValue * 100, 2) : 0);
$numClassCour += $specialtiesInEpal->capacity_class_specialty;
......@@ -636,6 +639,7 @@ class ReportsCreator extends ControllerBase
array_push($numColumn, $numStud);
$capacityColumnValue = $specialtiesInEpal->capacity_class_specialty_d * $limitup;
array_push($capacityColumn, $capacityColumnValue);
array_push($limitDownColumn,$this->retrieveDownLimit($epalSchool->metathesis_region));
array_push($percColumn, $capacityColumnValue > 0 ? number_format($numStud / $capacityColumnValue * 100, 2) : 0);
$numClassCour_D += $specialtiesInEpal->capacity_class_specialty_d;
......@@ -691,6 +695,7 @@ class ReportsCreator extends ControllerBase
array_push($numColumn, $numStud);
$capacityColumnValue = ($numClasses[$clId-1] * $limitup);
array_push($capacityColumn, $capacityColumnValue);
array_push($limitDownColumn,$this->retrieveDownLimit($epalSchool->metathesis_region));
array_push($percColumn, $capacityColumnValue > 0 ? number_format($numStud / $capacityColumnValue * 100, 2) : 0);
}
} // end εύρεση αριθμού μαθητών για κάθε τάξη
......@@ -709,6 +714,7 @@ class ReportsCreator extends ControllerBase
'num' => $numColumn[$j],
'capacity' => $capacityColumn[$j],
'percentage' => $percColumn[$j],
'limit_down' => $limitDownColumn[$j],
));
}
}
......@@ -1047,6 +1053,25 @@ class ReportsCreator extends ControllerBase
}
}
public function retrieveDownLimit($category)
{
try {
$sCon = $this->connection->select('epal_class_limits', 'eSchool');
$sCon->fields('eSchool', array('name', 'limit_down'));
$sCon->condition('eSchool.name', '1', '=');
$sCon->condition('eSchool.category', $category, '=');
$epalLimitDowns = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$epalLimitDown = reset($epalLimitDowns);
return $epalLimitDown->limit_down;
} catch (\Exception $e) {
$this->logger->warning($e->getMessage());
return -1;
}
}
/**
* Check if $user, under $role, can issue the report on the
* designated region, admin area and school.
......
......@@ -305,7 +305,7 @@ import { ReportsSchema, TableColumn } from "./reports-schema";
else if (this.reportId === 5) {
route = "/ministry/report-all-stat/";
this.distribFinalized = 0;
this.settings = this.reportSchema.reportAllStatSchema;
this.settings = this.reportSchema.reportSmallClassesSchema;
this.settings.fileName = "e-ΕΠΑΛ Ολιγομελή τμήματα - Προσωρινά τοποθετημένοι μαθητές";
}
......
......@@ -230,6 +230,60 @@ export class ReportsSchema {
}
};
reportSmallClassesSchema = {
actions: false,
fileName: "e-ΕΠΑΛ Ολιγομελή Τμήματα",
pager: {
display: true,
perPage: 10
},
noDataMessage: "Δεν υπάρχουν δεδομένα που περιέχουν το κείμενο αναζήτησης",
columns: {
name: {
title: "Σχολείο",
width: "18%",
filter: false
},
region: {
title: "Περιφερειακή Διεύθυνση",
width: "15%",
filter: false
},
admin: {
title: "Διεύθυνση Εκπαίδευσης",
width: "15%",
filter: false
},
section: {
title: "Τάξη/Τομέας/Ειδικότητα",
width: "18%",
filter: false
},
num: {
title: "Αριθμός Μαθητών",
width: "8%",
filter: false
},
limit_down: {
title: "Ελάχιστος Αριθμός Μαθητών",
width: "8%",
filter: false
},
capacity: {
title: "Χωρ/κα",
width: "8%",
filter: false
},
percentage: {
title: "Ποσοστό (%)",
width: "8%",
filter: false
}
}
};
constructor() { }
}
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