<?php 

/**
* @version 2.6.0
* @package Joomla 1.5
* @subpackage DT Register
* @copyright Copyright (C) 2006 DTH Development
* @copyright contact dthdev@dthdevelopment.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

include(JPATH_SITE."/components/com_dtregister/ideal.class.php");

$iDEAL = new iDEAL_Payment ($partner_id);

if($idealmode=='test'){

  $iDEAL->setTestmode();

}

$bank_array = $iDEAL->getBanks();

$amount = $_SESSION['register']['amountCharged']+$_SESSION['register']['billingInfo']['customFee'] - $_SESSION['register']['discount_code_amount'];

?>

<table>

  <tr>

      <td><?php echo JText::_( 'DT_BANK' );?></td>

      <td><select name="bank_id" id="bank_id">

        <option value=''><?php echo JText::_( 'DT_SELECT_BANK' );?></option>

        <?php foreach ($bank_array as $bank_id => $bank_name) { ?>

        <option value="<?= $bank_id ?>"><?= $bank_name ?></option>

        <?php } ?>

        </select>

      </td>

 </tr>

 <tr>

  <td>

        <input type="button" onclick="this.form.type.value='';this.form.submit();" class="button" value="<?php echo JText::_('DT_BACK'); ?>" id="next" name="billingInfo"/>

        <input type="button" name="send" value="<?php echo JText::_('DT_NEXT_BUTTON'); ?>" class="button" onClick="sendPayment();" /></td>

	<td align="left" >&nbsp;

        <input type="hidden" name="authPayment" value="1" />

        <input type="hidden" name="task" value="<?php echo $task; ?>" />

        <input type="hidden" name="type" value="<?php echo $type; ?>" />

  </td>

 </tr>

</table>

<script>

  function sendPayment(){

    if(document.frmcart.bank_id.value==""){

	   alert('<?php echo JText::_( 'DT_ERROR_SELECT_BANK' );?>');

	   return ;

	}

	document.frmcart.submit();

  }

</script>