{if $ajax eq 0}
{include file="$admingentemplates/admin_top.tpl"}

<font class=red_header>{$header.razdel_name}</font><!--<font class=red_sub_header>&nbsp;|&nbsp;{$header.upr_list}&nbsp;|&nbsp;{$lang.admin_menu.upr_recslist}</font><br><br><br>-->
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
<div style="display:block;" class="help_text">
	<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>{$lang.admin_help.av_module}
	</div>
</div>
<div class="cr">&nbsp;</div>
<div style="display:table;width:100%;">
	<ul class="tabs">
		<li>
			<a href="{$site_url}{$site_root}/admin/{$file_name_root}">{$lang.admin_menu.settings}</a>
		</li>
		<li>
			<a href="{$site_url}{$site_root}/topcmm_123flashchat/admin/basicsetting.php">{$lang.settings.123flashchat}</a>
		</li>
		<li>
			<a href="{$site_url}{$site_root}/admin/admin_chat7.php">{$lang.settings.flashcoms}</a>
		</li>
		{*<li>
			<a href="{$site_url}{$site_root}/admin/admin_toksta.php?app=chat">{$lang.settings.toksta}</a>
		</li>*}
		<li>
			<a class="current">{$lang.settings.userplane}</a>
		</li>
		<li>
			<a href="{$site_url}{$site_root}/admin/admin_av_module.php?sel=cometchat">Cometchat</a>
		</li>
	</ul>
	<div class="user_operation_line" style="height:4px;font-size:0px;">&nbsp;</div>
</div>
{/if}
<div class="ajax_load" id="ajax_load" style="overflow:hidden;">
	<div id="user_status_line" class="user_status_line" style="margin-bottom:-1px;">
		<div id="tab_chat" class="user_status_elem" onclick="List('chat')">
			<a>{$lang.av_module.chat}</a>
		</div>
		<div id="tab_mess" class="user_status_elem" onclick="List('mess');">
			<a>{$lang.av_module.messenger}</a>
		</div>
		<div id="tab_rec" class="user_status_elem_active" onclick="List('rec');">
			{$lang.av_module.recorder}
		</div>
	</div>

	<table border=0 class="" cellspacing=0 cellpadding=0 width="100%" id="div_content_value">
	
	<tr bgcolor="#ffffff">
	  <td>
		<div style="margin:10px;">
			<select onchange="List_select(this.options[this.selectedIndex].value);">
				<option value="{$site_url}{$site_root}/admin/webrecorder/settings.php">{$chats.upc_settings}</option>
				<option value="{$site_url}{$site_root}/admin/webrecorder/recslist.php" selected>{$chats.upr_recslist}</option>
			</select>
		</div>
	</td></tr>
	{if $links}
	<tr bgcolor="#ffffff">
	  <td height="20" colspan=5 align="left" class="main_content_text">{$links}</td>
	</tr>
	{/if}
	<tr class="table_header">
	  <td width="5%">{$header.number}</td>
	  <td width="50%"><div onclick="javascript:location.href='{$form.action}?sorter=user';">{$header.user}</div></td>
	  <td width="20%"><div onclick="javascript:location.href='{$form.action}?sorter=created';">{$header.created}</div></td>
	  <td width="10%"><div onclick="javascript:location.href='{$form.action}?sorter=status';">{$header.status}</div></td>
	  <td width="15%">{$header.action}</td>
	</tr>

	{section name=num loop=$recs}
	<tr {if $smarty.section.num.index mod 2 eq 1}class="even"{else}class="odd"{/if}>
	  <td valign="top" align=left><font class="main_content_text">{$recs[num].number}</td>
	  <td valign="top" align=left><font class="main_content_text">{$recs[num].user}</td>
	  <td valign="top" align=left><font class="main_content_text">{$recs[num].created}</td>
	  <td valign="top" align=left><font class="main_content_text">{$recs[num].status}</td>
	  <td valign="top" align=left><font class="main_content_text"><a href="#" onclick="javascript: window.open('{$recs[num].action_link}','admin_record','menubar=0, resizable=1, scrollbars=0,status=0,toolbar=0, width={$form.wr_width},height={$form.wr_height}');return false;">{$recs[num].action}</a></td>
	</tr>

	{sectionelse}

	<tr bgcolor="#FFFFFF">
		  <td align=center colspan="5"><font class="main_content_text">{$header.no_records}</td>
	</tr>

	{/section}

	<tr class="table_header"><td colspan="5"></td></tr>
	{if $links}
	<tr bgcolor="#ffffff">
	  <td height="20" colspan=5 align="left" class="main_content_text">{$links}</td>
	</tr>
	{/if}
	</table>
</div>
{if $ajax eq 0}
{include file="$admingentemplates/admin_bottom.tpl"}
{/if}
{literal}
<script language="JavaScript" type="text/javascript" >  
if ({/literal}"{$ajax}"{literal} == 0) 
    var tab_id_last = 'chat';
	var site_url = {/literal}"{$site_url}"{literal};
	var site_root = {/literal}"{$site_root}"{literal};
	var path = site_url+site_root+"/admin/admin_av_module.php";
		
function List(subtabs) {
	if ($('#tab_'+subtabs).find('a').text() == '') return;
	
	var ajax = 1;
	$('#tab_'+tab_id_last).html("<a>"+$('#tab_'+tab_id_last).text()+"<\/a>");
	$('#tab_'+subtabs).text($('#tab_'+subtabs).text());
	$('#tab_'+tab_id_last).removeClass('user_status_elem_active');
	$('#tab_'+tab_id_last).addClass('user_status_elem');
	$('#tab_'+subtabs).removeClass('user_status_elem');
	$('#tab_'+subtabs).addClass('user_status_elem_active');
	
	if (subtabs == "mess")
		path = site_url+site_root+"/admin/webmessenger/connlist.php";
	if (subtabs == "chat"){
		path = site_url+site_root+"/admin/webchat/roomlist.php";
		ajax = 0;
	}
	tab_id_last = subtabs;
	if (subtabs != "chat"){
		ajaxLoadingImage(1, 'ajax_load');
		$.post(path, {par:'4',subtabs:subtabs,ajax:ajax}, function(data){
			ajaxLoadingImage(0, 'ajax_load');
			$('#ajax_load').html(data);
		});
	}
	else{document.location = path;}
}
function List_select(value) {
	ajaxLoadingImage(1, 'ajax_load');
	$.post(value, {ajax:'1'}, function(data){
		ajaxLoadingImage(0, 'ajax_load');
		$('#ajax_load').html(data);
	});
}
</script>
{/literal}