From 38ca8c5683ec02a62badb6a0150e60a9a9338580 Mon Sep 17 00:00:00 2001
From: Michael Andreen
Date: Fri, 15 Dec 2006 11:47:03 +0000
Subject: [PATCH 1/1] initial commit of alliances
---
alliances.pl | 123 +++++++++++++++++++++++++++++++++++++++
index.pl | 2 +-
templates/alliances.tmpl | 106 +++++++++++++++++++++++++++++++++
3 files changed, 230 insertions(+), 1 deletion(-)
create mode 100644 alliances.pl
create mode 100644 templates/alliances.tmpl
diff --git a/alliances.pl b/alliances.pl
new file mode 100644
index 0000000..101f2db
--- /dev/null
+++ b/alliances.pl
@@ -0,0 +1,123 @@
+#**************************************************************************
+# Copyright (C) 2006 by Michael Andreen *
+# *
+# 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; either version 2 of the License, or *
+# (at your option) any later version. *
+# *
+# 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. *
+#**************************************************************************/
+
+use strict;
+use POSIX;
+our $BODY;
+our $DBH;
+our $LOG;
+my $error;
+
+$ND::TEMPLATE->param(TITLE => 'Alliances');
+
+die "You don't have access" unless isHC();
+
+my $alliance;
+if (param('alliance') =~ /^(\d+)$/){
+ my $query = $DBH->prepare(q{SELECT id,name, relationship FROM alliances WHERE id = ?});
+ $alliance = $DBH->selectrow_hashref($query,undef,$1);
+}
+if ($alliance && param ('cmd') eq 'coords'){
+ $DBH->begin_work;
+ $DBH->commit or $error .= "