<?php

// -----------------------------------------------------------------------
// This file is part of AROUNDMe
//
// Copyright (C) 2003 - 2007 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.
// -----------------------------------------------------------------------

?>

<style type="text/css">
<!--
@import url(<?php echo $template_path;?>css/aroundme_form.css);
-->
</style>

<style type="text/css">

#content .col_left {
		float:left;
		position:relative;
		left:0px;
		width:220px;
	}
	
	#content .col_main {
		float:left;
		position:relative;
		left:12px;
		width:276px;
	}
	
	#content .col_right {
		float:left;
		position:relative;
		left:24px;
		width:220px;
	}
</style>


<div class="col_left">
	<div class="box">
		<div class="box_top">
			<div class="content">
				<h1><?php echo $identity['identity_nic'];?></h1>
			</div>
		</div>

		<div class="box_mid">
			<div class="content">
				<p>
					<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $identity['identity_id'];?>"><b><?php echo $identity['identity_nic'];?></b></a><br />	
				</p>
	
				<?php
				if(isset($identity['image'])) {
				?>
				<p align="center">
					<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $identity['identity_id'];?>"><img src="get_file.php?file=<?php echo $identity['image']['file_md5_name_view']; ?>" border="0" class="picture" alt="" /></a><br />
				</p>
				<?php }?>
			
	
				<p>
					<?php echo $identity['location_name'];?><br />
					<?php echo $this->date->formatDate($identity['user_create_datetime'],1);?><br />
					<?php echo $lang['user_online_status'][$identity['online_status']];?><br />
				</p>
		
				<?php
				if (isset($identity['display_type']) && $identity['display_type'] == "full") {
				if (!empty($identity['identity_signature'])) {
				?>
				<p>
					<i>"<?php echo $identity['identity_signature'];?>"</i><br />
				</p>
				<?php }}?>
				
				<?php
				if (isset($invitee['identity'])) {
				?>
				<p>
					<b><?php echo $lang['txt_invited_by'];?></b><br />
				</p>
				
				<table cellspacing="2" cellpadding="0" border="0" width="100%">
					<tr>
						<td valign="top">
							<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $invitee['identity']['matrix'][0]['identity_relation']['identity_id'];?>"><?php echo $invitee['identity']['matrix'][0]['identity_relation']['identity_nic'];?></a><br />
						</td>
						<td valign="top" align="right">
							<?php
							if (isset($invitee['identity']['matrix'][0])) {
								echo drawMatrix($invitee['identity']['matrix'][0]);
							}
							?>
						</td>
					</tr>
				</table>
				<?php }?>
				
				<p>
					<b><?php echo $lang['txt_mutual_respected'];?></b><br />
				</p>

				<?php
				if (isset($mutual_respected['identity_id'])) {
				?>
				<table cellspacing="0" cellpadding="2" border="0" width="100%">
					<?php
					foreach ($mutual_respected['identity_id'] as $key => $i):
					?>
					<tr>
						<td width="32" valign="top">
							<a href="index.php?amn=core_profile&amp;module_id=<?php echo $i['module_id'];?>&amp;item_id=<?php echo $i['item_id'];?>&amp;identity_id=<?php echo $i['identity_id'];?>"><img src="get_file.php?file=<?php echo $i['image']['file_md5_name_view'];?>" border="0" alt="<?php echo $i['image']['file_save_name'];?>" /></a><br />
						</td>
						<td valign="top">
							<a href="index.php?amn=core_profile&amp;module_id=<?php echo $i['module_id'];?>&amp;item_id=<?php echo $i['item_id'];?>&amp;identity_id=<?php echo $i['identity_id'];?>"><?php echo dots($i['identity_nic'],14);?></a><br />
							<?php echo $lang['txt_since']; ?> <?php echo $this->date->formatDate($i['relation_create_datetime']);?><br />
						</td>
						<td valign="top" align="right">
							<?php
							if (isset($i['matrix'][0])) {
								echo drawMatrix($i['matrix'][0]);
							}
							?>
						</td>
					</tr>
					<?php
					endforeach;
					?>
				</table>
				<?php }?>

				<p>
					<b><?php echo $lang['txt_statistics']; ?></b><br />
					<?php echo $lang['txt_given_respect']; ?> <b><?php echo $statistics['identity_id']['respected']; ?></b><br />
					<?php echo $lang['txt_received_respect']; ?> <b><?php echo $statistics['identity_id']['respect']; ?></b><br />
					
				</p>
			</div>
		</div>
	</div>
