Base setup for displaying groups and listing members
This commit is contained in:
42
modules/Gruppen/Views/GruppenOverview.php
Normal file
42
modules/Gruppen/Views/GruppenOverview.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Bdp\Modules\Gruppen\Controllers\MainController as GruppenController;
|
||||
|
||||
function kompass_print_gruppen_overview()
|
||||
{
|
||||
global $dbHandler;
|
||||
?>
|
||||
|
||||
<form method="post" action="admin.php?page=kompass-groups">
|
||||
<p style="width: 100%; text-align: right">
|
||||
<input type="hidden" name="action" value="searchmember">
|
||||
<input type="text" name="member_name" style="width: 500px;"
|
||||
placeholder="<?=__('Search for member', BDP_LV_PLUGIN_SLUG); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
|
||||
<table class="wp-list-table widefat fixed striped table-view-list" id="myTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="manage-column column-name"><?= __('Group Name', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th scope="col" class="manage-column column-name"><?= __('Number Members', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th style="width: 100px;" class="manage-column column-name"><?= __('Actions', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
foreach ($dbHandler->readFromDb( GruppenController::KOMPASS_STAMMESGRUPPEN_GRUPPEN) as $currentGruppe) {
|
||||
echo '<tr>';
|
||||
echo '<td>' . $currentGruppe->gruppen_name .'</td>';
|
||||
echo '<td>' . $dbHandler->countSqlRows(GruppenController::KOMPASS_STAMMESGRUPPEN_TEILIS, ['gruppe_id' => $currentGruppe->id]) .'</td>';
|
||||
echo '<td><a href="admin.php?page=bdp-kompass-limit-login-attempts&action=removeFromList">' .
|
||||
__('Show Members', BDP_LV_PLUGIN_SLUG) . '</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
65
modules/Gruppen/Views/PrintMembers.php
Normal file
65
modules/Gruppen/Views/PrintMembers.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
function kompass_print_gruppen_members(array $memberList)
|
||||
{
|
||||
?>
|
||||
<p style="width: 100%; text-align: right">
|
||||
<input type="text" id="searchInput"
|
||||
onkeyup="searchTable('myTable', this)"
|
||||
placeholder="<?=__('Filter member', BDP_LV_PLUGIN_SLUG); ?>">
|
||||
</p>
|
||||
<table class="wp-list-table widefat fixed striped table-view-list" id="myTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="manage-column column-name"><?= __('Name', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
<th style="width: 100px;" class="manage-column column-name"><?= __('Actions', BDP_LV_PLUGIN_SLUG); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($memberList as $curMember) {
|
||||
?>
|
||||
<tr>
|
||||
<td> <?= $curMember->vorname . ' ' . $curMember->nachname ?>
|
||||
<br />
|
||||
<?php kompass_gruppen_printTelephonNumbers($curMember); ?>
|
||||
<br />
|
||||
<?= __('Allergies:', BDP_LV_PLUGIN_SLUG) . ' ' .
|
||||
($curMember->allergien != '' ? $curMember->allergien : '---'); ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<a href="admin.php?page=bdp-kompass-limit-login-attempts&action=removeFromList">
|
||||
<?= __('Show details', BDP_LV_PLUGIN_SLUG); ?></a>
|
||||
<br />
|
||||
|
||||
<a href="admin.php?page=bdp-kompass-limit-login-attempts&action=removeFromList">
|
||||
<?= __('Send E-Mail', BDP_LV_PLUGIN_SLUG); ?></a>
|
||||
<br />
|
||||
|
||||
<?php
|
||||
if ( current_user_can( 'delete_teilis' ) ) {
|
||||
?>
|
||||
<a href="admin.php?page=bdp-kompass-limit-login-attempts&action=removeFromList">
|
||||
<?= __('Delete', BDP_LV_PLUGIN_SLUG); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
function kompass_gruppen_printTelephonNumbers(stdClass $curMember)
|
||||
{
|
||||
kompass_print_telephone_link($curMember->telefon_1);
|
||||
if ($curMember->telefon_2 != '') {
|
||||
echo ' // ';
|
||||
kompass_print_telephone_link( $curMember->telefon_2 );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user