<?php
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
$set['title']='+5 Авторитета';
include_once '../../sys/inc/thead.php';
title();
aut();
################################################################################
if(!isset($user) || !isset($_GET['id'])){
header("Location:/index.php");
break;
}
################################################################################
function sictime($timediff){
$oneMinute=60;
$oneHour=60*60;
$oneDay=60*60*24;
$dayfield=floor($timediff/$oneDay);
$hourfield=floor(($timediff-$dayfield*$oneDay)/$oneHour);
$minutefield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour)/$oneMinute);
$secondfield=floor(($timediff-$dayfield*$oneDay-$hourfield*$oneHour-$minutefield*$oneMinute));
$time_1="$hourfield ч. $minutefield м. $secondfield сек.";
return $time_1;
}
################################################################################
$id=abs(intval($_GET['id']));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `zona` WHERE `ids`='".$user['id']."' AND `id`='".$id."'"),0)!='0'){
$u=mysql_result(mysql_query("SELECT `time_lovkost` FROM `zona` WHERE `id`='".$id."'"),0);
if($u<=time()){
$times=time()+1800;
mysql_query("UPDATE `zona` SET `sila`=`sila`+5, `time_lovkost`=".$times." WHERE `id`='".$id."' LIMIT 1");
echo "+5 к вашему авторитету!<br/><a href='index.php'>Назад</a><br/>";
}else{
$sic=$u-time();
echo "Вы не можете так часто поднимать авторитет! Подождите еще ".sictime($sic)."<br /><a href='index.php'>Назад</a><br />";
}
}else{
echo 'аяяй!';
}
################################################################################
include_once '../../sys/inc/tfoot.php';
?>