<div class="content-add01">
	<div class="heading01"><h1>Adhérent : <?php echo $katao_member->getFullName() ?></h1></div>
</div>

<u>Historique de ses adhésions :</u>
<a class="send_button_link" href="<?php /*echo url_for('@katao_member_sent_relance?id='.$userid)*/ ?>">Envoyer la relance</a>
<a class="add_button_link" href="<?php echo url_for('@katao_member_adhesion_create?userid='.$userid) ?>">Ajouter une adhésion</a>


<table class="admin-list">
	<thead>
		<tr>
			<th>Année</th>
			<th>Montant</th>
			<th>Moyen de paiement</th>
			<th>Nouvelle adhésion</th>
			<th>Actions</th>
		</tr>
	</thead>
	<tbody>
	<?php foreach($list_objet as $obj): ?>
		<tr>
			<td>
				<?php echo $obj->getYear('Y') ?>
			</td>
			<td>
				<?php echo $obj->getAmount()." €" ?>
			</td>
			<td>
				<?php echo KataoMemberAdhesionPeer::$HASH_TABLE['payment_kind'][$obj->getPaymentKind()] ?>
				<?php
					if($obj->getPaymentKind() == 2){
						echo "n° ".$obj->getCheckNo();
					}
				?>
			</td>
			<td>
				<?php echo KataoMemberAdhesionPeer::$HASH_TABLE['type'][$obj->getType()] ?>
			</td>
			<td>
				<a href='<?php echo url_for('@katao_member_adhesion_edit?id='.$obj->getId().'&userid='.$userid) ?>'><?php echo image_tag('actions/edit.png') ?></a>
	   			<?php echo catalyz_link_to_image_tag('@katao_member_adhesion_delete?userid='.$userid.'&id='.$obj->getId(), 'actions/delete.png', array('title' => 'Supprimer', 'confirm' => 'Êtes-vous sûr de vouloir supprimer cette adhésion ?'), array('alt' => 'Supprimer')) ?>
			</td>
		</tr>
	<?php endforeach ?>
	</tbody>
</table>
<br />
<u>Historique de ses noeuds :</u>
<table class="admin-list">
<tr>
	<th nowrap="nowrap">Début</th>
	<th nowrap="nowrap">Fin</th>
	<th nowrap="nowrap">Noeud</th>
</tr>
<?php foreach ($katao_member->getNodesHistory() as $history): ?>
<tr valign="top">
	<td nowrap="nowrap"><?php echo $history['begin'] ?></td>
	<td nowrap="nowrap"><?php echo $history['end'] ?></td>
	<td nowrap="nowrap"><?php echo $history['node'] ?></td>
</tr>
<?php endforeach ?>
</table>

<br /><u>Liste de ses filleuls :</u>

<?php $filleuls = $katao_member->getKataoMembersRelatedByKataoMemberId() ?>
<?php if (0 == count($filleuls)): ?>
	<p><i>Aucun filleul.</i></p>
<?php else: ?>
	<ul>
	<?php foreach ($filleuls as/*(KataoMember)*/ $filleul): ?>
		<li><?php echo link_to($filleul->getFullName(), '@katao_member_show?id=' . $filleul->getId()) ?></li>
	<?php endforeach ?>
	</ul>
<?php endif ?>

<?php if (0 < count($history_euro)): ?>
<br /><u>Historique de ses transactions en € :</u>
<table class="profile-list">
<tr>
	<th nowrap="nowrap" width="1%">Date</th>
	<th>Nature</th>
	<th nowrap="nowrap" width="1%">Montant</th>
	<th nowrap="nowrap" width="1%">Solde</th>
</tr>
<?php $is_firt = true ?>
<?php foreach ($history_euro as $history): ?>
<tr valign="top">
	<td nowrap="nowrap" width="1%"><?php echo CatalyzDate::formatShort($history['date']) ?></td>
	<td><?php echo $history['summary'] ?></td>
	<td nowrap="nowrap" width="1%" style="text-align: right!important"><?php echo ('initial' != $history['type'])?Utils::formatCurrencyEuro($history['amount']):'' ?></td>
	<td nowrap="nowrap" width="1%" style="text-align: right!important"<?php echo $is_firt?' class="bold"':'' ?>><?php echo Utils::formatCurrencyEuro($history['account']) ?></td>
</tr>
	<?php $is_firt = false ?>
<?php endforeach ?>
</table>
<?php endif ?>

<?php if (0 < count($history_sol)): ?>
<br /><u>Historique de ses transactions en <?php echo wpConfig::getAdditionalCurrencyName() ?> :</u>
<table class="profile-list">
<tr>
	<th nowrap="nowrap" width="1%">Date</th>
	<th>Nature</th>
	<th nowrap="nowrap" width="1%">Montant</th>
	<th nowrap="nowrap" width="1%">Solde</th>
</tr>
<?php $is_firt = true ?>
<?php foreach ($history_sol as $history): ?>
<tr valign="top">
	<td nowrap="nowrap" width="1%"><?php echo CatalyzDate::formatShort($history['date']) ?></td>
	<td><?php echo $history['summary'] ?></td>
	<td nowrap="nowrap" width="1%" style="text-align: right!important"><?php echo ('initial' != $history['type'])?Utils::formatCurrencySol($history['amount']):'' ?></td>
	<td nowrap="nowrap" width="1%" style="text-align: right!important"<?php echo $is_firt?' class="bold"':'' ?>><?php echo Utils::formatCurrencySol($history['account']) ?></td>
</tr>
	<?php $is_firt = false ?>
<?php endforeach ?>
</table>
<?php endif ?>
