<?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="node_abuse_reports.php" method="post">
<input type="hidden" name="data[abuse_id]" value="<?php if (isset($report['abuse_id'])) {echo $report['abuse_id'];}?>">

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

			
			<?php
			if (isset($display) && $display == "edit_report") {
			?>
			
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="10" alt="" /><br />

			<table border="0" cellspacing="0" cellpadding="4" width="100%">
				<tr>
					<td class="txt_title">
						<?php echo $lang['section_action'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<a href="node_abuse_reports.php" class="txt_sub_menu"><?php echo $lang['href_list_reports'];?></a><br />
						
					</td>
				</tr>
			</table>
			<?php
			}
			?>
			
			<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">

			<?php
			if (isset($display) && $display == "edit_report") {
			?>
			<table border="0" cellspacing="0" cellpadding="2" width="100%">
				<tr>
					<td class="txt_title" align="right" colspan="2">
						<?php echo $lang['hdr_report'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<?php echo $lang['txt_report_txt'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_from'];?><br />
					</td>
					<td>
						<?php echo $report['user_firstname'] . " " . $report['user_surname'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_language'];?><br />
					</td>
					<td>
						<?php echo $lang['arr_lang_name'][$report['reportee_language_id']];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_status'];?><br />
					</td>
					<td>
						<select name="data[report_status_id]" class="formInput">
							<?php foreach($lang['arr_abuse_status'] as $key => $r):
							?>
							<option value="<?php echo $key;?>" <? if($report['report_status_id'] == $key) echo "selected";?>><?php echo $r;?></option>
							<?php
							endforeach;
							?>
						</select>
						<br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_datetime'];?><br />
					</td>
					<td>
						<?php echo $report['report_datetime'];?><br />
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $lang['txt_abuse_note'];?><br />
					</td>
					<td>
						<?php echo $report['abuse_note'];?><br />
					</td>
				</tr>
				
				<tr>
					<td>
						<?php echo $lang['txt_assigned'];?><br />
					</td>
					<td>
						<?php
						if (isset($report['assigned_firstname'])) {
						    echo $report['assigned_firstname'] . " " . $report['assigned_surname'];
						}
						?><br />
					</td>
				</tr>
				<tr>
					<td align="right" colspan="3">
						<input type="submit" name="update_report" class="formInput" value="<?php echo $lang['sub_update_report'];?>" /><br />
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>

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

<table width="770" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td valign="top" class="picture">
			<?php 
			$string = $report['abuse_source'];
			$string = str_replace ( '&amp;', '&', $string );
			$string = str_replace ( '&#039;', '"', $string );
			$string = str_replace ( '&quot;', '"', $string );
			$string = str_replace ( '&lt;', '<', $string );
			$string = str_replace ( '&gt;', '>', $string );
      		echo $string;
			?><br />
		</td>
	</tr>
	<tr>
		<td valign="top">
			<?php echo $report['abuse_url'];?><br />
		</td>
	</tr>
</table>
			<?php
			}
			else {
			?>
			<table border="0" cellspacing="0" cellpadding="4" width="100%">
				<tr>
					<td class="txt_title" align="right" colspan="6">
						<?php echo $lang['hdr_report_list'];?><br />
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						&nbsp;<br />
					</td>
					<td valign="top">
						<b><?php echo $lang['txt_datetime'];?></b><br />
					</td>
					<td valign="top">
						<b><?php echo $lang['txt_status'];?></b><br />
					</td>
					<td valign="top">
						<b><?php echo $lang['txt_reportee'];?></b><br />
					</td>
					<td valign="top">
						<b><?php echo $lang['txt_language'];?></b><br />
					</td>
				</tr>
				
				
				<?php
				if (isset($reports[0])) {
				foreach($reports as $key => $i):
				?>
				<tr>
					<td valign="top">
						<a href="node_abuse_reports.php?abuse_id=<?php echo $i['abuse_id'];?>"><?php echo $i['abuse_id'];?></a><br />
					</td>
					<td valign="top">
						<?php echo $i['report_datetime'];?><br />
					</td>
					<td valign="top">
						<?php echo $lang['arr_abuse_status'][$i['report_status_id']];?><br />
					</td>
					<td valign="top">
						<?php echo $i['user_firstname'] . " " . $i['user_surname'];?><br />
					</td>
					<td valign="top">
						<?php echo $lang['arr_lang_name'][$i['reportee_language_id']];?><br />
					</td>
				</tr>
				<?php
				endforeach;
				}
				else {
				?>
				<tr>
					<td colspan="5">
						<?php echo $lang['err_no_reports'];?><br />
					</td>
				</tr>
				<?php
				}
				?>
			</table>

			<?php
			}
			?>
		</td>
	</tr>
</table>
</form>
