<?php

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


<form action="mag_overview.php" method="post">

<div class="col_left1">
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_blogs'];?><br />
		</div>
		
		<div class="box_mid">
			<?php
			if (isset($blogs)) {
			foreach($blogs as $key => $i):
			if (!empty($i['rsp_sticky'])) {
			unset($blogs[$key]);
			?>
			<span class="pic">
				<a href="blg_view.php?blog_id=<?php echo $i['blog_id'];?>"><img src="get_file.php?file=<?php echo $i['image']['file'];?>" class="picture" border="0" title="<?php echo $i['image']['file_title'];?>"></a>
			</span>
			<span class="pic_content">
				<a href="blg_view.php?blog_id=<?php echo $i['blog_id'];?>"><?php echo $this->date->formatDate($i['blog_create_datetime']);?></a><br />
				<b><?php echo $i['blog_title'];?></b><br />
				<?php echo $i['blog_synopsis'];?><br />
			</span>
			<?php
			}
			endforeach;
			}
			?>
			<?php
			if (isset($blogs)) {
			foreach($blogs as $key => $i):
			?>
			<div class="content">
				<a href="blg_view.php?blog_id=<?php echo $i['blog_id'];?>"><?php echo $this->date->formatDate($i['blog_create_datetime']);?></a><br />
				<b><?php echo $i['blog_title'];?></b><br />
				<?php echo $i['blog_synopsis'];?><br />
			</div>
			<?php
			endforeach;
			}
			else {
			?>
			<div class="content">
				<?php echo $lang['err_no_blog'];?><br />
			</div>
			<?php }?>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
	
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_subjects'];?><br />
		</div>
			
		<div class="box_mid">
			<?php
			if (isset($subjects)) {
			foreach($subjects as $key => $i):
			if (!empty($i['rsp_sticky'])) {
			unset($subjects[$key]);
			?>
			<span class="pic">
				<a href="frm_view.php?subject_id=<?php echo $i['subject_id'];?>"><img align="left" src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture" title="<?php echo $i['image']['file_title'];?>"></a>
			</span>
			<span class="pic_content">
				<a href="blg_view.php?blog_id=<?php echo $i['blog_id'];?>"><?php echo $this->date->formatDate($i['blog_create_datetime']);?></a><br />
				<b><?php echo $i['subject_title'];?></b><br />
				<?php echo $i['subject_synopsis'];?><br />
			</span>
			<?php
			}
			endforeach;
			}
			?>
			<?php
			if (isset($subjects)) {
			foreach($subjects as $key => $i):
			?>
			<div class="content">
				<a href="frm_view.php?subject_id=<?php echo $i['subject_id'];?>"><?php echo $this->date->formatDate($i['subject_create_datetime']);?></a><br />
				<b><?php echo $i['subject_title'];?></b><br />
				<?php echo $i['subject_synopsis'];?><br />
			</div>
			<?php
			endforeach;
			}
			else {
			?>
			<div class="content">
				<?php echo $lang['err_no_subjects'];?><br />
			</div>
			<?php }?>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>

<div class="col_right1">
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_schedule'];?><br />
		</div>
		
		<div class="box_mid">
			<?php
			if (isset($schedule_items)) {
			foreach($schedule_items as $key => $i):
			?>
				<div class="content">
					<div class="content_right">
						<?php
						if (!empty($i['schedule_occurence'])) {
							if ($i['schedule_occurence'] == $schedule_config['occurrence']['daily']) {
								echo $lang['schedule']['occurrence'][1] . ": " . $this->date->formatDate($i['schedule_start_datetime'], 3);
							}
							elseif ($i['schedule_occurence'] == $schedule_config['occurrence']['weekly']) {
								echo $lang['schedule']['occurrence'][3] . ": " . $this->date->formatDate($i['schedule_start_datetime'], 4);
							}
							elseif ($i['schedule_occurence'] == $schedule_config['occurrence']['monthly']) {
								echo $lang['schedule']['occurrence'][9] . ": " . $this->date->formatDate($i['schedule_start_datetime'], 5);
							}
							elseif ($i['schedule_occurence'] == $schedule_config['occurrence']['yearly']) {
								echo $lang['schedule']['occurrence'][12] . ": " . $this->date->formatDate($i['schedule_start_datetime'], 5);
							}
						}
						else { //no repeat
							echo $i['display_schedule_start_datetime'];
						}
						?>
						<br />
						<?php
						if (isset($i['schedule_allocation'])) {
							echo $lang['txt_allocation'] . ": " . $i['schedule_allocation'] . "<br />";
						}
						?>
					</div>
					
					<b><a href="sch_view.php?schedule_id=<?php echo $i['schedule_id']?>"><?php echo $i['schedule_title'];?></a></b><br />
					<?php echo $i['schedule_synopsis'];?><br />
				</div>
				<?php
				endforeach;
				}
				else {
				?>
				<div class="content">
					<?php echo $lang['err_no_schedule_items'];?><br />
				</div>
				<?php }?>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
	
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_polls'];?><br />
		</div>
		
		<div class="box_mid">
			<?php
			if (isset($polls)) {
			foreach($polls as $key => $i):
			?>
			<div class="content">
				<?php
				$poll = $i;
				$poll_url = "pol_view.php?poll_id=" . $i['poll_id'];
				include $templatePath . "poll.inc.tpl.php";
				?>
			</div>
			<?php
			endforeach;
			}
			else {
			?>
				<div class="content">
					<?php echo $lang['err_no_polls'];?><br />
				</div>
			<?php }?>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>

	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_library_items'];?><br />
		</div>
			
		<div class="box_mid">
			<?php
			if (isset($library_items)) {
			foreach($library_items as $key => $i):
			if (!empty($i['rsp_sticky'])) {
			unset($library_items[$key]);
			?>
			<span class="pic">
				<a href="lib_view.php?library_id=<?php echo $i['library_id'];?>"><img align="left" src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture" title="<?php echo $i['image']['file_title'];?>"></a>
			</span>
			<span class="pic_content">
				<a href="lib_view.php?library_id=<?php echo $i['library_id'];?>"><?php echo $i['library_create_datetime'];?></a><br />
				<b><?php echo $i['library_title'];?></b><br />
				<?php echo $i['library_synopsis'];?><br />
			</span>
			<?php
			}
			endforeach;
			}
			?>
			<?php
			if (isset($library_items)) {
			foreach($library_items as $key => $i):
			?>
			<div class="content">
				<a href="lib_view.php?library_id=<?php echo $i['library_id'];?>"><?php echo $this->date->formatDate($i['library_create_datetime']);?></a><br />
				<b><?php echo $i['library_title'];?></b><br />
				<?php echo $i['library_synopsis'];?><br />
			</div>
			<?php
			endforeach;
			}
			else {
			?>
			<div class="content">
				<?php echo $lang['err_no_library_items'];?><br />
			</div>
			<?php }?>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>
