fixed from error

This commit is contained in:
Torsten Schulz
2023-12-28 17:21:24 +01:00
parent 03df3393c3
commit 2f24dbf5d4
2 changed files with 7 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ class Members extends Renderer {
$tableBody = '<tbody>';
foreach ($members as $row) {
$tableBody .= '<tr>'
. '<td>' . $row['id'] . '</td>'
. '<td>' . $row['last_name'] . ', ' . $row['first_name'] . '</td>'
. '<td>' . $row['email'] . '</td>'
. '<td>' . $row['last_payment'] . '</td>'

View File

@@ -541,9 +541,9 @@ class Renderer {
return $decoded;
}
protected function getMemberList(): array {
protected function getMemberList(bool $withId = false): array {
$query = <<<queryend
SELECT c.first_name, c.last_name , c.street , c.zip , c.town, c.birthdate, c.phone, c.email, c.child_name,
SELECT c.id, c.first_name, c.last_name , c.street , c.zip , c.town, c.birthdate, c.phone, c.email, c.child_name,
c.child_street, c.subscription, c.bank_name, c.iban, c.bic, c.account_member_name, c.membership_status, c.salt, c.membership_start,
cs.`status_text`, (SELECT ph.`payment_date` FROM `paying_history` ph WHERE ph.`clubmember_id` = c.`id` ORDER BY `payment_date` DESC LIMIT 1) as last_payment,
cp.description
@@ -557,7 +557,7 @@ queryend;
$result = mysqli_query($this->dbConnection, $query);
$entries = [];
while ($row = mysqli_fetch_assoc($result)) {
$entries[] = [
$entry = [
'last_name' => $this->decode($row['last_name'], $row['salt']),
'first_name' => $this->decode($row['first_name'], $row['salt']),
'street' => $this->decode($row['street'], $row['salt']),
@@ -578,6 +578,9 @@ queryend;
'last_payment' => $row['last_payment'],
'description' => $row['description'],
];
if ($withId) [
$entry['id'] = $row['id'];
$entries[] = $entry;
}
return $this->sortUserList($entries);
}