<?php

// -----------------------------------------------------------------------
// This file is part of Igloo
// 
// 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., 51 Franklin St, Fifth Floor, Boston, MA
// 02110-1301, USA.
// -----------------------------------------------------------------------

?>

<form action="setup.php" method="post">
<input type="hidden" name="user_id" value="<?php if (isset($data['user_id'])) { echo $data['user_id'];}?>" />
<input type="hidden" name="language_id" value="<?php if (isset($data['language_id'])) { echo $data['language_id'];}?>" />
<input type="hidden" name="user_firstname" value="<?php if (isset($data['user_firstname'])) { echo $data['user_firstname'];}?>" />
<input type="hidden" name="user_surname" value="<?php if (isset($data['user_surname'])) { echo $data['user_surname'];}?>" />
<input type="hidden" name="user_hometown" value="<?php if (isset($data['user_hometown'])) { echo $data['user_hometown'];}?>" />
<input type="hidden" name="user_gender" value="<?php if (isset($data['user_gender'])) { echo $data['user_gender'];}?>" />
<input type="hidden" name="alias_nic" value="<?php if (isset($data['alias_nic'])) { echo $data['alias_nic'];}?>" />
<input type="hidden" name="alias_hometown" value="<?php if (isset($data['alias_hometown'])) { echo $data['alias_hometown'];}?>" />
<input type="hidden" name="alias_gender" value="<?php if (isset($data['alias_gender'])) { echo $data['alias_gender'];}?>" />
<input type="hidden" name="to" value="<?php if (isset($data['to'])) { echo $data['to'];}?>" />
<input type="hidden" name="message" value="<?php if (isset($data['message'])) { echo $data['message'];}?>" />
<input type="hidden" name="user_email_message" value="<?php if (isset($data['user_email_message'])) { echo $data['user_email_message'];}?>" />
<input type="hidden" name="user_digest_newsletter" value="<?php if (isset($data['user_digest_newsletter'])) { echo $data['user_digest_newsletter'];}?>" />




