From 4f645ca657821c5806972d2e033bb590408d6601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B3th=20Rich=C3=A1rd?= Date: Thu, 21 Nov 2019 19:17:41 +0100 Subject: [PATCH] added set credit to zero option --- _class/class_page.php | 4 ++++ _include/include_set_credit_to_zero.php | 14 ++++++++++++++ common.php | 1 + template/templates/user_data_edit.tpl | 6 ++++++ 4 files changed, 25 insertions(+) create mode 100644 _include/include_set_credit_to_zero.php diff --git a/_class/class_page.php b/_class/class_page.php index 0aae8eb..4ea6d40 100644 --- a/_class/class_page.php +++ b/_class/class_page.php @@ -264,6 +264,10 @@ class page { # GYEREKLISTA EXPORTÁLÁSA include('include_export_users.php'); break; + case 'set_credit_to_zero': + # HITELALKALOM NULLÁZÁS + include('include_set_credit_to_zero.php'); + break; case 'delete_training_type': # EDZÉS TÍPUS TÖRLÉS include('include_delete_training_type.php'); diff --git a/_include/include_set_credit_to_zero.php b/_include/include_set_credit_to_zero.php new file mode 100644 index 0000000..c1b01cb --- /dev/null +++ b/_include/include_set_credit_to_zero.php @@ -0,0 +1,14 @@ +is_id()) { + $sql->update_table("user_kid", array( + "uk_credit" => 0, + ), array( + "uk_id" => $this->get_id(), + )); + + header("Location: /admin/members/{$this->get_id()}"); +} +?> diff --git a/common.php b/common.php index 3a65d70..25975b5 100644 --- a/common.php +++ b/common.php @@ -231,6 +231,7 @@ elseif ($_GET['page'] == 'taborvezeto' && (isset($_COOKIE['badminton_camp_leader } $smarty->assign('can_logout', $logout); +$smarty->assign('maxCredit', $sql->single_variable("SELECT setv_int FROM setting_value WHERE setv_setting_set_id = 5")); //$page = new page(); diff --git a/template/templates/user_data_edit.tpl b/template/templates/user_data_edit.tpl index 91934d9..0604260 100644 --- a/template/templates/user_data_edit.tpl +++ b/template/templates/user_data_edit.tpl @@ -42,6 +42,12 @@
{{$user_data.uk_balance|number_format:0:'':' '}} Ft
+
+ +
{$user_data.uk_credit|number_format:0:'':' '}/{$maxCredit}
+
Nullázás
+
+
{if $user_data.uk_balance}