{include file="$admingentemplates/admin_top.tpl"}
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.banners.razdel_name}</div>
<div class="cr">&nbsp;</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>{$lang.admin_help.banners_edit}
    </div>
</div>
<ul class="tabs">
    <li>
        <a class="current">{$lang.admin_menu.banners_list}</a>
    </li>
    <li>
        <a href="admin_banners.php?sel=user_banners">{$lang.admin_menu.user_banners}</a>
    </li>
    <li>
        <a href="admin_banners.php?sel=settings">{$lang.admin_menu.banners_settings}</a>
    </li>
</ul>
<div class="user_operation_line">
            <div class="uol_item" onclick="javascript: location.href='admin_banners.php?sel=add';">
                <div class="uol_in_item">{$lang.button.add}</div>
            </div>
</div>
<div class="cr"></div>
<div id="tooltip" onclick="hideToolTip()" style="text-align:center; background-color: #FFFFFF; border: 1px dotted; text-align: {$default_left}; position:absolute; display:none; padding:5px;"></div>
{literal}
<script type="text/javascript">
$(function() {
$('#tool_tip_4 *').tooltip();
});
</script>
{/literal}
<p>{$lang.settings.use_user_banners_feature}:&nbsp;
<input type="checkbox" name="user_banners_feature" id="user_banners_feature" value="1" {if $use_user_banners}checked{/if} onclick="Banners();">
<span style="padding-left:100px;" class="error_box_blue" id="save"></span>
</p>
        <table border=0 cellspacing=0 cellpadding=0 width="100%">
              <tr class="table_header">
                <td class="main_header_text" align="middle">{$lang.banners.status}</td>
                <td class="main_header_text" align="left">{$lang.banners.banner}</td>
                <td class="main_header_text" align="left">{$lang.banners.link}</td>
                <td class="main_header_text" align="left">{$lang.banners.place}</td>
                <td class="main_header_text" align="left" width="120" style="white-space:nowrap;">{$lang.banners.stop_after}</td>
                <td class="main_header_text" align="left" style="white-space:nowrap;">{$lang.banners.show_for}</td>
                <td class="main_header_text" align="right" style="white-space:nowrap;width:100px;">{$lang.button.action}</td>
              </tr>
              {foreach from=$all_banners item=one_banner name=spr}
              <tr {if $smarty.foreach.spr.iteration mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
                <td class="main_content_text" align="center" valign="top" style="padding-top:5px;">
                    <input type="checkbox" name="comments" disabled="disabled" {if $one_banner.status eq 1}checked="checked"{/if}>
                </td>
                <td class="main_content_text" align="left" valign="top" style="padding-top:5px;">
                  <table>
                   <tr><td class="main_content_text" align="left" style="padding-left:0px;">
                    {$one_banner.name}
                   </td></tr>
                   {if $one_banner.banner_type  eq "1"}
                     <tr><td class="main_header_text" align="left" style="padding-left:0px;">
                       {$lang.banners.this_is_html_code}
                     </td></tr>
                   {elseif $one_banner.banner_type  eq "2"}
                     <tr><td class="main_header_text" align="left" style="padding-left:0px;">
                       {$lang.banners.this_is_js_code}
                     </td></tr> 
                   {else}
                     <tr><td class="main_content_text" align="left" style="padding-left:0px;">
                       {$lang.banners.size}: {$one_banner.size_x}x{$one_banner.size_y}
                     </td></tr>
                     <tr><td align="left" style="padding-left:0px;">
                      {if $one_banner.img_file_path neq ""}
                        <img src="{$one_banner.img_file_path}" width="{$one_banner.show_size_x}" height="{$one_banner.show_size_y}" alt="{$one_banner.alt_text}">
                      {/if}
                     </td></tr>
                   {/if}
                  </table>
                </td>
                {if $one_banner.banner_type  eq "1"}
                <td>
                </td>
                {else}
                <td class="main_content_text" align="left" valign="top" style="padding-top:5px;">
                 <a href="{$one_banner.banner_url}">{$one_banner.banner_url}</a>
                </td>
                {/if}
                <td class="main_content_text" align="left" valign="top" style="padding-top:5px;">
                  <table>
                    <tr><td class="main_content_text" align="left" style="padding-left:0px;">
                       {$lang.banners.position}: {if $one_banner.place eq 0}{$lang.banners.position_left}{/if}{if $one_banner.place eq 1}{$lang.banners.position_bottom}{/if}{if $one_banner.place eq 2}{$lang.banners.position_right}{/if}{if $one_banner.place eq 3}{$lang.banners.position_top}{/if} <br>
                    </td></tr>
                    <tr><td class="main_content_text" align="left" style="padding-left:0px;">

                    {foreach from=$one_banner.areas item=one_area}
                      {$one_area.description};&nbsp&nbsp
                    {/foreach}

                    </td></tr>
                  </table>
                </td>
                <td class="main_content_text" align="left" valign="top" style="padding-top:5px;">
                {if $one_banner.stop_after_views eq 0}
                 {$lang.banners.stoped_by_views}!
                {elseif $one_banner.stop_after_hits eq 0}
                  {$lang.banners.stoped_by_hits}!
                {elseif $one_banner.stoped_by_date}
                  {$lang.banners.stoped_by_date}!
                {elseif $one_banner.stop_after_views neq -1 or $one_banner.stop_after_hits neq -1 or $one_banner.stop_after_date neq "0000-00-00"}
                 {if $one_banner.stop_after_views neq -1}
                   {$lang.banners.stop_after_views}: {$one_banner.stop_after_views} <br><br>
                 {/if}
                 {if $one_banner.stop_after_hits neq -1}
                   {$lang.banners.stop_after_hits}: {$one_banner.stop_after_hits}
                 {/if}
                 {if $one_banner.stop_after_date neq "0000-00-00"}
                   {$lang.banners.stop_after_date}: {$one_banner.stop_after_date}
                 {/if}
                {else}
                 {$lang.banners.never_stop}
                {/if}
                </td>
				<td valign="top" align="left" style="padding-top:5px;">
					{$one_banner.groups}
				</td>
                <td class="main_content_text" align="right" valign="top" style="padding-top:5px;">
{*                <a href="admin_banners.php?sel=statistics&id={$one_banner.id}">{$lang.button.statistic}</a>&nbsp;<br><br>
                <a href="{$FILE_SELF}?sel=edit&id={$one_banner.id}">{$lang.button.edit}</a>&nbsp;<br><br>
*}					<div 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" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" onclick="javascript: if (window.confirm('{$lang.banners.realy_delete|escape:javascript}')){literal}{{/literal}location.href='{$FILE_SELF}?sel=delete&id={$one_banner.id}';{literal}}{/literal}">
						</div>
					</div>			
					<div style="width:10px;float:right;" class="fl">&nbsp;</div>
					<div class="block_action fr" style="display: none;">
						<div class="action_edit" style="display: block;">
							<img width="16" alt="" src="{$site_root}{$template_root}/images/edit.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false" onclick="document.location.href='{$FILE_SELF}?sel=edit&id={$one_banner.id}'">
						</div>
					</div>			
					<div style="width:10px;float:right;" class="fl">&nbsp;</div>
					<div class="block_action fr" style="display: none;">
						<div class="action_edit" style="display: block;">
							<img width="16" alt="" src="{$site_root}{$template_root}/images/admin_marketing_view1.gif" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.statistic}');return false" onclick="document.location.href='admin_banners.php?sel=statistics&id={$one_banner.id}'">
						</div>
					</div>			
				