<table width="760" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td valign="top" width="200" style="border-color: #DCDCDC #DCDCDC #DCDCDC #DCDCDC; border-style: solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px">
			<?php
			if (isset($display) && $display == "persona") {
			?>
				<p class="txt_item_title" style="color:#F36692">
					<?php echo $lang['menu_persona'];?> &raquo;<br />
				</p>
			<?php
			}
			else {
			?>
				<p class="txt_item_title">
					<?php echo $lang['menu_persona'];?><br />
				</p>
			<?php }?>
			
			<?php
			if (isset($allow_setup_invites)) {
			if (isset($display) && $display == "network") {
			?>
				<p class="txt_item_title" style="color:#F36692">
					<?php echo $lang['menu_network'];?> &raquo;<br />
				</p>
			<?php
			}
			else {
			?>
				<p class="txt_item_title">
					<?php echo $lang['menu_network'];?><br />
				</p>
			<?php }}?>
			
			<?php
			if (isset($display) && $display == "preferences") {
			?>
				<p class="txt_item_title" style="color:#F36692">
					<?php echo $lang['menu_preferences'];?> &raquo;<br />
				</p>
			<?php
			}
			else {
			?>
				<p class="txt_item_title">
					<?php echo $lang['menu_preferences'];?><br />
				</p>
			<?php }?>
				
			<?php
			if (isset($display) && $display == "account") {
			?>
				<p class="txt_item_title" style="color:#F36692">
					<?php echo $lang['menu_setup'];?> &raquo;<br />
				</p>
			<?php
			}
			else {
			?>
				<p class="txt_item_title">
					<?php echo $lang['menu_setup'];?><br />
				</p>
			<?php }?>
		</td>
		
		<td width="20">&nbsp;</td>
		
		<td valign="top" width="530">
			<?php
			if (isset($display) && $display == "preferences") {
			?>
				<p class="txt_item_title">
					<?php echo $lang['hdr_preferences'];?><br />
				</p>
				
				<table width="100%" border="0" cellspacing="4" cellpadding="0">
					<tr>
						<td valign="top">
							<?php echo $lang['txt_messaging_help'];?><br />
						</td>
						<td align="right" valign="top">
							<input type="checkbox" name="message" value="1" class="checkbox" /><br />
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
					</tr>
					<tr>
						<td valign="top">
							<?php echo $lang['txt_email_message_help'];?><br />
						</td>
						<td valign="top" align="right">
							<input id="id_user_email_message" type="checkbox" name="user_email_message" value="1" /><br />
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
					</tr>
					<?php
					if (isset($cron_enabled) && $cron_enabled==true) {
					?>
					<tr>
						<td valign="top">
							<?php echo $lang['txt_digest_newsletter_help'];?><br />
						</td>
						<td valign="top" align="right">
							<input id="id_user_digest_newsletter" type="checkbox" name="user_digest_newsletter" value="1" /><br />
						</td>
					</tr>
					<?php }?>
				</table>
				
				<p align="right">
				<input type="submit" name="preferences" value="<?php echo $lang['sub_next'];?>" class="button_urgent" /><br />
				</p>
				
			<?php
			}
			elseif (isset($display) && $display == "network" && isset($allow_setup_invites)) {
			?>
				<p class="txt_item_title">
					<?php echo $lang['hdr_network'];?><br />
				</p>
				
				<table width="100%" border="0" cellspacing="0" cellpadding="4">
					<tr>
						<td>
							<?php echo $lang['txt_network_intro'];?><br />
						</td>
					</tr>
					<tr>
						<td>
							<textarea name="to" rows="4" cols="50"><?php if (isset($data['to'])) { echo $data['to'];}?></textarea>
						</td>
					</tr>
				</table>
				
				<p align="right">
				<input type="submit" name="network" value="<?php echo $lang['sub_next'];?>" class="button_urgent" /><br />
				</p>
			<?php
			}
			elseif (isset($display) && $display == "persona") {
			?>
				<p class="txt_item_title">
					<?php echo $lang['hdr_persona'];?><br />
				</p>
				
				<p>
					<?php echo $lang['txt_personas_intro'];?><br />
				</p>
				
				<table cellpadding="4" cellspacing="0" border="0" width="100%">
					<tr>
						<td colspan="2">
							<b><?php echo $lang['txt_true_self'];?></b><br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_nic"><?php echo $lang['txt_firstname'];?></label><br />
						</td>
						<td>
							<input id="id_nic" type="text" name="user_firstname" size="32"  maxlength="50" value="<?php if (isset($data['user_firstname'])) { echo $data['user_firstname'];}?>" />&nbsp;*<br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_nic"><?php echo $lang['txt_surname'];?></label><br />
						</td>
						<td>
							<input id="id_nic" type="text" name="user_surname" size="32"  maxlength="50" value="<?php if (isset($data['user_surname'])) { echo $data['user_surname'];}?>" />&nbsp;*<br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_hometown"><?php echo $lang['txt_hometown'];?></label><br />
						</td>
						<td>
							<input id="id_hometown" type="text" name="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="user_gender" value="0" checked="checked">&nbsp;<?php echo $lang['txt_none'];?>
							<input id="id_gender" type="radio" name="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="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">
							<b><?php echo $lang['txt_alias'];?></b><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="alias_nic" size="32"  maxlength="50" value="<?php if (isset($data['alias_nic'])) { echo $data['alias_nic'];}?>" />&nbsp;*<br />
						</td>
					</tr>
					<tr>
						<td>
							<label for="id_hometown"><?php echo $lang['txt_hometown'];?></label><br />
						</td>
						<td>
							<input id="id_hometown" type="text" name="alias_hometown" size="32" value="<?php if (isset($data['alias_hometown'])) { echo $data['alias_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="alias_gender" value="0" checked="checked">&nbsp;<?php echo $lang['txt_none'];?>
							<input id="id_gender" type="radio" name="alias_gender" value="1" <?php if (isset($data['alias_gender']) && $data['alias_gender'] == "1") { echo "checked";}?>>&nbsp;<?php echo $lang['txt_male'];?>
							<input id="id_gender" type="radio" name="alias_gender" value="2" <?php if (isset($data['alias_gender']) && $data['alias_gender'] == "2") { echo "checked";}?>>&nbsp;<?php echo $lang['txt_female'];?><br />
						</td>
					</tr>
				</table>
				
				<p align="right">
				<input type="submit" name="persona" value="<?php echo $lang['sub_next'];?>" class="button_urgent" /><br />
				</p>
			<?php
			}
			elseif (isset($display) && $display == "account") {
			?>
				<p class="txt_item_title">
					<?php echo $lang['hdr_setup'];?><br />
				</p>
				
				<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="access_code" size="10" value="<?php if (isset($data['access_code'])) { echo $data['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="user_password1" size="8" value="<?php if (isset($data['user_password1'])) { echo $data['user_password1'];}?>" /><br />
						</td>
					</tr>
					<tr>
						<td>
							<?php echo $lang['txt_password2'];?><br />
						</td>
					</tr>
					<tr>
						<td>
							<input type="password" name="user_password2" size="8" value="<?php if (isset($data['user_password1'])) { echo $data['user_password1'];}?>" /><br />
						</td>
					</tr>
				</table>
				
				<p align="right">
				<input type="submit" name="setup" value="<?php echo $lang['sub_finish'];?>" class="button_urgent" /><br />
				</p>
			<?php
			}
			elseif (isset($display) && $display == "setup_already") {
			?>
				<p>
					<?php echo $lang['txt_hi'];?> <?php echo $frmdata['user_firstname'];?>,<br />
					<?php echo $lang['txt_already_setup'];?><br />
				</p>
				
				<p>
				<a href="http://www.barnraiser.org/"><?php echo $lang['href_index'];?></a><br />
				<p />
			<?php
			}
			elseif (isset($display) && $display == "hack") {
			?>
				<p>
					<?php echo $lang['txt_hack'];?><br />
				</p>
			<?php }?>
		</td>
	</tr>
</table>
</form>
