Display with first letter ranking
This commit is contained in:
parent
0d7df91a61
commit
0f68f20d4c
|
@ -20,9 +20,13 @@
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @return NULL
|
* @return NULL
|
||||||
*/
|
*/
|
||||||
function show_my_details($name,$type) {
|
function show_my_details($name,$type,$letter=NULL) {
|
||||||
|
global $conf;
|
||||||
print '<tr><td><a href="' .$type. '.php?view='
|
print '<tr><td>';
|
||||||
|
if($letter) {
|
||||||
|
printf('<a name="%s"></a>', $letter);
|
||||||
|
}
|
||||||
|
print '<a href="' .$type. '.php?view='
|
||||||
.$name. '">' .$name. '</a></td>';
|
.$name. '">' .$name. '</a></td>';
|
||||||
|
|
||||||
if ( $type == 'compte' && $conf['admin']['quota']) {
|
if ( $type == 'compte' && $conf['admin']['quota']) {
|
||||||
|
@ -150,6 +154,24 @@ if (isset($_SESSION['login'])) {
|
||||||
|
|
||||||
<h3>Liste des comptes :</h3>
|
<h3>Liste des comptes :</h3>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$alpha = array();
|
||||||
|
foreach($comptes as $compte) {
|
||||||
|
$letter = strtoupper(substr($compte, 0, 1));
|
||||||
|
$alpha[$letter] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$letters = array_keys($alpha);
|
||||||
|
sort($letters);
|
||||||
|
foreach($letters as $letter) {
|
||||||
|
printf('<a href="#%s">%s</a> ', $letter, $letter);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
|
||||||
<table width="500px" bgcolor="#ddd" border="1">
|
<table width="500px" bgcolor="#ddd" border="1">
|
||||||
<tr>
|
<tr>
|
||||||
<td><strong>Nom du compte</strong></td>
|
<td><strong>Nom du compte</strong></td>
|
||||||
|
@ -167,7 +189,13 @@ if (isset($_SESSION['login'])) {
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
foreach ($comptes as $compte) {
|
foreach ($comptes as $compte) {
|
||||||
show_my_details($compte,'compte');
|
$letter = strtoupper(substr($compte, 0, 1));
|
||||||
|
if($alpha[$letter] == 1) {
|
||||||
|
$alpha[$letter] = 0;
|
||||||
|
} else {
|
||||||
|
$letter = NULL;
|
||||||
|
}
|
||||||
|
show_my_details($compte,'compte', $letter);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
Loading…
Reference in a new issue