{*{include file="$admingentemplates/admin_top.tpl"}

<div class="back">
    <a href="{$site_url}{$site_root}/admin/affiliate/aff_summary.php">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.affiliate.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.aff_ads}
    </div>
</div>
<div class="cr">&nbsp;</div>

<ul class="tabs" style="width: 100.5%">
    <li>
        <a href="aff_summary.php">{$lang.aff.tab_1}</a>
    </li>
    <li>
        <a href="aff_sales.php">{$lang.aff.tab_2}</a>
    </li>
	<li>
        <a href="aff_affiliates.php">{$lang.aff.tab_3}</a>
    </li>
	<li>
        <a class="current" href="#">{$lang.aff.tab_4}</a>
    </li>
	<li>
        <a href="aff_stats.php">{$lang.aff.tab_5}</a>
    </li>
	<li>
        <a href="aff_editsettings.php">{$lang.aff.tab_6}</a>
    </li>
</ul>
*}
{literal}

<SCRIPT LANGUAGE="JavaScript">
<!-- //hide
function Preview(id){
   window.open('affiliate/aff_preview.php?id=' + id, 'blank_', 'resizable=yes,scrollbars=yes,location=no,directories=no,status=no,toolbar=no,menubar=no,width=520,height=520,left=0,top=0');
}
//-->
</SCRIPT>
{/literal}
{if $ajax eq 0}
<div class="user_operation_line" style="width:100%;">
            <div class="uol_item" onclick='javascript: document.location.href="affiliate/aff_ads_new.php"'>
                <div class="uol_in_item">{$lang.affiliate.create}</div>
            </div>
</div>
<div class="cr"></div>

{/if}
<div id="aff_ads_div">
    <div class="user_status_line" style="margin-bottom:0px;width:100%;">
        <div id="tab_feeds" class="user_status_elem_active">
            {$lang.affiliate.links}
        </div>
        <div id="tab_news" class="user_status_elem" onclick="banners_load();">
            <a>{$lang.affiliate.banners}</a>
        </div>
	</div>
<div class="panel" style="margin: 0px;">
		<div class="panel_content" style="width: 100%; margin: 0px;">
		
{*<table>
	<tr>
		<td><a href="affiliate/aff_bans.php">{$lang.affiliate.banners}</a>&nbsp;&nbsp;&nbsp;</td>
		<td><a href="affiliate/aff_ads_new.php">{$lang.affiliate.create}</a>&nbsp;&nbsp;&nbsp;</td>
	</tr>
</table>*}
{if $page_links}
<b>{$lang.affiliate.pages}:</b>
{section name=c loop=$page_links}
	<a href={$page_links[c].url}>{$page_links[c].text}</a>&nbsp;
{/section}
<br><br>
{/if}
<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="5" width="100%">
<tr class="table_header">
  <td width="5%" align="left">#</td>
  <td width="39%" align="left">{$lang.affiliate.title}</td>
  <td width="20%" align="left">{$lang.affiliate.total_clicks}</td>
  <td width="20%" align="left">{$lang.affiliate.unique_shows}</td>
  <td width="16%" align="right">{$lang.button.action}</td>
</tr>

{section name=num loop=$ads}

<tr {if $smarty.section.num.index mod 2 eq 1}class="even"{else}class="odd"{/if} height="27px">
  <td align="left">{$ads[num].number}</td>
  <td align="left">{$ads[num].title}</td>
  <td align="left">{$ads[num].total_clicks}</td>
  <td align="left">{$ads[num].unique_shows}</td>
  <td>{*<a href="javascript:Preview('{$ads[num].id}')">{$lang.button.view}</a>
  <a href="aff_ads_new.php?which={$ads[num].id}">{$lang.button.edit}</a>
  <a href="aff_ads.php?action=Delete&which={$ads[num].id}">{$lang.button.delete}</a></td>*}
		<div class="block_action fr" style="display: none;">
			<div class="action_edit" style="display: block;float:left;cursor:pointer;">
				<img height="16" alt="" src="{$site_root}{$template_root}/images/icn_view.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.view}');return false" onclick="javascript:Preview('{$ads[num].id}')">
			</div>
			<div style="width:10px;" class="fl">&nbsp;</div>
			<div class="action_edit" style="display: block;float:left;cursor:pointer;">
				<img height="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='affiliate/aff_ads_new.php?which={$ads[num].id}'">
			</div>
			<div style="width:10px;" class="fl">&nbsp;</div>
			<div class="action_del" style="display: block;float:left;cursor:pointer;">
				<img height="16" alt="" src="{$site_root}{$template_root}/images/photo_delete.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" onclick="document.location.href='affiliate/aff_ads.php?action=Delete&which={$ads[num].id}'">
			</div>
		</div>
</tr>

{sectionelse}

<tr height="40">
	<td class="main_error_text" align="left" colspan="5" bgcolor="#FFFFFF">{$lang.affiliate.no_ads}</td>
</tr>

{/section}
<tr class="table_header"><td colspan="7"></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_load(){
			ajaxLoadingImage(1, 'aff_ads_div');
			$.post("affiliate/aff_bans.php", function(data){
				ajaxLoadingImage(0, 'aff_ads_div');
				$('#aff_ads_div').html(data);
			});			
		}
{/literal}		
</script>
		</div>
	</div>
</div>
{*
{include file="$admingentemplates/admin_bottom.tpl"}*}