</div>
	

<div class="col_main">
	<div class="box">
		<div class="box_top">
			<div class="content">
				<h1><?php echo $lang['hdr_matrix'];?></h1>
			</div>
		</div>

		<div class="box_mid">
			<div class="content">
				<?php if (isset($relation_user)) { ?>
				<div class="picture" style="padding:6px;">
					<?php echo $lang['txt_connection_intro']; ?> <i><?php echo $identity_relation['identity_nic']; ?></i>. <?php echo $lang['txt_relationship_summery']; ?> <i><?php echo $identity_relation['identity_nic']; ?></i>.
					<table cellspacing="0" cellpadding="4" border="0" width="100%">
						<?php foreach($relation_user as $r): ?>
							<tr>
								<td align="top">
									<?php if ($r['identity']['identity_id'] == $_REQUEST['identity_id']) { ?>
										<?php echo $r['identity']['identity_name']; ?> (viewed)<br />
									<?php } else { ?>
										<?php echo $r['identity']['identity_name']; ?><br />
									<?php } ?>
									
								</td>
								<td align="top">
									<?php echo drawMatrix($r); ?>
								</td>
							</tr>
						<?php endforeach; ?>
					</table>
				</div>
				<?php } ?>
			
				<?php
				if (isset($lang['txt_relation_summary1'])) {
				?>
				<p>
					<b><?php echo $lang['txt_respect_intro'];?></b><br />
				</p>
				
				<p>
					<?php echo $lang['txt_relation_summary1'];?><br />
				</p>

				<?php
				if (isset($respected_item)) {
				?>
				<p>
					<?php echo $lang['txt_source']; ?> <a href="<?php echo $respected_item['item_url'];?>"><?php echo $respected_item['item_title'];?></a><br />
				</p>
				<?php }}?>

				<?php
				if (isset($lang['txt_relation_summary2'])) {
				?>
				
				<p>
					<b><?php echo $lang['txt_mutual_respect_intro'];?></b><br />
				</p>
				
				<p>
					<?php echo $lang['txt_relation_summary2'];?><br />
				</p>

				<?php
				if (isset($respected_item_relation)) {
				?>
				<p>
					<?php echo $lang['txt_source']; ?> <a href="<?php echo $respected_item_relation['item_url'];?>"><?php echo $respected_item_relation['item_title'];?></a><br />
				</p>
				<?php }}?>
					

				<?php
				if (isset($shared_participation)) {
				?>
				<hr />

				<p>
					<b><?php echo $lang['txt_shared_participation_intro'];?></b><br />
				</p>

				<ol>
					<?php foreach($shared_participation as $t): ?>
					<li><a href="<?php echo $t['item']['item_url'];?>"><?php echo $t['item']['item_title'];?></a></li>
					<?php endforeach; ?>
				</ol>
				<?php } ?>

				<hr />
				
				<?php if (isset($testimonials['identity'][0]) || isset($testimonials['identity_relation'][0])) { ?>
				<p>
					<b><?php echo $lang['txt_vouched']; ?></b><br />
				</p>
				<?php } ?>
				
				<?php
				if (isset($testimonials['identity'][0])) {
				$testimonials['identity'] = $testimonials['identity'][0];
				?>
				<p>
					<?php echo $this->date->formatDate($testimonials['identity']['testimonial_create_datetime']);?>: <?php echo $testimonials['identity']['identity_nic'];?> wrote<br />
					<i><?php echo $testimonials['identity']['testimonial_body'];?></i><br />
				</p>
				<?php }?>

				<?php
				if (isset($testimonials['identity_relation'][0])) {
				$testimonials['identity_relation'] = $testimonials['identity_relation'][0];
				?>
				<p>
					<?php echo $this->date->formatDate($testimonials['identity_relation']['testimonial_create_datetime']);?>: <?php echo $testimonials['identity_relation']['identity_nic'];?> wrote<br />
					<i><?php echo $testimonials['identity_relation']['testimonial_body'];?></i><br />
				</p>
				<?php }?>
			</div>
		</div>
	</div>
