Add code for registration workflow

This commit is contained in:
Artur Savitskiy 2024-04-29 16:09:02 +02:00
parent 946f0d6bb8
commit ce25e4e6d0
7 changed files with 255 additions and 127 deletions

View File

View File

@ -0,0 +1,70 @@
<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
require_once('../../utils/config.php');
require_once('../../utils/db.php');
require_once('../../utils/tools.php');
$method = $_SERVER['REQUEST_METHOD'];
if ('POST' === $method) {
parse_str(file_get_contents('php://input'), $_POST);
}
$connection = connect();
$rid = intval($_POST["rid"]);
$firstname = escape($connection, $_POST["firstname"]);
$lastname = escape($connection, $_POST["lastname"]);
$birthday = escape($connection, $_POST["birthday"]);
$gender = intval($_POST["gender"]);
$street = escape($connection, $_POST["street"]);
$house = intval($_POST["house"]);
$zip = escape($connection, $_POST["zip"]);
$city = escape($connection, $_POST["city"]);
$phone = escape($connection, $_POST["phone"]);
$email = escape($connection, $_POST["email"]);
$accountHolder = escape($connection, $_POST["accountHolder"]);
$iban = escape($connection, $_POST["iban"]);
$bic = escape($connection, $_POST["bic"]);
$bank = escape($connection, $_POST["bank"]);
$applicationConsent = intval($_POST["applicationConsent"]);
$dataChangeConsent = intval($_POST["dataChangeConsent"]);
$privacyPolicyConsent = intval($_POST["privacyPolicyConsent"]);
$directDebitConsent = intval($_POST["directDebitConsent"]);
$returnDebitConsent = intval($_POST["returnDebitConsent"]);
$dataStorageConsent = intval($_POST["dataStorageConsent"]);
$multimediaConsent = intval($_POST["multimediaConsent"]);
$querystr = "SELECT * FROM li_registrations
WHERE li_registrations.rid = ${rid}";
$result = mysqli_query($connection, $querystr);
if($result->num_rows !== 0) {
$querystr = "UPDATE li_registrations SET firstname='${firstname}', lastname='${lastname}', birthday='${birthday}',
gender=${gender}, street='${street}', house=${house},
zip='${zip}', city='${city}', phone='${phone}', email='${email}',
accountholder='${accountHolder}', iban='${iban}', bic='${bic}', bank='${bank}',
applicationconsent=${applicationconsent}, datachangeconsent=${datachangeconsent}, privacypolicyconsent=${privacypolicyconsent},
returndebitconsent=${returndebitconsent}, datastorageconsent=${datastorageconsent}, multimediaconsent=${multimediaconsent},
WHERE rid=${rid}";
} else {
$querystr = "INSERT INTO li_registrations (firstname, lastname, birthday, gender, street, house, zip, city, phone, email,
accountholder, iban, bic, bank,
applicationconsent, datachangeconsent, privacypolicyconsent,
returndebitconsent, datastorageconsent, multimediaconsent)
VALUES('{$firstname}', '{$lastname}', '{$birthday}', {$gender}, '{$street}', {$house}, '{$house_suffix}', '{$zip}', '{$city}', '{$phone}', '{$email}'.
'${accountHolder}', '${iban}', '${bic}', '${bank}',
${applicationconsent}, ${datachangeconsent}, ${privacypolicyconsent},
${returndebitconsent}, ${datastorageconsent}, ${multimediaconsent})";
}
$result = mysqli_query($connection, $querystr);
echo json_encode('{ "result": "' . $result . '" }');
?>

View File

