You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-07-31 10:04:20 +03:00
Greatly enhanced the multi-page experience for list-virtual.php and overview.php
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@15 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
@ -260,6 +260,78 @@ function get_domain_properties ($domain)
|
||||
$list['quota_sum'] = $row[0];
|
||||
$list['alias_count'] = $list['alias_count'] - $list['mailbox_count'];
|
||||
|
||||
$list['alias_pgindex']=array ();
|
||||
$list['mbox_pgindex']=array ();
|
||||
|
||||
//while loop to figure index names. use page_size and loop of queries
|
||||
$i=0;
|
||||
$current=0;
|
||||
$page_size = $CONF['page_size'];
|
||||
$tmpstr="";
|
||||
$idxlabel="";
|
||||
|
||||
if ( $list['alias_count'] > $page_size )
|
||||
{
|
||||
while ( $current < $list['alias_count'] )
|
||||
{
|
||||
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
|
||||
$query = "SELECT $table_alias.address FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql";
|
||||
$result = db_query ("$query");
|
||||
$row = db_array ($result['result']);
|
||||
$tmpstr = $row['address'];
|
||||
//get first 2 chars
|
||||
$idxlabel = $tmpstr[0] . $tmpstr[1] . "-";
|
||||
($current + $page_size - 1 <= $list['alias_count']) ? $current = $current + $page_size - 1 : $current = $list['alias_count'] - 1;
|
||||
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
|
||||
$query = "SELECT $table_alias.address FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql";
|
||||
$result = db_query ("$query");
|
||||
$row = db_array ($result['result']);
|
||||
$tmpstr = $row['address'];
|
||||
$idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1];
|
||||
|
||||
$current = $current + 1;
|
||||
|
||||
$list['alias_pgindex'][]=$idxlabel;
|
||||
$i++;
|
||||
}
|
||||
$list['alias_pgindex_count']=$i;
|
||||
}
|
||||
|
||||
$i=0;
|
||||
$current=0;
|
||||
$page_size = $CONF['page_size'];
|
||||
$tmpstr="";
|
||||
$idxlabel="";
|
||||
|
||||
if ( $list['mailbox_count'] > $page_size )
|
||||
{
|
||||
while ( $current < $list['mailbox_count'] )
|
||||
{
|
||||
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
|
||||
$query = "SELECT $table_mailbox.username FROM $table_mailbox WHERE $table_mailbox.domain='$domain' ORDER BY $table_mailbox.username LIMIT $limitSql";
|
||||
$result = db_query ("$query");
|
||||
$row = db_array ($result['result']);
|
||||
$tmpstr = $row['username'];
|
||||
//get first 2 chars
|
||||
$idxlabel = $tmpstr[0] . $tmpstr[1] . "-";
|
||||
($current + $page_size - 1 <= $list['mailbox_count']) ? $current = $current + $page_size - 1 : $current = $list['mailbox_count'] - 1;
|
||||
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
|
||||
$query = "SELECT $table_mailbox.username FROM $table_mailbox WHERE $table_mailbox.domain='$domain' ORDER BY $table_mailbox.username LIMIT $limitSql";
|
||||
$result = db_query ("$query");
|
||||
$row = db_array ($result['result']);
|
||||
$tmpstr = $row['username'];
|
||||
$idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1];
|
||||
|
||||
$current = $current + 1;
|
||||
|
||||
$list['mbox_pgindex'][]=$idxlabel;
|
||||
$i++;
|
||||
}
|
||||
$list['mbox_pgindex_count']=$i;
|
||||
}
|
||||
|
||||
// end mod
|
||||
|
||||
$query="SELECT * FROM $table_domain WHERE domain='$domain'";
|
||||
if ('pgsql'==$CONF['database_type'])
|
||||
{
|
||||
|
Reference in New Issue
Block a user