<? session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="ru">
<head>
<title>Административная часть.</title>
<link href="tablecloth/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="estilo.css" />
<link rel="stylesheet" type="text/css" href="sdmenu/sdmenu.css" />
<script type="text/javascript" src="tablecloth/tablecloth.js"></script>
<script type="text/javascript">

function setCookie (name, value, path, domain, secure, expires)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function getCookie (name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie (name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-2020 00:00:01 GMT";
    }
}


function addLoadEvent (func)
{    
    var oldonload = window.onload;
    if (typeof window.onload != 'function')
    {
        window.onload = func;
    } 
    else 
    {
        window.onload = function()
        {
            oldonload();
            func();
        }
    }
}

</script>

<script type="text/javascript">

function menu_init ()
{
        var menu = document.getElementById('nav');
        var subs = menu.childNodes;
        
        var j = 0;
        
        for (var i=0 ; subs[i]; i++)
        {
                if (subs[i].tagName=='LI')
                {
                        hs = subs[i].getElementsByTagName('B');
                        heading = hs[0];
                        ss = subs[i].getElementsByTagName('UL');
                        submenu = ss[0];
                        
                        j++;
                        
                        heading.onclick = function () { menu_toggle(this); };

                        if (getCookie('menu'+j)=='1')
                                 submenu.style.display = 'block';
                        else if (getCookie('menu'+j)=='0')
                                submenu.style.display = 'none';
                        else if (j==1)
                                submenu.style.display = 'block';
                        else
                                submenu.style.display = 'none';
                }
        }
}

function menu_toggle (heading)
{
        var section = heading.parentNode;
        var submenus = section.getElementsByTagName('UL');
        var submenu = submenus[0];
                
        if (submenu.style.display=='none')
                submenu.style.display = 'block';
        else
                submenu.style.display = 'none';
                
        var j = 0;

        var menu = document.getElementById('nav');
        var subs = menu.childNodes;
        for (var i=0 ; subs[i]; i++)
        {
                if (subs[i].tagName=='LI')
                {
                        hs = subs[i].getElementsByTagName('B');
                        h = hs[0];                      
                        j++;
                        
                        if (h==heading && submenu.style.display=='none')
                                setCookie('menu'+j, '0', '/');
                        else if (h==heading)
                                setCookie('menu'+j, '1', '/');
                }
        }
                

}

addLoadEvent(menu_init);

</script>

</head>

<body>
<? require('funciones.php'); require('config.php'); include('checkcookie.php'); ?>
<div id="framecontent">
<div class="innertube">
<? include('adminmenu.php'); ?>
</div>
</div>

<div id="maincontent">
<div class="innertube">
    <tr>
          <tr>
            <td class="head toph">&nbsp;&nbsp;Вы зашли как: <font color=Red><b><?=$_SESSION["username"];?></font></b></td>
            <td class="head">|</td>
            <td class="head toph">Посетителей on-line: <b><? require 'onlinesql.php'; ?>
</b></td>
            <td class="head">|</td>
            <td class="head last toph" width="100%"><a href="adminmain.php?p=reqpay">Ждут выплату: </a><b><font color='red'><b><?php include('config.php');
                                $result=mysql_query ("SELECT COUNT(*) FROM `tb_payme`");
                                echo mysql_result($result,0);
                                $sqryvar="Select sum(money) from tb_payme";
                                $iqryvar=mysql_query($sqryvar);
                                $tot1=mysql_result($iqryvar,0,0);
                                $totalmoney=$tot1;
                                ?>
                                      </font>          на сумму <font color=Blue><?
                                        if ($totalmoney > 0)
                                        {
                                        echo $totalmoney;
                                        }
                                        else
                                        {
                                        echo 0;
                                        }
                                        ?></font>&nbsp;руб</b></b></a></td>
            <td class="head">
                <tr>
                  <td class="head">|</td>
                  <td class="head last toph2 toph"><a href="<?=$url?>">Выход из АДМИНКИ</a></td>
                </tr>
              </table>
          </tr>
      </td>
    </tr>
    <tr>
<?
if(isset($_GET["p"]))
{
	$p=$_GET["p"];
	$p.='.php';
	include($p);
}
mysql_close($con);
?>
</div>
</div>

</body>
</html>