<?php

// -----------------------------------------------------------------------
// This file is part of AROUNDMe
// 
// Copyright (C) 2003 - 2006 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., 51 Franklin St, Fifth Floor, Boston, MA
// 02110-1301, USA.
// -----------------------------------------------------------------------

?>

<div class="col_main">
	<?php
	if (isset($invite)) {
	?>
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_invite'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
				<table width="100%" cellpadding="4" cellspacing="0" border="0">
					<tr>
						<?php
						if (isset($invite['image'])) {
						?>
						<td valign="top" width="50">
							<img src="get_file.php?file=<?php echo $invite['image']['file'];?>" border="0" class="picture" title="<?php echo $invite['image']['file_title'];?>" /></a><br />
						</td>
						<td width="20">&nbsp;</td>
						<?php } ?>
						<td valign="top">
							<?php echo $invite['profile_nic'];?><br />
							<?php echo $invite['profile_create_datetime'];?><br />
							<?php echo $invite['profile_hometown'];?><br />
							<p>
							<?php echo $lang['txt_invited_personal'];?><br />
							</p>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
	<?php }?>


	<?php
	if (isset($display) && $display == "registration_complete") {
	?>
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_reg_complete'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
				<?php echo $lang['txt_index_intro_post_reg'];?><br />
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
	
	<?php
	}
	elseif (isset($display) && $display == "preview") {
	?>
	<form action="register.php" method="post" name="register">
	<input type="hidden" name="language_id" value="<?php echo $data['language_id'];?>" />
	<input type="hidden" name="language_ids[]" value="<?php echo $data['language_id'];?>" />
	<input type="hidden" name="user_email" value="<?php echo $data['user_email'];?>" />
	<input type="hidden" name="user_firstname" value="<?php echo $data['user_firstname'];?>" />
	<input type="hidden" name="invitee_id" value="<?php if (isset($data['invitee_id'])) { echo $data['invitee_id'];}?>" />
	
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_registration'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
				<table cellpadding="4" cellspacing="0" border="0" width="100%">
					<tr>
						<td>
							<?php echo $lang['txt_email'];?><br />
						</td>
						<td>
							<?php echo $data['user_email'];?><br />
						</td>
					</tr>
					<tr>
						<td>
							<?php echo $lang['txt_firstname'];?><br />
						</td>
						<td>
							<?php echo $data['user_firstname'];?><br />
						</td>
					</tr>
					<tr>
						<td valign="top">
							<?php echo $lang['txt_lang_selection'];?><br />
						</td>
						<td>
							<?php
							foreach($lang['arr_lang_name'] as $key => $i):
								echo $i . "<br />";
							endforeach;
							?>
						</td>
					</tr>
					<tr>
						<td>
							<?php echo $lang['txt_lang'];?><br />
						</td>
						<td>
							<?php echo $lang['arr_lang_name'][$data['language_id']];?><br />
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="20" alt="" /><br />
						</td>
					</tr>
					<tr>
						<td align="right" colspan="2">
							<input type="submit" name="edit_again" value="<?php echo $lang['sub_edit_again'];?>" class="button_urgent" />&nbsp;&nbsp;
							<input type="submit" name="register" value="<?php echo $lang['sub_register'];?>" class="button_urgent" /><br />
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
	</form>
	
	<?php
	}
	else {
	?>
	
	<form action="register.php" method="post" name="register">
	<input type="hidden" name="invitee_id" value="<?php if (isset($invite['user_id'])) { echo $invite['user_id'];}?>" />
	
	<?php
	if (count($lang['arr_lang_name']) == 1) {
	?>
	<input type="hidden" name="language_id" value="<?php echo $language_default;?>" />
	<input type="hidden" name="language_ids[]" value="<?php echo $language_default;?>" />
	<?php
	}
	?>
	
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_registration'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
				<table cellpadding="4" cellspacing="0" border="0" width="100%">
					<tr>
						<td colspan="2">
							 <?php echo $lang['txt_welcome'];?><br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_email"><?php echo $lang['txt_email'];?></label><br />
						</td>
						<td>
							<input id="id_email" type="text" name="user_email" size="32" value="<?php if (isset($data['user_email'])) { echo $data['user_email'];}?>" />&nbsp;*<br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_fname"><?php echo $lang['txt_firstname'];?></label><br />
						</td>
						<td>
							<input id="id_fname" type="text" name="user_firstname" size="32" value="<?php if (isset($data['user_firstname'])) { echo $data['user_firstname'];}?>" />&nbsp;*<br />
						</td>
					</tr>
					<?php
					if (count($lang['arr_lang_name']) > 1) {
					?>
					<tr>
						<td valign="top">
							<label for="id_language"><?php echo $lang['txt_lang_selection'];?></label><br />
						</td>
						<td>
								<?php
								foreach($lang['arr_lang_name'] as $key => $i):
								?>
								<input id="id_language" type="checkbox" name="language_ids[]" value="<?php echo $key;?>" checked="checked" class="checkbox" />&nbsp;<?php echo $i;?><br />
								<?php
								endforeach;
								?>
							<br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_language_id"><?php echo $lang['txt_lang'];?></label><br />
						</td>
						<td>
							<select id="id_language_id" name="language_id" size="1">
								<?php
								foreach($lang['arr_lang_name'] as $key => $i):
								?>
								<option value="<?php echo $key;?>" <? if(isset($data['language_id']) && $data['language_id'] == $key) echo "selected";?>><?php echo $i;?></option>
								<?php
								endforeach;
								?>
							</select>&nbsp;*<br />
						</td>
					</tr>
					<?php
					}
					?>
					
					<tr>
						<td colspan="2">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" /><br />
						</td>
					</tr>
					
					<tr>
						<td valign="top">
							<label for="id_captcha"><?php echo $lang['txt_captcha'];?></label><br />
						</td>
						<td>
							<?php echo $lang['txt_captcha_intro'];?><br />
						</td>
					</tr>
					<tr>
						<td valign="top">
							&nbsp;<br />
						</td>
						<td>
							<table cellpadding="2" cellspacing="0" border="0">
								<tr>
									<td>
										<img src="get_captcha.php" alt="CAPTCHA" class="picture"><br />
									</td>
								</tr>
								<tr>
									<td>
										<input id="id_captcha" type="text" name="captchastring" size="20">&nbsp;*<br />
									</td>
								</tr>
							</table>
						</td>
					</tr>
					
					<tr>
						<td valign="top">
							&nbsp;<br />
						</td>
						<td>
							<?php echo $lang['txt_captcha_hint'];?><br />
						</td>
					</tr>
					
					<tr>
						
					</tr>
					
					<tr>
						<td colspan="2">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="20" alt="" /><br />
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<?php echo $lang['txt_reg_legal'];?><br />
						</td>
					</tr>
	
					<tr>
						<td align="right" colspan="2">
							<input type="submit" name="preview" value="<?php echo $lang['sub_preview'];?>" class="button_urgent" />&nbsp;&nbsp;
							<input type="submit" name="register" value="<?php echo $lang['sub_register'];?>" class="button_urgent" /><br />
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
	</form>
	<?php }?>
</div>

<div class="col_side">
	<?php
	if (isset($display) && $display == "registration_complete") {
	?>
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_instructions'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
				<?php echo $lang['txt_instructions2'];?><br />
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
	
	<?php
	}
	elseif (isset($display) && $display == "preview") {
	?>
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_preview'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
				<?php echo $lang['txt_preview'];?><br />
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
	
	<?php
	}
	else {
	?>
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_instructions'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
				<?php echo $lang['txt_instructions'];?><br />
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
	<?php }?>
</div>
