Location: PHPKode > projects > 3TimeReport > timereport_0.61/userlist.php
<?
//############################################################
//
// $Id: userlist.php,v 1.6 2002/12/15 12:43:06 eric Exp $
//
//  
//
//
//############################################################
require_once("./config.php");
if(isset($picked_user))
{
	setcookie ("timereport_user",$picked_user,time()+3600,"/");
	$message="Cookie stored";
	echo parsepage("./html/message.html");
	exit;
}

$help_loginname=get_help("help_loginname");
$help_fullname=get_help("help_fullname");
$help_shortname=get_help("help_shortname");
$help_password=get_help("help_password");

if( isset($action) && $action=="new")
{
	$sqlstr='insert into users set login="'.input_read('login', 'get', 'string').'", password="'.input_read('password', 'get', 'string').'", longname="'.input_read('longname', 'get', 'string').'", shortname="'.input_read('shortname', 'get', 'string').'"';
	$db->query($sqlstr);
	if( $db->affected_rows()>0 )
		$message="User created";
	else
		$message="User could NOT be created";
	echo parsepage("./html/message.html");
	exit;
}
echo parsepage("./html/userlist-top.html");


$sqlstr="select * from users order by longname desc";
$db->query($sqlstr);
while( $db->next_record() )
{
	$u_login = $db->f('login');
	$u_longname = $db->f('longname');
	$u_shortname = $db->f('shortname');
	$u_edit_url = 'edit_user.php?uid='.$db->f('uid');
	$u_del_url = 'delete_user.php?uid='.$db->f('uid');

	echo parsepage("./html/userlist-tr.html");
}

echo parsepage("./html/userlist-fot.html");

//
// $Log: userlist.php,v $
// Revision 1.6  2002/12/15 12:43:06  eric
// Modified to include a delete/edit link. Moved the form of adding user to edit_user.php
//
// Revision 1.5  2002/12/12 20:24:41  eric
// added a field for password
// changed to use the databaseclass and the input_read
// added an error message if the user could not be created for some reason.
//
// Revision 1.4  2002/12/03 15:09:39  kling
// sets cookie
//
// Revision 1.3  2002/12/03 10:09:35  kling
// initial release for V 0.5
// eric joined team
//
//
//

?>
Return current item: 3TimeReport