116 lines
6.7 KiB
PHP
116 lines
6.7 KiB
PHP
<?php
|
|
|
|
define('GAME',true);
|
|
setlocale(LC_CTYPE ,"ru_RU.CP1251");
|
|
include('/home/newcom1/public_html/_incl_data/__config.php');
|
|
include('/home/newcom1/public_html/_incl_data/class/__db_connect.php');
|
|
include('/home/newcom1/public_html/_incl_data/class/__user.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$sp = mysql_query('SELECT * FROM `stats` WHERE `priemslot` > 10');
|
|
while( $pl = mysql_fetch_array($sp) ) {
|
|
$test = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$pl['id'].'" LIMIT 1'));
|
|
$userst = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$pl['id'].'" LIMIT 1'));
|
|
if($test['add_slot']>0)
|
|
{
|
|
|
|
// echo "íèê:".$userst['login']." êîëè÷åñòâî ñëîòîâ:".$pl['priemslot']." êîëè÷åñòâî äîáàâëåííûõ ñ ïîäçåìêè ñëîòîâ:".$test['add_slot']."<br>";
|
|
|
|
}
|
|
$kolvo = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `actions` WHERE `uid` ="'.$pl['id'].'" AND `vars` ="read"'));
|
|
|
|
$overtop=$pl['priemslot']-10-$test['add_slot']-($kolvo['COUNT(*)']+1);
|
|
|
|
$overtopkorrect=$pl['priemslot']-10-$test['add_slot'];
|
|
|
|
if($overtop>8)
|
|
{
|
|
$prevish = $overtop -8;
|
|
} else {$prevish =0;}
|
|
|
|
if ($overtopkorrect>8){$overtopkorrect=8;}
|
|
|
|
$resultslot= 10 + $test['add_slot'] + $overtopkorrect;
|
|
if($overtop>0)
|
|
{
|
|
|
|
echo "íà÷àëî!!! íèê:".$userst['login']." êîëè÷åñòâî ñëîòîâ:".$pl['priemslot']." äîëæíî áûòü:".$resultslot." êîëè÷åñòâî äîáàâëåííûõ ñ ïîäçåìêè ñëîòîâ:".$test['add_slot']." êîëè÷åñòâî ïðî÷èòàíûõ êíèã:".$kolvo['COUNT(*)']." ðåçóëüòàò:".$overtop." ïðåâûøåíèå:".$prevish." íóæíî ïðî÷èòàòü:".$overtopkorrect."<br>";
|
|
|
|
mysql_query('UPDATE `stats` SET `priemslot` = "'.$resultslot.'" WHERE `id` = "'.$pl['id'].'"');
|
|
// mysql_query('UPDATE `stats` SET `priemslot` = "'.$resultslot.'" WHERE `id` = "'.$pl['id'].'"');
|
|
mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$pl['id'].'" AND `vars` = "read" ');
|
|
|
|
if($overtopkorrect==5){$overtopkorrect=6;}
|
|
|
|
if ($overtopkorrect==1)
|
|
{
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
|
|
}
|
|
elseif ($overtopkorrect==2)
|
|
{
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
|
|
}
|
|
elseif ($overtopkorrect==3)
|
|
{
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
|
|
}
|
|
elseif ($overtopkorrect==4)
|
|
{
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")');
|
|
}
|
|
elseif ($overtopkorrect==6)
|
|
{
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")');
|
|
|
|
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")');
|
|
}
|
|
elseif ($overtopkorrect==7)
|
|
{
|
|
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")');
|
|
|
|
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4812")');
|
|
|
|
}
|
|
elseif ($overtopkorrect==8)
|
|
{
|
|
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1044")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1045")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1046")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","1047")');
|
|
|
|
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4811")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4812")');
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `vals`) VALUES ("'.$pl['id'].'","'.time().'","capitalcity","10","read","4813")');
|
|
}
|
|
|
|
|
|
|
|
echo "ðåçóëüòàò!!! íèê:".$userst['login']." êîëè÷åñòâî ñëîòîâ:".$resultslot." êîëè÷åñòâî äîáàâëåííûõ ñ ïîäçåìêè ñëîòîâ:".$test['add_slot']." êîëè÷åñòâî ïðî÷èòàíûõ êíèã:".$overtopkorrect."<br>";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
?>
|