diff --git a/_class/class_page.php b/_class/class_page.php index c3664b9..82d69a6 100644 --- a/_class/class_page.php +++ b/_class/class_page.php @@ -44,7 +44,7 @@ class page OR ua_authority_a_id = 1) WHERE spage_page_id = 1 - AND ua_user_kid_uk_id = '.$user->get_ua_id().' ORDER BY spage_id ASC; + AND ua_user_kid_uk_id = ' . $user->get_ua_id() . ' ORDER BY spage_id ASC; '; } else { $menus_query = 'SELECT * FROM subpage WHERE spage_page_id = 1;'; @@ -238,7 +238,7 @@ class page case 'money_update': // FRISSÍTÉS include 'include_money_update.php'; - // no break + // no break case 'settings': // BEÁLLÍTÁSOK include 'include_settings.php'; @@ -404,6 +404,10 @@ class page // TÁBORVEZETŐ TÖRLÉS include 'include_delete_camp_leader.php'; break; + case 'set_active_status': + // TÁBORVEZETŐ TÖRLÉS + include 'include_set_active_status.php'; + break; case 'emails': # email log include('include_emails.php'); @@ -419,7 +423,7 @@ class page break; case 'ajax': if ($this->is_subpage()) { - include 'ajax/'.$this->get_subpage(); + include 'ajax/' . $this->get_subpage(); } break; case 'view': diff --git a/_include/include_set_active_status.php b/_include/include_set_active_status.php new file mode 100644 index 0000000..a148dea --- /dev/null +++ b/_include/include_set_active_status.php @@ -0,0 +1,17 @@ +is_id()) { + $user_kid = new user_kid(); + $user_kid->set_user_data_by_id($this->get_id()); + + $activityToSet = $user_kid->get_uk_is_active() == 1 ? 0 : 1; + + $sql->update_table('user_kid', [ + 'uk_is_active' => $activityToSet + ], [ + 'uk_id' => $this->get_id() + ]); + + header("Location: /admin/members/" . $this->get_id()); +} \ No newline at end of file diff --git a/template/templates/user_data_create.tpl b/template/templates/user_data_create.tpl index 68a8e77..33c2477 100644 --- a/template/templates/user_data_create.tpl +++ b/template/templates/user_data_create.tpl @@ -1,6 +1,6 @@
-
- + +
@@ -61,7 +61,7 @@
- +
Kéz:
@@ -162,84 +162,84 @@
- +
+ \ No newline at end of file diff --git a/template/templates/user_data_edit.tpl b/template/templates/user_data_edit.tpl index c36b730..f4260c4 100644 --- a/template/templates/user_data_edit.tpl +++ b/template/templates/user_data_edit.tpl @@ -1,6 +1,13 @@
Törlés + + {if $user_data.uk_is_active} + Inaktiválás + {else} + Aktiválás + {/if} +
@@ -13,12 +20,6 @@ value="{$user_data.uk_name}" required>
-
- -
-
-
@@ -258,8 +259,10 @@ const form = document.querySelector(".form_wrapper form"); const submitButton = form.querySelector('input.button.black[type="submit"]'); + // Collect text inputs but exclude #uk_other const textInputs = Array.from(form.querySelectorAll( - 'input[type="text"], input[type="email"], textarea')); + 'input[type="text"], input[type="email"], textarea' + )).filter(input => input.id !== "uk_other"); // Select fields that control conditional validation const parentSelect = form.querySelector('#uk_parent_1');