<?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.
// -----------------------------------------------------------------------

?>


<div class="col_left1">
	<div class="box">
		<div class="box_top">
			<div class="content">
				<h1><?php echo $lang['hdr_my_membership'];?></h1>
			</div>
		</div>

		<div class="box_mid">
			<div class="content">
				<?php
				if (isset($_SESSION['membership_type_id'])) {
				?>
				<table cellspacing="2" cellpadding="2" border="0">
					<?php
					if (isset($lang['membership_type'][$_SESSION['membership_type_id']])) {
					?>
					<tr>
						<td valign="top">
							membership type<br />
						</td>
						<td valign="top">
							<b><?php echo $lang['membership_type'][$_SESSION['membership_type_id']];?></b><br />
						</td>
					</tr>
					<?php
					}
					if (isset($lang['role'][$_SESSION['role_id']])) {
					?>
					<tr>
						<td valign="top">
							role<br />
						</td>
						<td valign="top">
							<b><?php echo $lang['role'][$_SESSION['role_id']];?></b><br />
						</td>
					</tr>
					<?php }?>
				</table>
				<?php }?>

				<p>
					<?php echo $lang['txt_membership_overview'][$_SESSION['membership_type_id']];?><br />
				</p>
			</div>
		</div>
	</div>

	
	<?php
	if (!empty($core_config['user']['include_ledger'])) {
	?>
	<div class="box">
		<div class="box_top">
			<div class="content">
				<h1><?php echo $lang['hdr_ledger'];?></h1>
			</div>
		</div>
		
		<div class="box_mid">
			<div class="content">
				<p>
					<?php echo $lang['txt_my_ledger_intro'];?><br />
				</p>

				<?php
				if (isset($legder)) {
				?>
				<table border="0" cellspacing="2" cellpadding="2" width="100%">
					<?php
					$ledger_total = "0";
					
					foreach($legder as $key => $i):
					$ledger_total = $ledger_total+$i['ledger_net'];
					?>
					<tr>
						<td valign="top">
							<?php echo $i['ledger_id'];?><br />
						</td>
						<td valign="top">
							<?php echo $lang['user_ledger_type'][$i['ledger_type']];?><br />
						</td>
						<td valign="top">
							<?php echo $this->date->formatDate($i['legder_payment_date']);?><br />
						</td>
						<td valign="top" align="right">
							<?php echo $i['ledger_net'];?><br />
						</td>
					</tr>
					<?php
					endforeach;
					?>
					<tr>
						<td valign="top" align="right" colspan="4">
							(<?php echo $lang['curr_symbol'];?>) <b><?php echo $ledger_total;?></b><br />
						</td>
					</tr>
				</table>
				<?php
				} else {
				?>
			
				<p>
					<?php echo $lang['template_error']['err_no_items'];?><br />
				</p>
			
				<?php }?>
			</div>
		</div>
	</div>
	<?php }?>
		
	<div class="box">
		<div class="box_top">
			<div class="content">
				<h1><?php echo $lang['hdr_membership'];?></h1>
			</div>
		</div>

		<div class="box_mid">
			<div class="content">
				<p>
					<?php echo $lang['hdr_membership_intro'];?><br />
				</p>
			</div>
		</div>
	</div>
</div>


<div class="col_right1">
	<div class="box">
		<div class="box_top">
			<div class="content">
				<h1><?php echo $lang['hdr_reputation'];?></h1>
			</div>
		</div>

		<div class="box_mid">
			<div class="content">
					<?php
					if (isset($statistics['user'])) {
					?>
					<table border="0" cellspacing="0" cellpadding="4">
					<?php
					foreach($statistics['user'] as $key => $i):
					if (isset($lang['statistic']['user'][$i['statistic_type_id']])) {
					?>
					<tr>
						<td>
							<?php echo $lang['statistic']['user'][$i['statistic_type_id']];?><br />
						</td>
						<td>
							<?php echo $i['total'];?><br />
						</td>
					</tr>
					<?php
					}
					endforeach;
					?>
				</table>
				<?php }?>
			</div>
		</div>
	</div>
		
	<div class="box">
		<div class="box_top">
			<div class="content">
				<h1><?php echo $lang['hdr_donate'];?></h1>
			</div>
		</div>

		<div class="box_mid">
			<div class="content">
				<p>
					<?php echo $lang['hdr_donate_intro'];?><br />
				</p>
			</div>
		</div>
	</div>
</div>
