{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.banners.help_admin_users_table}
    </div>
</div>
<ul class="tabs">
    <li>
        <a href="admin_banners.php">{$lang.admin_menu.banners_list}</a>
    </li>
    <li>
        <a class="current">{$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 onclick="document.del_bans.submit();" class="uol_item">
				<div class="uol_in_item">{$lang.button.delete}</div>
			</div>
		</div>
		<div class="cr"></div>


{if $error}<div class="error_msg">{$error}</div>{/if}
<form name="del_bans" enctype="multipart/form-data" method="post" action="{$file_name}">
<input type="hidden" name="sel" value="delete_banners">
<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}
<table border=0 cellspacing=0 cellpadding=0 width="100%">
<tr class="table_header">
	<td><input type="checkbox" id="select_all" name="select_all" onclick="PutAll()" /></td>
	<td class="main_header_text" align="left">{$lang.banners.username}</td>
	<td class="main_header_text" align="left">{$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">{$lang.banners.stop_after}</td>
	<td class="main_header_text" align="right">{$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 align="center" valign="top">
		<input type="checkbox" value="{$one_banner.id}" name="id[]">
	</td>
	<td align="left" valign="top"><a href="{$one_banner.profile_link}">{$one_banner.login}</a></td>
	<td align="left" valign="top"> 
		{if $one_banner.payment_status == 'toaprove'}
		{$lang.banners.to_aprove}
		{elseif $one_banner.payment_status == 'topay'}
		{$lang.banners.to_pay}
		{elseif $one_banner.payment_status == 'payed'}
		{$lang.banners.aproved}<br />
		<input type="checkbox" name="comments" disabled="disabled" {if $one_banner.status eq 1}checked="checked"{/if}>
		{/if} 
	</td>
	<td align="left" valign="top">
		<table cellspacing="1" cellpadding="0">
		<tr>
			<td align="left" style="padding-left:0px;">{$one_banner.name}</td>
		</tr>
		<tr>
			<td align="left" style="padding-left:0px;">
				{if $one_banner.banner_type  eq "1"}
				<b>{$lang.banners.this_is_html_code}</b><br />
				<textarea readonly="readonly" style="width:150px; height:75px;">{$one_banner.html_code}</textarea>
				{else}
				{$lang.banners.size}: {$one_banner.size_x}x{$one_banner.size_y}<br />
				{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}
				{/if}
			</td>
		</tr>
		</table>
	</td>
	<td align="left" valign="top">{if $one_banner.banner_type neq "1"}<a href="{$one_banner.banner_url}">{$one_banner.banner_url}</a>{/if}</td>
	<td align="left" valign="top">
		{$lang.banners.position}: {if $one_banner.place eq '0'}{$lang.banners.position_left}{elseif $one_banner.place eq '1'}{$lang.banners.position_bottom}{/if}
		{if $one_banner.areas}
		<br /><br />
		{/if}
		{foreach from=$one_banner.areas item=one_area}
		{$one_area.description};&nbsp&nbsp
		{/foreach} 
	</td>
	<td align="left" valign="top">
	{if $one_banner.payment_status == 'payed'}
		{if $one_banner.stoped_by_date}		
		  {$lang.banners.stoped_by_date}!
		{elseif $one_banner.stop_after_date neq "0000-00-00"}
		 {if $one_banner.stop_after_date neq "0000-00-00"}
		  {$lang.banners.stop_after_date}:<br />{$one_banner.stop_after_date}
		 {/if}
		{else}
		 {$lang.banners.never_stop}
		{/if}
	{/if}
	</td>
	<td width="75" valign="top">
		{if $one_banner.stoped_by_date || $one_banner.payment_status != 'payed'}
		<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_name}?sel=delete&id={$one_banner.id}';{literal}}{/literal}">
			</div>
		</div>			
		{/if}
		<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="window.open('{$file_name}?sel=get_resols&id={$one_banner.id}&commit=1', '1sdc','height=520, width=800, resizable=1, scrollbars=1')">
			</div>
		</div>			
{*		{if $one_banner.payment_status == 'toaprove'}
		<a href="#" onclick="window.open('{$file_name}?sel=get_resols&id={$one_banner.id}', '1sdc','height=520, width=800, resizable=1, scrollbars=1')">{$lang.banners.aprove_link}</a><br /><br />
		{/if}
		{if $one_banner.stoped_by_date || $one_banner.payment_status != 'payed'}
		<a href="#" onclick="javascript: if (window.confirm('{$lang.banners.realy_delete|escape:javascript}')){literal}{{/literal}location.href='{$file_name}?sel=delete&id={$one_banner.id}';{literal}}{/literal}">{$lang.button.delete}</a>
		{/if}*}
	</td>
</tr>
{foreachelse}
	<tr height="40">
		<td class="main_error_text" align="left" colspan="8">{$lang.interests_spr.empty}</td>
	</tr>
{/foreach}
<tr class="table_header">
	<td colspan="8">&nbsp;</td>
<tr>
</table>
<script type="text/javascript">
{literal}
function PutAll() {
         var o=document.getElementsByName('select_all')	
         var i
         if (o[0].checked){                    
            o=document.getElementsByName('id[]')
            for (i=0; i<o.length; i++){                
                o[i].checked = true
            }            
         }
         else{
            o=document.getElementsByName('id[]')
            for (i=0; i<o.length; i++){                
                o[i].checked = false
            }            
         }             
}
{/literal}
</script>
<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';
		}
{/literal}		
</script>
{include file="$admingentemplates/admin_bottom.tpl"}