<?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="my_overview.php" method="post" name="homepage">

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

			<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" class="table_stnd">
				<tr>
					<td colspan="3" class="txt_title" align="right">
						<?php echo $lang['hdr_tasks'];?><br />
						<hr />
					</td>
				</tr>
				<?php
				if (isset($tasks)) {
				foreach($tasks as $key => $i):
				?>
			     <tr>
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td>
						<a href="a_activity.php?activity_id=<?php echo $i['activity_id'];?>"><?php echo $i['task_title'];?></a><br />
						<?php echo $i['task_start_datetime'];?><br />
						<span class="txt_footer">
						<?php echo $i['task_synopsis'];?><br />
					</td>
					<td align="right" valign="top" class="txt_footer">
						<?php echo $lang['arr_activity_user_status'][$i['status']['status_id']];?><br />
					</td>
			    </tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="3">
						<?php echo $lang['err_no_tasks'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>

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

			<table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_stnd">
				<tr>
					<td colspan="2" class="txt_title" align="right">
						<?php echo $lang['section_comments'];?><br />
						<hr />
					</td>
				</tr>
				<?php
				if (isset($comments)) {
				foreach($comments as $key => $i):
				?>
				<tr>
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td valign="top">
						<table width="100%" cellpadding="4" cellspacing="0" border="0" class="table_nested">
							<tr>
								<td class="txt_footer" colspan="2">
									<?php echo $lang['txt_from'];?>: <a href="sn_profile.php?user_id=<?php echo $i['user_id'];?>" class="txt_footer_link"><?php echo $i['profile_nic'];?></a>&nbsp;(<?php echo $lang['txt_joined'];?>: <?php echo $i['profile_create_datetime'];?>, <?php echo $lang['txt_hometown'];?>: <?php echo $i['profile_hometown'];?>)<br />
									<?php echo $lang['txt_comment_datetime'];?>: <?php echo $i['comment_create_datetime'];?><br />
								</td>
							</tr>
							<tr>
								<td valign="top">
									<?php
									if ($cms_item_type_ids['user_blog'] == $i['cms_item_type_id']) {
									?>
									<a href="my_blog.php?blog_id=<?php echo $i['item_id'];?>"><?php echo $lang['cms']['item_type'][$i['cms_item_type_id']];?></a>:&nbsp;
									<?php
									}
									elseif ($cms_item_type_ids['user_library'] == $i['cms_item_type_id']) {
									?>
									<a href="my_library.php?library_id=<?php echo $i['item_id'];?>"><?php echo $lang['cms']['item_type'][$i['cms_item_type_id']];?></a>:&nbsp;
									<? }?>
									
									<?php echo $i['comment_body'];?><br />
								</td>
						    </tr>

						</table>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				else {
				?>
				<tr class="bg_2">
					<td colspan="2">
						<?php echo $lang['err_no_comments'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>

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

			<table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_stnd">
				<tr>
					<td colspan="3" class="txt_title" align="right">
						<?php echo $lang['hdr_statistics'];?><br />
						<hr />
					</td>
				</tr>
				<?php
				if (isset($user_statistic)) {
				foreach($user_statistic as $key => $i):
				?>
				<tr>
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td>
						<?php echo $lang['arr_user_statistic_type_id'][$i['statistic_type_id']];?><br />
					</td>
					<td align="right">
						<?php echo $i['total'];?><br />
					</td>
				</tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="3">
						<?php echo $lang['err_no_statistics'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>

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

			<table border="0" cellspacing="0" cellpadding="4" width="100%" class="table_stnd">
				<tr>
					<td colspan="3" class="txt_title" align="right">
						<?php echo $lang['hdr_node_stats'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td>
						<?php echo $lang['txt_date'];?>:<br />
					</td>
					<td>
						<?php echo $node_statistics['today'];?><br />
					</td>
				</tr>
				<tr>
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td>
						<?php echo $lang['txt_total_online_users'];?>:<br />
					</td>
					<td>
						<?php echo $node_statistics['total_online_users'];?><br />
					</td>
				</tr>
				<tr>
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td>
						<?php echo $lang['txt_total_users'];?>:<br />
					</td>
					<td>
						<?php echo $node_statistics['total_users'];?><br />
					</td>
				</tr>
				<tr>
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td>
						<?php echo $lang['txt_total_groups'];?>:<br />
					</td>
					<td>
						<?php echo $node_statistics['total_groups'];?><br />
					</td>
				</tr>
			</table>
		</td>

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

		<td width="180" valign="top">
			<table border="0" cellspacing="0" cellpadding="4" width="100%" class="table_stnd">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['section_me'];?><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 $user['user_firstname'];?> <?php echo $user['user_surname'];?><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_user_hometown'];?><br />
									</span>
								</td>
								<td class="bg4">
									<span class="txt_footer">
									<?php echo $user['user_hometown'];?><br />
									</span>
								</td>
							</tr>
							<tr>
								<td class="bg3">
									<span class="txt_footer">
									<?php echo $lang['txt_user_create_datetime'];?><br />
									</span>
								</td>
								<td class="bg4">
									<span class="txt_footer">
									<?php echo $user['user_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="0" class="table_stnd">
				<tr>
					<td class="txt_title" align="right">
						<?php echo $lang['hdr_friends'];?><br />
						<hr />
					</td>
				</tr>
				<?php
				if (isset($friends)) {
				foreach($friends as $key => $i):
				?>
				<tr>
					<td>

						<table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_nested">
							<tr>
								<td valign="top" width="1%">
									<a href="sn_profile.php?user_id=<?php echo $i['user_id'];?>"><img src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture" title="<?php echo $i['image']['file_title'];?>" alt="" /></a><br />
								</td>
								<td valign="top" class="txt_footer">
									<a href="sn_profile.php?user_id=<?php echo $i['user_id'];?>"><?php echo $i['profile_nic'];?></a><br />

									<?php echo $i['profile_create_datetime'];?><br />
									<?php echo $i['profile_hometown'];?><br />

									<?php
									if ($i['online_status'] == 1) {
									    echo "<span class='txt_red'><b>" . $lang['arr_user_online_status'][1] . "</b></span><br />";
									}
									else {
										    echo $lang['arr_user_online_status'][$i['online_status']] . "<br />";
									}
									?>
								</td>
								<td width="10" valign="top">
									<?php
									if (isset($i['profile_allow_msg']) && $i['profile_allow_msg'] == 1) {
									?>
									<a href="msg_compose.php?to_user_id=<?php echo $i['user_id'];?>"><img src="<?php echo $templatePath;?>img/unopenned_mail.png" title="<?php echo $lang['ttl_send_message'];?>" border="0" alt="" /></a>
									<?php }?><br />
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="3">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				else {
				?>
				<tr>
					<td colspan="3">
						<?php echo $lang['err_no_friends'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
		</td>
	</tr>
</table>
