diff --git a/langs/en/actions.json b/langs/en/actions.json index 14d51b8..241fb60 100644 --- a/langs/en/actions.json +++ b/langs/en/actions.json @@ -7,5 +7,6 @@ "Cancel": "Cancel", "Edit Family": "Edit Family", "View Families": "View Families", - "View Payments": "View Payments" + "View Payments": "View Payments", + "Manual Entry": "Manual Entry" } diff --git a/langs/en/labels.json b/langs/en/labels.json index 12f3c22..b137f74 100644 --- a/langs/en/labels.json +++ b/langs/en/labels.json @@ -31,5 +31,8 @@ "Member Directory": "Member Directory", "Office (ODT)": "Office (ODT)", "HTML": "HTML", - "DOCX": "DOCX" + "DOCX": "DOCX", + "Amount": "Amount", + "Date": "Date", + "Paid": "Paid" } diff --git a/langs/en/titles.json b/langs/en/titles.json index c77b580..cc90524 100644 --- a/langs/en/titles.json +++ b/langs/en/titles.json @@ -6,5 +6,6 @@ "Family": "Family", "Delete Family": "Delete Family", "Events": "Events", - "Reports": "Reports" + "Reports": "Reports", + "Payments": "Payments" } diff --git a/pages.php b/pages.php index 4a0dc0c..a95c139 100644 --- a/pages.php +++ b/pages.php @@ -36,6 +36,19 @@ define("PAGES", [ "confirmdelete" => [ "title" => "Delete Family" ], + "payments" => [ + "title" => "Payments", + "navbar" => true, + "icon" => "fas fa-dollar-sign", + "styles" => [ + "static/css/datatables.min.css", + "static/css/tables.css" + ], + "scripts" => [ + "static/js/datatables.min.js", + "static/js/payments.js" + ] + ], "events" => [ "title" => "Events", "navbar" => true, diff --git a/pages/payments.php b/pages/payments.php new file mode 100644 index 0000000..7148f98 --- /dev/null +++ b/pages/payments.php @@ -0,0 +1,70 @@ +hasPermission("HACHEPORTAL_VIEW")) { + header("Location: ./app.php?msg=no_permission"); + die(); +} + +$writeaccess = $user->hasPermission("HACHEPORTAL_EDIT"); + +$payments = $database->select("payments", ['paymentid (id)', 'familyid', 'amount', 'paid', 'date']); +?> + +
+ + get("Manual Entry"); ?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get('Actions'); ?> get('Family'); ?> get('Amount'); ?> get('Date'); ?> get('Paid'); ?>
+ + get("Edit"); ?> + + load($p['familyid'])->getName(); ?>$get("Yes") : $Strings->get("No"); ?>
get('Actions'); ?> get('Family'); ?> get('Amount'); ?> get('Date'); ?> get('Paid'); ?>
\ No newline at end of file diff --git a/static/js/payments.js b/static/js/payments.js new file mode 100644 index 0000000..c400540 --- /dev/null +++ b/static/js/payments.js @@ -0,0 +1,34 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +$('#paytable').DataTable({ + responsive: { + details: { + display: $.fn.dataTable.Responsive.display.modal({ + header: function (row) { + var data = row.data(); + return " " + data[2]; + } + }), + renderer: $.fn.dataTable.Responsive.renderer.tableAll({ + tableClass: 'table' + }), + type: "column" + } + }, + columnDefs: [ + { + targets: 0, + className: 'control', + orderable: false + }, + { + targets: 1, + orderable: false + } + ], + order: [ + [4, 'desc'] + ] +}); \ No newline at end of file