<?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.
// -----------------------------------------------------------------------

?>

<table width="760" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="160" valign="top">
			<?
			include($templatePath . 'menu.inc.php');
			?>
		</td>

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

		<td width="360" valign="top">
			<?php
			if (isset($invite)) {
			?>
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td colspan="3" align="right" class="txt_title">
						<?php echo $lang['section_invite'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<?php
					if (isset($invite['image'])) {
					?>
					<td valign="top" width="50">
						<img src="<?php echo $aroundme_dir;?>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>

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


			<?php
			if (isset($display) && $display == "registration_complete") {
			?>
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['section_reg_complete'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_index_intro_post_reg'];?><br />
					</td>
				</tr>
			</table>
			<?php
			}
			elseif (isset($display) && $display == "preview") {
			?>
			<form action="register.php" method="post" name="register">
			<input type="hidden" name="data[language_id]" value="<?php echo $data['language_id'];?>" />
			<input type="hidden" name="language_ids[]" value="<?php echo $data['language_id'];?>" />
			<input type="hidden" name="data[user_email]" value="<?php echo $data['user_email'];?>" />
			<input type="hidden" name="data[user_nic]" value="<?php echo $data['user_nic'];?>" />
			<input type="hidden" name="data[user_firstname]" value="<?php echo $data['user_firstname'];?>" />
			<input type="hidden" name="data[user_surname]" value="<?php echo $data['user_surname'];?>" />
			<input type="hidden" name="data[user_hometown]" value="<?php echo $data['user_hometown'];?>" />
			<input type="hidden" name="data[user_gender]" value="<?php if (isset($data['user_gender'])) { echo $data['user_gender'];}?>" />
			<input type="hidden" name="year" value="<?php echo $year;?>" />
			<input type="hidden" name="month" value="<?php echo $month;?>" />
			<input type="hidden" name="day" value="<?php echo $day;?>" />
			<input type="hidden" name="data[invitee_id]" value="<?php if (isset($data['invitee_id'])) { echo $data['invitee_id'];}?>" />
						
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td align="right" class="txt_title" colspan="2">
						<?php echo $lang['section_registration'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_email'];?><br />
					</td>
					<td>
						<?php echo $data['user_email'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_nickname'];?><br />
					</td>
				    <td>
						<?php echo $data['user_nic'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_firstname'];?><br />
					</td>
					<td>
						<?php echo $data['user_firstname'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_surname'];?><br />
					</td>
					<td>
						<?php echo $data['user_surname'];?><br />
					</td>
				</tr>

				<tr>
					<td>
						<?php echo $lang['txt_dob'];?><br />
					</td>
					<td>
						<?php echo $display_dob;?><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>
						<?php echo $lang['txt_hometown'];?><br />
					</td>
					<td>
						<?php echo $data['user_hometown'];?><br />
					</td>
				</tr>

				<tr>
					<td>
						<?php echo $lang['txt_gender'];?><br />
					</td>
					<td>
						<?php if (isset($data['user_gender'])) { echo $data['user_gender'];}?><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="formInput" />&nbsp;&nbsp;
						<input type="submit" name="register" value="<?php echo $lang['sub_register'];?>" class="formInput" /><br />
					</td>
				</tr>
			</table>
			</form>
			<?php
			}
			else {
			?>
			<form action="register.php" method="post" name="register">
			<input type="hidden" name="data[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="data[language_id]" value="<?php echo $language_default;?>" />
			<input type="hidden" name="language_ids[]" value="<?php echo $language_default;?>" />
			<?php
			}
			?>
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td align="right" class="txt_title" colspan="2">
						<?php echo $lang['section_registration'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td colspan="2">
						 <?php echo $lang['txt_welcome'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_email'];?><br />
					</td>
					<td>
						<input type="text" name="data[user_email]" size="32" class="formInput" value="<?php if (isset($data['user_email'])) { echo $data['user_email'];}?>" />&nbsp;*<br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_nickname'];?><br />
					</td>
				    <td>
						<input type="text" name="data[user_nic]" size="32"  maxlength="50" class="formInput" value="<?php if (isset($data['user_nic'])) { echo $data['user_nic'];}?>" />&nbsp;*<br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_firstname'];?><br />
					</td>
					<td>
						<input type="text" name="data[user_firstname]" size="32" class="formInput" value="<?php if (isset($data['user_firstname'])) { echo $data['user_firstname'];}?>" />&nbsp;*<br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_surname'];?><br />
					</td>
					<td>
						<input type="text" name="data[user_surname]" size="32" class="formInput" value="<?php if (isset($data['user_surname'])) { echo $data['user_surname'];}?>" /><br />
					</td>
				</tr>

				<tr>
					<td>
						<?php echo $lang['txt_dob'];?><br />
					</td>
					<td>
						<?php
						echo $datedropdown;
						?>
					</td>
				</tr>
				<?php
				if (count($lang['arr_lang_name']) > 1) {
				?>
				<tr>
					<td valign="top">
						<?php echo $lang['txt_lang_selection'];?><br />
					</td>
					<td>
							<?php
							foreach($lang['arr_lang_name'] as $key => $i):
							?>
							<input type="checkbox" name="language_ids[]" value="<?php echo $key;?>" checked="checked" />&nbsp;<?php echo $i;?><br />
							<?php
							endforeach;
							?>
						<br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_lang'];?><br />
					</td>
					<td>
						<select name="data[language_id]" size="1" class="formInput">
							<?php
							foreach($lang['arr_lang_name'] as $key => $i):
							?>
							<option value="<?php echo $key;?>" <? if($data['language_id'] == $key) echo "selected";?>><?php echo $i;?></option>
							<?php
							endforeach;
							?>
						</select>&nbsp;*<br />
					</td>
				</tr>
				<?php
				}
				?>
				<tr>
					<td>
						<?php echo $lang['txt_hometown'];?><br />
					</td>
					<td>
						<input type="text" name="data[user_hometown]" size="32" class="formInput" value="<?php if (isset($data['user_hometown'])) { echo $data['user_hometown'];}?>" />&nbsp;*<br />
					</td>
				</tr>

				<tr>
					<td>
						<?php echo $lang['txt_gender'];?><br />
					</td>
					<td>
						<input type="radio" name="data[user_gender]" value="1" <?php if (isset($data['user_gender']) && $data['user_gender'] == "1") { echo "checked";}?>>&nbsp;<?php echo $lang['txt_male'];?>
						<input type="radio" name="data[user_gender]" value="2" <?php if (isset($data['user_gender']) && $data['user_gender'] == "2") { echo "checked";}?>>&nbsp;<?php echo $lang['txt_female'];?>*
					</td>
				</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="formInput" />&nbsp;&nbsp;
						<input type="submit" name="register" value="<?php echo $lang['sub_register'];?>" class="formInput" /><br />
					</td>
				</tr>
			</table>
			</form>
			<?php
			}
			?>

		</td>
		<td width="20">&nbsp;</td>
		<td valign="top" width="180">
			<?php
			if (isset($display) && $display == "registration_complete") {
			?>
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td align="right" class="txt_title">
						<?php echo $lang['section_instructions'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_instructions2'];?>
					</td>
				</tr>
			</table>
			<?php
			}
			elseif (isset($display) && $display == "preview") {
			?>
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td align="right" class="txt_title">
						<?php echo $lang['section_preview'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_preview'];?><br />
					</td>
				</tr>
			</table>
			<?php
			}
			else {
			?>
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td align="right" class="txt_title">
						<?php echo $lang['section_instructions'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_instructions'];?><br />
					</td>
				</tr>
			</table>
			<?php
			}
			?>
		</td>
	</tr>
</table>
