final changes

parent c971f75c
...@@ -834,10 +834,12 @@ class ApplicationSubmit extends ControllerBase ...@@ -834,10 +834,12 @@ class ApplicationSubmit extends ControllerBase
&& preg_match(self::VALID_ADDRESS_PATTERN, $student["regionaddress"]) !== 1) { && preg_match(self::VALID_ADDRESS_PATTERN, $student["regionaddress"]) !== 1) {
return 1008; return 1008;
} }
/*
if ( ( ($wsEnabled === 1 && $student["lastschool_schoolyear"] < self::LIMIT_SCHOOL_YEAR) || ($wsEnabled === 0) ) if ( ( ($wsEnabled === 1 && $student["lastschool_schoolyear"] < self::LIMIT_SCHOOL_YEAR) || ($wsEnabled === 0) )
&& preg_match(self::VALID_ADDRESSTK_PATTERN, $student["regiontk"]) !== 1) { && preg_match(self::VALID_ADDRESSTK_PATTERN, $student["regiontk"]) !== 1) {
return 1009; return 1009;
} }
*/
if ( ( ($wsEnabled === 1 && $student["lastschool_schoolyear"] < self::LIMIT_SCHOOL_YEAR) || ($wsEnabled === 0) ) if ( ( ($wsEnabled === 1 && $student["lastschool_schoolyear"] < self::LIMIT_SCHOOL_YEAR) || ($wsEnabled === 0) )
&& preg_match(self::VALID_NAMES_PATTERN, $student["regionarea"]) !== 1) { && preg_match(self::VALID_NAMES_PATTERN, $student["regionarea"]) !== 1) {
return 1010; return 1010;
......
...@@ -61,11 +61,191 @@ class CreateEncodedData extends ControllerBase { ...@@ -61,11 +61,191 @@ class CreateEncodedData extends ControllerBase {
//insert isolated entries to SP //insert isolated entries to SP
//152714,225690,215472,177493 και το 46662 //152714,225690,215472,177493 και το 46662
$ids_arr = array(); $ids_arr = array();
/*
array_push($ids_arr, 152714); array_push($ids_arr, 152714);
array_push($ids_arr, 225690); array_push($ids_arr, 225690);
array_push($ids_arr, 215472); array_push($ids_arr, 215472);
array_push($ids_arr, 177493); array_push($ids_arr, 177493);
array_push($ids_arr, 46662); array_push($ids_arr, 46662);
*/
array_push($ids_arr,235372);
array_push($ids_arr,235447);
array_push($ids_arr,233877);
array_push($ids_arr,234374);
array_push($ids_arr,234423);
array_push($ids_arr,234201);
array_push($ids_arr,234806);
array_push($ids_arr,234810);
array_push($ids_arr,234536);
array_push($ids_arr,233891);
array_push($ids_arr,235382);
array_push($ids_arr,235554);
array_push($ids_arr,235409);
array_push($ids_arr,235471);
array_push($ids_arr,234829);
array_push($ids_arr,235422);
array_push($ids_arr,234848);
array_push($ids_arr,235469);
array_push($ids_arr,234896);
array_push($ids_arr,235399);
array_push($ids_arr,235601);
array_push($ids_arr,235548);
array_push($ids_arr,234865);
array_push($ids_arr,235546);
array_push($ids_arr,233441);
array_push($ids_arr,235424);
array_push($ids_arr,233287);
array_push($ids_arr,233389);
array_push($ids_arr,233615);
array_push($ids_arr,233870);
array_push($ids_arr,233954);
array_push($ids_arr,233962);
array_push($ids_arr,234223);
array_push($ids_arr,234327);
array_push($ids_arr,234339);
array_push($ids_arr,234372);
array_push($ids_arr,234733);
array_push($ids_arr,235218);
array_push($ids_arr,235238);
array_push($ids_arr,235324);
array_push($ids_arr,235357);
array_push($ids_arr,234949);
array_push($ids_arr,235498);
array_push($ids_arr,235602);
array_push($ids_arr,233882);
array_push($ids_arr,234951);
array_push($ids_arr,235480);
array_push($ids_arr,235263);
array_push($ids_arr,235411);
array_push($ids_arr,234817);
array_push($ids_arr,235287);
array_push($ids_arr,235363);
array_push($ids_arr,235466);
array_push($ids_arr,235056);
array_push($ids_arr,234835);
array_push($ids_arr,234864);
array_push($ids_arr,234851);
array_push($ids_arr,234837);
array_push($ids_arr,235318);
array_push($ids_arr,234644);
array_push($ids_arr,234888);
array_push($ids_arr,234836);
array_push($ids_arr,235346);
array_push($ids_arr,234942);
array_push($ids_arr,233455);
array_push($ids_arr,234546);
array_push($ids_arr,235587);
array_push($ids_arr,234658);
array_push($ids_arr,234891);
array_push($ids_arr,235600);
array_push($ids_arr,234468);
array_push($ids_arr,233875);
array_push($ids_arr,234486);
array_push($ids_arr,233428);
array_push($ids_arr,233868);
array_push($ids_arr,233892);
array_push($ids_arr,233904);
array_push($ids_arr,233919);
array_push($ids_arr,233921);
array_push($ids_arr,234291);
array_push($ids_arr,234294);
array_push($ids_arr,234317);
array_push($ids_arr,234377);
array_push($ids_arr,234384);
array_push($ids_arr,234388);
array_push($ids_arr,234390);
array_push($ids_arr,234433);
array_push($ids_arr,234434);
array_push($ids_arr,234483);
array_push($ids_arr,234541);
array_push($ids_arr,234623);
array_push($ids_arr,234807);
array_push($ids_arr,234856);
array_push($ids_arr,234879);
array_push($ids_arr,234880);
array_push($ids_arr,234883);
array_push($ids_arr,234910);
array_push($ids_arr,234934);
array_push($ids_arr,235007);
array_push($ids_arr,235084);
array_push($ids_arr,235256);
array_push($ids_arr,235291);
array_push($ids_arr,235327);
array_push($ids_arr,235416);
array_push($ids_arr,235455);
array_push($ids_arr,235467);
array_push($ids_arr,235569);
array_push($ids_arr,235572);
array_push($ids_arr,235577);
array_push($ids_arr,51380);
array_push($ids_arr,124299);
array_push($ids_arr,163908);
array_push($ids_arr,234001);
array_push($ids_arr,233665);
array_push($ids_arr,234020);
array_push($ids_arr,233531);
array_push($ids_arr,233671);
array_push($ids_arr,233631);
array_push($ids_arr,234043);
array_push($ids_arr,233658);
array_push($ids_arr,233632);
array_push($ids_arr,233742);
array_push($ids_arr,233625);
array_push($ids_arr,233756);
array_push($ids_arr,233541);
array_push($ids_arr,233491);
array_push($ids_arr,233411);
array_push($ids_arr,234308);
array_push($ids_arr,234461);
array_push($ids_arr,234226);
array_push($ids_arr,234170);
array_push($ids_arr,234098);
array_push($ids_arr,234106);
array_push($ids_arr,234481);
array_push($ids_arr,234497);
array_push($ids_arr,234787);
array_push($ids_arr,234750);
array_push($ids_arr,234180);
array_push($ids_arr,234125);
array_push($ids_arr,234695);
array_push($ids_arr,234649);
array_push($ids_arr,234688);
array_push($ids_arr,234591);
array_push($ids_arr,234960);
array_push($ids_arr,234927);
array_push($ids_arr,234430);
array_push($ids_arr,234503);
array_push($ids_arr,234259);
array_push($ids_arr,234488);
array_push($ids_arr,234642);
array_push($ids_arr,235031);
array_push($ids_arr,234983);
array_push($ids_arr,235028);
array_push($ids_arr,234072);
array_push($ids_arr,234529);
array_push($ids_arr,234952);
array_push($ids_arr,234956);
array_push($ids_arr,234694);
array_push($ids_arr,235513);
array_push($ids_arr,235137);
array_push($ids_arr,235189);
array_push($ids_arr,235175);
array_push($ids_arr,235353);
array_push($ids_arr,235266);
array_push($ids_arr,235152);
array_push($ids_arr,235342);
array_push($ids_arr,235243);
array_push($ids_arr,235060);
array_push($ids_arr,235127);
array_push($ids_arr,235143);
array_push($ids_arr,235433);
array_push($ids_arr,235488);
$sCon = $this->connection $sCon = $this->connection
->select('gel_student', 'eInvalid') ->select('gel_student', 'eInvalid')
......
This diff is collapsed.
...@@ -292,7 +292,9 @@ class Distribution extends ControllerBase ...@@ -292,7 +292,9 @@ class Distribution extends ControllerBase
//$datelimit = '7-9-2017'; //$datelimit = '7-9-2017';
$datelimitInt = strtotime($datelimit); $datelimitInt = strtotime($datelimit);
$sCon->condition('eStudent.changed', $datelimitInt, '>='); //ΠΡΟΣΟΧΗ: πιθανά πρέεπι να χρησιμοποιώ το changed (και όχι το created)
//για να πιάσω και τις περιπτώσεις αιτήσεων που έκαναν edit και ήταν ακατανέμητοι --> παρενέργεια;; --> στα νούμερα του report
$sCon->condition('eStudent.created', $datelimitInt, '>=');
} }
...@@ -840,12 +842,16 @@ class Distribution extends ControllerBase ...@@ -840,12 +842,16 @@ class Distribution extends ControllerBase
try { try {
//για λόγους ασφαλείας το απενεργοποιώ προσωρινά. ΜΙΑ φορά πρέπει να τρέξει η κατανομή.
/*
if ($this->initializeResultsInSecondPeriod($dateStart) === self::ERROR_DB) { if ($this->initializeResultsInSecondPeriod($dateStart) === self::ERROR_DB) {
$transaction->rollback(); $transaction->rollback();
return $this->respondWithStatus([ return $this->respondWithStatus([
"message" => t("Unexpected Error") "message" => t("Unexpected Error")
], Response::HTTP_INTERNAL_SERVER_ERROR); ], Response::HTTP_INTERNAL_SERVER_ERROR);
} }
*/
// τοποθέτηση όλων των μαθητών Β' περιόδου στην πρώτη τους προτίμηση' // τοποθέτηση όλων των μαθητών Β' περιόδου στην πρώτη τους προτίμηση'
$this->globalCounterId = $this->retrieveLastStudentId() + 1; $this->globalCounterId = $this->retrieveLastStudentId() + 1;
...@@ -913,8 +919,9 @@ class Distribution extends ControllerBase ...@@ -913,8 +919,9 @@ class Distribution extends ControllerBase
try { try {
$this->connection->delete('epal_student_class') $this->connection->delete('epal_student_class')
->condition('second_period', 1) ->condition('second_period', 1)
//->condition('created', $datelimitInt, '>=') //προσοχή: χρησιμοποιώ το created, γιατί το changed τροποποιείται με confirm διευθυντή..
->condition('changed', $datelimitInt, '>=') ->condition('created', $datelimitInt, '>=')
//->condition('changed', $datelimitInt, '>=')
->execute(); ->execute();
} catch (\Exception $e) { } catch (\Exception $e) {
$this->logger->error($e->getMessage()); $this->logger->error($e->getMessage());
......
...@@ -136,6 +136,7 @@ class ReportsCreator extends ControllerBase ...@@ -136,6 +136,7 @@ class ReportsCreator extends ControllerBase
//υπολογισμός αριθμού αιτήσεων για τρίτη περίοδο //υπολογισμός αριθμού αιτήσεων για τρίτη περίοδο
$datelimit = '31-8-2018'; $datelimit = '31-8-2018';
$datelimitInt = strtotime($datelimit); $datelimitInt = strtotime($datelimit);
//$this->logger->warning("1/9/2018:" . $datelimitInt );
$sCon = $this->connection $sCon = $this->connection
->select('epal_student', 'eStudent') ->select('epal_student', 'eStudent')
...@@ -147,6 +148,20 @@ class ReportsCreator extends ControllerBase ...@@ -147,6 +148,20 @@ class ReportsCreator extends ControllerBase
array_push($list, (object) array('name' => "Αριθμός Αιτήσεων περιόδου Σεπτεμβρίου", 'numStudents' => $numApplications)); array_push($list, (object) array('name' => "Αριθμός Αιτήσεων περιόδου Σεπτεμβρίου", 'numStudents' => $numApplications));
//array_push($list, (object) array('name' => "Αριθμός Αιτήσεων περιόδου Σεπτεμβρίου", 'numStudents' => 0)); //array_push($list, (object) array('name' => "Αριθμός Αιτήσεων περιόδου Σεπτεμβρίου", 'numStudents' => 0));
//υπολογισμός αριθμού αιτήσεων για εκπρόθεσμες αιτήσεις, που τοποθετουνται με απόφαση ΔΔΕ
$datelimit = '11-9-2018';
$datelimitInt = strtotime($datelimit);
//$this->logger->warning("11/9/2018:" . $datelimitInt );
$sCon = $this->connection
->select('epal_student', 'eStudent')
->fields('eStudent', array('id'))
->condition('eStudent.second_period', 1, '=')
->condition('created', $datelimitInt, '>=')
->condition('eStudent.delapp', 0, '=');
$numApplications = $sCon->countQuery()->execute()->fetchField();
array_push($list, (object) array('name' => "Αριθμός Εκπρόθεσμων Αιτήσεων ", 'numStudents' => $numApplications));
//υπολογισμός αριθμού χρηστών //υπολογισμός αριθμού χρηστών
$sCon = $this->connection $sCon = $this->connection
...@@ -1556,11 +1571,12 @@ class ReportsCreator extends ControllerBase ...@@ -1556,11 +1571,12 @@ class ReportsCreator extends ControllerBase
//'AND eStudent.currentclass = 2 AND eStudent.directorconfirm = 1'); //'AND eStudent.currentclass = 2 AND eStudent.directorconfirm = 1');
'AND eStudent.currentclass = 2'); 'AND eStudent.currentclass = 2');
$sCon->fields('eSchool', array('sector_id','capacity_class_sector','approved_sector')) $sCon->fields('eSchool', array('sector_id','capacity_class_sector','approved_sector'))
->fields('eSectors', ['name']) ->fields('eSectors', ['name','id'])
->groupBy('sector_id') ->groupBy('sector_id')
->groupBy('capacity_class_sector') ->groupBy('capacity_class_sector')
->groupBy('approved_sector') ->groupBy('approved_sector')
->groupBy('eSectors.name') ->groupBy('eSectors.name')
->groupBy('eSectors.id')
->condition('eSchool.epal_id', $epalSchool->id, '='); ->condition('eSchool.epal_id', $epalSchool->id, '=');
//$sCon->addExpression('count(eStudent.id)', 'eStudent_count'); //$sCon->addExpression('count(eStudent.id)', 'eStudent_count');
$sCon->addExpression('sum(case when eStudent.directorconfirm = 1 then 1 else 0 end)','eStudent_count'); //synolo pou exoun ginei confirm $sCon->addExpression('sum(case when eStudent.directorconfirm = 1 then 1 else 0 end)','eStudent_count'); //synolo pou exoun ginei confirm
...@@ -1574,8 +1590,8 @@ class ReportsCreator extends ControllerBase ...@@ -1574,8 +1590,8 @@ class ReportsCreator extends ControllerBase
foreach ($sectorsInEpals as $sectorsInEpal) { foreach ($sectorsInEpals as $sectorsInEpal) {
array_push($regionColumn, $epalSchool->eRegion_name); array_push($regionColumn, $epalSchool->eRegion_name);
array_push($adminColumn, $epalSchool->eAdmin_name); array_push($adminColumn, $epalSchool->eAdmin_name);
array_push($schoolNameColumn, $epalSchool->name); array_push($schoolNameColumn, $epalSchool->name . ' / ' . $epalSchool->id);
array_push($schoolSectionColumn, 'Β τάξη / ' . $sectorsInEpal->name); array_push($schoolSectionColumn, 'Β τάξη / ' . $sectorsInEpal->name . '/ ' . $sectorsInEpal->id) ;
$numStud = $sectorsInEpal->eStudent_count; $numStud = $sectorsInEpal->eStudent_count;
$smCl = $this->isSmallClass($epalSchool->id, $numStud, "2", $sectorsInEpal->sector_id, $epalSchool->metathesis_region); $smCl = $this->isSmallClass($epalSchool->id, $numStud, "2", $sectorsInEpal->sector_id, $epalSchool->metathesis_region);
...@@ -1609,11 +1625,12 @@ class ReportsCreator extends ControllerBase ...@@ -1609,11 +1625,12 @@ class ReportsCreator extends ControllerBase
//'AND eStudent.currentclass = 3 AND eStudent.directorconfirm = 1'); //'AND eStudent.currentclass = 3 AND eStudent.directorconfirm = 1');
'AND eStudent.currentclass = 3'); 'AND eStudent.currentclass = 3');
$sCon->fields('eSchool', array('specialty_id', 'capacity_class_specialty','approved_speciality')) $sCon->fields('eSchool', array('specialty_id', 'capacity_class_specialty','approved_speciality'))
->fields('eSpecialties', ['name']) ->fields('eSpecialties', ['name','id'])
->groupBy('specialty_id') ->groupBy('specialty_id')
->groupBy('capacity_class_specialty') ->groupBy('capacity_class_specialty')
->groupBy('approved_speciality') ->groupBy('approved_speciality')
->groupBy('eSpecialties.name') ->groupBy('eSpecialties.name')
->groupBy('eSpecialties.id')
->condition('eSchool.epal_id', $epalSchool->id, '='); ->condition('eSchool.epal_id', $epalSchool->id, '=');
//$sCon->addExpression('count(eStudent.id)', 'eStudent_count'); //$sCon->addExpression('count(eStudent.id)', 'eStudent_count');
$sCon->addExpression('sum(case when eStudent.directorconfirm = 1 then 1 else 0 end)','eStudent_count'); $sCon->addExpression('sum(case when eStudent.directorconfirm = 1 then 1 else 0 end)','eStudent_count');
...@@ -1628,8 +1645,8 @@ class ReportsCreator extends ControllerBase ...@@ -1628,8 +1645,8 @@ class ReportsCreator extends ControllerBase
foreach ($specialtiesInEpals as $specialtiesInEpal) { foreach ($specialtiesInEpals as $specialtiesInEpal) {
array_push($regionColumn, $epalSchool->eRegion_name); array_push($regionColumn, $epalSchool->eRegion_name);
array_push($adminColumn, $epalSchool->eAdmin_name); array_push($adminColumn, $epalSchool->eAdmin_name);
array_push($schoolNameColumn, $epalSchool->name); array_push($schoolNameColumn, $epalSchool->name . ' / ' . $epalSchool->id);
array_push($schoolSectionColumn, 'Γ τάξη / ' . $specialtiesInEpal->name ); array_push($schoolSectionColumn, 'Γ τάξη / ' . $specialtiesInEpal->name . ' / ' . $specialtiesInEpal->id);
$numStud = $specialtiesInEpal->eStudent_count; $numStud = $specialtiesInEpal->eStudent_count;
$smCl = $this->isSmallClass($epalSchool->id, $numStud, "3", $specialtiesInEpal->specialty_id, $epalSchool->metathesis_region); $smCl = $this->isSmallClass($epalSchool->id, $numStud, "3", $specialtiesInEpal->specialty_id, $epalSchool->metathesis_region);
...@@ -1664,11 +1681,12 @@ class ReportsCreator extends ControllerBase ...@@ -1664,11 +1681,12 @@ class ReportsCreator extends ControllerBase
//'AND eStudent.currentclass = 4 AND eStudent.directorconfirm = 1'); //'AND eStudent.currentclass = 4 AND eStudent.directorconfirm = 1');
'AND eStudent.currentclass = 4'); 'AND eStudent.currentclass = 4');
$sCon->fields('eSchool', array('specialty_id', 'capacity_class_specialty_d','approved_speciality_d')) $sCon->fields('eSchool', array('specialty_id', 'capacity_class_specialty_d','approved_speciality_d'))
->fields('eSpecialties', ['name']) ->fields('eSpecialties', ['name','id'])
->groupBy('specialty_id') ->groupBy('specialty_id')
->groupBy('capacity_class_specialty_d') ->groupBy('capacity_class_specialty_d')
->groupBy('approved_speciality_d') ->groupBy('approved_speciality_d')
->groupBy('eSpecialties.name') ->groupBy('eSpecialties.name')
->groupBy('eSpecialties.id')
->condition('eSchool.epal_id', $epalSchool->id, '='); ->condition('eSchool.epal_id', $epalSchool->id, '=');
//$sCon->addExpression('count(eStudent.id)', 'eStudent_count'); //$sCon->addExpression('count(eStudent.id)', 'eStudent_count');
$sCon->addExpression('sum(case when eStudent.directorconfirm = 1 then 1 else 0 end)','eStudent_count'); $sCon->addExpression('sum(case when eStudent.directorconfirm = 1 then 1 else 0 end)','eStudent_count');
...@@ -1684,8 +1702,8 @@ class ReportsCreator extends ControllerBase ...@@ -1684,8 +1702,8 @@ class ReportsCreator extends ControllerBase
foreach ($specialtiesInEpals as $specialtiesInEpal) { foreach ($specialtiesInEpals as $specialtiesInEpal) {
array_push($regionColumn, $epalSchool->eRegion_name); array_push($regionColumn, $epalSchool->eRegion_name);
array_push($adminColumn, $epalSchool->eAdmin_name); array_push($adminColumn, $epalSchool->eAdmin_name);
array_push($schoolNameColumn, $epalSchool->name); array_push($schoolNameColumn, $epalSchool->name . ' / ' . $epalSchool->id);
array_push($schoolSectionColumn, 'Δ τάξη / ' . $specialtiesInEpal->name ); array_push($schoolSectionColumn, 'Δ τάξη / ' . $specialtiesInEpal->name . ' / ' . $specialtiesInEpal->id);
$numStud = $specialtiesInEpal->eStudent_count; $numStud = $specialtiesInEpal->eStudent_count;
$smCl = $this->isSmallClass($epalSchool->id, $numStud, "4", $specialtiesInEpal->specialty_id, $epalSchool->metathesis_region); $smCl = $this->isSmallClass($epalSchool->id, $numStud, "4", $specialtiesInEpal->specialty_id, $epalSchool->metathesis_region);
...@@ -1758,7 +1776,7 @@ class ReportsCreator extends ControllerBase ...@@ -1758,7 +1776,7 @@ class ReportsCreator extends ControllerBase
$smCl = $this->isSmallClass($epalSchool->id, $numStud, "1", "-1", $epalSchool->metathesis_region); $smCl = $this->isSmallClass($epalSchool->id, $numStud, "1", "-1", $epalSchool->metathesis_region);
array_push($smallClass, $smCl); array_push($smallClass, $smCl);
array_push($schoolNameColumn, $epalSchool->name); array_push($schoolNameColumn, $epalSchool->name . ' / ' . $epalSchool->id);
array_push($regionColumn, $epalSchool->eRegion_name); array_push($regionColumn, $epalSchool->eRegion_name);
array_push($adminColumn, $epalSchool->eAdmin_name); array_push($adminColumn, $epalSchool->eAdmin_name);
array_push($numColumn, $numStud); array_push($numColumn, $numStud);
......
...@@ -437,6 +437,7 @@ class SubmitedApplications extends ControllerBase ...@@ -437,6 +437,7 @@ class SubmitedApplications extends ControllerBase
$applicantsAppModifyDisabled = $eggrafesConfig->lock_modify->value; $applicantsAppModifyDisabled = $eggrafesConfig->lock_modify->value;
//$secondPeriodEnabled = $eggrafesConfig->activate_second_period->value; //$secondPeriodEnabled = $eggrafesConfig->activate_second_period->value;
$dateStartInt = strtotime($eggrafesConfig->date_start_b_period->value); $dateStartInt = strtotime($eggrafesConfig->date_start_b_period->value);
//$this->logger->warning("Test.." . $dateStartInt);
} }
$status = "-1"; $status = "-1";
......
...@@ -199,8 +199,8 @@ class WSConsumer extends ControllerBase ...@@ -199,8 +199,8 @@ class WSConsumer extends ControllerBase
$sCon->condition('epal_app.lastschool_schoolyear','2017-2018', '<'); $sCon->condition('epal_app.lastschool_schoolyear','2017-2018', '<');
$sCon->condition('epal_app.myschool_id',NULL, 'IS NOT'); $sCon->condition('epal_app.myschool_id',NULL, 'IS NOT');
$sCon->condition('epal_app.delapp',0, '='); $sCon->condition('epal_app.delapp',0, '=');
$sCon->condition('epal_app.myschool_promoted',2, '='); //$sCon->condition('epal_app.myschool_promoted',2, '=');
//$sCon->condition('epal_app.myschool_promoted',NULL, 'IS'); $sCon->condition('epal_app.myschool_promoted',NULL, 'IS');
$sCon->condition('epal_app.second_period',1, '='); $sCon->condition('epal_app.second_period',1, '=');
$students_promotions = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); $students_promotions = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
......
This diff is collapsed.
...@@ -670,10 +670,12 @@ class GelApplicationSubmit extends ControllerBase ...@@ -670,10 +670,12 @@ class GelApplicationSubmit extends ControllerBase
&& preg_match(self::VALID_ADDRESS_PATTERN, $student["regionaddress"]) !== 1) { && preg_match(self::VALID_ADDRESS_PATTERN, $student["regionaddress"]) !== 1) {
return 1008; return 1008;
} }
/*
if ( ( ($wsEnabled === 1 && $student["lastschool_schoolyear"] < self::LIMIT_SCHOOL_YEAR) || ($wsEnabled === 0) ) if ( ( ($wsEnabled === 1 && $student["lastschool_schoolyear"] < self::LIMIT_SCHOOL_YEAR) || ($wsEnabled === 0) )
&& preg_match(self::VALID_ADDRESSTK_PATTERN, $student["regiontk"]) !== 1) { && preg_match(self::VALID_ADDRESSTK_PATTERN, $student["regiontk"]) !== 1) {
return 1009; return 1009;
} }
*/
if ( ( ($wsEnabled === 1 && $student["lastschool_schoolyear"] < self::LIMIT_SCHOOL_YEAR) || ($wsEnabled === 0) ) if ( ( ($wsEnabled === 1 && $student["lastschool_schoolyear"] < self::LIMIT_SCHOOL_YEAR) || ($wsEnabled === 0) )
&& preg_match(self::VALID_NAMES_PATTERN, $student["regionarea"]) !== 1) { && preg_match(self::VALID_NAMES_PATTERN, $student["regionarea"]) !== 1) {
return 1010; return 1010;
......
...@@ -297,9 +297,9 @@ class GelSubmittedApplications extends ControllerBase ...@@ -297,9 +297,9 @@ class GelSubmittedApplications extends ControllerBase
if (!$applicantsAppDelDisabled && if (!$applicantsAppDelDisabled &&
( (
($eggrafesConfig->activate_second_period->value == $object->second_period->value) ($eggrafesConfig->activate_second_period->value == $object->second_period->value)
&& $object->changed->value >= $dateStartInt) && $object->created->value >= $dateStartInt)
|| //||
($this->isInvalidApp($object->id->value)) // ($this->isInvalidApp($object->id->value))
) )
$canDelete = 1; $canDelete = 1;
...@@ -499,9 +499,9 @@ class GelSubmittedApplications extends ControllerBase ...@@ -499,9 +499,9 @@ class GelSubmittedApplications extends ControllerBase
if ( $applicantsAppModifyDisabled == "0" && if ( $applicantsAppModifyDisabled == "0" &&
( (
($eggrafesConfig->activate_second_period->value == $gelStudent->second_period ($eggrafesConfig->activate_second_period->value == $gelStudent->second_period
&& $gelStudent->changed >= $dateStartInt) && $gelStudent->created >= $dateStartInt)
|| //||
($this->isInvalidApp($gelStudent->id)) // ($this->isInvalidApp($gelStudent->id))
) )
) )
$canedit = '1'; $canedit = '1';
......
...@@ -75,9 +75,20 @@ class SdeDistribution extends ControllerBase ...@@ -75,9 +75,20 @@ class SdeDistribution extends ControllerBase
], Response::HTTP_FORBIDDEN); ], Response::HTTP_FORBIDDEN);
} elseif ($userRole === 'eduadmin') { } elseif ($userRole === 'eduadmin') {
$sCon = $this->connection->select('invalid_apps', 'invalid')
->fields('invalid', array('id', 'type'));
$inv_apps = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$invalid_ids = array();
foreach ($inv_apps as $app) {
array_push($invalid_ids, $app->id);
}
$sCon = $this->connection->select('gel_student', 'gStudent') $sCon = $this->connection->select('gel_student', 'gStudent')
->fields('gStudent', array('lastschool_registrynumber','lastschool_unittypeid', 'lastschool_class' , 'delapp','nextclass','name','am','regionarea','regiontk','regionaddress','id','second_period')) ->fields('gStudent', array('lastschool_registrynumber','lastschool_unittypeid', 'lastschool_class' , 'delapp','nextclass','name','am','regionarea','regiontk','regionaddress','id','second_period'))
->condition('gStudent.lastschool_unittypeid', 40 , '=') ->condition('gStudent.lastschool_unittypeid', 40 , '=')
//->condition('gStudent.id', $invalid_ids, 'IN')
//->condition(db_or()->condition('gStudent.id', $invalid_ids, 'IN')->condition('gStudent.created', 1535662800,">"))
->condition(db_or()->condition('gStudent.id', $invalid_ids, 'IN')->condition(db_and()->condition('gStudent.created', 1535662800,">")->condition('gStudent.created', 1544313600,"<")))
->condition('gStudent.delapp', 0, '='); ->condition('gStudent.delapp', 0, '=');
$sCon -> orderBy('gStudent.regionarea', 'DESC'); $sCon -> orderBy('gStudent.regionarea', 'DESC');
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); $studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
...@@ -337,11 +348,22 @@ class SdeDistribution extends ControllerBase ...@@ -337,11 +348,22 @@ class SdeDistribution extends ControllerBase
], Response::HTTP_FORBIDDEN); ], Response::HTTP_FORBIDDEN);
} elseif ($userRole === 'eduadmin') { } elseif ($userRole === 'eduadmin') {
$sCon = $this->connection->select('invalid_apps', 'invalid')
->fields('invalid', array('id', 'type'));
$inv_apps = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
$invalid_ids = array();
foreach ($inv_apps as $app) {
array_push($invalid_ids, $app->id);
}
$sCon = $this->connection->select('gel_student', 'gStudent'); $sCon = $this->connection->select('gel_student', 'gStudent');
$sCon->leftJoin('gel_school', 'gSchool', 'gSchool.registry_no = gStudent.lastschool_registrynumber'); $sCon->leftJoin('gel_school', 'gSchool', 'gSchool.registry_no = gStudent.lastschool_registrynumber');
$sCon->fields('gStudent', array('lastschool_registrynumber','lastschool_unittypeid', 'lastschool_class' , 'delapp','nextclass','am','regionarea','regiontk','regionaddress','id','second_period')) $sCon->fields('gStudent', array('lastschool_registrynumber','lastschool_unittypeid', 'lastschool_class' , 'delapp','nextclass','am','regionarea','regiontk','regionaddress','id','second_period'))
->fields('gSchool', array('id', 'name','edu_admin_id', 'registry_no','extra_unitid')) ->fields('gSchool', array('id', 'name','edu_admin_id', 'registry_no','extra_unitid'))
->condition('gStudent.delapp', 0, '=') ->condition('gStudent.delapp', 0, '=')
//->condition('gStudent.id', $invalid_ids, 'IN')
->condition(db_or()->condition('gStudent.id', $invalid_ids, 'IN')->condition(db_and()->condition('gStudent.created', 1535662800,">")->condition('gStudent.created', 1544313600,"<")))
->condition(db_or()->condition('gSchool.extra_unitid', 300 , '=') ->condition('gSchool.extra_unitid',1300,'=')); ->condition(db_or()->condition('gSchool.extra_unitid', 300 , '=') ->condition('gSchool.extra_unitid',1300,'='));
//->condition('gSchool.extra_unitid',300,'='); //->condition('gSchool.extra_unitid',300,'=');
$studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ); $studentPerSchool = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
...@@ -397,6 +419,67 @@ class SdeDistribution extends ControllerBase ...@@ -397,6 +419,67 @@ class SdeDistribution extends ControllerBase
); );
} }
$sCon = $this->connection->select('gel_student', 'gStudent');
$sCon->leftJoin('eepal_school_field_data', 'eSchool', 'eSchool.registry_no = gStudent.lastschool_registrynumber');
$sCon->fields('gStudent', array('lastschool_registrynumber','lastschool_unittypeid', 'lastschool_class' , 'delapp','nextclass','am','regionarea','regiontk','regionaddress','id','second_period'))
->fields('gStudent', array('lastschool_registrynumber','lastschool_unittypeid', 'lastschool_class' , 'created', 'delapp','nextclass','am','regionarea','regiontk','regionaddress','id','second_period'))
->fields('eSchool', array('id', 'name', 'registry_no','edu_admin_id'))
->condition('eSchool.edu_admin_id',59, '=')
->condition('gStudent.lastschool_unittypeid', 5 , '=')
->condition('gStudent.delapp', 0, '=')
->condition('gStudent.id', $invalid_ids, 'IN');
//->condition(db_or()->condition('gStudent.id', $invalid_ids, 'IN')->condition('gStudent.created', 1535662800,">"));
//->condition(db_or()->condition('gStudent.nextclass', "1")->condition('gStudent.nextclass', "4"));
$sCon -> orderBy('gStudent.id', 'DESC');
$studentPerSchoolfromepal = $sCon->execute()->fetchAll(\PDO::FETCH_OBJ);
foreach ($studentPerSchoolfromepal as $object) {
$i++;
$crypt = new Crypt();
try {
$regionaddress_decoded = $crypt->decrypt($object->regionaddress);
if ($object->regiontk !== null)
$regiontk_decoded = $crypt->decrypt($object->regiontk);
else
$regiontk_decoded = "";
if ($object->regionarea !== null)
$regionarea_decoded = ", ".$crypt->decrypt($object->regionarea);
else
$regionarea_decoded = null;
if ($object ->nextclass >= "4")
{
$school_type = "ΕΣΠΕΡΙΝΟ";
}
else{
$school_type = "ΗΜΕΡΗΣΙΟ";
}
$school_sourceName = $object->name;//$crypt->decrypt($object->name);
} catch (\Exception $e) {
$this->logger->warning(__METHOD__ . ' Decrypt error: ' . $e->getMessage());
return $this->respondWithStatus([
"message" => t("An unexpected error occured during DECODING data in getStudentPerSchool Method ")
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
$list[] = array(
'idnew' => $i,
'id' => $object ->id,
'regionaddress' => $regionaddress_decoded,
'regionarea' => $regionarea_decoded,
'regiontk'=>$regiontk_decoded,
'source_school'=>$school_sourceName,
'school_type'=>$school_type,
'oldschool' => $this->getSchoolperStudent($object->id),
);
}
return $this->respondWithStatus($list, Response::HTTP_OK); return $this->respondWithStatus($list, Response::HTTP_OK);
} }
......
...@@ -162,7 +162,7 @@ class CurrentUser extends ControllerBase ...@@ -162,7 +162,7 @@ class CurrentUser extends ControllerBase