Inaktive Mitglieder und Mitgliederanzahl
authorPascal Hofmann <mail@pascalhofmann.de>
Tue, 1 Feb 2011 10:31:37 +0000 (11:31 +0100)
committerPascal Hofmann <mail@pascalhofmann.de>
Tue, 1 Feb 2011 10:31:37 +0000 (11:31 +0100)
include/fees.php
include/members.php
index.php

index 58011ce..787c158 100644 (file)
@@ -122,6 +122,13 @@ function fees_for_member_at_date($member_id, $end_date) {
     return NULL;
 }
 
+function fees_info_for_member($member_id, $end_date) {
+    $membership_info = fees_get_list_for_member($member_id, $end_date);
+    
+    $this_year = array_pop($membership_info);
+    return array_pop($this_year);
+}
+
 function fees_sum_by_month($end_date) {
     $members = db_get_members();
     $fees = array();
index 7abcc9d..244228b 100644 (file)
@@ -159,6 +159,7 @@ function validate_member_number($member_number, $member_id = NULL) {/*{{{*/
 
 function action_list_members() {/*{{{*/
     $members = db_get_members();
+    $count   = 0;
     ?>
     <h2>Liste der Mitglieder</h2>
     <?php if (isset($members)) : ?>
@@ -170,7 +171,9 @@ function action_list_members() {/*{{{*/
                 <th>Nachname</th>
             </tr>
         <?php foreach ($members as $member) : ?>
-            <tr>
+            <?php $membership_info = fees_info_for_member($member['id'], time()); ?>
+                       <?php if (!empty($membership_info['is_member'])) $count++; ?>
+            <tr <?php if (empty($membership_info['is_member'])) : ?>class="inactive"<?php endif ?>>
                 <td><a href="<?=html_escape(link_to('view_member', array('id'=> $member['id'])))?>"><?=html_escape($member['number'])?></a></td>
                 <td><?=html_escape($member['nickname'])?></td>
                 <td><?=html_escape($member['firstname'])?></td>
@@ -179,8 +182,9 @@ function action_list_members() {/*{{{*/
         <?php endforeach ?>
         </table>
     <?php else : ?>
-        <p>Bisher gibt's noch keine Mitglieder.</p>
+        <p>Bisher gibt es noch keine Mitglieder.</p>
     <?php endif ?>
+        <p>Derzeit gibt es <?=$count?> aktive Mitglieder.</p>
         <a href="<?=link_to('create_member')?>">Neues Mitglied</a>
         <a href="<?=link_to('export_email')?>">E-Mail-Adressen</a>
     <?php
index 3f191f4..9e938aa 100644 (file)
--- a/index.php
+++ b/index.php
@@ -89,6 +89,7 @@ ob_end_clean();
             tr.expense:hover { background-color: #fdd; }
             tr.total { background-color: #eee; font-weight: bold; }
             tr.current { background-color: #eee; font-weight: bold; }
+            tr.inactive { color: #999; }
             th { text-align: left; background-color: #eee; font-weight: normal; border-bottom: 1px solid #ccc;  }
             h1, h2, h3, legend { font-family: Georgia, Sans-Serif, Verdana; font-weight: normal; color: #333;}
             #header h1 { font-size: 4em; color: #fff; }