@ -2,74 +2,92 @@
<mat-stepper>
<!-- Step 1-->
<mat-step [stepControl]="firstFormGroup">
<form [formGroup]="firstFormGroup" class="flexContainerRow">
<form [formGroup]="firstFormGroup" class="flexContainerColumn width50">
<ng-template matStepLabel>Persönliche Informationen</ng-template>
<div class="leftContainer">
<mat-form-field appearance="fill">
<mat-label>Name</mat-label>
<input
matInput
formControlName="firstName"
placeholder="Name"
required />
</mat-form-field>
<div class="flexContainerRow">
<div class="leftContainer">
<mat-form-field appearance="fill">
<mat-label>Name</mat-label>
<input
matInput
formControlName="firstName"
placeholder="Name"
required />
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Nachname</mat-label>
<input
matInput
formControlName="lastName"
placeholder="Nachname"
required />
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Nachname</mat-label>
<input
matInput
formControlName="lastName"
placeholder="Nachname"
required />
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Geburtstag</mat-label>
<input
matInput
[matDatepicker]="birthdatePicker"
formControlName="birthdate"
placeholder="DD.MM.YYYY"
required />
<mat-datepicker-toggle
matSuffix
[for]="birthdatePicker"></mat-datepicker-toggle>
<mat-datepicker
#birthdatePicker
startView="multi-year"></mat-datepicker>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Geburtstag</mat-label>
<input
matInput
[matDatepicker]="birthdatePicker"
formControlName="birthdate"
placeholder="DD.MM.YYYY"
required />
<mat-datepicker-toggle
matSuffix
[for]="birthdatePicker"></mat-datepicker-toggle>
<mat-datepicker
#birthdatePicker
startView="multi-year"></mat-datepicker>
</mat-form-field>
<mat-form-field>
<mat-label>Geschlecht</mat-label>
<mat-select formControlName="gender" required >
<mat-option value="male">männlich</mat-option>
<mat-option value="female">weiblich</mat-option>
<mat-option value="divers">divers</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="rightContainer">
<mat-form-field appearance="fill">
<mat-label>Adresse</mat-label>
<input matInput formControlName="address" required />
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Postleitzahl</mat-label>
<input matInput formControlName="postalCode" required />
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Telefon</mat-label>
<input matInput formControlName="phone" required/>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>E-Mail</mat-label>
<input matInput formControlName="email" required />
<mat-error>Ungültige E-Mail Adresse</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Geschlecht</mat-label>
<mat-select formControlName="gender" required >
<mat-option value="0">männlich</mat-option>
<mat-option value="1">weiblich</mat-option>
<mat-option value="2">divers</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>E-Mail</mat-label>
<input matInput formControlName="email" required />
<mat-error>Ungültige E-Mail Adresse</mat-error>
</mat-form-field>
</div>
<div class="rightContainer">
<mat-form-field appearance="fill">
<mat-label>Straße</mat-label>
<input matInput formControlName="street" required />
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Hausnummer</mat-label>
<input matInput formControlName="house" required />
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Postleitzahl</mat-label>
<input matInput formControlName="postalCode" required />
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Stadt</mat-label>
<input matInput formControlName="city" required />
</mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Telefon</mat-label>
<input matInput formControlName="phone" required/>
</mat-form-field>
</div>
</div>
<div class="flexContainerColumn whitebox">
<mat-checkbox formControlName="applicationConsent" required><span [innerHTML]="infoTextAufnahme"></span></mat-checkbox>
<br style="margin-bottom: 20px;">
<mat-checkbox formControlName="dataChangeConsent" required><span [innerHTML]="infoTextDataChange"></span></mat-checkbox>
<br style="margin-bottom: 20px;">
<mat-checkbox formControlName="privacyPolicyConsent" required><span [innerHTML]="infoTextPrivacyPolicy"></span></mat-checkbox>
</div>
</form>
<div class="buttonsContainer">
<button
@ -83,7 +101,7 @@
<!-- Step 2-->
<mat-step [stepControl]="secondFormGroup">
<form [formGroup]="secondFormGroup" class="flexContainerColumn width50">
<ng-template matStepLabel>Bank Informationen</ng-template>
<ng-template matStepLabel>Zahlungsinformationen</ng-template>
<div class="flexContainerRow">
<div class="leftContainer">
<mat-form-field appearance="fill">
@ -110,9 +128,10 @@
</div>
</div>
<div class="flexContainerColumn">
<textarea cols="30" rows="7" readonly>{{infoTextEinzugermaechtigung}}</textarea>
<mat-checkbox formControlName="directDebitAuthorization" required>Einzugsermächtigung</mat-checkbox>
<div class="flexContainerColumn whitebox">
<mat-checkbox formControlName="directDebitConsent" required><span [innerHTML]="infoTextEinzugermaechtigung"></span></mat-checkbox>
<br style="margin-bottom: 20px;">
<mat-checkbox formControlName="returnDebitConsent" required><span [innerHTML]="infoTextReturnDebit"></span></mat-checkbox>
</div>
</form>
@ -130,31 +149,26 @@
<mat-step>
<form [formGroup]="thirdFormGroup" class="flexContainerColumn width50">
<ng-template matStepLabel>Einwilligung</ng-template>
<div class="flexContainerColumn">
<textarea cols="30" rows="10" readonly>{{infoTextEinwilligungserklaerung}}</textarea>
<mat-checkbox formControlName="consent" required
>Einwilligung zur Erhebung, Speicherung, Verarbeitung und Nutzung von
personenbezogenen Daten
</mat-checkbox>
<div class="flexContainerColumn whitebox">
<p>{{infoTextEinwilligungserklaerung}}</p>
<mat-checkbox formControlName="dataStorageConsent" required>Einwilligung zur Erhebung, Speicherung, Verarbeitung und Nutzung von personenbezogenen Daten</mat-checkbox>
</div>
<br style="margin-bottom: 20px;">
<div class="flexContainerColumn">
<textarea cols="30" rows="10" readonly>{{infoTextEinverstaendniserklaerung}}</textarea>
<mat-checkbox formControlName="declarationOfConsent" required
>Einverständniserklärung zur Nutzung von Bild- und Videomaterial
</mat-checkbox>
<div class="flexContainerColumn whitebox">
<p>{{infoTextEinverstaendniserklaerung}}</p>
<mat-checkbox formControlName="multimediaConsent" required>Einverständniserklärung zur Nutzung von Bild- und Videomaterial</mat-checkbox>
</div>
</form>
<div class="buttonsContainer">
<button mat-button matStepperPrevious class="backButton">Zurück</button>
<button
<button color="warn"
mat-button
matStepperNext
[disabled]="thirdFormGroup.status == 'INVALID'"
(click)="submit()"
>
Fertig
Kostenpflichtig anmelden
</button>
</div>
</mat-step>

