<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

session_start( );
echo "<LINK REL=\"StyleSheet\" HREF=\"style.css\" TYPE=\"text/css\">\r\n";
$classe = new td_class( );
$mid = $classe->checkcookie( );
$classe->carregainformacoespainel( $mid );
$character = $_POST['character'];
$action = $_POST['action'];
$GLOBALS['_SESSION']['character'] = $character;
setcookie( "character", $character."", time( ) + 7257600 );
if ( $action == NULL )
{
    exit( );
}
if ( $action == "1" )
{
    $classe->verificalevelreset( $character );
    $classe->verificamoneyreset( $character );
    $classe->verficaconectado( $mid );
    $classe->executareset( $character );
}
if ( $action == "2" )
{
    $classe->verificalevelpk( $character );
    $classe->verificazenpk( $character );
    $classe->executapk( $character );
}
if ( $action == "3" )
{
    $classe->checapontosdistribui( $character );
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=01\">";
}
if ( $action == "4" )
{
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=02\">";
}
if ( $action == "5" )
{
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=03\">";
}
if ( $action == "6" )
{
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=04\">";
}
if ( $action == "7" )
{
    echo "<center>Carregando acao...</center>";
    $classe->executalimparinventario( $character );
}
if ( $action == "10" )
{
    $classe->executaredistribuirpontos( $character );
}
if ( $action == "11" )
{
    $classe->executalimparmagia( $character );
}
if ( $action == "12" )
{
    $classe->verificacharsconta( $mid );
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=05\">";
}
if ( $action == "13" )
{
    $classe->executalimpezabau( $mid, $cod_bau_vazio );
}
if ( $action == "14" )
{
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=06\">";
}
if ( $action == "15" )
{
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=07\">";
}
if ( $action == "16" )
{
    $classe->verificasetemguild( $character );
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=08\">";
}
if ( $action == "17" )
{
    $classe->executaconsertapontos( $character );
}
if ( $action == "18" )
{
    $classe->executadeletachar( $character );
}
if ( $action == "19" )
{
    echo "<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">";
    $qMostraLog = mssql_query( "Select onde,ip,conectadoem From Log_Conexao_Server Where login='".$mid."'" );
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\" class=\"paineltitulo\">\r\n<tr><td>\r\n<table width=\"100%\" border=\"0\" align=\"center\">\r\n<tr>\r\n<td><table width=\"66%\" border=\"0\" align=\"center\">\r\n<tr bgcolor=\"#096f9e\">\r\n<td height=\"22\" colspan=\"3\" align=\"center\" class=\"paineltitulo\">QUEM LOGOU </font></td>\r\n</tr>\r\n<tr>\r\n<td width=\"30%\" align=\"center\" class=\"painelchar\"><b>Onde</b></td>\r\n<td width=\"30%\" align=\"center\" class=\"painelchar\"><b>IP</b></td>\r\n<td width=\"40%\" align=\"center\" class=\"painelchar\"><b>Data</b></td>\r\n</tr>";
    while ( $MostraLog = mssql_fetch_array( $qMostraLog ) )
    {
        echo "<tr>\r\n<td width='30%' align='center' class=\"painelchar\">".$MostraLog['onde']."</td>\r\n<td width='30%' align='center' class=\"painelchar\">".$MostraLog['ip']."</td>\r\n<td width='40%' align='center' class=\"painelchar\">".$MostraLog['conectadoem']."</td>\r\n</tr>";
    }
    echo "\r\n<tr>\r\n<td align=\"center\" colspan=\"3\" class=\"painelchar\"><input type=\"button\" value=\"Voltar\" style=\"border:1px  solid #096f9e; color: 096f9e;\" onclick=\"javascript:window.location='?pagina=painel';\"></td>\r\n</tr>\r\n</table></td></tr>\r\n</table></td></tr>\r\n</table>";
}
if ( $action == "20" )
{
    $classe->verificasetemguild2( $character );
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=09\">";
}
if ( $action == "21" )
{
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=10\">";
}
if ( $action == "22" )
{
    $classe->verificastatsresetao( $character );
    $classe->verficaconectado( $mid );
    $classe->executaresetao( $mid, $character );
}
if ( $action == "23" )
{
    echo "<center>Carregando acao...</center><meta http-equiv=\"refresh\" content=\"0; url=?pagina=painel&acao=12\">";
}
echo "\r\n";
?>
