<?php
/* @var $this RetiroParcialController */
/* @var $model RetiroParcial */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'liquidacion-_migrar_pago_lote-form',
	'type' => 'horizontal',
        'enableAjaxValidation' => false,
        'enableClientValidation' => true,
        'clientOptions' => array(
        'validateOnSubmit' => true,
        'validateOnChange' => true,
        'validateOnType' => true,
        ),
    'htmlOptions' => array('enctype' => 'multipart/form-data'),
));  
function cambio_fecha($fecha){
    $fecha_final=date('d/m/Y', strtotime($fecha));
    return $fecha_final;
}
?>
    
        <br>
    <br>
    <br>
    <br>
    <br>
    <h3>Migración masiva de retiro parcial</h3>

        
        <div class="well">
	<div class="row">
        <?php //echo $form->textFieldRow($model,'banco'); ?>
        <?php 
                Yii::import('application.modules.contable.models.*');
                echo $form->dropDownListRow($model,'banco',
                CHtml::listData(ParametrosBancos::model()->findAll(array('condition'=>'estatus=true and blnborrado=true')),'id','descripcion'),array('prompt'=>'-- Seleccione banco--'));
        ?>
	</div>
	<div class="row">
		<?php echo $form->textFieldRow($model,'referencia'); ?>
	</div>

	<div class="row">
		<?php echo $form->textFieldRow($model,'observacion'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'Fecha desde'); ?>
                <?php
      if ($model->fecha_desde!='') {       
      $model->fecha_desde=date('d-m-Y',strtotime($model->fecha_desde));
      }
      $this->widget('zii.widgets.jui.CJuiDatePicker', array(
              'model'=>$model,
              'attribute'=>'fecha_desde',
              'value'=>$model->fecha_desde,
				'language' => 'es',
				'htmlOptions' => array('readonly'=>"readonly",'style'=>'width:140px'),
                //additional javascript options for the date picker plugin
              'options'=>array(
                      'autoSize'=>true,
                      'defaultDate'=>$model->fecha_desde,
          //'dateFormat'=>'yy-m-d',
          'dateFormat'=>'dd-mm-yy',
          'buttonImage'=>Yii::app()->baseUrl.'/images/calendar.png',
                      'buttonImageOnly'=>true,
                      'buttonText'=>'Fecha desde',
                      'selectOtherMonths'=>true,
                      'showAnim'=>'slide',
                      'showButtonPanel'=>true,
                      'showOn'=>'button',
                      'showOtherMonths'=>true,
                      'changeMonth' => 'true',
                      'changeYear' => 'true',
                  ),
      )); ?> 
	</div>

            	<div class="row">
		<?php echo $form->labelEx($model,'Fecha hasta'); ?>
                <?php
      if ($model->fecha_hasta!='') {       
      $model->fecha_desde=date('d-m-Y',strtotime($model->fecha_hasta));
      }
      $this->widget('zii.widgets.jui.CJuiDatePicker', array(
              'model'=>$model,
              'attribute'=>'fecha_hasta',
              'value'=>$model->fecha_hasta,
				'language' => 'es',
				'htmlOptions' => array('readonly'=>"readonly",'style'=>'width:140px'),
                //additional javascript options for the date picker plugin
              'options'=>array(
                      'autoSize'=>true,
                      'defaultDate'=>$model->fecha_hasta,
          //'dateFormat'=>'yy-m-d',
          'dateFormat'=>'dd-mm-yy',
          'buttonImage'=>Yii::app()->baseUrl.'/images/calendar.png',
                      'buttonImageOnly'=>true,
                      'buttonText'=>'Fecha hasta',
                      'selectOtherMonths'=>true,
                      'showAnim'=>'slide',
                      'showButtonPanel'=>true,
                      'showOn'=>'button',
                      'showOtherMonths'=>true,
                      'changeMonth' => 'true',
                      'changeYear' => 'true',
                  ),
      )); ?> 
	</div>
    </div>
	  <?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			'type' => 'success',
                        'icon'=>'icon-ok',
			'label' => 'Generar pago',

    ));?>

<?php $this->endWidget(); ?>

</div><!-- form -->