<?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
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 valign="top" width="370">
			<div class="box_top">
				<?php echo $lang['hdr_setup'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" border="0" cellspacing="4" cellpadding="0">
				<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>
						<b><?php echo $lang['txt_access_code'];?></b><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_access_code_help'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<input type="text" name="data[access_code]" 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>
						<b><?php echo $lang['txt_create_password'];?></b><br />
					</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]" 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]" size="8" value="<?php if (isset($formdata['user_password1'])) { echo $formdata['user_password1'];}?>" /><br />
					</td>
				</tr>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
			
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="20" alt="" /><br />
			<a href="http://www.barnraiser.org/aroundme/"><img src="<?php echo $templatePath;?>img/am_base.png" hspace="9" width="142" height="43" alt="" border="0" /></a><br />
		
		</td>

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

		<td valign="top" width="370">
			<?php
			if (isset($allow_setup_invites)) {
			?>
			<div class="box_top">
				<?php echo $lang['txt_add_friends'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" border="0" cellspacing="4" cellpadding="0">
				<tr>
					<td>
						<?php echo $lang['txt_add_friends_help'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<textarea name="data[to]" rows="6" cols="38"><?php if (isset($formdata['to'])) { echo $formdata['to'];}?></textarea>
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_invite_to_help'];?><br />
					</td>
				</tr>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
			<?php }?>
			
			<div class="box_top">
				<?php echo $lang['txt_messaging'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" border="0" cellspacing="4" cellpadding="0">
				<tr>
					<td>
						<?php echo $lang['txt_messaging_help'];?><br />
					</td>
				</tr>
				<tr>
					<td align="right">
						<input type="checkbox" name="data[message]" value="1" class="checkbox" /><br />
					</td>
				</tr>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
			
			<div class="box_top">
				<?php echo $lang['txt_finish'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" border="0" cellspacing="4" cellpadding="0">
				<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="button_urgent" /><br />
					</td>
				</tr>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table>
</form>

<?php
}
elseif (isset($display) && $display == "setup_already") {
?>
<table width="760" border="0" cellspacing="0" cellpadding="0" class="table_stnd">
	<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 }?>
