<?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>Devenir prestataire</h1></div>
</div>
<div style="text-align:right;"><a href=<?php echo public_path ('uploads/'.$link_form_pdf) ?> target="_blank"><?php echo image_tag("actions/pdf.png", array('title' => 'Télécharger le formulaire'), array('alt' => 'Télécharger le formulaire')) ?></a></div>
<form action="<?php echo url_for('@prestataire_subscribe') ?>" method="post" multipart="">
<table>
	<tfoot>
		<tr>
			<td colspan="2">
				<br /><input type="submit" value="Suivant" /> <?php // echo link_to('annuler', '') ?>
			</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['structure_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['structure_name'] ?>
		  <?php echo $form['structure_name']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['siret']->renderLabel() ?></th>
        <td>
          <?php echo $form['siret'] ?>
		  <?php echo $form['siret']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['card_number']->renderLabel() ?></th>
        <td>
          <?php echo $form['card_number'] ?>
		  <?php echo $form['card_number']->renderError() ?>
		  <?php echo $form['card_lost'] ?>
		  <?php echo $form['card_lost']->renderLabel() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['referent_first_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['referent_first_name'] ?>
		  <?php echo $form['referent_first_name']->renderError() ?>
        </td>
      </tr>
	  <tr valign="top">
	  	<td colspan="2" align="left"><br /><u>Adresse</u></td>
	  </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['referent_last_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['referent_last_name'] ?>
		  <?php echo $form['referent_last_name']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['email']->renderLabel() ?></th>
        <td>
          <?php echo $form['email'] ?>
		  <?php echo $form['email']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['telephone']->renderLabel() ?></th>
        <td>
          <?php echo $form['telephone'] ?>
		  <?php echo $form['telephone']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['adress']->renderLabel() ?></th>
        <td>
          <?php echo $form['adress'] ?>
		  <?php echo $form['adress']->renderError() ?>
        </td>
      </tr>
	  <tr valign="top">
        <th align="left"><?php echo $form['zip_code']->renderLabel() ?></th>
        <td>
          <?php echo $form['zip_code'] ?>
		  <?php echo $form['zip_code']->renderError() ?>
        </td>
      </tr>
	  <tr valign="top">
        <th align="left"><?php echo $form['city']->renderLabel() ?></th>
        <td>
      		<?php echo $form['city'] ?>
      		<?php echo $form['city']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
	  	<td colspan="2" align="left"><br /><u><?php echo $form['payment_amount']->renderLabel() ?></u></td>
	  </tr>
	  <tr valign="top">
        <td colspan="2">
      		<?php echo $form['payment_amount'] ?>
      		<?php echo $form['payment_amount']->renderError() ?>
        </td>
      </tr>
	  <tr valign="top">
	  	<td colspan="2" align="left"><br /><u><?php echo $form['payment_mode']->renderLabel() ?></u></td>
	  </tr>
	  <tr valign="top">
        <td colspan="2">
      		<?php echo $form['payment_mode'] ?>
      		<?php echo $form['payment_mode']->renderError() ?>
        </td>
      </tr>
	  <tr valign="top" id="cheque_numero_tr">
        <th>
        	<?php echo $form['payment_mode_cheque']->renderLabel() ?>
        </th>
		<td>
      		<?php echo $form['payment_mode_cheque'] ?>
      		<?php echo $form['payment_mode_cheque']->renderError() ?>
        </td>
      </tr>
    </tbody>
</table>
</form>

<p>
	<small>Les informations recueillies sont nécessaires à votre adhésion. Notre fichier est déclaré à la CNIL sous le n° 1521182v0.
		En application  de la loi informatique et liberté, vous diposez d'un droit d'accès et de rectification aux informations qui vous concernent.
      	 Veuillez contacter <a href="mailto:contact@sol-violette.info">contact@sol-violette.info</a>
	</small>
</p>

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

	$('input[name="form_presta_subscription[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);

?>