</div>

<div class="col_right">
	<div class="box">
		<div class="box_top">
			<div class="content">
				<h1><?php echo $identity_relation['identity_nic'];?></h1>
			</div>
		</div>

		<div class="box_mid">
			<div class="content">
				<p>
					<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $identity_relation['identity_id'];?>"><b><?php echo $identity_relation['identity_nic'];?></b></a><br />
				</p>
	
				<?php
				if(isset($identity_relation['image'])) {
				?>
				<p align="center">
					<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $identity_relation['identity_id'];?>"><img src="get_file.php?file=<?php echo $identity_relation['image']['file_md5_name_view']; ?>" border="0" class="picture" alt="" /></a><br />
				</p>
				<?php }?>
			
	
				<p>
					<?php echo $identity_relation['location_name'];?><br />
					<?php echo $this->date->formatDate($identity_relation['user_create_datetime'],1);?><br />
					<?php echo $lang['user_online_status'][$identity_relation['online_status']];?><br />
				</p>
	
				<?php
				if (isset($identity_relation['display_type']) && $identity_relation['display_type'] == "full") {
				if (!empty($identity_relation['identity_signature'])) {
				?>
				<p>
					<i>"<?php echo $identity_relation['identity_signature'];?>"</i><br />
				</p>
				<?php }}?>
				
				<?php
				if (isset($invitee['identity_relation'])) {
				?>
				<p>
					<b><?php echo $lang['txt_invited_by'];?></b><br />
				</p>
				
				<table cellspacing="0" cellpadding="2" border="0" width="100%">
					<tr>
						<td valign="top">
							<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $invitee['identity_relation']['matrix'][0]['identity_relation']['identity_id'];?>"><?php echo $invitee['identity_relation']['matrix'][0]['identity_relation']['identity_nic'];?></a><br />
						</td>
						<td valign="top" align="right">
							<?php
							if (isset($invitee['identity_relation']['matrix'][0])) {
								echo drawMatrix($invitee['identity_relation']['matrix'][0]);
							}
							?>
						</td>
					</tr>
				</table>
				<?php }?>
				
				<p>
					<b><?php echo $lang['txt_mutual_respected'];?></b><br />
				</p>

				<?php
				if (isset($mutual_respected['identity_id_relation'])) {
				?>
				<table cellspacing="2" cellpadding="0" border="0" width="100%">
					<?php
					foreach ($mutual_respected['identity_id_relation'] as $key => $i):
					?>
					<tr>
						<td width="32" valign="top">
							<a href="index.php?amn=core_profile&amp;module_id=<?php echo $i['module_id'];?>&amp;item_id=<?php echo $i['item_id'];?>&amp;identity_id=<?php echo $i['identity_id'];?>"><img src="get_file.php?file=<?php echo $i['image']['file_md5_name_view'];?>" border="0" alt="<?php echo $i['image']['file_save_name'];?>" /></a><br />
						</td>
						<td valign="top">
							<a href="index.php?amn=core_profile&amp;module_id=<?php echo $i['module_id'];?>&amp;item_id=<?php echo $i['item_id'];?>&amp;identity_id=<?php echo $i['identity_id'];?>"><?php echo dots($i['identity_nic'],14);?></a><br />
							<?php echo $lang['txt_since']; ?> <?php echo $this->date->formatDate($i['relation_create_datetime']);?><br />
						</td>
						<td valign="top" align="right">
							<?php
							if (isset($i['matrix'][0])) {
								echo drawMatrix($i['matrix'][0]);
							}
							?>
						</td>
					</tr>
					<?php
					endforeach;
					?>
				</table>
				<?php }?>

				<p>
					<b><?php echo $lang['txt_statistics']; ?></b><br />
					<?php echo $lang['txt_given_respect']; ?> <b><?php echo $statistics['identity_id_relation']['respected']; ?></b><br />
					<?php echo $lang['txt_received_respect']; ?> <b><?php echo $statistics['identity_id_relation']['respect']; ?></b><br />
					
				</p>
			</div>
		</div>
	</div>
</div>