<?php $katao_member_deposit = $form->getObject() ?>
<div class="content-add01">
	<div class="heading01"><h1><?php echo $katao_member_deposit->isNew() ? 'Ajout' : 'Modification' ?> d'un dépôt</h1></div>
</div>

<form action="<?php echo url_for('kataoMemberDeposit/update' . (!$katao_member_deposit->isNew() ? '?id=' . $katao_member_deposit->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <br /><input type="submit" value="Sauver" /> ou <a href="<?php echo url_for('kataoMemberDeposit/index') ?>">annuler</a>
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr valign="top">
        <th align="left"><?php echo $form['katao_member_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['katao_member_id'] ?>
		  <?php echo $form['katao_member_id']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['amount']->renderLabel() ?></th>
        <td>
          <?php echo $form['amount'] ?> <?php echo $form['currency'] ?>
		  <?php echo $form['amount']->renderError() ?>
		  <?php echo $form['currency']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['comment']->renderLabel() ?></th>
        <td>
          <?php echo $form['comment'] ?>
		  <?php echo $form['comment']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['payment_mode']->renderLabel() ?></th>
        <td>
          <?php echo $form['payment_mode'] ?>
		  <?php echo $form['payment_mode']->renderError() ?>
        </td>
      </tr>
      <tr valign="top" id="check_number_row"<?php echo (KataoMemberDeposit::PAYMENT_MODE_CHECK != $katao_member_deposit->getPaymentMode())?' style="display: none"':''?>>
        <th align="left"><?php echo $form['check_number']->renderLabel() ?></th>
        <td>
          <?php echo $form['check_number'] ?>
		  <?php echo $form['check_number']->renderError() ?>
        </td>
      </tr>
      <tr valign="top" id="check_bank_row"<?php echo (KataoMemberDeposit::PAYMENT_MODE_CHECK != $katao_member_deposit->getPaymentMode())?' style="display: none"':''?>>
        <th align="left"><?php echo $form['check_bank']->renderLabel() ?></th>
        <td>
          <?php echo $form['check_bank'] ?>
		  <?php echo $form['check_bank']->renderError() ?>
        </td>
      </tr>
      <tr valign="top">
        <th align="left"><?php echo $form['status']->renderLabel() ?></th>
        <td>
          <?php echo $form['status'] ?>
		  <?php echo $form['status']->renderError() ?>
        </td>
      </tr>
      <tr valign="top" id="valid_until_row"<?php echo (KataoMemberDeposit::STATUS_PENDING != $katao_member_deposit->getStatus())?' style="display: none"':''?>>
        <th align="left"><?php echo $form['valid_until']->renderLabel() ?></th>
        <td>
          <?php echo $form['valid_until'] ?>
		  <?php echo $form['valid_until']->renderError() ?>

        <?php echo $form['id'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>

<script type="text/javascript" language="JavaScript">
/* <![CDATA[ */

function togglePaymentModeDetails(){
	if(<?php echo KataoMemberDeposit::PAYMENT_MODE_CHECK ?> == $('katao_member_deposit_payment_mode').value) {
		$('check_number_row').show();
		$('check_bank_row').show();
	} else {
		$('check_number_row').hide();
		$('katao_member_deposit_check_number').value = "";
		$('check_bank_row').hide();
		$('katao_member_deposit_check_bank').value = "";
	}
}

function toggleStatusDetails(){
	if(<?php echo KataoMemberDeposit::STATUS_PENDING ?> == $('katao_member_deposit_status').value) {
		$('valid_until_row').show();
	} else {
		$('valid_until_row').hide();
		$('katao_member_deposit_valid_until').value = "";
	}
}

/* ]]> */
</script>