Вход Регистрация
Файл: alinar.ru/API/save_perks.php
Строк: 68
<?
header 
("Content-type: text/html; charset=windows-1251");
if (
substr_count($_SERVER['HTTP_REFERER'],'main.php')>0):
    require (
$_SERVER['DOCUMENT_ROOT'].'/maintenance/vars.php');
    require (
ROOT.'/maintenance/dbconn.php');
    require (
ROOT.'/maintenance/vcode.php');
    require (
ROOT.'/maintenance/functions.php');
    if (
VALID):
        
$info explode('|',$_REQUEST["info"]);
        echo (
$_REQUEST["info"]);
        if (
$info[0]>=&& $info[1]>=&& $info[2]>=&& $info[3]>=&& $info[4]>=&& $info[5]>=&& $info[6]>=&& $info[7]>=0):
            
$pers user(UID);
            
$checks = array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
            
$adds = array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
            foreach (
$info as $k=>$v):
                if (
$k<8): $p 'f';
                elseif (
$k>=&& $k<13): $p 's';
                elseif (
$k>=13 && $k<16): $p 'r';
                elseif (
$k>=16 && $k<21): $p 'm';
                endif;
                
$full_perk $pers[$p."_".($k+1)] + $adds[$k];
                
$found false;
                while (
$adds[$k]<$v):
                    if (
$full_perk<20):  $add 4;
                    elseif (
$full_perk>=20 && $full_perk<80): $add 3;
                    else: 
$add 2;
                    endif;
                    
$adds[$k] = $adds[$k] + $add;
                    
$checks[$k]++;
                endwhile;
            endforeach;
            
$out '{';
            foreach (
$checks as $a):
             
$out $out .' '.$a;
            endforeach;
            
$out $out '}';
            echo 
$out;
            
$fight_checks $checks[0]+$checks[1]+$checks[2]+$checks[3]+$checks[4]+$checks[5]+$checks[6]+$checks[7]+$checks[13]+$checks[14]+$checks[15];
            
$second_checks $checks[8]+$checks[9]+$checks[10]+$checks[11]+$checks[12];
            
$magic_checks $checks[16]+$checks[17]+$checks[18]+$checks[19]+$checks[20];
            if (
$fight_checks<=$pers["f_um"] && $second_checks<=$pers["p_um"] && $magic_checks<=$pers["m_um"]):
                
query("UPDATE users SET f_1=f_1+".$info[0].", f_2=f_2+".$info[1].", f_3=f_3+".$info[2].", f_4=f_4+".$info[3].", f_5=f_5+".$info[4].", f_6=f_6+".$info[5].", f_7=f_7+".$info[6].", f_8=f_8+".$info[7].", s_1=s_1+".$info[8].", s_2=s_2+".$info[9].", s_3=s_3+".$info[10].", s_4=s_4+".$info[11].", s_5=s_5+".$info[12].", r_1=r_1+".$info[13].", r_2=r_2+".$info[14].", r_3=r_3+".$info[15].", m_1=m_1+".$info[16].", m_2=m_2+".$info[17].", m_3=m_3+".$info[18].", m_4=m_4+".$info[19].", m_5=m_5+".$info[20].", f_um=f_um-".$fight_checks.", p_um=p_um-".$second_checks.", m_um=m_um-".$magic_checks." WHERE uid=".UID);
            endif;
        endif;
    endif;
else:
    echo 
'ERROR';
endif;

?>
Онлайн: 1
Реклама