<?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="180" valign="top">
			<?
			include($templatePath . 'p_menu.inc.php');
			?>
		</td>

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

		<td width="360" valign="top">
			<?php
			if (isset($invite)) {
			?>
			<div class="box_top">
				<?php echo $lang['section_invite'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<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 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 }?>


			<?php
			if (isset($display) && $display == "registration_complete") {
			?>
			<div class="box_top">
				<?php echo $lang['section_reg_complete'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<?php echo $lang['txt_index_intro_post_reg'];?><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>
			<?php
			}
			elseif (isset($display) && $display == "preview") {
			?>
			<form action="p_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'];}?>" />
			
			<div class="box_top">
				<?php echo $lang['section_registration'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<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_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']) && $data['user_gender'] == 1) { 
							echo $lang['txt_male'];
						}
						elseif (isset($data['user_gender']) && $data['user_gender'] == 2) { 
							echo $lang['txt_female'];
						}
						else {
							echo $lang['txt_none'];
						}
						?><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 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>
			</form>
			<?php
			}
			else {
			?>
			<form action="p_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
			}
			?>
			<div class="box_top">
				<?php echo $lang['section_registration'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<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="data[user_email]" size="32" value="<?php if (isset($data['user_email'])) { echo $data['user_email'];}?>" />&nbsp;*<br />
					</td>
				</tr>
				<tr>
					<td>
						<label for="id_nic"><?php echo $lang['txt_nickname'];?></label><br />
					</td>
				    <td>
						<input id="id_nic" type="text" name="data[user_nic]" size="32"  maxlength="50" value="<?php if (isset($data['user_nic'])) { echo $data['user_nic'];}?>" />&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="data[user_firstname]" size="32" value="<?php if (isset($data['user_firstname'])) { echo $data['user_firstname'];}?>" />&nbsp;*<br />
					</td>
				</tr>
				<tr>
					<td>
						<label for="id_sname"><?php echo $lang['txt_surname'];?></label><br />
					</td>
					<td>
						<input id="id_sname" type="text" name="data[user_surname]" size="32" value="<?php if (isset($data['user_surname'])) { echo $data['user_surname'];}?>" />&nbsp;*<br />
					</td>
				</tr>

				<tr>
					<td>
						<label for="id_dob"><?php echo $lang['txt_dob'];?></label><br />
					</td>
					<td>
						<?php
						echo $datedropdown;
						?>&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="data[language_id]" size="1">
							<?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>
						<label for="id_hometown"><?php echo $lang['txt_hometown'];?></label><br />
					</td>
					<td>
						<input id="id_hometown" type="text" name="data[user_hometown]" size="32" value="<?php if (isset($data['user_hometown'])) { echo $data['user_hometown'];}?>" />&nbsp;*<br />
					</td>
				</tr>

				<tr>
					<td>
						<label for="id_gender"><?php echo $lang['txt_gender'];?></label><br />
					</td>
					<td>
						<input id="id_gender" type="radio" name="data[user_gender]" value="0" checked="checked">&nbsp;<?php echo $lang['txt_none'];?>
						<input id="id_gender" 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 id="id_gender" 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'];?><br />
					</td>
				</tr>
				
				<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 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>
			</form>
			<?php }?>

		</td>
		
		<td width="20">&nbsp;</td>
		
		<td valign="top" width="180">
			<?php
			if (isset($display) && $display == "registration_complete") {
			?>
			<div class="box_top">
				<?php echo $lang['section_instructions'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<?php echo $lang['txt_instructions2'];?>
					</td>
				</tr>
			</table>
			<?php
			}
			elseif (isset($display) && $display == "preview") {
			?>
			<div class="box_top">
				<?php echo $lang['section_preview'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<?php echo $lang['txt_preview'];?><br />
					</td>
				</tr>
			</table>
			<?php
			}
			else {
			?>
			<div class="box_top">
				<?php echo $lang['section_instructions'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table cellpadding="4" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<?php echo $lang['txt_instructions'];?><br />
					</td>
				</tr>
			</table>
			<?php }?>
			</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>
