<?php

define('RENDER_MODE', 'catalyz');

$node = $page->getNode();

use_helper('Form');

$properties = array();
$properties['page'] = $page;
$properties['node'] = $node;
$properties['ContentTree'] = $ContentTree;

use_javascript('catalyz/jquery-1.3.2.min.js', 'last');

ob_start();

?>
<div id="transfer_holder">
<h1>Faire un virement</h1>

<?php
echo '<table cellpadding="0" cellspacing="0" border="0">';
	$companies = $KataoMember->getKataoSuppliersRelatedByMemberId();
	if ($companies) {
		$company = /*(KataoSupplier)*/array_shift($companies);
		printf('<tr><th colspan="2"><h4>%s</h4></th></tr>', 'Société');
		printf('<tr><th width="150">%s</th><td>%s</td></tr>', 'Nom', $company->getName());
		printf('<tr><th width="150">%s</th><td>%s</td></tr>', 'Téléphone', $company->getPhone());
		printf('<tr><th colspan="2"><h4>%s</h4></th></tr>', 'Contact');
	}
	printf('<tr><th width="150">%s</th><td>%s</td></tr>', 'Nom', $KataoMember->getLastName());
	printf('<tr><th width="150">%s</th><td>%s</td></tr>', 'Prénom', $KataoMember->getFirstName());
	printf('<tr><th width="150">%s</th><td>%s</td></tr>', 'Téléphone', $KataoMember->getFirstKataoUser()->getPhone());
	printf('<tr><th width="150">%s</th><td>%s</td></tr>', 'Carte', $KataoMember->getCardNumberSol());
echo '</table>';
 ?>

 <?php echo form_tag('@sol_violette_transfer_step_1?id='.$KataoMember->getId(), array('class'=>'solViolette')) ?>

 <?php
 echo 'Montant du virement à effectuer : ';
 echo $form['id'];
 echo $form['amount'].' Sols';
 echo $form['amount']->renderError();

 printf('<p>Vous avez actuellement %s sur votre compte. Le montant du virement ci-dessus doit être inférieur à cette valeur.</p>', $user->getKataoMember()->getCurrentAmountSolStr());

 echo '<br /><input type="submit" class="submit" value="Effectuer le virement" id="form_submit" name="form_submit"/></form>';
 ?>

</div>
	<?php

$content = ob_get_contents();

ob_end_clean();
$properties['layout_family'] = 'katao';
$properties['layout_name'] = 'layoutv2';
$properties['content'] = $content;

include_component($properties['layout_family'], $properties['layout_name'], $properties);

?>