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

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

		<td width="20">&nbsp;</td>
		
		<td width="560" valign="top">
			<div class="box_top">
				<?php echo $lang['hdr_rsp'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<?php
				if (isset($subjects)) {
				?>
				<tr>
					<td colspan="5">
						<?php echo $lang['txt_intro'];?><br />
					</td>
				</tr>
				<tr>
					<td colspan="5">
						<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="6" alt="" /><br />
					</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>
				<tr>
					<td colspan="5">
						<hr />
					</td>
				</tr>
				<?php
				foreach($subjects as $key => $i):
				
				foreach($rsp_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>
						<a href="frm_item.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['rsp_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['rsp']['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;
				}
				if (isset($library_items)) {
				?>
				<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>
				<tr>
					<td colspan="5">
						<hr />
					</td>
				</tr>
				<?php
				foreach($library_items as $key => $i):
				
				foreach($rsp_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="lib_item.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['rsp_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['rsp']['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;
				}
				if (isset($activities)) {
				?>
				<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>
				<tr>
					<td colspan="5">
						<hr />
					</td>
				</tr>
				<?php
				foreach($activities as $key => $i):
				
				foreach($rsp_activities as $key1 => $r):
					if ($i['schedule_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="sch_item.php?group_id=<?php echo $group['group_id'];?>&amp;schedule_id=<?php echo $i['schedule_id'];?>"><?php echo $i['schedule_title'];?></a><br />
						<?php echo $i['schedule_start_datetime'];?><br />
						<span class="txt_footer"><?php echo $i['schedule_synopsis'];?><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="radio" name="data[schedule_status][<?php echo $i['schedule_id'];?>]" value="0" /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="checkbox" name="data[schedule_sticky][<?php echo $i['schedule_id'];?>]" value="1"<?php if (isset($temp['rsp_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['rsp']['status'] as $key_r => $r):
						$selected = "";
						if (isset($temp['status_id']) && $temp['status_id'] == $key_r) {
						    $selected = " checked=\"checked\"";
						}
						?>
						<input type="radio" name="data[schedule_status][<?php echo $i['schedule_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;
				}
				
				if (isset($tasks)) {
				?>
				<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>
				<tr>
					<td colspan="5">
						<hr />
					</td>
				</tr>
				<?php
				foreach($tasks as $key => $i):
				
				foreach($rsp_tasks as $key1 => $r):
					if ($i['schedule_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="sch_item.php?group_id=<?php echo $group['group_id'];?>&amp;schedule_id=<?php echo $i['schedule_id'];?>"><?php echo $i['schedule_title'];?></a><br />
						<?php echo $i['schedule_start_datetime'];?><br />
						<span class="txt_footer"><?php echo $i['schedule_synopsis'];?><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="radio" name="data[schedule_status][<?php echo $i['schedule_id'];?>]" value="0" /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<input type="checkbox" name="data[schedule_sticky][<?php echo $i['schedule_id'];?>]" value="1"<?php if (isset($temp['rsp_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['rsp']['status'] as $key_r => $r):
						$selected = "";
						if (isset($temp['status_id']) && $temp['status_id'] == $key_r) {
						    $selected = " checked=\"checked\"";
						}
						?>
						<input type="radio" name="data[schedule_status][<?php echo $i['schedule_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;
				}
				
				if (isset($blogs)) {
				?>
				<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_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>
				<tr>
					<td colspan="5">
						<hr />
					</td>
				</tr>
				<?php
				foreach($blogs as $key => $i):
				
				foreach($rsp_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="blg_item.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['rsp_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['rsp']['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;
				}
				if (isset($files)) {
				?>
				<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>
				<tr>
					<td colspan="5">
						<hr />
					</td>
				</tr>
				<?php
				foreach($files as $key => $i):
				
				foreach($rsp_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="fil_list.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['rsp_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['rsp']['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;
				}
				if (isset($polls)) {
				?>
				<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>
				<tr>
					<td colspan="5">
						<hr />
					</td>
				</tr>
				<?php
				foreach($polls as $key => $i):
				
				foreach($rsp_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="pol_item.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['rsp_sticky'])) { echo " checked=\"checked\"";}?> /><br />
					</td>
					<td valign="top" align="right" nowrap="nowrap">
						<?php
						foreach($lang['rsp']['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="button_urgent" /><br />
					</td>
				</tr>
				<tr>
					<td colspan="5">
						<div class="box_edit">
						<table cellpadding="2" cellspacing="0" border="0" width="100%">
							<tr>
								<td>
									<select name="status_id" class="formInput">
										<option value="0" selected="selected"><?php echo $lang['txt_all'];?></option>
										<?php
										foreach($lang['rsp']['status'] as $key => $i):
											$selected = "";
											if(isset($status_id) && $status_id == $key) {
												$selected = " selected=\"selected\"";
											}
											print "<option value='" . $key . "'" . $selected . ">" . $i . "</option>";
										endforeach;
										?>
									</select>
									&nbsp;
									<input type="submit" name="search" value="<?php echo $lang['sub_search'];?>" class="button" /><br />
								</td>
								<td 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>
						</table>
						</div>
					</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>
		</td>
	</tr>
</table>
</form>
