added camp leader view, camp list with kids

This commit is contained in:
Ricsi
2017-06-25 12:10:49 +02:00
parent b85da38e8a
commit 63bdbf9888
23 changed files with 643 additions and 9 deletions

View File

@@ -37,6 +37,7 @@ if (isset($_POST['action'])) {
if ($_REQUEST['page'] == 'view') $user_kid_id = $login->check_kid_login($_POST['user_name'], $_POST['user_password']);
if ($_REQUEST['page'] == 'coach') $user_coach_id = $login->check_coach_login($_POST['user_name'], $_POST['user_password']);
if ($_REQUEST['page'] == 'tabor') $user_camp_id = $login->check_camp_login($_POST['user_name'], $_POST['user_password']);
if ($_REQUEST['page'] == 'taborvezeto') $user_camp_leader_id = $login->check_camp_leader_login($_POST['user_name'], $_POST['user_password']);
if ($user_admin_id) {
//sikeres bejelentkezés adminként
@@ -62,6 +63,12 @@ if (isset($_POST['action'])) {
log::register('camp_user_login', $user_camp_id, null, $user_camp_id);
header("Location: " . $actual_link);
}
elseif ($user_camp_leader_id) {
//sikeres bejelentkezés szülőként
$login->login_user($user_camp_leader_id, 'badminton_camp_leader', 5);
log::register('camp_leader_login', $user_camp_leader_id, null, $user_camp_leader_id);
header("Location: " . $actual_link);
}
else {
//die($user_coach_id);
//sikertelen bejelentkezés
@@ -485,6 +492,21 @@ if (isset($_POST['action'])) {
camp_apply::update_camp_apply($_POST['camp_apply_id'], 2, $_POST['camp_accomodation'], $_POST['camp_shuttle'], date('Y-m-d H:i:s'), 'null', $_POST['camp_id']);
header('Location: /tabor/jelentkezes/5');
break;
case 'user_camp_leader_create':
# táborvezető létrehozása
$new_ucl_id = user_camp_leader::create_camp_leader($_POST['ucl_name'], $_POST['ucl_password']);
log::register('new_camp_leader', $new_ucl_id);
header('Location: /admin/camp_user');
break;
case 'user_camp_leader_update':
# táborvezető update
if (empty($_POST['ucl_password'])) {
$_POST['ucl_password'] = null;
}
$new_ucl_id = user_camp_leader::update_camp_leader($_POST['ucl_name'], $_POST['ucl_password'], $_POST['ucl_id']);
log::register('update_camp_leader', $_POST['ucl_id']);
header('Location: /admin/camp_user');
break;
default:
# code...
break;