{*                <a href="#" onclick="javascript: if (window.confirm('{$lang.banners.realy_delete|escape:javascript}')){literal}{{/literal}location.href='{$FILE_SELF}?sel=delete&id={$one_banner.id}';{literal}}{/literal}">{$lang.button.delete}</a>&nbsp;*}
		</td>
              </tr>
		{foreachelse}
		<tr height="40">
			<td class="main_error_text" align="left" colspan="7">{$lang.interests_spr.empty}</td>
		</tr>
              {/foreach}
              <tr class="table_header">
                <td colspan="7">&nbsp;</td>
              </tr>
{*              <tr bgcolor="#FFFFFF">
                <td colspan="7" align="left" style="padding-top:15px;">
					<a class="admin_button_major" onclick="javascript: location.href='admin_banners.php?sel=add';">{$lang.button.add}<span>&nbsp;</span></a>
				</td>
              </tr>*}
        </table>
<script type="text/javascript">
{literal}
		function showToolTip(e,text){
			if(document.all)e = event;
			var obj = document.getElementById('tooltip');
			obj.innerHTML = text;
			obj.style.display = 'block';
			var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
			var leftPos = e.clientX - $('#tooltip').width()-10;
			if(leftPos<0)leftPos = 0;
			obj.style.left = leftPos + 'px';
			obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
		}
		function hideToolTip(){
			document.getElementById('tooltip').style.display = 'none';
		}
		function Banners(){
			var use = $("#user_banners_feature").is(":checked") ? 1 : 0;	
			data = 'ajax=1&sel=usebanners&use='+use;
			$.post('admin_banners.php',data,function(data){
				if (data == "ok"){
					ShowAjaxError('{/literal}{$lang.country.saved}{literal}', '', 'success');
				}
			});
		}
{/literal}		
</script>
{*	<font class=red_sub_header>{$lang.banners.parameters}</font>
	<div class="help_text"><span class="help_title">{$lang.help}:</span>{$lang.admin_help.banners_rotate}</div>
        <form method="post" action="{$FILE_SELF}?sel=save_rotate" name="banner_form">
        <table border=0 cellspacing=0 cellpadding=0 width="350">
              <tr class="table_header">
                <td class="main_header_text" align="center">{$lang.banners.rotate_area}</td>
                <td class="main_header_text" align="center">{$lang.banners.rotate_status}</td>
                <td class="main_header_text" align="center">{$lang.banners.rotate_time}</td>
              </tr>
              <tr class="table_row even">
                <td class="main_content_text" align="center">{$lang.banners.position_left}</td>
                <td class="main_content_text" align="center">
                 <input type="checkbox" name="rotate_left_flag" {if $rotate_left_flag eq 1}checked="checked"{/if}>
                </td>
                <td class="main_content_text" align="center">
                 <input type="text" name="rotate_left_time" value="{$rotate_left_time}" size="10"> {$lang.banners.ms}
                </td>
              </tr>
              <tr class="table_row odd">
                <td class="main_content_text" align="center">{$lang.banners.position_bottom}</td>
                <td class="main_content_text" align="center">
                 <input type="checkbox" name="rotate_bottom_flag" {if $rotate_bottom_flag eq 1}checked="checked"{/if}>
                </td>
                <td class="main_content_text" align="center">
                 <input type="text" name="rotate_bottom_time" value="{$rotate_bottom_time}" size="10"> {$lang.banners.ms}
                </td>
              </tr>
              <tr class="table_row even">
                <td class="main_content_text" align="center">{$lang.banners.position_right}</td>
                <td class="main_content_text" align="center">
                 <input type="checkbox" name="rotate_right_flag" {if $rotate_right_flag eq 1}checked="checked"{/if}>
                </td>
                <td class="main_content_text" align="center">
                 <input type="text" name="rotate_right_time" value="{$rotate_right_time}" size="10"> {$lang.banners.ms}
                </td>
              </tr>
              <tr class="table_row odd">
                <td class="main_content_text" align="center">{$lang.banners.position_top}</td>
                <td class="main_content_text" align="center">
                 <input type="checkbox" name="rotate_top_flag" {if $rotate_top_flag eq 1}checked="checked"{/if}>
                </td>
                <td class="main_content_text" align="center">
                 <input type="text" name="rotate_top_time" value="{$rotate_top_time}" size="10"> {$lang.banners.ms}
                </td>
              </tr>
              <tr class="table_header">
                <td colspan="3">&nbsp;</td>
              </tr>
              <tr bgcolor="#FFFFFF">
                <td colspan="3" align="left" style="padding-top:5px;">
					<a class="admin_button_major" onclick="javascript: document.banner_form.submit();">{$lang.button.save}<span>&nbsp;</span></a>
				</td>
              </tr>
        </table>
        </form>*}
{include file="$admingentemplates/admin_bottom.tpl"}