2000-08-18 05:24:22 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare - administration *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2001-03-26 23:12:56 +02:00
|
|
|
$phpgw_info = array();
|
|
|
|
$phpgw_info['flags'] = array('currentapp' => 'admin', 'enable_nextmatchs_class' => True);
|
|
|
|
include('../header.inc.php');
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2001-03-25 20:10:30 +02:00
|
|
|
function account_total($query)
|
|
|
|
{
|
|
|
|
global $phpgw;
|
|
|
|
|
|
|
|
if ($query) {
|
2001-03-26 23:12:56 +02:00
|
|
|
$querymethod = " AND (account_firstname LIKE '%$query%' OR account_lastname LIKE "
|
|
|
|
. "'%$query%' OR account_lid LIKE '%$query%') ";
|
2001-03-25 20:10:30 +02:00
|
|
|
}
|
|
|
|
|
2001-03-26 23:12:56 +02:00
|
|
|
$phpgw->db->query("SELECT COUNT(*) FROM phpgw_accounts WHERE account_type='u'".$querymethod,__LINE__,__FILE__);
|
2001-03-25 20:10:30 +02:00
|
|
|
$phpgw->db->next_record();
|
|
|
|
|
|
|
|
return $phpgw->db->f(0);
|
|
|
|
}
|
|
|
|
|
2001-05-06 13:20:02 +02:00
|
|
|
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
|
2001-03-25 20:10:30 +02:00
|
|
|
|
2001-02-20 15:12:06 +01:00
|
|
|
$p->set_file(array(
|
|
|
|
'list' => 'accounts.tpl',
|
|
|
|
'row' => 'accounts_row.tpl',
|
|
|
|
'empty_row' => 'accounts_row_empty.tpl'
|
|
|
|
));
|
2000-08-21 07:15:45 +02:00
|
|
|
|
2001-03-26 23:12:56 +02:00
|
|
|
$total = account_total($query);
|
2000-08-19 08:17:20 +02:00
|
|
|
|
2001-03-26 23:12:56 +02:00
|
|
|
$p->set_var('bg_color',$phpgw_info['theme']['bg_color']);
|
|
|
|
$p->set_var('th_bg',$phpgw_info['theme']['th_bg']);
|
2001-02-20 15:12:06 +01:00
|
|
|
|
2001-03-26 23:12:56 +02:00
|
|
|
$p->set_var('left_next_matchs',$phpgw->nextmatchs->left('/admin/accounts.php',$start,$total));
|
|
|
|
$p->set_var('lang_user_accounts',lang('user accounts'));
|
|
|
|
$p->set_var('right_next_matchs',$phpgw->nextmatchs->right('/admin/accounts.php',$start,$total));
|
2001-02-20 15:12:06 +01:00
|
|
|
|
2001-03-26 23:12:56 +02:00
|
|
|
$p->set_var('lang_loginid',$phpgw->nextmatchs->show_sort_order($sort,'account_lid',$order,'/admin/accounts.php',lang('LoginID')));
|
|
|
|
$p->set_var('lang_lastname',$phpgw->nextmatchs->show_sort_order($sort,'account_lastname',$order,'/admin/accounts.php',lang('last name')));
|
|
|
|
$p->set_var('lang_firstname',$phpgw->nextmatchs->show_sort_order($sort,'account_firstname',$order,'/admin/accounts.php',lang('first name')));
|
2001-02-20 15:12:06 +01:00
|
|
|
|
2001-03-26 23:12:56 +02:00
|
|
|
$p->set_var('lang_edit',lang('Edit'));
|
|
|
|
$p->set_var('lang_delete',lang('Delete'));
|
|
|
|
$p->set_var('lang_view',lang('View'));
|
2001-02-20 15:12:06 +01:00
|
|
|
|
2001-03-26 23:12:56 +02:00
|
|
|
$account_info = $phpgw->accounts->get_list('accounts',$start,$sort, $order, $query, $total);
|
2001-02-20 15:12:06 +01:00
|
|
|
|
|
|
|
if (! count($account_info))
|
|
|
|
{
|
|
|
|
$p->set_var('message',lang('No matchs found'));
|
|
|
|
$p->parse('rows','empty_row',True);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while (list($null,$account) = each($account_info))
|
|
|
|
{
|
|
|
|
$lastname = $account['account_lastname'];
|
|
|
|
$firstname = $account['account_firstname'];
|
|
|
|
$account_id = $account['account_id'];
|
|
|
|
$loginid = $account['account_lid'];
|
|
|
|
|
2001-04-18 18:52:56 +02:00
|
|
|
$phpgw->nextmatchs->template_alternate_row_color($p);
|
2001-02-20 15:12:06 +01:00
|
|
|
|
|
|
|
if (! $lastname)
|
|
|
|
{
|
|
|
|
$lastname = ' ';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! $firstname)
|
|
|
|
{
|
|
|
|
$firstname = ' ';
|
|
|
|
}
|
|
|
|
|
|
|
|
$p->set_var('row_loginid',$loginid);
|
|
|
|
$p->set_var('row_firstname',$firstname);
|
|
|
|
$p->set_var('row_lastname',$lastname);
|
2001-03-09 00:32:22 +01:00
|
|
|
$p->set_var('row_edit','<a href="'.$phpgw->link('/admin/editaccount.php','account_id='
|
2001-02-20 15:12:06 +01:00
|
|
|
. $account_id) . '"> ' . lang('Edit') . ' </a>');
|
|
|
|
|
|
|
|
if ($phpgw_info['user']['userid'] != $account['account_lid'])
|
|
|
|
{
|
2001-03-09 00:32:22 +01:00
|
|
|
$p->set_var('row_delete','<a href="' . $phpgw->link('/admin/deleteaccount.php','account_id='
|
2001-02-20 15:12:06 +01:00
|
|
|
. $account_id) . '"> '.lang('Delete').' </a>');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$p->set_var('row_delete',' ');
|
|
|
|
}
|
|
|
|
|
2001-03-25 15:50:40 +02:00
|
|
|
$p->set_var('row_view','<a href="' . $phpgw->link('/admin/viewaccount.php','account_id='
|
|
|
|
. $account_id) . '"> ' . lang('View') . ' </a>');
|
2001-02-20 15:12:06 +01:00
|
|
|
|
|
|
|
$p->parse('rows','row',True);
|
|
|
|
}
|
|
|
|
} // End else
|
|
|
|
|
2001-03-25 15:50:40 +02:00
|
|
|
$p->set_var('actionurl',$phpgw->link('/admin/newaccount.php'));
|
|
|
|
$p->set_var('accounts_url',$phpgw->link('/admin/accounts.php'));
|
|
|
|
$p->set_var('lang_add',lang('add'));
|
|
|
|
$p->set_var('lang_search',lang('search'));
|
2001-02-20 15:12:06 +01:00
|
|
|
|
|
|
|
$p->pparse('out','list');
|
|
|
|
|
|
|
|
$phpgw->common->phpgw_footer();
|
2000-09-28 04:25:19 +02:00
|
|
|
?>
|