<?php

// -----------------------------------------------------------------------
// This file is part of aroundme
// 
// Copyright (C) 2003, 2005 Barnraiser
// http://www.barnraiser.org/
// info@barnraiser.org
// 
// 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, 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 program; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
// -----------------------------------------------------------------------

?>


<?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title><?php echo "barnraiser: " . $lang['node_num'] . " / " . $lang['node_name'];?></title>
<style type="text/css">
<!--
@import url(template/aroundme.css);

-->
</style>


<script language="JavaScript" src="js/functions.js" type="text/javascript"></script>
</head>

<body bgcolor="#FFFFFF">

<?php
if (isset($log[0])) {
?>
<table width="770" border="0" cellspacing="0" cellpadding="4">
	<?php
	foreach($log as $key => $i):
		if (isset($i[0])) {
			unset($error);
			if (isset($error_handling) && $error_handling>0 && isset($i[1])) {
				$error = $lang['arr_error'][$i[0]] . ": " . $i[2] . "<br />";
			}
			elseif (empty($i[1])) {
				$error = $lang['arr_error'][$i[0]] . "<br />";
			}
		}

		if (isset($error)) {
	?>
	<tr>
		<td class="txt_error">
			<?php echo $error;?>
		</td>
	</tr>
	<?
	}
	endforeach;
	?>
</table>
<?php
}
?>

<?php
if (isset($display) && $display == "setup") {
?>
<form action="setup.php" method="post">
<input type="hidden" name="data[user_id]" value="<?php echo $user['user_id'];?>" />
<input type="hidden" name="language_id" value="<?php echo $user['language_id'];?>" />

<table width="760" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="160" valign="top">

			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<a href="http://www.barnraiser.org/aroundme/" title="<?php echo $lang['title_home'];?>"><img src="<?php echo $templatePath;?>img/aroundme.png" width="160" height="161" alt="aroundme" border="0" /></a><br />
					</td>
				</tr>
				<tr>
					<td class="txt_light" align="center">
						<?php echo $lang['menu_strap'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<a href="http://www.barnraiser.org/" title="<?php echo $lang['title_home'];?>"><img src="<?php echo $templatePath;?>img/br_build.png" width="160" height="142" alt="barnraiser" border="0" /></a><br />
					</td>
				</tr>
			</table>

		</td>

    	<td width="20">&nbsp;</td>

		<td valign="top" width="270">

			<table width="100%" border="0" cellspacing="4" cellpadding="0">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['hdr_setup'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_intro'];?><br />
					</td>
				</tr>
			</table>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />

			<table width="100%" border="0" cellspacing="4" cellpadding="0">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['txt_access_code'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_access_code_help'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<input type="text" name="data[access_code]" class="formInput" size="10" value="<?php if (isset($formdata['access_code'])) { echo $formdata['access_code'];}?>" /><br />
					</td>
				</tr>
			</table>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />

			<table width="100%" border="0" cellspacing="4" cellpadding="0">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['txt_create_password'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_create_password_help'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_password1'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<input type="password" name="data[user_password1]" class="formInput" size="8" value="<?php if (isset($formdata['user_password1'])) { echo $formdata['user_password1'];}?>" /><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_password2'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<input type="password" name="data[user_password2]" class="formInput" size="8" value="<?php if (isset($formdata['user_password1'])) { echo $formdata['user_password1'];}?>" /><br />
					</td>
				</tr>
			</table>
		</td>

		<td width="20">&nbsp;</td>

		<td valign="top" width="270">
			<?php
			if (isset($allow_setup_invites)) {
			?>
			<table width="100%" border="0" cellspacing="4" cellpadding="0">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['txt_add_friends'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_add_friends_help'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<textarea name="data[to]" rows="8" cols="38" class="formInput"><?php if (isset($formdata['to'])) { echo $formdata['to'];}?></textarea>
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_invite_to_help'];?><br />
					</td>
				</tr>
			</table>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
			<?php }?>
			<table width="100%" border="0" cellspacing="4" cellpadding="0">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['txt_finish'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_finish_help'];?><br />
					</td>
				</tr>
				<tr>
					<td align="right">
						<input type="submit" name="setup" value="<?php echo $lang['sub_finish'];?>" class="formInput" /><br />
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</form>

<?php
}
elseif (isset($display) && $display == "setup_already") {
?>
<table width="760" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td>
			<?php echo $lang['txt_hi'];?> <?php echo $user['user_firstname'];?>,<br />
			<?php echo $lang['txt_already_setup'];?><br />
			<p>
			<a href="http://www.barnraiser.org/"><?php echo $lang['href_index'];?></a><br />
			<p />
		</td>
	</tr>
</table>
<?php
}
?>

<table width="760" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="center" class="txt_footer">
		<?php echo $lang['copyright'];?><br />
		</td>
	</tr>
</table>
</body>
</html>
