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

?>


<form action="sn_profile.php" method="post">
<input type="hidden" name="user_id" value="<?php echo $profile['user_id'];?>" />

<table width="770" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="180" valign="top">
			<?php
			include $templatePath . "sn_menu.inc.tpl.php";
			?>

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

			<table border="0" cellspacing="0" cellpadding="4" width="100%">
				<tr>
					<td class="txt_title">
						<?php echo $lang['section_action'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<?php
						if (isset($display) && $display == "blocked") {
						?>
						<a href="sn_profile.php?user_id=<?php echo $profile['user_id'];?>&amp;unblock=1" class="txt_sub_menu"><?php echo $lang['href_unblock'];?></a><br />
						<?php
						}
						elseif (isset($display) && $display == "block") {
						?>
						<table width="100%" cellpadding="4" cellspacing="0" border="0">
			   				<tr>
								<td>
									<b><?php echo $lang['hdr_block'];?></b><br />
									<?php echo $lang['txt_block_description_text'];?><br />
								</td>
							</tr>
							<tr>
								<td>
									<textarea rows="3" cols="25" name="data[block_description]" class="formInput"></textarea><br />
								</td>
							</tr>
							<tr>
								<td align="right">
									<input type="submit" name="set_block" value="<?php echo $lang['sub_block'];?>" class="formInput" /><br />
									<br />
								</td>
							</tr>
						</table>
						<?
						}
						elseif (isset($profile['user_id']) && $profile['user_id'] != $me['user_id']) {
						?>
						<a href="sn_profile.php?user_id=<?php echo $profile['user_id'];?>&amp;block=1" class="txt_sub_menu"><?php echo $lang['href_block'];?></a><br />
						<?
						}
						?>
					</td>
				</tr>
			</table>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="52" alt="" /><br />
			
			<?php
			include $templatePath . "logo.inc.tpl.php";
			?>
		</td>

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


		<td width="370" valign="top">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<tr>
					<td colspan="2" class="txt_title" align="right">
						<?php echo $lang['hdr_summary'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td valign="top">
						<?php echo $profile['profile_summary'];?><br />
					</td>
				</tr>
			</table>

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

			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['hdr_relationship'];?><br />
						<hr />
					</td>
				</tr>
				<?php
				if (isset($relationship_paths)) {
				foreach($relationship_paths as $key => $r):
				?>
				<tr>
					<td>
						<table cellpadding="0" cellspacing="4" border="0">
							<tr>
								<?php
								foreach($r['relation'] as $key1 => $i):
								?>
								<td>
									<?php 
									if ($i == $me['user_id']) {
									    echo "me<br />";
									}
									else {
										foreach($relationship_profiles as $keyrp => $rp):
											if ($i == $rp['user_id']) {
												
												if (count($r['relation']) > $key1+1) {
													echo "<a href=\"sn_profile.php?user_id=" . $rp['user_id'] . "\">" . $rp['profile_nic'] . "</a><br />";
												}
												else {
													echo $rp['profile_nic'] . "<br />";
												}
												
												break;
											}
										endforeach;
									}
									?>
								</td>
								<?php
								if (count($r['relation']) > $key1+1) {
									echo "<td>-&#62;<br /></td>";
								}
								?>
								<?php 
								endforeach;
								?>
							</tr>
						</table>
					</td>
				</tr>
				<?
				endforeach;
				}
				?>
			</table>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
			
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<tr>
					<td colspan="2" class="txt_title" align="right">
						<?php echo $lang['hdr_contact'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<b><?php echo $lang['txt_profile_msn_account'];?></b><br />
					</td>
					<td>
						<?php echo $profile['profile_msn_account'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<b><?php echo $lang['txt_profile_yahoo_account'];?></b><br />
					</td>
					<td>
						<?php echo $profile['profile_yahoo_account'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<b><?php echo $lang['txt_profile_icq'];?></b><br />
					</td>
					<td>
						<?php echo $profile['profile_icq_account'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<b><?php echo $lang['txt_profile_skype_account'];?></b><br />
					</td>
					<td>
						<?php echo $profile['profile_skype_account'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<b><?php echo $lang['txt_profile_mobile_phone'];?></b><br />
					</td>
					<td>
						<?php echo $profile['profile_mobile_phone'];?><br />
					</td>
				</tr>
			</table>
		</td>

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

		<td width="180" valign="top">
			<table border="0" cellspacing="0" cellpadding="4" width="100%">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['hdr_profile'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<table border="0" cellspacing="2" cellpadding="4" width="100%" class="picture">
							<tr>
								<td class="bg1" colspan="2">
									<?php echo $profile['profile_nic'];?><br />
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<img src="get_file.php?file=<?php echo $profile['image']['file'];?>" border="0" alt="<?php echo $profile['image']['file_title'];?>" /><br />
								</td>
							</tr>
							<tr>
								<td class="bg3">
									<span class="txt_footer">
									<?php echo $lang['txt_profile_session_status'];?><br />
									</span>
								</td>
								<td class="bg4">
									<span class="txt_footer">
									<?php
									if ($profile['online_status'] == 1) {
									    echo "<span class='txt_breadcrumb_on'><b>" . $lang['arr_user_online_status'][1] . "</b></span><br />";
									}
									else {
										    echo $lang['arr_user_online_status'][$profile['online_status']] . "<br />";
									}
									?>
									</span>
								</td>
							</tr>
							<tr>
								<td class="bg3">
									<span class="txt_footer">
									<?php echo $lang['txt_profile_hometown'];?><br />
									</span>
								</td>
								<td class="bg4">
									<span class="txt_footer">
									<?php echo $profile['profile_hometown'];?><br />
									</span>
								</td>
							</tr>
							<tr>
								<td class="bg3">
									<span class="txt_footer">
									<?php echo $lang['txt_profile_create_datetime'];?><br />
									</span>
								</td>
								<td class="bg4">
									<span class="txt_footer">
									<?php echo $profile['profile_create_datetime'];?><br />
									</span>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />

			<table border="0" width="100%" cellspacing="0" cellpadding="4">
				<tr>
					<td colspan="2" class="txt_title" align="right">
						<?php echo $lang['hdr_statistics'];?><br />
						<hr />
					</td>
				</tr>
				<?php
				if (isset($profile_statistic)) {
				foreach($profile_statistic as $key => $i):
				?>
				<tr>
					<td>
						<span class="txt_footer"><?php echo $lang['arr_user_statistic_type_id'][$i['statistic_type_id']];?></span><br />
					</td>
					<td align="right">
						<span class="txt_footer"><?php echo $i['total'];?></span><br />
					</td>
				</tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_statistics'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
		</td>
	</tr>
</table>
</form>
