summaryrefslogtreecommitdiff
path: root/cacert/scripts/nearest.php
diff options
context:
space:
mode:
authorMarkus Warg <mw@it-sls.de>2010-03-11 15:17:02 +0100
committerMarkus Warg <mw@it-sls.de>2010-03-11 15:17:02 +0100
commit83b70a122092220d839d8a62c2b07913faa20fce (patch)
tree9b39a35e5183d9a36a3c3df38cf185f99de6708b /cacert/scripts/nearest.php
downloadcacert-devel-83b70a122092220d839d8a62c2b07913faa20fce.tar.gz
cacert-devel-83b70a122092220d839d8a62c2b07913faa20fce.tar.xz
cacert-devel-83b70a122092220d839d8a62c2b07913faa20fce.zip
source code taken from cacert-20090625.tar.bz2
Diffstat (limited to 'cacert/scripts/nearest.php')
-rwxr-xr-xcacert/scripts/nearest.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/cacert/scripts/nearest.php b/cacert/scripts/nearest.php
new file mode 100755
index 0000000..c5d0578
--- /dev/null
+++ b/cacert/scripts/nearest.php
@@ -0,0 +1,34 @@
+#!/usr/bin/php -q
+<? /*
+ LibreSSL - CAcert web application
+ Copyright (C) 2004-2008 CAcert Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+// 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";
+ }
+?>