<?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($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="node_register_user.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="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="invitee_id" value="<?php if (isset($data['invitee_id'])) { echo $data['invitee_id'];}?>" />
	<input type="hidden" name="subject" value="<?php if (isset($data['subject'])) { echo $data['subject'];}?>" />
	<input type="hidden" name="message" value="<?php if (isset($data['message'])) { echo $data['message'];}?>" />
	
	<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>
							<?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 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="node_register_user.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="data[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_user_email"><?php echo $lang['txt_email'];?></label><br />
						</td>
						<td>
							<input id="id_user_email" type="text" name="user_email" size="30" value="<?php if (isset($data['user_email'])) { echo $data['user_email'];}?>" />&nbsp;*<br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_user_firstname"><?php echo $lang['txt_firstname'];?></label><br />
						</td>
						<td>
							<input id="id_user_firstname" type="text" name="user_firstname" size="30" value="<?php if (isset($data['user_firstname'])) { echo $data['user_firstname'];}?>" />&nbsp;*<br />
						</td>
					</tr>
	
					<tr>
						<td>
							<label for="id_user_dob"><?php echo $lang['txt_dob'];?></label><br />
						</td>
						<td>
							<?php
							echo $datedropdown;
							?>
						</td>
					</tr>
					<?php
					if (count($lang['arr_lang_name']) > 1) {
					?>
					<tr>
						<td valign="top">
							<label for="id_lang_sel"><?php echo $lang['txt_lang_selection'];?></label><br />
						</td>
						<td>
								<?php
								foreach($lang['arr_lang_name'] as $key => $i):
								?>
								<input id="id_lang_sel" type="checkbox" name="language_ids[]" value="<?php echo $key;?>" checked="checked" />&nbsp;<?php echo $i;?><br />
								<?php
								endforeach;
								?>
							<br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_language"><?php echo $lang['txt_lang'];?></label><br />
						</td>
						<td>
							<select id="id_language" name="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
					}
					?>
				</table>
				
				<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
				
				<table cellpadding="4" cellspacing="0" border="0" width="100%">
					<tr>
						<td colspan="2">
							<b><?php echo $lang['hdr_invite_notes'];?></b><br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_subject"><?php echo $lang['txt_subject'];?></label><br />
						</td>
						<td>
							<input id="id_subject" type="text" size="40" name="subject" value="<?php echo $lang['txt_invite'];?>" /><br />
						</td>
					</tr>
					<tr>
						<td valign="top">
							<label for="id_message"><?php echo $lang['txt_message'];?></label><br />
						</td>
						<td>
							<textarea id="id_message" name="message" rows="6" cols="38"><?php echo $lang['txt_invite_message_txt'];?></textarea>
						</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>
