Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fsfahrttool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sarah Kleest-Meißner
fsfahrttool
Commits
439c93d8
Commit
439c93d8
authored
10 years ago
by
Tim Repke
Browse files
Options
Downloads
Patches
Plain Diff
now registrationform is working, some bugfixes needed, no proper functionality test yet
parent
7e43e962
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
registration-system/config.inc.php
+1
-1
1 addition, 1 deletion
registration-system/config.inc.php
registration-system/frameworks/commons.php
+20
-0
20 additions, 0 deletions
registration-system/frameworks/commons.php
registration-system/index.php
+24
-7
24 additions, 7 deletions
registration-system/index.php
with
45 additions
and
8 deletions
registration-system/config.inc.php
+
1
−
1
View file @
439c93d8
...
...
@@ -2,7 +2,7 @@
// https://repke.eu:8443
// passwort manu:kuzerPenis666!
$config_verbose_level
=
2
;
// 0 = nothing, 1 = important, 2 = somewhat important, 3 = detailed verbose
$config_verbose_level
=
3
;
// 0 = nothing, 1 = important, 2 = somewhat important, 3 = detailed verbose
$config_db
=
array
(
"name"
=>
"fsfahrt"
,
...
...
This diff is collapsed.
Click to expand it.
registration-system/frameworks/commons.php
+
20
−
0
View file @
439c93d8
...
...
@@ -20,4 +20,24 @@ function comm_format_date($date){
function
comm_get_possible_dates
(
$fid
){
return
array
(
"12.03.2014"
,
"13.03.2014"
,
"14.03.2014"
);
}
function
comm_isopen_fid
(
$db_handle
,
$fid
){
comm_verbose
(
3
,
"checking if fid "
.
$fid
.
" is open"
);
return
$db_handle
->
has
(
"fahrten"
,
array
(
"AND"
=>
array
(
"fahrt_id"
=>
$fid
,
"regopen"
=>
1
)));
}
function
comm_generate_key
(
$db_handle
,
$table
,
$col
,
$conditions
){
again
:
$bytes
=
openssl_random_pseudo_bytes
(
8
);
$hex
=
bin2hex
(
$bytes
);
comm_verbose
(
3
,
"generated hex for test: "
.
$hex
);
$conditions
[
$col
]
=
$hex
;
if
(
$db_handle
->
has
(
$table
,
array
(
"AND"
=>
$conditions
)))
goto
again
;
comm_verbose
(
2
,
"generated hex: "
.
$hex
);
return
$hex
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
registration-system/index.php
+
24
−
7
View file @
439c93d8
...
...
@@ -43,10 +43,12 @@ function index_show_content(){
// --- Formular
if
(
isset
(
$_REQUEST
[
'submit'
])){
// Formular auswerten
comm_verbose
(
1
,
"Formular bekommen"
);
index_check_form
();
}
elseif
(
isset
(
$_REQUEST
[
'bid'
])){
// Änderungsformular anzeigen TODO: Anmeldung noch offen?
$data
=
index_check_form
();
if
(
!
is_null
(
$data
))
index_form_to_db
(
$data
);
}
/*elseif(isset($_REQUEST['bid'])){ // Änderungsformular anzeigen, Anmeldung noch offen?
index_show_formular($fid, $_REQUEST['bid']);
}
else
{
// leeres Formular anzeigen
}
*/
else
{
// leeres Formular anzeigen
index_show_formular
(
$fid
);
}
...
...
@@ -61,6 +63,13 @@ function index_show_content(){
}
function
index_form_to_db
(
$data
){
global
$index_db
;
$data
[
'version'
]
=
1
;
$data
[
'bachelor_id'
]
=
comm_generate_key
(
$index_db
,
"bachelor"
,
"bachelor_id"
,
array
(
'fahrt_id'
=>
$data
[
'fahrt_id'
]));
$index_db
->
insert
(
"bachelor"
,
$data
);
}
/**
* validates the sent form
* on failure: repost form with prefilled data and errors
...
...
@@ -68,10 +77,17 @@ function index_show_content(){
*
*/
function
index_check_form
(){
global
$config_studitypen
,
$config_essen
,
$config_reisearten
;
global
$config_studitypen
,
$config_essen
,
$config_reisearten
,
$index_db
;
$errors
=
array
();
$data
=
array
();
$fid
=
$_REQUEST
[
'fid'
];
$data
=
array
();
$data
[
'fahrt_id'
]
=
$fid
;
if
(
!
comm_isopen_fid
(
$index_db
,
$fid
)){
$errors
=
array
(
"Ungültige Fahrt!"
);
goto
index_check_form_skip
;
}
$possible_dates
=
comm_get_possible_dates
(
$fid
);
index_check_field
(
'forname'
,
'/^[a-zA-Z]{2,50}$/'
,
$data
,
$errors
,
"Fehlerhafter oder fehlender Vorname!"
);
...
...
@@ -88,12 +104,13 @@ function index_check_form(){
index_check_field
(
'virgin'
,
array
(
"Ja"
,
"Nein"
),
$data
,
$errors
,
'Bitte Altersbereich wählen!'
);
index_check_field
(
'comment'
,
"comment"
,
$data
,
$errors
,
'Trollololol'
);
index_check_form_skip
:
if
(
count
(
$errors
)
>
0
){
index_show_errors
(
$errors
);
index_show_formular
(
$fid
,
NULL
,
$data
);
return
NULL
;
}
else
{
// put in DB
return
$data
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment