{if $ajax eq 0}
{include file="$admingentemplates/admin_top.tpl"}
 
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$info.name}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
{if $info.help != ''}
    <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>{$info.help}
        </div>
    </div>
{/if}
<ul class="tabs">
    <li>
        <a {if $info.active == "reports"} class="current" {else} href="admin_abuse_reports.php"  {/if}>{$lang.admin_abuse_reports.razdel_name} ({$count.new_abuse}/{$count.all_abuse})</a>
    </li>
    <li>
        <a {if $info.active == "bad_words"} class="current" {else} href="admin_badwords.php" {/if}>{$lang.admin_menu.bad_words} ({$count.badwords})</a>
    </li>
    <li>
        <a {if $info.active == "ip_check"} class="current" {else} href="admin_block_ip.php" {/if}>{$lang.admin_menu.block_ip} ({$count.ip})</a>
    </li>
    <li>
        <a {if $info.active == "approve"} class="current" {else} href="admin_upload.php" {/if}>{$lang.admin_menu.uploads_approve} ({$count.approve})</a>
    </li>
</ul>
<div class="user_operation_line">       
    {if $info.active ne "ip_check"}
            <div class="uol_item" onclick="changeUserStatusAll(0)">
                <div class="uol_in_item">{$lang.button.make_inactive}</div>
            </div>
            <div class="uol_item" onclick="changeUserStatusAll(1)">
                <div class="uol_in_item">{$lang.button.make_active}</div>
            </div>            
            <div class="uol_item" onclick="delReportAll();">
                <div class="uol_in_item">{$lang.button.delete_report}</div>
            </div>        
    {/if}
</div>
<div class="cr"></div>
   
<div align="right" style="padding-right: 10px;">
    
    <form name="num_on_page" action="{$file_name}" method="POST" >
    {$lang.admin_menu.num_on_page} 
    <select id="num_on_page" name="num_on_page" onchange="NumUsers()">
                                    <option value="10" >10</option>
                                    <option value="30">30</option>
                                    <option value="50">50</option>
                                    <option value="100">100</option>
                                </select>
    </form>
</div>
{/if} 
    
	<div id="reports" style="float: left; width: 100%; margin-top:5px;">
		{include file="$admingentemplates/admin_abuse_content_table.tpl"}        
	</div>

{if $ajax eq 0}	
{include file="$admingentemplates/admin_bottom.tpl"}
<script type="text/javascript">
var page={$page};
{literal}
function delReportAll(){    
	$('input[name=delete]:checked').each(function(){
	   delReport($(this).val());	  
     });
}

function delReport(id){
    num_users = $("select[name=num_on_page]").val();
	par = 'ajax=1&sel=delreport&id_report='+id+"&num_on_page="+num_users;
	$.post('admin_abuse_reports.php', par, function(data){		
		$('#reports').html(data);
	});
}

function changeUserStatusAll(val){
        $('input[name=delete]:checked').each(function(){
	    changeUserStatus($(this).val(), val);	  
     });
}

function changeUserStatus(id, status){
    num_users = $("select[name=num_on_page]").val();
    str = 'ajax=1&sel=user_status&id='+id+'&status='+status+"&num_on_page="+num_users+"&par=1";
	$.post("admin_abuse_reports.php", str, function(data){
		$('#reports').html(data);
	});
    return false
}


function NumUsers(){
    num_users = $("select[name=num_on_page]").val();
    par = 'num_on_page='+num_users+'&ajax=1';
    ajaxLoadingImage(1, 'reports');
        $.post("admin_abuse_reports.php", par, function(data){
            ajaxLoadingImage(0, 'reports');
            $('#reports').html(data);
        });
}

function PageList(id_div, par) {
        ajaxLoadingImage(1, 'reports');
        $.post("admin_abuse_reports.php", par, function(data){
            ajaxLoadingImage(0, 'reports');
            $('#reports').html(data);
        });
    }
    
function PutAll() {
         var o=document.getElementsByName('select_all')	
         var i
         if (o[0].checked){                    
            o=document.getElementsByName('delete')
            for (i=0; i<o.length; i++){                
                o[i].checked = true
            }            
         }
         else{
            o=document.getElementsByName('delete')
            for (i=0; i<o.length; i++){                
                o[i].checked = false
            }            
         }             
}
  
{/literal}
</script>
{/if}