// This script seems to add points for assurances that didn't received their points automatically before.
include_once("../includes/mysql.php");
$query="select * from `notary` group by `from`";
$res=mysql_query($query);
while($row=mysql_fetch_assoc($res))
{
$query="select *,sum(`points`) as `points` from `users`, `notary` where `users`.`id`=`notary`.`to` and `users`.`id`='".$row['from']."' group by `notary`.`to`";
$drow=mysql_fetch_assoc(mysql_query($query));
if($drow['points']<100||$drow['points']>=150)
continue;
$query="select * from `notary` where `from`='".$drow['id']."' and `to`='".$drow['id']."'";
$num=mysql_num_rows(mysql_query($query));
$query="select * from `notary` where `from`='".$drow['id']."' and `to`!='".$drow['id']."'";