$sql->query('SELECT `online`, `cpu`, `ram`, `hdd` FROM `graph_hour` WHERE `server`="'.$server['id'].'" AND `time`>"'.($start_point-86400).'" ORDER BY `id` DESC LIMIT 24');
$n=$sql->num();
if(!$n)
continue;
while($graph=$sql->get())
{
$aGraph['online']+=$graph['online'];
$aGraph['cpu']+=$graph['cpu'];
$aGraph['ram']+=$graph['ram'];
$aGraph['hdd']+=$graph['hdd'];
}
$aGraph['online']=$aGraph['online']/$n;
$aGraph['cpu']=$aGraph['cpu']/$n;
$aGraph['ram']=$aGraph['ram']/$n;
$aGraph['hdd']=$aGraph['hdd']/$n;
$sql->query('INSERT INTO `graph_day` set `server`="'.$server['id'].'",'