{include file="$admingentemplates/admin_top.tpl"}
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_modules.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$header.razdel_name}</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;">
    <div class="close_help">
        <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
    </div>
    <div class="help_body">
        <span class="help_title">{$lang.help}:</span>{$help.chat_messages}
    </div>
</div>
<div class="cr">&nbsp;</div>
<div style="float:right;"><a href="{$site_url}{$site_root}/flash_chat/flashchat.php" target="_blank">{$lang.admin_menu.chat_login}</a></div>
<div class="cr">&nbsp;</div>
<ul class="tabs">
    <li>
        <a class="current">{$lang.admin_menu.chat_messages}</a>
    </li>
    <li>
        <a href="roomlist.php">{$lang.admin_menu.settings}</a>
    </li>
{*    <li>
        <a href="connlist.php">{$lang.admin_menu.chat_connections}</a>
    </li>
    <li>
        <a href="banlist.php">{$lang.admin_menu.chat_bans}</a>
    </li>*}
    <li>
        <a href="ignorelist.php">{$lang.admin_menu.object_moderation}</a>
    </li>
{*    <li>
        <a href="botlist.php">{$lang.admin_menu.chat_bots}</a>
    </li>
    <li>
        <a href="modlist.php">{$lang.admin_menu.chat_moderators}</a>
    </li>
    <li>
        <a href="modules.php">{$lang.admin_menu.chat_modules}</a>
    </li>*}
{*    <li>
        <a href="{$site_url}{$site_root}/flash_chat/flashchat.php" target="_blank">{$lang.admin_menu.chat_login}</a>
    </li>*}
</ul>
<div class="panel_section">
<div class="panel_content">
	<form name="msglist" id="msglist" action="msglist.php" method="post">
	<table border=0 cellspacing=0 cellpadding=0>
		<tr>
			<td class="main_content_text" align="left" style="padding:5px 0px 5px 0px;">{$header.in_this_room}:</td>
			<td style="padding:5px 0px 5px 0px;">
				<select name="roomid">
				<option value="0">{$header.any_room_option}
				{html_options options=$rooms selected=$smarty.request.roomid}
				</select>
			</td>
		</tr>
		<tr>
			<td class="main_content_text" align="left" style="padding:5px 0px 5px 0px;">{$header.between_these_dates}:</td>
			<td style="padding:5px 0px 5px 0px;"><input type="text" name="from" value="{$smarty.request.from}" size="19">&nbsp;{$header.and}&nbsp;<input type="text" name="to" value="{$smarty.request.to}" size="19">&nbsp;{$header.date_format_example}</td>
		</tr>
		<tr>
			<td align="left" style="padding:5px 0px 5px 0px;">{$header.days_text}:</td>
			<td style="padding:5px 0px 5px 0px;"><input type="text" name="days" value="{$smarty.request.days}" size="8"></td>
		</tr>
		<tr>
			<td align="left" style="padding:5px 0px 5px 0px;">{$header.by_this_user}:</td>
			<td style="padding:5px 0px 5px 0px;">
				<select name="userid">
				<option value="0">{$header.any_user_option}
				{html_options options=$users selected=$smarty.request.userid}
				</select>
			</td>
		</tr>
		<tr>
			<td align="left" width="200" style="padding:5px 0px 5px 0px;">{$header.keyword_text}:</td>
			<td style="padding:5px 0px 5px 0px;"><input type="text" name="keyword" value="{$smarty.request.keyword}" size="32"></td>
		</tr>
		</table>
	</form>
</div>
</div>
<div style="float:left;width:100%;">
	<table width="100%">
		<tr>
			<td colspan="2">
				<a class="admin_button_major" name="apply" onclick="document.msglist.submit();">{$header.show_messages_btn}<span>&nbsp;</span></a>
				<a class="admin_button" name="clear" style="float:right;" onclick="document.msglist.submit();">{$header.clear_filter_btn}<span>&nbsp;</span></a>
				<input type="hidden" id="sort" name="sort" value="none">
			</td>
		</tr>
	</table>
</div>
<div style="float:left;width:100%;margin-top:10px;">
<table border=0 cellspacing=0 cellpadding=0 width="100%">
	<tr class="table_header">
		<td class="main_header_text" align="left"><a href="javascript:my_getbyid('sort').value = 'id'; my_getbyid('msglist').submit()">{$header.id}</a></td>
		<td class="main_header_text" align="center"><a href="javascript:my_getbyid('sort').value = 'sent'; my_getbyid('msglist').submit()">{$header.sent}</a></td>
		<td class="main_header_text" align="center"><a href="javascript:my_getbyid('sort').value = 'user'; my_getbyid('msglist').submit()">{$header.from_user}</a></td>
		<td class="main_header_text" align="center"><a href="javascript:my_getbyid('sort').value = 'toroom'; my_getbyid('msglist').submit()">{$header.to_room}</a></td>
		<td class="main_header_text" align="center"><a href="javascript:my_getbyid('sort').value = 'touser'; my_getbyid('msglist').submit()">{$header.to_user}</a></td>
		<td class="main_header_text" align="center">{$header.txt}</td>
	</tr>
{foreach from=$messages item=message name=spr}
	<tr {if $smarty.foreach.spr.iteration mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
		<td align="left">{$message.id}</td>
		<td align="center">{$message.sent}</td>
		<td align="center">{$message.user}</td>
		<td align="center"><a href="room.php?id={$message.toroomid}">{$message.toroom}</a></td>
		<td align="center">{$message.touser}</td>
		<td align="center">{$message.txt}</td>
	</tr>
{foreachelse}
	<tr height="40">
		<td class="main_error_text" align="left" colspan="6" bgcolor="#FFFFFF">{$header.err_no_messages_found}</td>
	</tr>
{/foreach}
	<tr class="table_header"><td colspan="6">&nbsp;</td></tr>
	</table>
</div>
{*<p align="right" class="main_header_text">&copy;<a href="http://tufat.com/" target="_blank">TUFaT.com</a> </p>*}
{include file="$admingentemplates/admin_bottom.tpl"}