Student application submit validation changes

parent ed27fc4c
......@@ -29,6 +29,15 @@ class ApplicationSubmit extends ControllerBase
const CERT_GYM = 'Απολυτήριο Γυμνασίου';
const CERT_LYK = 'Απολυτήριο Λυκείου';
const VALID_NAMES_PATTERN = '/^[A-Za-zΑ-ΩΆΈΉΊΙΎΌΏα-ωάέήίΐύόώ \-]*$/mu';
const VALID_UCASE_NAMES_PATTERN = '/^[A-ZΑ-Ω]{3,}[A-ZΑ-Ω \-]*$/mu';
const VALID_ADDRESS_PATTERN = '/^[0-9A-Za-zΑ-ΩΆΈΉΊΎΌΏα-ωάέήίύόώ\/\. \-]*$/mu';
const VALID_ADDRESSTK_PATTERN = '/^[0-9]{5}$/';
const VALID_DIGITS_PATTERN = '/^[0-9]*$/';
const VALID_TELEPHONE_PATTERN = '/^2[0-9]{9}$/';
const VALID_YEAR_PATTERN = '/^(19[6789][0-9]|20[0-1][0-9])$/';
const VALID_CAPACITY_PATTERN = '/[0-9]*$/';
protected $entityTypeManager;
protected $logger;
protected $connection;
......@@ -60,7 +69,8 @@ class ApplicationSubmit extends ControllerBase
);
}
public function appSubmit(Request $request) {
public function appSubmit(Request $request)
{
if (!$request->isMethod('POST')) {
return $this->respondWithStatus([
"error_code" => 2001
......@@ -69,11 +79,9 @@ class ApplicationSubmit extends ControllerBase
$applicationForm = array();
$content = $request->getContent();
if (!empty($content)) {
$applicationForm = json_decode($content, TRUE);
}
else {
$applicationForm = json_decode($content, true);
} else {
return $this->respondWithStatus([
"error_code" => 5002
], Response::HTTP_BAD_REQUEST);
......@@ -101,17 +109,15 @@ class ApplicationSubmit extends ControllerBase
$regionaddress_encoded = $crypt->encrypt($applicationForm[0]['regionaddress']);
$regiontk_encoded = $crypt->encrypt($applicationForm[0]['regiontk']);
$regionarea_encoded = $crypt->encrypt($applicationForm[0]['regionarea']);
//$certificatetype_encoded = $crypt->encrypt($applicationForm[0]['certificatetype']);
// $certificatetype_encoded = $crypt->encrypt($applicationForm[0]['certificatetype']);
$relationtostudent_encoded = $crypt->encrypt($applicationForm[0]['relationtostudent']);
$telnum_encoded = $crypt->encrypt($applicationForm[0]['telnum']);
$guardian_name_encoded = $crypt->encrypt($applicationForm[0]['cu_name']);
$guardian_surname_encoded = $crypt->encrypt($applicationForm[0]['cu_surname']);
$guardian_fathername_encoded = $crypt->encrypt($applicationForm[0]['cu_fathername']);
$guardian_mothername_encoded = $crypt->encrypt($applicationForm[0]['cu_mothername']);
}
catch (\Exception $e) {
} catch (\Exception $e) {
print_r($e->getMessage());
unset($crypt);
$this->logger->warning($e->getMessage());
return $this->respondWithStatus([
"error_code" => 5001
......@@ -125,7 +131,7 @@ class ApplicationSubmit extends ControllerBase
$authToken = $request->headers->get('PHP_AUTH_USER');
$epalUsers = $this->entityTypeManager->getStorage('epal_users')->loadByProperties(array('authtoken' => $authToken));
$epalUser = reset($epalUsers);
if (!$epalUser){
if (!$epalUser) {
return $this->respondWithStatus([
"error_code" => 4003
], Response::HTTP_FORBIDDEN);
......@@ -148,7 +154,6 @@ class ApplicationSubmit extends ControllerBase
'points' => 0,
'user_id' => $epalUser->user_id->target_id,
'epaluser_id' => $epalUser->id(),
'name' => $name_encoded,
'studentsurname' => $studentsurname_encoded,
'birthdate' => $applicationForm[0]['studentbirthdate'],
......@@ -157,8 +162,8 @@ class ApplicationSubmit extends ControllerBase
'regionaddress' => $regionaddress_encoded,
'regionarea' => $regionarea_encoded,
'regiontk' => $regiontk_encoded,
//'certificatetype' => $certificatetype_encoded,
//'graduation_year' => $applicationForm[0]['graduation_year'],
// 'certificatetype' => $certificatetype_encoded,
// 'graduation_year' => $applicationForm[0]['graduation_year'],
'lastschool_registrynumber' => $applicationForm[0]['lastschool_registrynumber'],
'lastschool_unittypeid' => $applicationForm[0]['lastschool_unittypeid'],
'lastschool_schoolname' => $applicationForm[0]['lastschool_schoolname'],
......@@ -172,11 +177,25 @@ class ApplicationSubmit extends ControllerBase
'agreement' => $applicationForm[0]['disclaimer_checked'],
'relationtostudent' => $relationtostudent_encoded,
'telnum' => $telnum_encoded,
'second_period' => $second_period,
);
if (($errorCode = $this->validateStudent($student)) > 0) {
if (($errorCode = $this->validateStudent(array_merge(
$student, [
'name' => $applicationForm[0]['name'],
'studentsurname' => $applicationForm[0]['studentsurname'],
'fatherfirstname' => $applicationForm[0]['fatherfirstname'],
'motherfirstname' => $applicationForm[0]['motherfirstname'],
'regionaddress' => $applicationForm[0]['regionaddress'],
'regiontk' => $applicationForm[0]['regiontk'],
'regionarea' => $applicationForm[0]['regionarea'],
'relationtostudent' => $applicationForm[0]['relationtostudent'],
'telnum' => $applicationForm[0]['telnum'],
'guardian_name' => $applicationForm[0]['cu_name'],
'guardian_surname' => $applicationForm[0]['cu_surname'],
'guardian_fathername' => $applicationForm[0]['cu_fathername'],
'guardian_mothername' => $applicationForm[0]['cu_mothername']
]))) > 0) {
return $this->respondWithStatus([
"error_code" => $errorCode
], Response::HTTP_OK);
......@@ -218,7 +237,6 @@ class ApplicationSubmit extends ControllerBase
$entity_storage_epalchosen->save($entity_object);
}
if ($applicationForm[0]['currentclass'] === "3" || $applicationForm[0]['currentclass'] === "4") {
$course = array(
'student_id' => $created_student_id,
......@@ -256,19 +274,17 @@ class ApplicationSubmit extends ControllerBase
return $res;
}
private function retrievePeriod() {
private function retrievePeriod()
{
$config_storage = $this->entityTypeManager->getStorage('epal_config');
$epalConfigs = $config_storage->loadByProperties(array('name' => 'epal_config'));
$epalConfig = reset($epalConfigs);
if (!$epalConfig)
return 0;
else
if (!$epalConfig) {
$secondPeriodEnabled = 0;
} else {
$secondPeriodEnabled = $epalConfig->activate_second_period->getString();
}
return $secondPeriodEnabled;
}
/**
......@@ -299,58 +315,51 @@ class ApplicationSubmit extends ControllerBase
(checkdate($date_parts[1], $date_parts[2], $date_parts[0]) !== true)) {
return 1003;
}
if (intval($date_parts[0]) >= 2003)
if (intval($date_parts[0]) >= 2003) {
return 1003;
}
$birthdate = "{$date_parts[2]}-{$date_parts[1]}-{$date_parts[0]}";
if (!$student["name"]) {
if (preg_match(self::VALID_UCASE_NAMES_PATTERN, $student["name"]) !== 1) {
return 1004;
}
if (!$student["studentsurname"]) {
if (preg_match(self::VALID_UCASE_NAMES_PATTERN, $student["studentsurname"]) !== 1) {
return 1005;
}
if (!$student["fatherfirstname"]) {
if (preg_match(self::VALID_UCASE_NAMES_PATTERN, $student["fatherfirstname"]) !== 1) {
return 1006;
}
if (!$student["motherfirstname"]) {
if (preg_match(self::VALID_UCASE_NAMES_PATTERN, $student["motherfirstname"]) !== 1) {
return 1007;
}
if (!$student["regionaddress"]) {
if (preg_match(self::VALID_ADDRESS_PATTERN, $student["regionaddress"]) !== 1) {
return 1008;
}
if (!$student["regiontk"]) {
if (preg_match(self::VALID_ADDRESSTK_PATTERN, $student["regiontk"]) !== 1) {
return 1009;
}
if (!$student["regionarea"]) {
if (preg_match(self::VALID_NAMES_PATTERN, $student["regionarea"]) !== 1) {
return 1010;
}
/*
if (!$student["certificatetype"]) {
return 1011;
}
if (!$student["graduation_year"]) {
return 1012;
}
*/
if (!$student["currentclass"] || ($student["currentclass"] !== "1" && $student["currentclass"] !== "2" && $student["currentclass"] !== "3" && $student["currentclass"] !== "4") ) {
if (!$student["currentclass"] || ($student["currentclass"] !== "1" && $student["currentclass"] !== "2" && $student["currentclass"] !== "3" && $student["currentclass"] !== "4")) {
return 1013;
}
if (!$student["relationtostudent"]) {
return 1014;
}
if (!$student["telnum"]) {
if (preg_match(self::VALID_TELEPHONE_PATTERN, $student["telnum"]) !== 1) {
return 1015;
}
if (!$student["guardian_name"]) {
if (preg_match(self::VALID_NAMES_PATTERN, $student["guardian_name"]) !== 1) {
return 1016;
}
if (!$student["guardian_surname"]) {
if (preg_match(self::VALID_NAMES_PATTERN, $student["guardian_surname"]) !== 1) {
return 1017;
}
if (!$student["guardian_fathername"]) {
if (preg_match(self::VALID_NAMES_PATTERN, $student["guardian_fathername"]) !== 1) {
return 1018;
}
if (!$student["guardian_mothername"]) {
if (preg_match(self::VALID_NAMES_PATTERN, $student["guardian_mothername"]) !== 1) {
return 1019;
}
if (!$student["lastschool_registrynumber"]) {
......
......@@ -16,13 +16,11 @@ class DirectorView extends ControllerBase
{
protected $entityTypeManager;
protected $logger;
// protected $testSchoolId='0640050';
public function __construct(
EntityTypeManagerInterface $entityTypeManager,
LoggerChannelFactoryInterface $loggerChannel
) {
$this->entityTypeManager = $entityTypeManager;
$this->logger = $loggerChannel->get('epal-school');
}
......@@ -35,8 +33,6 @@ class DirectorView extends ControllerBase
);
}
public function getStudentPerSchool(Request $request, $classId, $sector, $specialit)
{
try {
......@@ -68,7 +64,6 @@ class DirectorView extends ControllerBase
], Response::HTTP_FORBIDDEN);
}
$userRoles = $user->getRoles();
$userRole = '';
foreach ($userRoles as $tmpRole) {
......@@ -91,11 +86,10 @@ class DirectorView extends ControllerBase
}
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id' => $epalId, 'specialization_id' => $selectIdNew, 'currentclass' => $classId));
}
$i = 0;
if ($studentPerSchool) {
$list = array();
foreach ($studentPerSchool as $object) {
$studentId = intval($object->student_id ->getString());
$studentId = intval($object->student_id->getString());
$epalStudents = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('id' => $studentId));
$epalStudent = reset($epalStudents);
if ($epalStudents) {
......@@ -118,7 +112,6 @@ class DirectorView extends ControllerBase
}
}
$crypt = new Crypt();
try {
$name_decoded = $crypt->decrypt($epalStudent->name->value);
......@@ -142,7 +135,6 @@ class DirectorView extends ControllerBase
], Response::HTTP_INTERNAL_SERVER_ERROR);
}
$list[] = array(
'id' => $epalStudent->id(),
'name' => $name_decoded,
......@@ -173,7 +165,6 @@ class DirectorView extends ControllerBase
);
}
++$i;
}
return $this->respondWithStatus(
$list, Response::HTTP_OK);
......@@ -251,8 +242,6 @@ class DirectorView extends ControllerBase
}
}
public function SaveCapacity(Request $request, $taxi, $tomeas, $specialit)
{
if (!$request->isMethod('POST')) {
......@@ -365,8 +354,6 @@ class DirectorView extends ControllerBase
}
}
public function getSchools(Request $request)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
......@@ -402,8 +389,6 @@ class DirectorView extends ControllerBase
'name' => $object->name->value,
'status' => $status,
);
++$i;
}
return $this->respondWithStatus(
......@@ -420,7 +405,6 @@ class DirectorView extends ControllerBase
}
}
public function getCoursesPerSchool(Request $request, $schoolid)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
......@@ -446,7 +430,6 @@ class DirectorView extends ControllerBase
$SchoolCats = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $schoolid, 'edu_admin_id' => $newid));
}
$SchoolCat = reset($SchoolCats);
if ($SchoolCat) {
$list = array();
......@@ -455,8 +438,6 @@ class DirectorView extends ControllerBase
}
$CourseA = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $schoolid));
if ($CourseA) {
$limit_down = $this->entityTypeManager->getStorage('epal_class_limits')->loadByProperties(array('name' => 1, 'category' => $categ));
$limitdown = reset($limit_down);
......@@ -522,7 +503,7 @@ class DirectorView extends ControllerBase
);
}
}
if ($CourseC && $operation_shift != 'ΗΜΕΡΗΣΙΟ' ) {
if ($CourseC && $operation_shift != 'ΗΜΕΡΗΣΙΟ') {
$limit_down = $this->entityTypeManager->getStorage('epal_class_limits')->loadByProperties(array('name' => 4, 'category' => $categ));
$limitdown = reset($limit_down);
if ($limitdown) {
......@@ -568,8 +549,8 @@ class DirectorView extends ControllerBase
if ($SchoolCat) {
$categ = $SchoolCat->metathesis_region->value;
}
$CourseA = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('id' => $schoolid));
$CourseA = $this->entityTypeManager->getStorage('epal_student')->loadByProperties(array('id' => $schoolid));
if ($CourseA) {
$limit_down = $this->entityTypeManager->getStorage('epal_class_limits')->loadByProperties(array('name' => 1, 'category' => $categ));
$limitdown = reset($limit_down);
......@@ -578,12 +559,10 @@ class DirectorView extends ControllerBase
}
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => -1, 'currentclass' => 1));
//foreach ($CourseA as $object) {
if (sizeof($studentPerSchool) < $limit) {
return false;
// exit;
}
} // }
}
$CourseB = $this->entityTypeManager->getStorage('eepal_sectors_in_epal')->loadByProperties(array('epal_id' => $schoolid));
if ($CourseB) {
......@@ -598,10 +577,10 @@ class DirectorView extends ControllerBase
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $sectorid, 'currentclass' => 2));
if (sizeof($studentPerSchool) < $limit) {
return false;
exit;
}
}
}
$CourseC = $this->entityTypeManager->getStorage('eepal_specialties_in_epal')->loadByProperties(array('epal_id' => $schoolid));
if ($CourseC) {
$limit_down = $this->entityTypeManager->getStorage('epal_class_limits')->loadByProperties(array('name' => 3, 'category' => $categ));
......@@ -616,7 +595,6 @@ class DirectorView extends ControllerBase
if (sizeof($studentPerSchool) < $limit) {
return false;
exit;
}
}
}
......@@ -638,14 +616,10 @@ class DirectorView extends ControllerBase
$school = reset($schools);
if (!$school) {
$this->logger->warning('no access to this school='.$user->id());
$response = new Response();
$response->setContent('No access to this school');
$response->setStatusCode(Response::HTTP_FORBIDDEN);
$response->headers->set('Content-Type', 'application/json');
return $response;
return $this->respondWithStatus(['message' => 'No access to this school'], Response::HTTP_FORBIDDEN);
}
$operation_shift = $school -> operation_shift -> value;
$operation_shift = $school->operation_shift->value;
$userRoles = $user->getRoles();
$userRole = '';
foreach ($userRoles as $tmpRole) {
......@@ -654,15 +628,13 @@ class DirectorView extends ControllerBase
}
}
if ($userRole === '') {
return $this->respondWithStatus([
'error_code' => 4003,
], Response::HTTP_FORBIDDEN);
return $this->respondWithStatus(['error_code' => 4003], Response::HTTP_FORBIDDEN);
} elseif ($userRole === 'epal') {
$categ = $school->metathesis_region->value;
$list = array();
$CourseA = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $schoolid));
$classcapacity = reset($CourseA);
if ($classcapacity) {
$list[] = array(
'class' => 1,
......@@ -671,10 +643,10 @@ class DirectorView extends ControllerBase
'taxi' => 'Ά Λυκείου',
'capacity' => $classcapacity->capacity_class_a->value,
'globalindex' => $i,
);
}
++$i;
$CourseB = $this->entityTypeManager->getStorage('eepal_sectors_in_epal')->loadByProperties(array('epal_id' => $schoolid));
if ($CourseB) {
foreach ($CourseB as $object) {
......@@ -695,6 +667,7 @@ class DirectorView extends ControllerBase
++$i;
}
}
$CourseC = $this->entityTypeManager->getStorage('eepal_specialties_in_epal')->loadByProperties(array('epal_id' => $schoolid));
if ($CourseC) {
foreach ($CourseC as $object) {
......@@ -709,7 +682,6 @@ class DirectorView extends ControllerBase
'taxi' => 'Γ Λυκείου '.$object->specialty_id->entity->get('name')->value,
'capacity' => $classcapacity->capacity_class_specialty->value,
'globalindex' => $i,
);
}
++$i;
......@@ -736,17 +708,13 @@ class DirectorView extends ControllerBase
}
}
return $this->respondWithStatus(
$list, Response::HTTP_OK);
return $this->respondWithStatus($list, Response::HTTP_OK);
}
} else {
return $this->respondWithStatus([
'message' => t('EPAL user not found'),
], Response::HTTP_FORBIDDEN);
return $this->respondWithStatus(['message' => t('EPAL user not found')], Response::HTTP_FORBIDDEN);
}
}
public function FindCoursesPerSchool(Request $request)
{
$i = 0;
......@@ -782,8 +750,8 @@ class DirectorView extends ControllerBase
} elseif ($userRole === 'epal') {
$categ = $school->metathesis_region->value;
$list = array();
$CourseA = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $schoolid));
$CourseA = $this->entityTypeManager->getStorage('eepal_school')->loadByProperties(array('id' => $schoolid));
if ($CourseA) {
$limit_down = $this->entityTypeManager->getStorage('epal_class_limits')->loadByProperties(array('name' => 1, 'category' => $categ));
$limitdown = reset($limit_down);
......@@ -803,6 +771,7 @@ class DirectorView extends ControllerBase
);
}
++$i;
$CourseB = $this->entityTypeManager->getStorage('eepal_sectors_in_epal')->loadByProperties(array('epal_id' => $schoolid));
if ($CourseB) {
$limit_down = $this->entityTypeManager->getStorage('epal_class_limits')->loadByProperties(array('name' => 2, 'category' => $categ));
......@@ -814,8 +783,6 @@ class DirectorView extends ControllerBase
foreach ($CourseB as $object) {
$sectorid = $object->sector_id->entity->id();
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $sectorid, 'currentclass' => 2));
$list[] = array(
'class' => 2,
'newsector' => $object->sector_id->entity->id(),
......@@ -829,6 +796,7 @@ class DirectorView extends ControllerBase
++$i;
}
}
$CourseC = $this->entityTypeManager->getStorage('eepal_specialties_in_epal')->loadByProperties(array('epal_id' => $schoolid));
if ($CourseC) {
$limit_down = $this->entityTypeManager->getStorage('epal_class_limits')->loadByProperties(array('name' => 3, 'category' => $categ));
......@@ -839,7 +807,6 @@ class DirectorView extends ControllerBase
foreach ($CourseC as $object) {
$specialityid = $object->specialty_id->entity->id();
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $specialityid, 'currentclass' => 3));
$list[] = array(
'class' => 3,
'newsector' => 0,
......@@ -849,7 +816,6 @@ class DirectorView extends ControllerBase
'limitdown' => $limit,
'size' => sizeof($studentPerSchool),
);
++$i;
}
}
......@@ -863,7 +829,6 @@ class DirectorView extends ControllerBase
foreach ($CourseC as $object) {
$specialityid = $object->specialty_id->entity->id();
$studentPerSchool = $this->entityTypeManager->getStorage('epal_student_class')->loadByProperties(array('epal_id' => $schoolid, 'specialization_id' => $specialityid, 'currentclass' => 4));
$list[] = array(
'class' => 4,
'newsector' => 0,
......@@ -872,15 +837,12 @@ class DirectorView extends ControllerBase
'globalindex' => $i,
'limitdown' => $limit,
'size' => sizeof($studentPerSchool),
);
++$i;
}
}
return $this->respondWithStatus(
$list, Response::HTTP_OK);
return $this->respondWithStatus($list, Response::HTTP_OK);
}
} else {
return $this->respondWithStatus([
......
......@@ -24,12 +24,9 @@
<form novalidate [formGroup]="studentDataGroup" #form>
<p style="margin-top: 20px; line-height: 2em;"> Συμπληρώστε με κεφαλαία γράμματα τα στοιχεία του μαθητή και στη συνέχεια επιλέξτε <i>Συνέχεια</i>. <strong>Προσοχη!</strong> Συμπληρώσετε τα στοιχεία ακριβώς όπως είναι στον τελευταίο τίτλο κτήσης απολυτηρίου/ πτυχίου του μαθητή.</p>
<p style="margin-top: 20px; line-height: 2em;"> <b> Η ακρίβεια των στοιχείων που υποβάλλονται με αυτή τη δήλωση μπορεί να ελεγχθεί με βάση το αρχείο άλλων υπηρεσιών (άρθρο 8 παρ. 4 Ν. 1599/1986)</b></p>
<p style="margin-top: 20px; line-height: 2em;"> <b> Όλα τα πεδία που συνοδεύονται από (*) είναι απαραίτητο να συμπληρωθούν</b></p>
<p style="margin-top: 20px; line-height: 2em;">Συμπληρώστε με κεφαλαία γράμματα τα στοιχεία του μαθητή και στη συνέχεια επιλέξτε <i>Συνέχεια</i>. <strong>Προσοχη!</strong> Συμπληρώσετε τα στοιχεία ακριβώς όπως είναι στον τελευταίο τίτλο κτήσης απολυτηρίου/ πτυχίου του μαθητή.</p>
<p style="margin-top: 20px; line-height: 2em;"><strong>Η ακρίβεια των στοιχείων που υποβάλλονται με αυτή τη δήλωση μπορεί να ελεγχθεί με βάση το αρχείο άλλων υπηρεσιών (άρθρο 8 παρ. 4 Ν. 1599/1986).</strong></p>
<p style="margin-top: 20px; line-height: 2em;"><strong>Όλα τα πεδία που συνοδεύονται από (*) είναι απαραίτητο να συμπληρωθούν.<br/>Παρακαλούμε συμπληρώνετε τα στοιχεία με κεφαλαίους χαρακτήρες.</strong></p>
<div *ngFor="let loginInfoRow$ of loginInfo$ | async; let i=index;" style="margin-bottom: 20px;">
<div class="row evenin" style="margin: 0px 2px 0px 2px; line-height: 2em;">
......@@ -70,7 +67,7 @@
Το πεδίο δεν μπορεί να αφεθεί κενό!
</div>
<div class="alert alert-danger" *ngIf="studentDataGroup.get('regiontk').dirty && studentDataGroup.get('regiontk').hasError('pattern')">
Δεν επιτρέπονται γράμματα αλφαβήτου ή μη έγκυροι χαρακτήρες σε αυτό το πεδίο!
Ο ταχυδρομικός κώδικας αποτελείται από πέντε (5) αριθμητικά ψηφία!
</div>
</td>
<td>
......
import { Component, OnInit, OnDestroy } from '@angular/core';
import { BehaviorSubject, Subscription, Observable } from 'rxjs/Rx';
import { Component, OnInit, OnDestroy } from "@angular/core";
import { BehaviorSubject, Subscription, Observable } from "rxjs/Rx";
import { Injectable } from "@angular/core";
import { Router } from '@angular/router';
import { NgRedux, select } from 'ng2-redux';
import { StudentDataFieldsActions } from '../../actions/studentdatafields.actions';
import { IStudentDataFields } from '../../store/studentdatafields/studentdatafields.types';
import { CriteriaActions } from '../../actions/criteria.actions';
import { ICriter } from '../../store/criteria/criteria.types';
import { IAppState } from '../../store/store';
import { VALID_NAMES_PATTERN, VALID_ADDRESS_PATTERN, VALID_ADDRESSTK_PATTERN, VALID_DIGITS_PATTERN,
VALID_DATE_PATTERN, FIRST_SCHOOL_YEAR, VALID_YEAR_PATTERN, VALID_TELEPHONE_PATTERN } from '../../constants';
import { STUDENT_DATA_FIELDS_INITIAL_STATE } from '../../store/studentdatafields/studentdatafields.initial-state';
import { CRITERIA_INITIAL_STATE } from '../../store/criteria/criteria.initial-state';
import { ILoginInfo, ILoginInfoToken } from '../../store/logininfo/logininfo.types';
import { LOGININFO_INITIAL_STATE } from '../../store/logininfo/logininfo.initial-state';
import {IMyDpOptions} from 'mydatepicker';
import {Http, RequestOptions} from '@angular/http';
import { Router } from "@angular/router";
import { NgRedux, select } from "ng2-redux";
import { StudentDataFieldsActions } from "../../actions/studentdatafields.actions";
import { IStudentDataFields } from "../../store/studentdatafields/studentdatafields.types";
import { CriteriaActions } from "../../actions/criteria.actions";
import { ICriter } from "../../store/criteria/criteria.types";
import { IAppState } from "../../store/store";
import { VALID_NAMES_PATTERN, VALID_UCASE_NAMES_PATTERN, VALID_ADDRESS_PATTERN, VALID_ADDRESSTK_PATTERN, VALID_DIGITS_PATTERN,
VALID_DATE_PATTERN, FIRST_SCHOOL_YEAR, VALID_YEAR_PATTERN, VALID_TELEPHONE_PATTERN } from "../../constants";
import { STUDENT_DATA_FIELDS_INITIAL_STATE } from "../../store/studentdatafields/studentdatafields.initial-state";
import { CRITERIA_INITIAL_STATE } from "../../store/criteria/criteria.initial-state";
import { ILoginInfo, ILoginInfoToken } from "../../store/logininfo/logininfo.types";
import { LOGININFO_INITIAL_STATE } from "../../store/logininfo/logininfo.initial-state";
import {IMyDpOptions} from "mydatepicker";
import {Http, RequestOptions} from "@angular/http";
import {
FormBuilder,
......@@ -23,11 +23,11 @@ import {
FormControl,
FormArray,
Validators,
} from '@angular/forms';
} from "@angular/forms";
@Component({
selector: 'application-form-main',
templateUrl: './application.form.main.html'