<?php

	if (! $sessionid)
	{
		Header("Location: ../login.php");
	}

	$phpgw_info["flags"] = array(
		"currentapp" => "chat",
		"noheader" => True,
		"nonavbar" => True
	);
	include("../header.inc.php");

	$phpgw->db->query("select * from phpgw_sessions ORDER BY session_lid");

	$size = $phpgw->db->nf();
	if (($size == 0) || ($size == 1))
	{
		$size = 2;
	}

	echo '<head><META HTTP-EQUIV="Refresh" Content="30" HREF="#bottom">
</head>';
?>

<body>
    <center><b><?php echo lang('Online'); ?>:</b>
    <form method="post" action="<?php echo $phpgw->link('/chat/load.php') ?>" target="_top">
    <input type="hidden" name="channel" value="<?php echo $channel; ?>">
    <input type="hidden" name="action" value="newprivate">
    <select name="channel" size="<?php echo $size; ?>">

<?php
	$phpgw->db->query("select * from phpgw_sessions ORDER BY session_lid");
	while ($phpgw->db->next_record())
	{
		echo "<option value= '" . $phpgw->db->f("session_lid") . "'>" . $phpgw->db->f("session_lid");
	}
?>

	</select><br>
	<input type="submit" value="<?php echo lang('Private Chat') ?>"></form>

	<a href="<?php echo $phpgw->link('/chat/users.php') ?>"><?php echo lang('Refresh Users') ?></a>
	</center><p>
</html>
</body>
