From 8350c1f546306dd9c426b56082d4fa7ff33897b9 Mon Sep 17 00:00:00 2001 From: Ricsi Date: Wed, 7 Dec 2016 09:27:02 +0100 Subject: [PATCH] coach helper status --- _class/class_user.php | 18 +++++++-------- _css/default.css | 6 +++++ event_handler.php | 32 ++++++++++++++++++++++---- template/templates/coach_create.tpl | 4 ++-- template/templates/coach_data_edit.tpl | 5 ++-- template/templates/coach_list.tpl | 2 +- 6 files changed, 47 insertions(+), 20 deletions(-) diff --git a/_class/class_user.php b/_class/class_user.php index 5c8af70..31d4cc2 100755 --- a/_class/class_user.php +++ b/_class/class_user.php @@ -15,7 +15,7 @@ class user { private $user_last_name; private $user_first_name; private $user_password; - private $user_email; + private $user_helper; private $user_last_login; private $logged_in; private $user_type; @@ -41,8 +41,8 @@ class user { $this->user_password = $_u_pass; } - public function set_ua_email($_u_email) { - $this->user_email = $_u_email; + public function set_ua_helper($_u_helper) { + $this->user_helper = $_u_helper; } public function set_ua_last_login($_u_last_login) { @@ -73,8 +73,8 @@ class user { return $this->user_password; } - public function get_ua_email() { - return $this->user_email; + public function get_ua_helper() { + return $this->user_helper; } public function get_ua_deleted() { @@ -123,22 +123,22 @@ class user { $this->user_type = $_type; } - public static function create_user($_name, $_email, $_password) { + public static function create_user($_name, $_helper, $_password) { global $sql; return $sql->insert_into('user_coach', array( 'ua_name' => $_name, - 'ua_email' => $_email, + 'ua_helper' => $_helper, 'ua_password' => $_password ) ); } - public static function update_user($_name, $_email, $_password, $_ua_id) { + public static function update_user($_name, $_helper, $_password, $_ua_id) { global $sql; return $sql->update_table('user_coach', array( 'ua_name' => $_name, - 'ua_email' => $_email, + 'ua_helper' => $_helper, 'ua_password' => $_password ), array( diff --git a/_css/default.css b/_css/default.css index d23f6e9..c259245 100644 --- a/_css/default.css +++ b/_css/default.css @@ -107,6 +107,8 @@ td.create a { margin-right: 5px; } + + .list a { color: #473C3C; font-family: Arial; @@ -132,6 +134,10 @@ td.create a { font-weight: bold; } +.transp { + opacity: 0.5; +} + @media (min-width: 680px) { diff --git a/event_handler.php b/event_handler.php index 6a06469..01e1edb 100755 --- a/event_handler.php +++ b/event_handler.php @@ -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': diff --git a/template/templates/coach_create.tpl b/template/templates/coach_create.tpl index b44113e..fb35f09 100644 --- a/template/templates/coach_create.tpl +++ b/template/templates/coach_create.tpl @@ -8,8 +8,8 @@
- -
+ +
diff --git a/template/templates/coach_data_edit.tpl b/template/templates/coach_data_edit.tpl index 75f3907..839b003 100644 --- a/template/templates/coach_data_edit.tpl +++ b/template/templates/coach_data_edit.tpl @@ -12,8 +12,8 @@
- -
+ +
@@ -38,7 +38,6 @@