78 lines
3.7 KiB
PHP
78 lines
3.7 KiB
PHP
|
|
<?php
|
||
|
|
if(!defined('OSTADMININC') || !$thisuser->isadmin()) die('Zugriff verweigert');
|
||
|
|
|
||
|
|
//List all groups.
|
||
|
|
$sql='SELECT grp.group_id,group_name,group_enabled,count(staff.staff_id) as users, grp.created,grp.updated'
|
||
|
|
.' FROM '.GROUP_TABLE.' grp LEFT JOIN '.STAFF_TABLE.' staff USING(group_id)';
|
||
|
|
$groups=db_query($sql.' GROUP BY grp.group_id ORDER BY group_name');
|
||
|
|
$showing=($num=db_num_rows($groups))?'Nutzergruppen':'keine Gruppen??';
|
||
|
|
?>
|
||
|
|
<div class="msg"><?=$showing?></div>
|
||
|
|
<table width="100%" border="0" cellspacing=1 cellpadding=2>
|
||
|
|
<form action="admin.php?t=groups" method="POST" name="groups" onSubmit="return checkbox_checker(document.forms['groups'],1,0);">
|
||
|
|
<input type=hidden name='a' value='update_groups'>
|
||
|
|
<tr><td>
|
||
|
|
<table border="0" cellspacing=0 cellpadding=2 class="dtable" align="center" width="100%">
|
||
|
|
<tr>
|
||
|
|
<th width="7px"> </th>
|
||
|
|
<th width=200>Gruppenname</th>
|
||
|
|
<th width=100>Gruppenstatus</th>
|
||
|
|
<th width=10> Mitglieder</th>
|
||
|
|
<th> Erstellungsdatum</th>
|
||
|
|
<th>Zuletzt geändert</th>
|
||
|
|
</tr>
|
||
|
|
<?
|
||
|
|
$class = 'row1';
|
||
|
|
$total=0;
|
||
|
|
$grps=($errors && is_array($_POST['grps']))?$_POST['grps']:null;
|
||
|
|
if($groups && db_num_rows($groups)):
|
||
|
|
while ($row = db_fetch_array($groups)) {
|
||
|
|
$sel=false;
|
||
|
|
if(($grps && in_array($row['group_id'],$grps)) || ($gID && $gID==$row['group_id']) ){
|
||
|
|
$class="$class highlight";
|
||
|
|
$sel=true;
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
<tr class="<?=$class?>" id="<?=$row['group_id']?>">
|
||
|
|
<td width=7px>
|
||
|
|
<input type="checkbox" name="grps[]" value="<?=$row['group_id']?>" <?=$sel?'checked':''?> onClick="highLight(this.value,this.checked);">
|
||
|
|
<td><a href="admin.php?t=grp&id=<?=$row['group_id']?>"><?=Format::htmlchars($row['group_name'])?></a></td>
|
||
|
|
<td><b><?=$row['group_enabled']?'Aktiv':'Inaktiv'?></b></td>
|
||
|
|
<td> <a href="admin.php?t=staff&gid=<?=$row['group_id']?>"><?=$row['users']?></a></td>
|
||
|
|
<td><?=Format::db_date($row['created'])?></td>
|
||
|
|
<td><?=Format::db_datetime($row['updated'])?></td>
|
||
|
|
</tr>
|
||
|
|
<?
|
||
|
|
$class = ($class =='row2') ?'row1':'row2';
|
||
|
|
} //end of while.
|
||
|
|
else: //not tickets found!! ?>
|
||
|
|
<tr class="<?=$class?>"><td colspan=6><b>Abfrage ergab 0 Ergebnisse</b></td></tr>
|
||
|
|
<?
|
||
|
|
endif; ?>
|
||
|
|
</table>
|
||
|
|
<?
|
||
|
|
if(db_num_rows($groups)>0): //Show options..
|
||
|
|
?>
|
||
|
|
<tr>
|
||
|
|
<td style="padding-left:20px;">
|
||
|
|
Auswahl:
|
||
|
|
<a href="#" onclick="return select_all(document.forms['groups'],true)">Alle auswählen</a> |
|
||
|
|
<a href="#" onclick="return toogle_all(document.forms['groups'],true)">Auswahl umkehren</a> |
|
||
|
|
<a href="#" onclick="return reset_all(document.forms['groups'])">Nichts auswählen</a>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<tr>
|
||
|
|
<td align="center">
|
||
|
|
<input class="button" type="submit" name="activate_grps" value="Aktivieren"
|
||
|
|
onClick=' return confirm("Sind sie sicher, dass die die ausgewählten Gruppen aktivieren wollen");'>
|
||
|
|
<input class="button" type="submit" name="disable_grps" value="Deaktivieren"
|
||
|
|
onClick=' return confirm("Sind sie sicher, dass die die ausgewählten Gruppen deaktivieren wollen");'>
|
||
|
|
<input class="button" type="submit" name="delete_grps" value="Löschen"
|
||
|
|
onClick=' return confirm("Sind sie sicher, dass die die ausgewählten Gruppen löschen wollen");'>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
<?
|
||
|
|
endif;
|
||
|
|
?>
|
||
|
|
</form>
|
||
|
|
</table>
|