Sorted member lists
This commit is contained in:
@@ -4,19 +4,12 @@ include 'renderer.php';
|
||||
class Members extends Renderer {
|
||||
public function __construct(?string $templateName = null) {
|
||||
parent::__construct($templateName);
|
||||
$result = mysqli_query($this->dbConnection,
|
||||
'SELECT c.*, 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 '
|
||||
. 'FROM `clubmember` c '
|
||||
. 'JOIN `clubmember_status` cs '
|
||||
. ' ON cs.`id` = c.`membership_status` '
|
||||
. 'WHERE cs.`status_text` NOT IN ("Mitgliedschaft abgelehnt", "Mitgliedschaft gekündigt") '
|
||||
. 'ORDER BY c.`last_name`, c.`first_name`');
|
||||
$members = $this->getMemberList();
|
||||
$tableBody = '<tbody>';
|
||||
while ($row = mysqli_fetch_assoc($result)) {
|
||||
foreach ($members as $row) {
|
||||
$tableBody .= '<tr>'
|
||||
. '<td>' . $row['id'] . '</td>'
|
||||
. '<td>' . $this->decode($row['last_name'], $row['salt']) . ', ' . $this->decode($row['first_name'], $row['salt']) . '</td>'
|
||||
. '<td>' . $this->decode($row['email'], $row['salt']) . '</td>'
|
||||
. '<td>' . $row['last_name'] . ', ' . $row['first_name'] . '</td>'
|
||||
. '<td>' . $row['email'] . '</td>'
|
||||
. '<td>' . $row['last_payment'] . '</td>'
|
||||
. '<td>' . $row['membership_start'] . '</td>'
|
||||
. '<td>' . $row['status_text'] . '</td>'
|
||||
|
||||
Reference in New Issue
Block a user