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

?>


<div class="box">
	<div class="box_top">
		<div class="content">
			<h1><?php echo $lang['hdr_announce'];?></h1>
		</div>
	</div>
		
	<div class="box_mid">
		<div class="content">
			<?php
			if ($_SESSION['user_core_permission'] & $core_config['resource']['user']['int_announce']) {
			?>
			<p align="right">
				<a href="index.php?amn=core_ann_edit"><?php echo $lang['href_add_ann']; ?></a><br />
			</p>
			<?php }?>
				
			<?php if (isset($announcements)) { ?>
				<table border="0" cellspacing="0" cellpadding="2" width="100%">
					<tr>
						<td>
							<b><a href="index.php?amn=core_ann_list&amp;sort=date&amp;desc=<?php echo isset($_GET['desc']) && $_GET['desc'] == 1 ? 0 : 1; ?>"><?php echo $lang['txt_date'];?></a></b><br />
						</td>
						<td>
							<b><a href="index.php?amn=core_ann_list&amp;sort=title&amp;desc=<?php echo isset($_GET['desc']) && $_GET['desc'] == 1 ? 0 : 1; ?>"><?php echo $lang['txt_title'];?></a></b><br />
						</td>
						<td>
	
							<b><?php echo $lang['txt_author'];?></b><br />
						</td>
					</tr>
					<?php foreach($announcements as $a): ?>				
					<tr>
						<td>
							<a href="index.php?amn=core_ann_view&amp;announce_id=<?php echo $a['announce_id']; ?>"><?php echo $this->date->formatDate($a['announce_create_datetime'], 1); ?></a><br />
						</td>	
						<td>
							<?php echo $a['announce_title'];?><br />
						</td>
						<td>
							<a href="index.php?amn=core_profile&amp;identity_id=<?php echo $a['identity_id']; ?>"><?php echo $a['identity_nic'];?></a><br />
						</td>
					</tr>
					<?php
					endforeach;
					?>
				</table>
			<?php } ?>
		</div>
	</div>
</div>