<?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]);
// $perms = array();
// $available_languages = array();
// foreach($allLanguages as $iso => $name) {
// if (!isset($existing_languages[$iso])) {
// $available_languages[$iso] = ucfirst($name);
// }
// $perms[$iso]['edit'] = true;
// $perms[$iso]['delete'] = ($iso != $default);
// }
// include_partial('catalyz/header');

?>

<div class="content-add01">
	<div class="heading01"><h1>S'inscrire</h1></div>
</div>

<?php echo form_tag('@sol_violette_subscribe', array('class'=>'solViolette')) ?>

<div style="display:none"><?php echo input_tag('no_spam', '') ?></div>

  <table>
    <tfoot>
      <tr>
        <td colspan="2">
        	<p>Les champs marqués d'une <sup>*</sup> sont obligatoires.</p>
          <br /><input type="submit" value="Sauver" /> ou <?php echo link_to('annuler', $sf_request->getReferer()?$sf_request->getReferer():'#') ?>
        </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_phone']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_phone'] ?>
		  <?php echo $form['user_phone']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_fax']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_fax'] ?>
		  <?php echo $form['user_fax']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_birthday']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_birthday'] ?>
		  <?php echo $form['user_birthday']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_situation']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_situation'] ?>
		  <?php echo $form['user_situation']->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['user_address1']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_address1'] ?>
		  <?php echo $form['user_address1']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_address2']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_address2'] ?>
		  <?php echo $form['user_address2']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_zip']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_zip'] ?>
		  <?php echo $form['user_zip']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_city']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_city'] ?>
		  <?php echo $form['user_city']->renderError() ?>
        </td>
      </tr>
	  <tr valign="top">
	  	<td colspan="2" align="left"><br /><u>Accès application</u></td>
	  </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_login']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_login'] ?>
		  <?php echo $form['user_login']->renderError() ?>
        </td>
      </tr>
 			<tr valign="top">
        <th align="left"><?php echo $form['user_password']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_password'] ?>
		  <?php echo $form['user_password']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['user_password_confirmation']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_password_confirmation'] ?>
		  <?php echo $form['user_password_confirmation']->renderError() ?>
        </td>
      </tr>
     <tr valign="top">
	  	<td colspan="2" align="left"><br /><u>Adhésion</u></td>
	  </tr>
	     <tr valign="top">
        <th align="left"><?php echo $form['parrain_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['parrain_name'] ?>
		  <?php echo $form['parrain_name']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['card_number_sol']->renderLabel() ?></th>
        <td>
          <?php echo $form['card_number_sol'] ?>
		  <?php echo $form['card_number_sol']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
      <td colspan="2">
          <?php echo $form['user_adhesion'] ?>
		  <?php echo $form['user_adhesion']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
      <td colspan="2">
			Je souhaite changer des euros pour un montant de :
          <?php echo $form['user_amount'] ?> euros<br/>(laissez vide si vous ne souhaitez pas effectuer de change)<br/>
          <?php echo $form['user_amount']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
      <td colspan="2">
      	<p class="notice">1 Sol offert par tranche de 20€</p>
			</td>
      </tr>
      <tr valign="top">
      <td colspan="2">
          <?php echo $form['user_payment_mode']->renderLabel() ?>
		  <?php echo $form['user_payment_mode'] ?>
		  <?php echo $form['user_payment_mode']->renderError() ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
<?php

$content = ob_get_contents();

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

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

?>
