Location: PHPKode > projects > O - OpenSource GroupWare > osgw/admin/user_list.php
<?php
/**************************************************************************
   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.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/
include("./data.php");
$service['add_header'] = TRUE;
include("../config.inc.php");

include($here. "/class.admin.php");
$admin = new admin;
echo $layout->page_header;
echo $layout->service_header($text['service_name'].' - '. $lang->msgs['user_list'], $admin->nav_buttons());


$sql = "SELECT * FROM o_users,o_tracker,o_user_security WHERE o_users.user_id=o_tracker.user_id 
	AND o_users.user_id=o_user_security.user_id";
$db->query($sql);
 

	$class = "list_header";
	echo $buffer = $html->create_list(
		$replace_header = array(
			"STYLE"		=> $class,
			"USER_ID"	=> $text['user_id'],
			"USERNAME"	=> $text['username'],
			"NAME"		=> $text['name'],
			"EMAIL"		=> $text['email'],
			"LAST_LOGIN"	=> $text['last_login'],
			"LAST_ACTIVE" => $text['last_active'],
			"STATUS"	=> $text['status']),
		$O->dir ."/admin/html/user_list_hdr.html");
while($db->fetch_results())
{
	$class = $html->list_class($class);
	
	if(!is_null($db->record['disabled']))
	{
		$disabled = "Disabled";
		$tmp = $class;
		$class = "expired";
	} else {
		$disabled = "Active";
	
	}
	if(is_null($db->record['last_login']))
	{
		$last_login = 'Never';
	} else {
		$last_login = date($date->short_date . ' - '. $date->time,$db->record['last_login']);
	}
	echo $buffer = $html->create_list(
		$replace_header = array(
			"STYLE"		=> $class,
			"USER_ID"	=> $db->record['user_id'],
			"USERNAME"	=> $O->create_link('/view_user.php?user_id='. $db->record['user_id'], $db->record['username'], $class),
			"NAME"		=> $db->record['firstname'] . " ". $db->record['lastname'],
			"EMAIL"		=> '<a href="mailto:'. $db->record['email'] .'" class="'. $class .'">'. $db->record['email'] .'</a>',
			"LAST_LOGIN"	=> $last_login,
			"LAST_ACTIVE" =>date($date->short_date . ' - '. $date->time ,$db->record['last_action_time']),
			"STATUS"	=> $disabled),
		$O->dir ."/admin/html/user_list.html");
}
 
 ?>
 <tr><td>&nbsp;</td></tr>
 <tr>
 <td colspan="9" style="text-align: right" class="<?php echo $class?>">
 Total Users: <?php echo $db->num_rows?>
 </td>
 </tr>
 </table>
 
<?php echo $layout->create_footer();?>
Return current item: O - OpenSource GroupWare