<?php

// -----------------------------------------------------------------------
// This file is part of Igloo
// 
// 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., 51 Franklin St, Fifth Floor, Boston, MA
// 02110-1301, USA.
// -----------------------------------------------------------------------
?>

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

<div class="col_main">
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_rsp'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
				<table width="100%" cellpadding="4" cellspacing="0" border="0">
					<?php
					if (isset($subjects)) {
					$show_update_button = 1;
					?>
					<tr>
						<td colspan="5">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" 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/dot.png" width="3" height="9" alt="" /><br />
						</td>
						<td>
							<?php echo $i['subject_id'];?>
							<a href="frm_view.php?subject_id=<?php echo $i['subject_id'];?>"><?php echo $i['subject_title'];?></a><br />
							<?php echo dots(200, $i['subject_synopsis']);?><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<input type="radio" name="subject_status[<?php echo $i['subject_id'];?>]" value="0" /><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<input type="checkbox" name="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="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)) {
					$show_update_button = 1;
					?>
					<tr>
						<td colspan="5">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" /><br />
						</td>
					</tr>
					<tr>
						<td colspan="2" class="txt_title">
							<?php echo $lang['hdr_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/dot.png" width="3" height="9" alt="" /><br />
						</td>
						<td>
							<a href="lib_view.php?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="library_item_status[<?php echo $i['library_id'];?>]" value="0" /><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<input type="checkbox" name="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="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)) {
					$show_update_button = 1;
					?>
					<tr>
						<td colspan="5">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" /><br />
						</td>
					</tr>
					<tr>
						<td colspan="2" class="txt_title">
							<?php echo $lang['hdr_schedule'];?><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/dot.png" width="3" height="9" alt="" /><br />
						</td>
						<td>
							<a href="sch_view.php?schedule_id=<?php echo $i['schedule_id'];?>"><?php echo $i['schedule_title'];?></a><br />
							<?php echo $i['schedule_start_datetime'];?><br />
							<?php echo $i['schedule_synopsis'];?><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<input type="radio" name="schedule_status[<?php echo $i['schedule_id'];?>]" value="0" /><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<input type="checkbox" name="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="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)) {
					$show_update_button = 1;
					?>
					<tr>
						<td colspan="5">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" 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/dot.png" width="3" height="9" alt="" /><br />
						</td>
						<td>
							<a href="blg_view.php?blog_id=<?php echo $i['blog_id'];?>"><?php echo $i['blog_title'];?></a><br />
							<?php echo $i['blog_synopsis'];?><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<input type="radio" name="blog_status[<?php echo $i['blog_id'];?>]" value="0" /><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<input type="checkbox" name="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="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($polls)) {
					$show_update_button = 1;
					?>
					<tr>
						<td colspan="5">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" 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/dot.png" width="3" height="9" alt="" /><br />
						</td>
						<td>
							<a href="pol_view.php?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="poll_status[<?php echo $i['poll_id'];?>]" value="0" /><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<input type="checkbox" name="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="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;
					}
					if (isset($channels)) {
					$show_update_button = 1;
					?>
					<tr>
						<td colspan="5">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" /><br />
						</td>
					</tr>
					<tr>
						<td colspan="2" class="txt_title">
							<?php echo $lang['hdr_channels'];?><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($channels as $key => $i):
					foreach($rsp_channels as $key1 => $r):
						if ($i['channel_id'] == $r['item_id']) {
							$temp = $r;
							break;
						}
					endforeach;
					?>
					<tr>
						<td width="3" valign="top">
							<img src="<?php echo $templatePath;?>img/dot.png" width="3" height="9" alt="" /><br />
						</td>
						<td>
							<?php echo $i['channel_title'];?><br />
							<?php echo $i['channel_synopsis'];?><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<input type="radio" name="channel_status[<?php echo $i['channel_id'];?>]" value="0" /><br />
						</td>
						<td valign="top" align="right" nowrap="nowrap">
							<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="channel_status[<?php echo $i['channel_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($show_update_button)) {
					?>
					<tr>
						<td align="right" colspan="5">
							<input type="submit" name="update" value="<?php echo $lang['sub_update'];?>" class="button_urgent" /><br />
						</td>
					</tr>
					<?php 
					}
					else {
						echo $lang['err_no_items'] . "<br />";
					}
					?>
				</table>
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>

<div class="col_side">
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_menu'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
				<p>
					<?php echo $lang['txt_intro'];?><br />
				</p>
				
				<table cellpadding="4" width="100%" 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>
					</tr>
					<tr>
						<td class="bg2">
							<?php echo $lang['ttl_hold'];?><br />
						</td>
						<td class="bg3">
							<?php echo $lang['txt_hold'];?><br />
						</td>
					</tr>
					<tr>
						<td class="bg2">
							<?php echo $lang['ttl_pending'];?><br />
						</td>
						<td class="bg3">
							<?php echo $lang['txt_pending'];?><br />
						</td>
					</tr>
					<tr>
						<td class="bg2">
							<?php echo $lang['ttl_sticky'];?><br />
						</td>
						<td class="bg3">
							<?php echo $lang['txt_sticky'];?><br />
						</td>
					</tr>
					<tr>
						<td class="bg2">
							<?php echo $lang['ttl_remove'];?><br />
						</td>
						<td class="bg3">
							<?php echo $lang['txt_remove'];?><br />
						</td>
					</tr>
				</table>
				
				<table border="0" width="100%" cellspacing="4" cellpadding="0">
					<tr>
						<td>
							<b><?php echo $lang['hdr_search'];?></b><br />
						</td>
					</tr>
					<tr>
						<td>
							<select name="status_id">
								<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>
						</td>
					</tr>
					<tr>
						<td>
							<?php
							$selected = "";
							if (isset($level_id) && $level_id == $level_node) {
								$selected = " checked=\"checked\"";
							}
							?>
							<input type="radio" name="level_id" value="<?php echo $level_node;?>"<?php echo $selected;?> />&nbsp;node&nbsp;&nbsp;
							<?php
							$selected = "";
							if (isset($level_id) && $level_id == $level_public) {
								$selected = " checked=\"checked\"";
							}
							?>
							<input type="radio" name="level_id" value="<?php echo $level_public;?>"<?php echo $selected;?> />&nbsp;public<br />
						</td>
					</tr>
					<tr>
						<td align="right" colspan="2">
							<input type="submit" name="search" value="<?php echo $lang['sub_search'];?>" class="button" /><br />
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>
</form>