View File

@ -45,9 +45,24 @@
margin-right: 10px;
}
.whitebox {
background-color: white;
border: gray;
padding: 1em;
margin-bottom: 1em;
p {
text-align: justify;
}
}
textarea {
font-family: inherit;
padding: 5px;
resize: none;
}
.buttonsContainer {
display: flex;
justify-content: right;
}

View File

@ -25,40 +25,49 @@ export class StudentRegisterComponent implements OnInit {
firstFormGroup!: FormGroup;
secondFormGroup!: FormGroup;
thirdFormGroup!: FormGroup;
infoTextAufnahme = 'Ich erkläre mich damit einverstanden, dass die Tanz- und Sportschule Li-Dance, ' +
'Inh. Lydia Kolepp die vorstehend angegebenen, zur Einzahlungsvollmacht notwendigen Daten speichert.';
infoTextDataChange = 'Änderungen der Anschrift, der Kontaktdaten, der Bankverbindung werde ich unverzüglich bekannt geben. ';
infoTextPrivacyPolicy = 'Die <a href="https://li-dance.de/files/dokumente/li-dance-agb.pdf" target="_blank">allgemeinen Geschäftsbedingungen</a> und die <a href="https://li-dance.de/datenschutz.html" target="_blank">Datenschutzerklärung</a> habe ich gelesen und akzeptiere diese.';
infoTextEinzugermaechtigung =
'Hiermit ermächtige ich die Tanz- und Sportschule Li-Dance, Inh. Lydia Kolepp (nachfolgend Li-Dance) die Monatsbeiträge i.H.v. oben genannten Betrag, diverse Einmalzahlungen und sonstige' +
'Verbindlichkeiten zu Lasten meines Kontos einzuziehen.' +
'Bitte beachten Sie, dass im Falle einer unberechtigten Rücklastschrift Li-Dance ein' +
'Verwaltungsaufwand entsteht und eine Gebühr i.H.v. derzeit 15,- € berechnet wird. Diese Gebühr' +
'wird zusammen mit dem nachfolgenden Monatsbeitrag vom gleichen Konto abgebucht.';
'Ich ermächtige die Tanz- und Sportschule Li-Dance, Inh. Lydia Kolepp die Monatsbeiträge, diverse Einmalzahlungen und sonstige ' +
'Verbindlichkeiten gem. unseres <a href="https://li-dance.de/files/dokumente/li-dance-preisverzeichnis.pdf" target="_blank">Preis- und Leistungsverzeichnisses</a> zu Lasten meines Kontos einzuziehen. ';
infoTextReturnDebit = 'Ich habe verstanden und akzeptiere, dass im Falle einer unberechtigten Rücklastschrift Li-Dance ein ' +
'Verwaltungsaufwand entsteht und eine Gebühr i.H.v. 15,- € berechnet wird. Diese Gebühr wird zusammen mit dem nachfolgenden Monatsbeitrag ' +
'vom gleichen Konto ohne erneute Erinnerung abgebucht.';
infoTextEinwilligungserklaerung =
'Ich bin darüber informiert worden, dass meine personenbezogenen Daten aufgrund rechtlicher' +
'Vorgaben mindestens 10 Jahre nach Vertragsende aufbewahrt werden müssen.' +
'Ich bin damit einverstanden, dass die oben genannten personenbezogenen Daten zu den oben' +
'genannten Zwecken erhoben, gespeichert, verarbeitet, genutzt und ggfs. weitergegeben werden.' +
'Ich bin darauf hingewiesen worden, dass die im Rahmen der vorstehend genannten Zwecke' +
'Ich bin darüber informiert worden, dass meine personenbezogenen Daten aufgrund rechtlicher ' +
'Vorgaben mindestens 10 Jahre nach Vertragsende aufbewahrt werden müssen. ' +
'Ich bin damit einverstanden, dass die oben genannten personenbezogenen Daten zu den oben ' +
'genannten Zwecken erhoben, gespeichert, verarbeitet, genutzt und ggfs. weitergegeben werden. ' +
'Ich bin darauf hingewiesen worden, dass die im Rahmen der vorstehend genannten Zwecke ' +
'erhobenen persönlichen Daten meiner Person unter Beachtung der EU-' +
'Datenschutzgrundverordnung (DSGVO) erhoben, gespeichert, genutzt und übermittelt werden.' +
'Ich bin zudem darauf hingewiesen worden, dass die Erhebung, Speicherung, Verarbeitung und' +
'Nutzung meiner Daten auf freiwilliger Basis erfolgt.' +
'Ich bin darüber informiert worden, dass diese Einverständniserklärung jederzeit mit sofortiger' +
'Wirkung verweigert, bzw. jederzeit mit Wirkung für die Zukunft widerrufen werden kann. Meine' +
'Datenschutzgrundverordnung (DSGVO) erhoben, gespeichert, genutzt und übermittelt werden. ' +
'Ich bin zudem darauf hingewiesen worden, dass die Erhebung, Speicherung, Verarbeitung und ' +
'Nutzung meiner Daten auf freiwilliger Basis erfolgt. ' +
'Ich bin darüber informiert worden, dass diese Einverständniserklärung jederzeit mit sofortiger ' +
'Wirkung verweigert, bzw. jederzeit mit Wirkung für die Zukunft widerrufen werden kann. Meine ' +
'Widerrufserklärung werde ich richten an die unten angegebene Adresse';
infoTextEinverstaendniserklaerung =
'Ich bin damit einverstanden, dass Bilder und Videos der Tanzschule und der Veranstaltungen,' +
'die durch die Tanzschule organisiert sind und/oder an denen die Tanzschule teilnimmt, auf' +
'denen ich selbst, mein Sohn oder meine Tochter zu sehen ist auf den Webseiten von Li-Dance und in anderen Online- und/oder Printmedien veröffentlicht' +
'werden und für Werbezwecke von Li-Dance genutzt werden dürfen. Rechtsgrundlage: Das Recht am eigenen Bild ist ein Teil des vom Gesetz geschützten' +
'allgemeinen Persönlichkeitsrechts (§22 Kunsturheberrechtsgesetz). Es gilt der Grundsatz, dass' +
'Bild- und Video-Material nur mit Einwilligung des Abgebildeten verbreitet oder veröffentlicht' +
'werden kann. Es handelt sich hierbei um eine rechtsgeschäftliche Willenserklärung. Deshalb' +
'kann bei Minderjährigen eine Einwilligung nur durch den gesetzlichen Vertreter erfolgen.' +
'Diese Einverständniserklärung kann mit sofortiger Wirkung verweigert, bzw. jederzeit mit' +
'Wirkung für die Zukunft widerrufen werden. Ein Widerruf kann einen Ausschluss aus der' +
'Ich bin damit einverstanden, dass Bilder und Videos der Tanzschule und der Veranstaltungen, ' +
'die durch die Tanzschule organisiert sind und/oder an denen die Tanzschule teilnimmt, auf ' +
'denen ich selbst, mein Sohn oder meine Tochter zu sehen ist auf den Webseiten von Li-Dance und in anderen Online- und/oder Printmedien veröffentlicht ' +
'werden und für Werbezwecke von Li-Dance genutzt werden dürfen. Rechtsgrundlage: Das Recht am eigenen Bild ist ein Teil des vom Gesetz geschützten ' +
'allgemeinen Persönlichkeitsrechts (§22 Kunsturheberrechtsgesetz). Es gilt der Grundsatz, dass ' +
'Bild- und Video-Material nur mit Einwilligung des Abgebildeten verbreitet oder veröffentlicht ' +
'werden kann. Es handelt sich hierbei um eine rechtsgeschäftliche Willenserklärung. Deshalb ' +
'kann bei Minderjährigen eine Einwilligung nur durch den gesetzlichen Vertreter erfolgen. ' +
'Diese Einverständniserklärung kann mit sofortiger Wirkung verweigert, bzw. jederzeit mit ' +
'Wirkung für die Zukunft widerrufen werden. Ein Widerruf kann einen Ausschluss aus der ' +
'jeweiligen Veranstaltung zur Folge haben.' +
'Ein späterer rückwirkender Widerruf für aktuell stattfindende bzw. bereits stattgefundene' +
'Ein späterer rückwirkender Widerruf für aktuell stattfindende bzw. bereits stattgefundene ' +
'Veranstaltungen ist ausgeschlossen.';
constructor(private _formBuilder: FormBuilder, private registerService: RegisterService) {}
@ -69,11 +78,16 @@ export class StudentRegisterComponent implements OnInit {
firstName: ['', Validators.required],
lastName: ['', Validators.required],
birthdate: ['', Validators.required],
postalCode: ['', [Validators.required, Validators.pattern(/^\d+$/)]], //^: Asserts the start of the string. \d+: Matches one or more digits.$: Asserts the end of the string.
address: ['', Validators.required],
street: ['', Validators.required],
house: ['', Validators.required, Validators.pattern("^[0-9]*$")],
zip: ['', [Validators.required, Validators.pattern(/^\d+$/)]], //^: Asserts the start of the string. \d+: Matches one or more digits.$: Asserts the end of the string.
city: ['', Validators.required],
phone: ['', [Validators.required, Validators.pattern(/^(\+?\d{1,3})?[ ]*\d{9,}$/)]],
gender: ['', Validators.required],
email: ['', [Validators.required, Validators.email]],
applicationConsent: ['', Validators.required],
dataChangeConsent: ['', Validators.required],
privacyPolicyConsent: ['', Validators.required],
});
this.secondFormGroup = this._formBuilder.group({
@ -81,12 +95,13 @@ export class StudentRegisterComponent implements OnInit {
iban: ['', [Validators.required, ValidatorService.validateIban]],
bic: ['', [Validators.required, Validators.pattern(/^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/)]],
nameOfFinancialInstitute: ['', Validators.required],
directDebitAuthorization: ['', Validators.required],
directDebitConsent: ['', Validators.required],
returnDebitConsent: ['', Validators.required],
});
this.thirdFormGroup = this._formBuilder.group({
consent: ['', Validators.required],
declarationOfConsent: ['', Validators.required],
dataStorageConsent: ['', Validators.required],
multimediaConsent: ['', Validators.required],
});
this.secondFormGroup.get("iban")?.valueChanges.subscribe(value => {
@ -115,24 +130,31 @@ export class StudentRegisterComponent implements OnInit {
firstName: this.firstFormGroup.get('firstName')?.value,
lastName: this.firstFormGroup.get('lastName')?.value,
birthdate: this.firstFormGroup.get('birthdate')?.value,
postalCode: this.firstFormGroup.get('postalCode')?.value,
address: this.firstFormGroup.get('address')?.value,
gender: this.firstFormGroup.get('gender')?.value,
street: this.firstFormGroup.get('street')?.value,
house: this.firstFormGroup.get('house')?.value,
zip: this.firstFormGroup.get('zip')?.value,
city: this.firstFormGroup.get('city')?.value,
phone: this.removeWhiteSpace(this.firstFormGroup.get('phone')?.value),
email: this.firstFormGroup.get('email')?.value,
applicationConsent: this.firstFormGroup.get('applicationConsent')?.value,
dataChangeConsent: this.firstFormGroup.get('dataChangeConsent')?.value,
privacyPolicyConsent: this.firstFormGroup.get('privacyPolicyConsent')?.value,
// Second Form Group
accountHolder: this.secondFormGroup.get('accountHolder')?.value,
iban: this.secondFormGroup.get('iban')?.value,
bic: this.secondFormGroup.get('bic')?.value,
nameOfFinancialInstitute: this.secondFormGroup.get('nameOfFinancialInstitute')?.value,
directDebitAuthorization: this.secondFormGroup.get('directDebitAuthorization')?.value,
iban: this.removeWhiteSpace(this.secondFormGroup.get('iban')?.value),
bic: this.removeWhiteSpace(this.secondFormGroup.get('bic')?.value),
bank: this.secondFormGroup.get('bank')?.value,
directDebitConsent: this.secondFormGroup.get('directDebitConsent')?.value,
returnDebitConsent: this.secondFormGroup.get('returnDebitConsent')?.value,
// Third Form Group
consent: this.thirdFormGroup.get('consent')?.value,
declarationOfConsent: this.thirdFormGroup.get('declarationOfConsent')?.value
dataStorageConsent: this.thirdFormGroup.get('dataStorageConsent')?.value,
multimediaConsent: this.thirdFormGroup.get('multimediaConsent')?.value
};
this.registerService.set(studentRegistration);
}
}

View File

@ -4,7 +4,7 @@
<div *ngIf="courseVisit" id="content">
<div class="grid-item">
<h1>{{ courseVisit?.name }}</h1>
<h1>{{ courseVisit.name }}</h1>
<h2>
{{ courseVisit.date | date: 'dd.MM.yyyy' }}, {{ courseVisit.begin }} -
{{ courseVisit.end }}

View File

@ -2,15 +2,22 @@ export interface StudentRegistration {
firstName: string;
lastName: string;
birthdate: Date;
postalCode: string;
address: string;
gender: number;
street: string;
house: number;
zip: string;
city: string;
phone: string;
email: string;
accountHolder: string;
iban: string;
bic: string;
nameOfFinancialInstitute: string;
directDebitAuthorization: boolean;
consent: boolean;
declarationOfConsent: boolean;
bank: string;
applicationConsent: boolean;
dataChangeConsent: boolean;
privacyPolicyConsent: boolean;
directDebitConsent: boolean;
returnDebitConsent: boolean;
dataStorageConsent: boolean;
multimediaConsent: boolean;
}