<?php
include_once('../inclfiles/core.php');           //юникод
if($_GET['key'] != $set['key']) exit;
mysql_query("UPDATE `generals` SET `vozrast`=(`vozrast`+1) WHERE `status` = 'activen'");
$generals = mysql_query("SELECT * FROM `generals` WHERE `vozrast` > 80 AND `status` = 'activen'");
while($general = mysql_fetch_array($generals)){
	$random = rand(1,(91 - $general['vozrast']));
	if($random == 1){
   		mysql_query("UPDATE `generals` SET `status`= 'umer' WHERE `id` = ".$general['id']."");
   		mysql_query("UPDATE `countries` SET `general`= 0 WHERE `id` = ".$general['country']."");
   		mysql_query("INSERT INTO `journal` SET `country` = ".$general['country'].", `type` = 5, `num1` = ".$general['id'].", `time` = ".time()."");
	}
}
?>