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

?>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="180" valign="top" rowspan="2">
			<?php
			include $templatePath . "g_menu.inc.tpl.php";
			
			if (isset($group)) {
			?>
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" /><br />
			<?php }?>
			
			<?php
			if (isset($group)) {
				$hidden_form = array(
					"item_id" => $group['group_id'],
					"group_id" => $group['group_id']
				);
			}
			
			$show_network = 1;
			
			include $templatePath . "tag.inc.tpl.php";?>
			
		</td>

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

		<td width="560" valign="top" colspan="3" height="1%">
			<div class="box_top">
				<?php echo $lang['section_group_summary'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td valign="top">
						<?php echo $group['group_home_synopsis'];?><br />
					</td>
				</tr>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
			
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
		</td>
	</tr>
	<tr>
		<td width="270" valign="top">
			<?php
			if ($this->group_acs->checkPermission($resource_ids['group_blog'], $privilege_ids['allow_access'])) { //resourece_id, Priv_id
			?>
			<div class="box_top">
				<?php echo $lang['hdr_recommended_b'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<?php
				if (isset($blogs)) {
				foreach($blogs as $key => $i):
				?>
				<tr>
					<td valign="top" width="1%">
						<a href="blg_item.php?group_id=<?php echo $group['group_id'];?>&amp;blog_id=<?php echo $i['blog_id'];?>"><img align="right" src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture" title="<?php echo $i['image']['file_title'];?>"></a><br />
					</td>
					<td valign="top">
						<a href="blg_item.php?group_id=<?php echo $group['group_id'];?>&amp;blog_id=<?php echo $i['blog_id'];?>"><?php echo $i['blog_create_datetime'];?></a><br />
						<b><?php echo $i['blog_title'];?></b><br />
						<?php echo $i['blog_synopsis'];?><br />
					</td>
			    </tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_blogs'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>

			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
			<?php }?>
			
			<?php
			if ($this->group_acs->checkPermission($resource_ids['group_forum'], $privilege_ids['allow_access'])) { //resourece_id, Priv_id
			?>
			<div class="box_top">
				<?php echo $lang['hdr_recommended_s'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<?php
				if (isset($subjects)) {
				foreach($subjects as $key => $i):
				?>
				<tr valign="top">
					<td valign="top" width="1%">
						<a href="frm_item.php?group_id=<?php echo $group['group_id'];?>&amp;subject_id=<?php echo $i['subject_id'];?>"><img align="right" src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture" title="<?php echo $i['image']['file_title'];?>"></a><br />
					</td>
					<td valign="top">
						<a href="frm_item.php?group_id=<?php echo $group['group_id'];?>&amp;subject_id=<?php echo $i['subject_id'];?>"><?php echo $i['subject_create_datetime'];?></a><br />
						<b><?php echo $i['subject_title'];?></b><br />
						<?php echo dots(200,$i['subject_body']);?><br />
		 			</td>
				</tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_subjects'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
			
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
			<?php }?>
			
			<?php
			if ($this->group_acs->checkPermission($resource_ids['group_library'], $privilege_ids['allow_access'])) { //resourece_id, Priv_id
			?>
			<div class="box_top">
				<?php echo $lang['hdr_library'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<?php
				if (isset($library)) {
				foreach($library as $key => $i):
				?>
				<tr>
					<td valign="top" width="1%">
						<a href="lib_item.php?group_id=<?php echo $group['group_id'];?>&amp;page=<?php echo $i['library_page_name'];?>"><img align="right" src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture" title="<?php echo $i['image']['file_title'];?>"></a><br />
					</td>
					<td valign="top">
						<a href="lib_item.php?group_id=<?php echo $group['group_id'];?>&amp;page=<?php echo $i['library_page_name'];?>"><?php echo $i['library_create_datetime'];?></a><br />
						<b><?php echo $i['library_title'];?></b><br />
						<?php echo dots('180', $i['library_synopsis']);?><br />
					</td>
				</tr>
			<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_library'];?><br />
					</td>
				</tr>
			<?php }?>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
			<?php }?>
		</td>

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

		<td width="270" valign="top">
			<?php
			if ($this->group_acs->checkPermission($resource_ids['group_poll'], $privilege_ids['allow_access'])) { //resourece_id, Priv_id
			if (isset($polls)) {
 			?>
			<div class="box_top">
				<?php echo $lang['hdr_polls'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
 			<table border="0" cellspacing="4" cellpadding="0" width="100%">
 				<?php
 				foreach($polls as $key => $i):
 				?>
 				<tr>
 					<td valign="top">
 						<?php
						$poll = $i;
						$poll_url = "pol_item.php?group_id=" . $group['group_id'] . "&amp;poll_id=" . $i['poll_id'];
 						include $templatePath . "poll.inc.tpl.php";
 						?>
 					</td>
 			    </tr>
				<tr>
					<td>
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="2" alt="" /><br />
					</td>
				</tr>
 				<?php
 				endforeach;
 				?>
 			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
			
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
			<?php }}?>
			
			<?php
			if ($this->group_acs->checkPermission($resource_ids['group_schedule'], $privilege_ids['allow_access'])) { //resourece_id, Priv_id
			?>
			<div class="box_top">
				<?php echo $lang['hdr_activities'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<?php
				if (isset($activities)) {
				foreach($activities as $key => $i):
				?>
			    <tr>
					<td valign="top" width="1%">
						<a href="sch_item.php?group_id=<?php echo $group['group_id'];?>&amp;schedule_id=<?php echo $i['schedule_id'];?>"><img align="right" src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture" title="<?php echo $i['image']['file_title'];?>"></a><br />
					</td>
					<td valign="top">
						<a href="sch_item.php?group_id=<?php echo $group['group_id'];?>&amp;schedule_id=<?php echo $i['schedule_id'];?>"><?php echo $i['display_schedule_start_datetime'];?></a><br />
						<b><?php echo $i['schedule_title'];?></b><br />
						<?php echo $i['schedule_synopsis'];?><br />

					</td>
				</tr>
			<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_activities'];?><br />
					</td>
				</tr>
			<?php }?>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
			
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
			<?php }?>
			
			<?php
			if ($this->group_acs->checkPermission($resource_ids['group_schedule'], $privilege_ids['allow_access'])) { //resourece_id, Priv_id
			?>
			<div class="box_top">
				<?php echo $lang['hdr_tasks'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<?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>
						<?php
						if (!empty($i['display_schedule_start_datetime'])) {
						?>
							<a href="sch_item.php?group_id=<?php echo $group['group_id'];?>&amp;schedule_id=<?php echo $i['schedule_id'];?>"><?php echo $i['display_schedule_start_datetime'];?></a><br />
							<b><?php echo $i['schedule_title'];?></b><br />
						<?php
						}
						else {
						?>
							<a href="sch_item.php?group_id=<?php echo $group['group_id'];?>&amp;schedule_id=<?php echo $i['schedule_id'];?>"><b><?php echo $i['schedule_title'];?></b></a><br />
						<?php }?>
						
						<?php echo $i['schedule_synopsis'];?><br />
					</td>
				</tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_tasks'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
			</div>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
			<?php }?>
		</td>
	</tr>
</table>
