coach helper status
This commit is contained in:
@@ -11,15 +11,30 @@ if (isset($_POST['action'])) {
|
||||
USER TYPES: 1 - coach, 2 - kid, 3 - parent
|
||||
*/
|
||||
$login = new login();
|
||||
/*
|
||||
$user_coach_id = $login->check_coach_login($_POST['user_name'], $_POST['user_password']);
|
||||
$user_kid_id = $login->check_kid_login($_POST['user_name'], $_POST['user_password']);
|
||||
if ($user_coach_id) {
|
||||
//sikeres bejelentkezés
|
||||
$login->login_user($user_coach_id, 'badminton_coach_user');
|
||||
header("Location: " . $actual_link);
|
||||
}
|
||||
elseif ($user_kid_id) {
|
||||
//sikeres bejelentkezés
|
||||
$login->login_user($user_kid_id, 'badminton_parent_user');
|
||||
header("Location: " . $actual_link);
|
||||
}
|
||||
else {
|
||||
die($user_coach_id);
|
||||
//sikertelen bejelentkezés
|
||||
}
|
||||
*/
|
||||
$user_id = $login->check_login($_POST['user_name'], $_POST['user_password']);
|
||||
if ($user_id) {
|
||||
//sikeres bejelentkezés
|
||||
$login->login_user($user_id, $_POST['user_type']);
|
||||
header("Location: " . $actual_link);
|
||||
}
|
||||
else {
|
||||
//sikertelen bejelentkezés
|
||||
}
|
||||
break;
|
||||
|
||||
case 'user_data_edit':
|
||||
@@ -118,7 +133,11 @@ if (isset($_POST['action'])) {
|
||||
else {
|
||||
$psw = "null";
|
||||
}
|
||||
user::create_user($_POST['ua_name'], $_POST['ua_email'], $psw);
|
||||
|
||||
if (!isset($_POST['ua_helper']) || empty($_POST['ua_helper'])) {
|
||||
$_POST['ua_helper'] = 0;
|
||||
}
|
||||
user::create_user($_POST['ua_name'], $_POST['ua_helper'], $psw);
|
||||
header("Location: /admin/coaches");
|
||||
break;
|
||||
case 'coach_data_edit':
|
||||
@@ -129,7 +148,10 @@ if (isset($_POST['action'])) {
|
||||
else {
|
||||
$psw = "null";
|
||||
}
|
||||
user::update_user($_POST['ua_name'], $_POST['ua_email'], $psw, $_POST['ua_id']);
|
||||
if (!isset($_POST['ua_helper']) || empty($_POST['ua_helper'])) {
|
||||
$_POST['ua_helper'] = 0;
|
||||
}
|
||||
user::update_user($_POST['ua_name'], $_POST['ua_helper'], $psw, $_POST['ua_id']);
|
||||
header("Location: /admin/coaches");
|
||||
break;
|
||||
case 'shirt_create':
|
||||
|
||||
Reference in New Issue
Block a user