<?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="g_cms.php" method="post">
<input type="hidden" name="group_id" value="<?php echo $group['group_id'];?>" />

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

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

			<table border="0" width="100%" cellspacing="4" cellpadding="0">
				<tr>
					<td class="txt_title">
						<?php echo $lang['section_search'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<select name="status_id" class="formInput">
							<option value="0" selected="selected"><?php echo $lang['txt_all'];?></option>
							<?php
							foreach($lang['cms']['status'] as $key => $i):
								$selected = "";
								if(isset($status_id) && $status_id == $key) {
									$selected = " selected=\"selected\"";
								}
								print "<option value='" . $key . "'" . $selected . ">" . $i . "</option>";
							endforeach;
							?>
						</select>
					</td>
			    </tr>
				<tr>
					<td align="right">
						<input type="submit" name="search" value="<?php echo $lang['sub_search'];?>" class="formInput" /><br />
					</td>
				</tr>
			</table>

			<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="570" valign="top">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td colspan="5" class="txt_title" align="right">
						<?php echo $lang['hdr_home_page_editorial'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td colspan="5" align="right">
						<table cellpadding="4" cellspacing="2" border="0" class="picture">
							<tr>
								<td class="bg2">
									<?php echo $lang['ttl_live'];?><br />
								</td>
								<td class="bg3">
									<?php echo $lang['txt_live'];?><br />
								</td>
								<td class="bg2">
									<?php echo $lang['ttl_hold'];?><br />
								</td>
								<td class="bg3">
									<?php echo $lang['txt_hold'];?><br />
								</td>
								<td class="bg2">
									<?php echo $lang['ttl_pending'];?><br />
								</td>
								<td class="bg3">
									<?php echo $lang['txt_pending'];?><br />
								</td>
								<td class="bg2">
									<?php echo $lang['ttl_sticky'];?><br />
								</td>
								<td class="bg3">
									<?php echo $lang['txt_sticky'];?><br />
								</td>
								<td class="bg2">
									<?php echo $lang['ttl_remove'];?><br />
								</td>
								<td class="bg3">
									<?php echo $lang['txt_remove'];?><br />
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="txt_title" colspan="2">
						<?php echo $lang['hdr_subjects'];?><br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_remove'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_sticky'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_live'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_hold'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_pending'];?><br />
					</td>
				</tr>
				<?php
				if (isset($subjects)) {
				foreach($subjects as $key => $i):
				
				foreach($cms_subjects as $key1 => $r):
					if ($i['subject_id'] == $r['item_id']) {
					    $temp = $r;
						break;
					}
				endforeach;
				?>
				<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 $i['subject_id'];?>
						<a href="g_forum_subject.php?group_id=<?php echo $group['group_id'];?>&amp;subject_id=<?php echo $i['subject_id'];?>"><?php echo $i['subject_title'];?></a><br />
						<span class="txt_footer"><?php echo dots(200, $i['subject_body']);?><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="radio" name="data[subject_status][<?php echo $i['subject_id'];?>]" value="0" /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="checkbox" name="data[subject_sticky][<?php echo $i['subject_id'];?>]" value="1"<?php if (isset($temp['cms_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['cms']['status'] as $key_r => $r):
						$selected = "";
						if (isset($temp['status_id']) && $temp['status_id'] == $key_r) {
						    $selected = " checked=\"checked\"";
						}
						?>
						<input type="radio" name="data[subject_status][<?php echo $i['subject_id'];?>]" value="<?php echo $key_r;?>"<?php echo $selected;?> />
						
						<?php
						endforeach;
						?>
					</td>
				</tr>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				?>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td colspan="2" class="txt_title">
						<?php echo $lang['hdr_group_library'];?><br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_remove'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_sticky'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_live'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_hold'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_pending'];?><br />
					</td>
				</tr>
				<?php
				if (isset($library_items)) {
				foreach($library_items as $key => $i):
				
				foreach($cms_library_items as $key1 => $r):
					if ($i['library_id'] == $r['item_id']) {
					    $temp = $r;
						break;
					}
				endforeach;
				?>
				<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="g_library.php?group_id=<?php echo $group['group_id'];?>&amp;page=<?php echo $i['library_page_name'];?>"><?php echo $i['library_title'];?></a><br />
						<span class="txt_footer"><?php echo dots(200, $i['library_synopsis']);?><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="radio" name="data[library_item_status][<?php echo $i['library_id'];?>]" value="0" /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="checkbox" name="data[library_item_sticky][<?php echo $i['library_id'];?>]" value="1"<?php if (isset($temp['cms_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['cms']['status'] as $key_r => $r):
						$selected = "";
						if (isset($temp['status_id']) && $temp['status_id'] == $key_r) {
						    $selected = " checked=\"checked\"";
						}
						?>
						<input type="radio" name="data[library_item_status][<?php echo $i['library_id'];?>]" value="<?php echo $key_r;?>"<?php echo $selected;?> />
						
						<?php
						endforeach;
						?>
					</td>
				</tr>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				?>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td colspan="2" class="txt_title">
						<?php echo $lang['hdr_activities'];?><br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_remove'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_sticky'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_live'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_hold'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_pending'];?><br />
					</td>
				</tr>
				<?php
				if (isset($activities)) {
				foreach($activities as $key => $i):
				
				foreach($cms_activities as $key1 => $r):
					if ($i['activity_id'] == $r['item_id']) {
					    $temp = $r;
						break;
					}
				endforeach;
				?>
			    <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="g_activity.php?group_id=<?php echo $group['group_id'];?>&amp;activity_id=<?php echo $i['activity_id'];?>"><?php echo $i['activity_title'];?></a><br />
						<?php echo $i['activity_start_datetime'];?><br />
						<span class="txt_footer"><?php echo $i['activity_synopsis'];?><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="radio" name="data[activity_status][<?php echo $i['activity_id'];?>]" value="0" /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="checkbox" name="data[activity_sticky][<?php echo $i['activity_id'];?>]" value="1"<?php if (isset($temp['cms_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['cms']['status'] as $key_r => $r):
						$selected = "";
						if (isset($temp['status_id']) && $temp['status_id'] == $key_r) {
						    $selected = " checked=\"checked\"";
						}
						?>
						<input type="radio" name="data[activity_status][<?php echo $i['activity_id'];?>]" value="<?php echo $key_r;?>"<?php echo $selected;?> />
						
						<?php
						endforeach;
						?>
					</td>
				</tr>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				?>
				</tr>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td colspan="2" class="txt_title">
						<?php echo $lang['hdr_tasks'];?><br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_remove'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_sticky'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_live'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_hold'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_pending'];?><br />
					</td>
				</tr>
				<?php
				if (isset($tasks)) {
				foreach($tasks as $key => $i):
				
				foreach($cms_tasks as $key1 => $r):
					if ($i['task_id'] == $r['item_id']) {
					    $temp = $r;
						break;
					}
				endforeach;
				?>
			    <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">
						<a href="g_activity.php?group_id=<?php echo $group['group_id'];?>&amp;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 valign="top" align="right">
						<input type="radio" name="data[task_status][<?php echo $i['task_id'];?>]" value="0" /><br />
					</td>
					<td valign="top" align="right">
						<input type="checkbox" name="data[task_sticky][<?php echo $i['task_id'];?>]" value="1"<?php if (isset($temp['cms_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right">
						<?php
						foreach($lang['cms']['status'] as $key_r => $r):
						$selected = "";
						if (isset($temp['status_id']) && $temp['status_id'] == $key_r) {
						    $selected = " checked=\"checked\"";
						}
						?>
						<input type="radio" name="data[task_status][<?php echo $i['task_id'];?>]" value="<?php echo $key_r;?>"<?php echo $selected;?> />
						
						<?php
						endforeach;
						?>
					</td>
				</tr>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				?>
				</tr>
				<tr>
					<td colspan="2" class="txt_title">
						<?php echo $lang['hdr_blogs'];?><br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_remove'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_sticky'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_live'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_hold'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_pending'];?><br />
					</td>
				</tr>
				<?php
				if (isset($blogs)) {
				foreach($blogs as $key => $i):
				
				foreach($cms_blogs as $key1 => $r):
					if ($i['blog_id'] == $r['item_id']) {
					    $temp = $r;
						break;
					}
				endforeach;
				?>
				<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="g_blog.php?group_id=<?php echo $group['group_id'];?>&amp;blog_id=<?php echo $i['blog_id'];?>"><?php echo $i['blog_title'];?></a><br />
						<span class="txt_footer"><?php echo $i['blog_synopsis'];?><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="radio" name="data[blog_status][<?php echo $i['blog_id'];?>]" value="0" /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="checkbox" name="data[blog_sticky][<?php echo $i['blog_id'];?>]" value="1"<?php if (isset($temp['cms_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['cms']['status'] as $key_r => $r):
						$selected = "";
						if (isset($temp['status_id']) && $temp['status_id'] == $key_r) {
						    $selected = " checked=\"checked\"";
						}
						?>
						<input type="radio" name="data[blog_status][<?php echo $i['blog_id'];?>]" value="<?php echo $key_r;?>"<?php echo $selected;?> />
						
						<?php
						endforeach;
						?>
					</td>
				</tr>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				?>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td colspan="2" class="txt_title">
						<?php echo $lang['hdr_files'];?><br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_remove'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_sticky'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_live'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_hold'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_pending'];?><br />
					</td>
				</tr>
				<?php
				if (isset($files)) {
				foreach($files as $key => $i):
				
				foreach($cms_files as $key1 => $r):
					if ($i['file_id'] == $r['item_id']) {
					    $temp = $r;
						break;
					}
				endforeach;
				?>
				<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="g_files.php?group_id=<?php echo $group['group_id'];?>&amp;file_id=<?php echo $i['file_id'];?>"><?php echo $i['file_title'];?></a><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="radio" name="data[file_status][<?php echo $i['file_id'];?>]" value="0" /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="checkbox" name="data[file_sticky][<?php echo $i['file_id'];?>]" value="1"<?php if (isset($temp['cms_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['cms']['status'] as $key_r => $r):
						$selected = "";
						if (isset($temp['status_id']) && $temp['status_id'] == $key_r) {
						    $selected = " checked=\"checked\"";
						}
						?>
						<input type="radio" name="data[file_status][<?php echo $i['file_id'];?>]" value="<?php echo $key_r;?>"<?php echo $selected;?> />
						
						<?php
						endforeach;
						?>
					</td>
				</tr>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				?>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<tr>
					<td colspan="2" class="txt_title">
						<?php echo $lang['hdr_polls'];?><br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_remove'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_sticky'];?>&nbsp;<br />
					</td>
					<td align="right" class="txt_title">
						<?php echo $lang['ttl_live'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_hold'];?>&nbsp;&nbsp;&nbsp;<?php echo $lang['ttl_pending'];?><br />
					</td>
				</tr>
				<?php
				if (isset($polls)) {
				foreach($polls as $key => $i):
				
				foreach($cms_polls as $key1 => $r):
					if ($i['poll_id'] == $r['item_id']) {
					    $temp = $r;
						break;
					}
				endforeach;
				?>
				<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="g_poll.php?group_id=<?php echo $group['group_id'];?>&amp;poll_id=<?php echo $i['poll_id'];?>"><?php echo $i['poll_question'];?></a><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="radio" name="data[poll_status][<?php echo $i['poll_id'];?>]" value="0" /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="checkbox" name="data[poll_sticky][<?php echo $i['poll_id'];?>]" value="1"<?php if (isset($temp['cms_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['cms']['status'] as $key_r => $r):
						$selected = "";
						if (isset($temp['status_id']) && $temp['status_id'] == $key_r) {
						    $selected = " checked=\"checked\"";
						}
						?>
						<input type="radio" name="data[poll_status][<?php echo $i['poll_id'];?>]" value="<?php echo $key_r;?>"<?php echo $selected;?> />
						<?php
						endforeach;
						?>
					</td>
				</tr>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="4" alt="" /><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				?>
				<tr>
					<td align="right" colspan="5">
						<input type="submit" name="update" value="<?php echo $lang['sub_update'];?>" class="formInput" /><br />
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</form>
