<?php

// -----------------------------------------------------------------------
// This file is part of AROUNDMe
//
// Copyright (C) 2003 - 2007 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.
// -----------------------------------------------------------------------

?>

<style type="text/css">
<!--
@import url(<?php echo $template_path;?>css/aroundme_form.css);
-->
</style>


<form action="index.php?amn=core_maint_contact_view" method="post" name="frm" id="id_frm">
<input type="hidden" name="contact_id" value="<?php if (isset($contact_report['contact_id'])) { echo $contact_report['contact_id'];}?>" />

<div class="col_left1">
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_contact_report'];?><br />
		</div>
	
		<div class="box_mid">
			<div class="content">
				<?php
				if (isset($contact_report)) {
				?>
				<p>
					<b>
					<?php echo $this->date->formatDate($contact_report['report_datetime'],1);?>: 
					<?php echo $lang['contact_report_type'][$contact_report['contact_report_type']];?>
					</b><br />	
				</p>
				
				<p>
					<?php echo $contact_report['contact_message'];?><br />	
				</p>
				
				<p>
					<?php
					if (isset($maintainers)) {
					?>
					<select name="assigned_user_id">
						<option value="0"><?php echo $lang['txt_none'];?></option>
						<?php
						foreach ($maintainers as $key =>$i):
						$selected = "";
						if (isset($contact_report['assigned_user_id']) && $i['user_id'] == $contact_report['assigned_user_id']) {
							$selected = "selected=\"selected\"";
						}
						?>
						<option value="<?php echo $i['user_id'];?>" <?php echo $selected;?>><?php echo $i['identity_nic'];?></option>	
						<?php
						endforeach;
						?>
					</select>
					<?php }?>
				</p>
				
				<p>
					<?php
					if (isset($lang['contact_status'])) {
					?>
					<select name="report_status_id">
						<?php
						foreach ($lang['contact_status'] as $key =>$i):
						$selected = "";
						if ($key == $contact_report['report_status_id']) {
							$selected = "selected=\"selected\"";
						}
						?>
						<option value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $i;?></option>	
						<?php
						endforeach;
						?>
					</select>
					<?php }?>
				</p>
				
				<hr />
				
				<p align="right">
					<input name="show_source" type="button" class="input_submit" value="<?php echo $lang['sub_source'];?>" onClick="javascript:objShowHide('id_source');" />&nbsp;
					<input name="update_contact" type="submit" class="input_submit" value="<?php echo $lang['sub_update_contact'];?>" /><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_identity'];?><br />
		</div>
	
		<div class="box_mid">
			<div class="content">
				<?php
				if (isset($identity)) {
					$id_card = $identity;
					include("inc/identity.inc.php");
				}
				else {
				?>
				
				<?php echo $lang['email_contact_report'];?><br />
				
				<?php }?>
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>
	
<div class="box">
	<div class="box_top">
		<?php echo $lang['hdr_comments'];?><br />
	</div>
	
	<div class="box_mid">
		<div class="content">
			<?php
			$profile_url = "index.php?amn=core_profile"
			?>
			
			<?php
			include $template_path_core . "inc/comment.inc.php";
			?>
			<hr />
			
			<?php
			include $template_path_core . "inc/add_comment.inc.php";
			?>
			
			</form>
		</div>
	</div>
</div>
	
<div class="box_bottom">
	<span class="box_bottom_right"></span>
	<span class="box_bottom_left"></span>
</div>

<div id="id_source">
	<img src="<?php echo $template_path;?>img/pixel.png" width="1" height="10" alt="" /><br />
	
	<div class="picture" style="float:left; width:740px;">
		<?php 
		$string = $contact_report['contact_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 );
		$string = str_replace ( '&gt;', '>', $string );
		$string = str_replace ( '"submit"', '"button"', $string );
		echo $string;
		?><br />
	
		<p>
			<?php echo $lang['txt_url'];?>: <?php echo $contact_report['contact_url'];?><br />
		</p>
	</div>
</div>

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