{include file="$admingentemplates/admin_top.tpl"}
<link href="{$site_root}{$template_root}/css/alert.css" rel="stylesheet" type="text/css">
<div id="boxes">
	<div id="close" class="close" onclick="Close()"></div>
	<div id="dialog" class="window">
	</div>
</div>
<div id="mask"></div>
<div class="back">
    <a href="{$file_name}">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.admin_games.comments_list}</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.admin_games_comments_help}
    </div>
</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}

<div id="games_comment_div">
	<div style="padding-top: 10px;">
		<a class="admin_button_major" onclick="Delete();" name="search_submit">{$lang.button.delete}<span>&nbsp;</span></a>
        <!--input type="button" name="delete" value="{$lang.button.delete}" onclick="Delete();"-->
	</div>
	<div style="padding-top: 10px;">
	<table border=0 class="table_main" cellspacing=0 cellpadding=0 width="100%">
{*		<tr bgcolor="#ffffff">
			<td colspan=5 class="main_content_text">
				{if $links}
				<div style="margin-{$default_left}: 0px; padding-top: 15px;">
				{foreach item=item from=$links}
					<span style="padding-{$default_right}: 15px;"><a href="{$item.link}" {if $item.selected eq '1'} class="text_head"{/if}>{$item.name}</a></span>
				{/foreach}
				</div>
				{/if}
			</td>
		</tr>*}
		<tr class="table_header">
			<td align="center" width="5%">
				<input type="checkbox" name="comment_all" id="comment_all" value="all" onclick="Select();">
			</td>
			<td align="left" width="15%">{$lang.users.login}</td>
			<td align="left" width="45%">{$lang.admin_games.comment}</td>
			<td align="left" width="20%">{$lang.admin_games.comment_date_add}</td>
			<td align="center" width="15%">{$lang.admin_games.actions}</td>
		</tr>
		{foreach item=item name=comments from=$games_comment}
		<tr {if $smarty.foreach.i.iteration mod 2 eq 1}class="table_row even"{else}class="table_row odd"{/if}>
			<td align="center">
				<input type="checkbox" class="comments" name="comment{$smarty.foreach.comments.iteration}" id="comment{$smarty.foreach.comments.iteration}" value="{$item.id_comment}">
			</td>
			<td class="main_content_text" align="left">{$item.login}</td>
			<td class="main_content_text" align="left">{$item.comment}</td>
			<td class="main_content_text" align="left">{$item.date_add}</td>
			<td class="main_content_text" align="center">
				<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/communicate.png"  onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.users.comunicate}');return false" onclick="javascript:window.open('./admin_comunicate.php?id={$item.id_user}&commit=1','comunicate', 'height=800, resizable=yes, scrollbars=yes,width=600, menubar=no,status=no');">
					</div>
				</div>
                
                <!--input type="button" onclick="javascript:window.open('./admin_comunicate.php?id={$item.id_user}','comunicate', 'height=800, resizable=yes, scrollbars=yes,width=600, menubar=no,status=no');" class="button" value="{$lang.users.comunicate}"-->
			</td>
		</tr>
		{/foreach}
{*		<tr bgcolor="#ffffff">
			<td colspan=5 class="main_content_text">
			{if $links}
			<div style="margin-{$default_left}: 0px; padding-top: 15px;">
			{foreach item=item from=$links}
				<span style="padding-{$default_right}: 15px;"><a href="{$item.link}" {if $item.selected eq '1'} class="text_head"{/if}>{$item.name}</a></span>
			{/foreach}
			</div>
			{/if}
			</td>
		</tr>*}
                    <tr class="table_header">
                        <td colspan="5">
                            &nbsp;&nbsp;
                            {if $links}
                            {foreach item=item from=$links.pages}
                                &nbsp;<a onclick="PageList('games_comment_div', '{$item.link}');" class="page_link" {if $item.selected} style=" font-weight: bold; text-decoration: none;" {/if}>{$item.name}</a>&nbsp;
                            {/foreach}
                            {/if}
                            <div class="page_navigation">
                            {if $links.previous}
                                <a onclick="PageList('games_comment_div', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
                            {/if}
                            {if $links.next}
                                <a onclick="PageList('games_comment_div', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
                            {/if}
                            </div>
                        </td>
                    </tr>
		
	</table>
	</div>
</div>
<script language="JavaScript" 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 Select() {
	if($('#comment_all').is(':checked')) {
		$(".comments").attr("checked","checked");
	} else {
		$(".comments").attr("checked","");
	}
}
function Delete() {
	total = {/literal}{$smarty.foreach.comments.total}{literal};
	str = '';
	for(i = 1; i < total+1; i++) {
		if($('#comment'+i).is(':checked')) {
			if (str == '') str = $('#comment'+i).val();
			else str = str+','+$('#comment'+i).val();
		}
	}
	if (str != '') {
		$.post("{/literal}{$file_name}{literal}", {sel:'delete_comments',str:str}, 
			function(data) {
				window.location.reload(true); 
			}
		);
	}
}
{/literal}
</script>
{include file="$admingentemplates/admin_bottom.tpl"}