{if $ajax eq 0}{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_moderators}
    </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 href="msglist.php">{$lang.admin_menu.chat_messages}</a>
    </li>
    <li>
        <a href="roomlist.php">{$lang.admin_menu.settings}</a>
    </li>
    <li>
        <a class="current">{$lang.admin_menu.object_moderation}</a>
    </li>
</ul>{/if}
		<div class="user_operation_line" style="height:4px;">

		</div>
	<div style="float:left;width:100%;">
	<table border=0 cellspacing=1 cellpadding=3 width="100%">
	<tr height="40" bgcolor="#FFFFFF">
        <td height="30"  align="right" bgcolor="#FFFFFF" class="main_content_text" style="padding-left:0px;">
		<form id="search_form" name="search_form" action="{$form.action}" method="post" enctype="multipart/form-data">
		<table><tr>
		<td class="main_content_text" style="padding-left:0px;">&nbsp;</td>
		<td class="main_content_text"><input type="text" name=search value="{$search}"></td>
		<td class="main_content_text">
			<select name="s_type">
				{section name=s loop=$types}
				<option value="{$smarty.section.s.index_next}" {if $types[s].sel}selected{/if}>{$types[s].value}</option>
				{/section}
			</select>
		</td>
		<td class="main_content_text">
			<input type="hidden" name=sel value="search">
			<input type="hidden" name=ajax value="1">
			<a class="admin_button_major" onclick="Add_status();">{$lang.button.search}<span>&nbsp;</span></a>
		</td>
		{if $search_select}
		<td class="main_content_text"><select name="search_select">
		{section name=s loop=$search_select}
		<option value="{$search_select[s].id}">{$search_select[s].name}</option>
		{/section}
		</select></td>
		<td class="main_content_text">
			<input type="hidden" name=sel value="add">
			<input type="hidden" name=ajax value="1">
{*			<input type="button" onclick="javascript: document.search_form.sel.value='add'; document.search_form.submit();" name="add_submit" value="{$lang.button.add}">*}
			<a class="admin_button_major" onclick="Add_user();" name="add_submit">{$lang.button.add}<span>&nbsp;</span></a>
		</td>
		{/if}
		</tr></table>
		</form>
        </td>
	</tr>
	</table>
	</div>
	<div class="user_status_line" style="margin-bottom:0px;width:100%;">
        <div id="tab_news" class="user_status_elem" onclick="links_load('ignorelist.php?');">
            <a>{$lang.admin_menu.chat_ignoring}</a>
        </div>
        <div id="tab_feeds" class="user_status_elem" onclick="links_load('botlist.php?');">
            <a>{$lang.admin_menu.chat_bots}</a>
        </div>
        <div class="user_status_elem_active">
            {$lang.admin_menu.chat_moderators}
        </div>
	</div>
	<div id="user_table" style="float:left;width:100%;">
	<form id="modlist" name="modlist" action="{$form.action}" method="post" enctype="multipart/form-data">
	<input type="hidden" name="ajax" value="1"/>
    <table border=0 cellspacing=0 cellpadding=0 width="100%">
		<tr class="table_header">
			<td width="20%" align="left">{$header.nick}</td>
			<td width="50%" align="left">{$header.name}</td>
			<td width="10%" align="center">{$header.created}</td>
			<td width="10%" align="center">{$header.status}</td>
			<td width="10%" align="center">{$header.delete_small}</td>
		</tr>
		{foreach from=$mods item=mod name=i}
		<tr {if $smarty.foreach.i.iteration mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
			<td class="main_content_text" align="left">{$mod.login}</td>
			<td class="main_content_text" align="left">{$mod.name}</td>
			<td class="main_content_text" align="center">{$mod.date}</td>
			<td class="main_content_text" align="center"><input type="checkbox" name="{$mod.status_name}" {if $mod.status}checked{/if} {if $mod.root_user}disabled{/if}></td>
			<td class="main_content_text" align="center"><input type="checkbox" name="{$mod.delete_name}" {if $mod.root_user}disabled{/if}></td>
			<input type="hidden" name="{$mod.id_name}" value="{$mod.id}">
		</tr>
		{foreachelse}
		<tr height="40">
			<td class="main_error_text" align="left" colspan="4">{$header.err_no_moderators_found}</td>
		</tr>
		{/foreach}
		<tr class="table_header"><td colspan="5"></td></tr>
	</table>
	<table style="margin-top:15px;">
	<tr height="40">
		<td><input type="hidden" name=sel value="submit_all">
			<a class="admin_button_major" onclick="Save_status();">{$header.submit_all_btn}<span>&nbsp;</span></a>
		</td>
	</tr>
	</table>
	<br><br>
	</form></div>
<script type="text/javascript">
{literal}
function Add_user(){
var options = {
	  success: function() {
			ajaxLoadingImage(0, 'aff_ads_div');
			links_load('modlist.php?');
		},
	beforeSubmit: function() { 
		ajaxLoadingImage(1, 'aff_ads_div');
	}
	};
	$("#search_form").ajaxSubmit(options); 
}	
function Add_status(){
var options = {
	  success: function(data) {
			ajaxLoadingImage(0, 'aff_ads_div');
			$('#aff_ads_div').html(data);
		},
	beforeSubmit: function() { 
		ajaxLoadingImage(1, 'aff_ads_div');
	}
	};
	$("#search_form").ajaxSubmit(options); 
}	
function Save_status(){
var options = {
	  success: function(data) {
			ajaxLoadingImage(0, 'aff_ads_div');
            $('#aff_ads_div').html(data);
		},
	beforeSubmit: function() { 
		ajaxLoadingImage(1, 'aff_ads_div');
	}
	};
	$("#modlist").ajaxSubmit(options); 
}	
{/literal}
</script>
{if $ajax eq 0}
{include file="$admingentemplates/admin_bottom.tpl"}{/if}