<?php define('RENDER_MODE', 'catalyz');

$node = $page->getNode();

use_helper('Form');

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

ob_start();
use_helper('I18N');

$allLanguages = sfConfig::get('app_translations_available_languages');
$default = sfConfig::get('app_translations_default_language');
// $existing_languages = $node->getAvailableTranslations();
$allLanguages = Catalyz::getAllTranslations();
unset($allLanguages[$default]);

?>

<div class="content-add01">
	<div class="heading01"><h1>Re-adhérer</h1></div>
</div>


<?php echo form_tag('@sol_violette_renew', 'method=post multipart=true class=simpleForm') ?>
<table>
	<tfoot>
		<tr>
			<td colspan="2">
				<br /><input type="submit" value="Suivant" /> ou <?php echo link_to('annuler', '@sol_violette_suscribe_choice') ?>
        	</td>
      	</tr>
    </tfoot>
   <tbody>
      <?php echo $form->renderGlobalErrors() ?>
	  <tr valign="top">
	  	<td colspan="2" align="left"><u>Informations personnelles</u></td>
	  </tr>
	  <tr valign="top">
        <th align="left"><?php echo $form['first_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['first_name'] ?>
		  <?php echo $form['first_name']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['last_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['last_name'] ?>
		  <?php echo $form['last_name']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_email']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_email'] ?>
		  <?php echo $form['user_email']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_membercard']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_membercard'] ?>
		  <?php echo $form['user_membercard']->renderError() ?>
			<?php echo $form['user_membercard_lost'] ?>
			<?php echo $form['user_membercard_lost']->renderLabel() ?>
		</td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_payment_amount']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_payment_amount'] ?>
		  <?php echo $form['user_payment_amount']->renderError() ?>
        </td>
      </tr>
	  <tr valign="top">
        <th align="left"><?php echo $form['user_payment_mode']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_payment_mode'] ?>
		  <?php echo $form['user_payment_mode']->renderError() ?>
		  <?php //echo $form['user_payment_mode_cheque'] ?>
		  <?php //echo $form['user_payment_mode_cheque']->renderError() ?>
        </td>
      </tr>
      	  <tr valign="top" id="cheque_numero_tr">
        <th align="left"><?php echo $form['user_payment_mode_cheque']->renderLabel() ?></th>
        <td>
      		<?php echo $form['user_payment_mode_cheque'];
				echo $form['user_payment_mode_cheque']->renderError();
			?>
        </td>
      </tr>
    <tr valigne="top">
      	<td colspan="2" align="left"><br /><u>Si vous souhaitez parrainer un prestataire du réseau, préciser le nom de la structure</u></td>
	</tr>
	<tr valign="top">
        <th align="left"><?php echo $form['user_parraining']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_parraining'] ?>
		  <?php echo $form['user_parraining']->renderError() ?>
        </td>
      </tr>
    </tbody>
</table>
</form>

<script language="Javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script>
	$().ready(function(){
		if($('input[name="form_renew[user_payment_mode]"]').val() == '2'){
			$('#cheque_numero_tr').show();
		} else {
			$('#cheque_numero_tr').hide();
		}
	});

	$('input[name="form_renew[user_payment_mode]"]').change( function () {
		if( $(this).val() == '2'){
			$('#cheque_numero_tr').show();
		} else {
			$('#cheque_numero_tr').hide();
		}
	});
</script>

<?php
$content = ob_get_contents();

ob_end_clean();
// $layout = LayoutManager::instance()->getCatalyzTemplate($ContentTreeNode->getCurrentLayoutNameForAction());
$properties['layout_family'] = 'katao';
$properties['layout_name'] = 'layoutv2';
$properties['content'] = $content;

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

?>