{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_bots}
    </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 id="aff_ads_div">  
{if $form_type eq '1'}
<div class="user_operation_line">
{if $enableBots}
		<div onclick="links_load('bot.php?id=0&');" class="uol_item">
            <div class="uol_in_item">{$lang.chats.add_new_bot}</div>
        </div>
{else}
		<div onclick="links_load('botlist.php?sel=install_form&');" class="uol_item">
            <div class="uol_in_item">{$lang.chats.install_bots}</div>
        </div>
{/if}
</div>
{/if}
{if $form_type eq '2' || $form_type eq '3'}
<div class="user_operation_line" style="height:4px;">
</div>
{/if}
    <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_active">
            {$lang.admin_menu.chat_bots}
        </div>
        <div class="user_status_elem" onclick="links_load('modlist.php?');">
            <a>{$lang.admin_menu.chat_moderators}</a>
        </div>
	</div>
  
<div style="float:left;width:100%;">
{if $form_type eq '1'}
	{*{if $enableBots}*}
<div style="float:left;width:100%;">	
	<form name="botlist" id="botlist" action="botlist.php" method="post">
		<input type="hidden" id="sort" name="sort" value="none">
	</form>
{*	<table><tr height="40"><td>
		<a class="admin_button_major" onclick="javascript: location.href='bot.php?id=0';">{$lang.chats.add_new_bot}<span>&nbsp;</span></a>
	</tr></table>
	<br>*}
	<table border=0 cellspacing=0 cellpadding=0 width="100%">
	<tr class="table_header">
		<td class="main_header_text" align="left" style="color: white;"><a style="color:white;" href="javascript:my_getbyid('sort').value = 'login'; my_getbyid('botlist').submit()">{$lang.chats.bot_name}</a></td>
		<td class="main_header_text" align="right" style="color: white;">{$button.action}</td>
	</tr>
	
	{foreach from=$botnames item=bot name=f}
	{assign var="on_click" value="javascript: links_load('botlist.php?id=`$bot.id`&')"}
	<tr {if $smarty.foreach.f.iteration mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
		<td class="main_content_text" align=left><a onclick="links_load('bot.php?id={$bot.id}&');">{$bot.login}</a></td>
		<td class="main_content_text" align="center">
			{*<input type="button" id="{$button_pass_id}" onclick="{$on_click}" value="Delete">*}
			<div id="{$button_pass_id}" class="block_action fr" style="display: none;">
				<div class="action_del" style="display: block;">
					<img width="16" alt="" src="{$site_root}{$template_root}/images/photo_delete.png" onclick="{$on_click}">
				</div>
			</div>						
		</td>
	</tr>
	{foreachelse}
		<tr height="40">
			<td class="main_error_text" align="left" colspan="2">{if $enableBots}{$lang.chats.no_bots}{else}{$lang.chats.bots_disabled}{/if}</td>
		</tr>
	{/foreach}
		<tr class="table_header"><td colspan="3" >&nbsp;</td></tr>
	</table>
</div>
{*	{else}
	<table><tr height="40"><td>
		<a class="admin_button_major" onclick="javascript: location.href='./botlist.php?sel=install_form';">{$lang.chats.install_bots}<span>&nbsp;</span></a>
	</tr></table>
	<table border=0 cellspacing=0 cellpadding=0 width="100%">
		<tr height="40">
			<td class="main_error_text" align="left" colspan="2">{$lang.chats.bots_disabled}</td>
		</tr>
	</table>
	{/if}*}
{elseif $form_type eq '2'}
<div class="panel_subtabs">
<div class="panel_content" style="width:97%;">
	<font color="red">{$errmsg}</font>
	<form  method="post" align="center" name="installInfo"  action="./botlist.php">
	<input type="hidden" name=sel value="install"><br>
	<table border=0 cellspacing=0 cellpadding=0 width="100%">
	<tr>
		<td class="main_content_text" align="left" colspan="3">
			<font class="main_header_text">{$lang.chats.integrating}</font><br>
			{$lang.chats.integrating_descr}
		</td>
	</tr>
	{if $errmsg}
	<tr height="40">
		<td class="main_error_text" align="left" colspan="3">{$errmsg}</td>
	</tr>
	{/if}
	<tr height="40">
		<td class="main_content_text" align="left" colspan="3">{$lang.chats.knowledgebase}</td>
	</tr>
	<tr>
		<td class="main_content_text" align="center" colspan="3">
			<table  border="0" cellspacing="5" width="100%">
									{section name=s loop=$learnfiles}
									{if $smarty.section.s.index is div by 3}<tr>{/if}
									<td nowrap class="main_content_text"><INPUT type="checkbox" name="fld_{$learnfiles[s]}" value="1" checked style='border: none'>&nbsp;{$learnfiles[s]}</td>
									{if $smarty.section.s.index_next is div by 3 || $smarty.section.s.last}</tr>{/if}
									{/section}
			</table>
		</td>
	</tr>
	</table>
	</form>
</div>
</div>
{elseif $form_type eq '3'}
<div class="panel_section">
<div class="panel_content" style="width:97%;">
	<font color="red">{$errmsg}</font>
	<input type="hidden" name=sel value="install">
	<table border=0 cellspacing=0 cellpadding=0 width="100%">
	{if $errmsg}
	<tr height="40">
		<td class="main_error_text" align="left" colspan="3">{$errmsg}</td>
	</tr>
	{/if}
	<tr height="40">
		<td class="main_content_text" align="left" colspan="3">
		<font class="main_header_text">{$lang.chats.integrating}</font><br>
		{$lang.chats.knowledgebase_loading}
		</td>
	</tr>
	<tr>
		<td class="main_content_text" align="center" colspan="3">
			<iframe application="Loader" title="Loader" scrolling="yes" frameborder="0" marginwidth="0" hspace="0" name="Loader"
	    		align="left" id="Loader" src="../bot/programe/src/botinst/botloader.php?lang_botton={$lang.button.gr_next}"  width="100%" height="600">
	  		</iframe>
		</td>
	</tr>
	</table>
</div>
</div>
{/if}
{if $form_type eq '2'}
	<table><tr height="40"><td>
		<a class="admin_button_major" onclick="Save_status();">{$lang.button.gr_next}<span>&nbsp;</span></a>
	</tr></table>
{/if}
</div>
</div>
<script type="text/javascript">
{literal}
function Save_status(){
document.installInfo.submit();}
/*var options = {
	  success: function(data) {
	  		$('#installInfo').html(data),
			ajaxLoadingImage(0, 'aff_ads_div');
		},
	beforeSubmit: function() { 
		ajaxLoadingImage(1, 'aff_ads_div');
	}
	};
	$("#installInfo").ajaxSubmit(options);
}	*/
{/literal}
</script>
{if $ajax eq 0}
{*<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"}{/if}