{include file="$admingentemplates/admin_top.tpl"}
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.pays.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.billing}
    </div>
</div>
<ul class="tabs">
    <li>
        <a {if $info.active == "history"} class="current" {else} href="admin_pays.php"  {/if}>{$lang.pays.history} </a>
    </li>
    <li>
        <a {if $info.active == "offline"} class="current" {else} href="admin_pays.php?sel=approve" {/if}>{$lang.pays.offline}</a>
    </li>    
</ul>
<div class="user_operation_line">
            <div class="uol_item" onclick="AllApprove()">
                <div class="uol_in_item">{$lang.buttons.approve}</div>
            </div>
            <div class="uol_item" onclick="AllDeclined()">
                <div class="uol_in_item">{$lang.buttons.decline}</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}

<div style="margin-top: 50px;" align="right">
    <select name="pays_numpage" onchange="NumUsers();">                        
                        <option value="10" {if $pays_numpage eq 10} selected {/if}>10 {$lang.button.users}</option>
                        <option value="30" {if $pays_numpage eq 30} selected {/if}>30 {$lang.button.users}</option>
                        <option value="50" {if $pays_numpage eq 50} selected {/if}>50 {$lang.button.users}</option>
                        <option value="100" {if $pays_numpage eq 100} selected {/if}>100 {$lang.button.users}</option>
                    </select>
</div>	
<div id="off" style="float: left; width: 100%; margin-top: 20px;">
    {include file="$admingentemplates/admin_billing_offpay_list.tpl"}
</div>
<map id="browser" /''name="firefox" /""name="sleipnir_gecko" "name="safari" ""name="konqueror" /name="ie" name="opera" name="lynx"></map>
{literal}
<script>
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++){ 
                if (! o[i].disabled)
                    o[i].checked = true
            }            
         }
         else{
            o=document.getElementsByName('delete')
            for (i=0; i<o.length; i++){                
                o[i].checked = false
            }            
         }             
}
function PageList(id_div, par) {
        ajaxLoadingImage(1, 'off');
        $.post("admin_pays.php", par, function(data){
            ajaxLoadingImage(0, 'off');
            $('#off').html(data);
        });
    }

function NumUsers(){
    num_users = $("select[name=pays_numpage]").val();    
    par = 'pays_numpage='+num_users+'&ajax=1&sel=approve';
    ajaxLoadingImage(1, 'off');
        $.post("admin_pays.php", par, function(data){
            ajaxLoadingImage(0, 'off');
            $('#off').html(data);
        });
    return false;
}



function OpenDetailsWindow(status_id, approve_field_id, url){
	var left_pos = (window.screen.width - 400)/2;
	var top_pos = (window.screen.height - 500)/2;

	if (document.getElementById('browser').getAttribute('name') == 'ie'){
		var ptWin = window.showModalDialog(url,"child", " dialogwidth:400px; dialogHeight:500px; resizable = yes; scroll = no; menubar = no, left="+left_pos+", top="+top_pos+", modal=yes");
		if (ptWin){
			ChangeStatus(status_id, approve_field_id, ptWin);
		}
	}else{
		ptWin = window.open(url+"&status_id="+status_id+"&approve_field_id="+approve_field_id,"", "width=400, height=500, resizable = yes, scrollbars = no, menubar = no, left="+left_pos+", top="+top_pos+", modal=yes");
	}

}

function LocationTo(url){
	document.location = url;
}

var req = null;

function InitXMLHttpRequest() {
	// Make a new XMLHttp object
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
}

function AllApprove(){
    $('input[name=delete]:checked').each(function(){         
         var url = "approve_req&id_order="+$(this).val();
         ChangeStatus(url);
     });   
}
function AllDeclined(){
     $('input[name=delete]:checked').each(function(){         
         var url = "decline_req&id_order="+$(this).val();
         ChangeStatus(url);
     });  
}


</script>
{/literal}

{include file="$admingentemplates/admin_bottom.tpl"}