From b9fa49e91186b7b6eb20c3ce66dc47d261b4dcd6 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 13 Jan 2008 13:52:06 +0000 Subject: [PATCH] Added the script --- scripts/nearest.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/nearest.php diff --git a/scripts/nearest.php b/scripts/nearest.php new file mode 100755 index 0000000..f3bda53 --- /dev/null +++ b/scripts/nearest.php @@ -0,0 +1,31 @@ +#!/usr/bin/php -q + + + This file is part of CAcert. + + CAcert has been released under a CAcert Source License + which can be found included with these source files or can + be downloaded from the internet from the following address: + http://www.cacert.org/src-lic.php + + CAcert is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the License for more details. +*/ + +// Searches for all assurers in a certain region + + include_once("../includes/mysql.php"); + + $query = "select * from `users` where `locid`=33572 OR `regid`=870"; + $res = mysql_query($query); + while($row = mysql_fetch_assoc($res)) + { + $ass = mysql_num_rows(mysql_query("select * from `notary` where `from`='".$row['id']."' and `from`!=`to`")); + $dres = mysql_query("select sum(`points`) as `tp` from `notary` where `to`='".$row['id']."'"); + $drow = mysql_fetch_assoc($dres); + if($drow['tp'] < 100) + echo $row['fname']." ".$row['lname']." <".$row['email']."> (memid: ".$row['id']." assurances: $ass tp: ".$drow['tp'].")\n"; + } +?>