<?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">
			<div class="content">
				<?php
				if (isset($blogs)) {
				?>
				<table border="0" cellspacing="0" cellpadding="4" width="100%">
				<?php
				foreach($blogs as $key => $i):
				if (!empty($i['rsp_sticky'])) {
				unset($blogs[$key]);
				?>
				<tr>
					<td width="60" valign="top" rowspan="2">
						<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>
					</td>
					<td valign="top">
						<a href="blg_view.php?blog_id=<?php echo $i['blog_id'];?>"><?php echo $this->date->formatDate($i['blog_create_datetime']);?></a><br />
					</td>
					<td valign="top" align="right">
						<?php
						if (!empty($i['blog_allow_comments'])) {
						?>
						<?php echo $lang['href_comments'];?>&nbsp;(<?php if (!empty($i['comment_total'])) { echo $i['comment_total'];} else { echo "0";}?>)
						<?php }?>
						<br />
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2">
						<b><?php echo $i['blog_title'];?></b><br />
						<?php echo $i['blog_synopsis'];?><br />
					</td>
				</tr>
				<tr>
					<td colspan="3">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="6" alt="" /><br />
					</td>
				</tr>
				<?php
				}
				endforeach;
				?>
				</table>
				<?php
				}
				?>
				<?php
				if (isset($blogs)) {
				?>
				<table border="0" cellspacing="0" cellpadding="2" width="100%">
				<?php
				foreach($blogs as $key => $i):
				?>
				<tr>
					<td valign="top">
						<a href="blg_view.php?blog_id=<?php echo $i['blog_id'];?>"><?php echo $this->date->formatDate($i['blog_create_datetime']);?></a><br />
					</td>
					<td valign="top" align="right">
						<?php
						if (!empty($i['blog_allow_comments'])) {
						?>
						<?php echo $lang['href_comments'];?>&nbsp;(<?php if (!empty($i['comment_total'])) { echo $i['comment_total'];} else { echo "0";}?>)
						<?php }?>
						<br />
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2">
						<b><?php echo $i['blog_title'];?></b><br />
						<?php echo $i['blog_synopsis'];?><br />
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="6" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				?>
				</table>
				<?php
				}
				else {
				?>
				<p>
					<?php echo $lang['err_no_blog'];?><br />
				</p>
				<?php }?>
			</div>
		</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">
			<div class="content">
				<?php
				if (isset($subjects)) {
				?>
				<table border="0" cellspacing="0" cellpadding="4" width="100%">
				<?php
				foreach($subjects as $key => $i):
				if (!empty($i['rsp_sticky'])) {
				unset($subjects[$key]);
				?>
				<tr>
					<td width="60" valign="top" rowspan="2">
						<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>
					</td>
					<td valign="top">
						<a href="frm_view.php?subject_id=<?php echo $i['subject_id'];?>"><?php echo $this->date->formatDate($i['subject_create_datetime']);?></a><br />
					</td>
					<td valign="top" align="right">
						<?php echo $lang['href_comments'];?>&nbsp;(<?php if (!empty($i['comment_total'])) { echo $i['comment_total'];} else { echo "0";}?>)
						<br />
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2">
						<b><?php echo $i['subject_title'];?></b><br />
						<?php echo $i['subject_synopsis'];?><br />
					</td>
				</tr>
				<tr>
					<td colspan="3">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="6" alt="" /><br />
					</td>
				</tr>
				<?php
				}
				endforeach;
				?>
				</table>
				<?php
				}
				?>
				<?php
				if (isset($subjects)) {
				?>
				<table border="0" cellspacing="0" cellpadding="2" width="100%">
				<?php
				foreach($subjects as $key => $i):
				?>
				<tr>
					<td valign="top">
						<a href="frm_view.php?subject_id=<?php echo $i['subject_id'];?>"><?php echo $this->date->formatDate($i['subject_create_datetime']);?></a><br />
					</td>
					<td valign="top" align="right">
						<?php echo $lang['href_comments'];?>&nbsp;(<?php if (!empty($i['comment_total'])) { echo $i['comment_total'];} else { echo "0";}?>)
						<br />
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2">
						<b><?php echo $i['subject_title'];?></b><br />
						<?php echo $i['subject_synopsis'];?><br />
						</td>
				</tr>
				<tr>
					<td colspan="2">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="6" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				?>
				</table>
				<?php
				}
				else {
				?>
				<p>
					<?php echo $lang['err_no_subjects'];?><br />
				</p>
				<?php }?>
			</div>
		</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>
