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']."
";
}
$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."
";
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."
";
}
}
?>