<?php
/* @var $this ReintegroController */
/* @var $model Reintegro */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'reintegro-form',
	'type' => 'horizontal',
        'enableAjaxValidation' => false,
        'enableClientValidation' => true,
        'clientOptions' => array(
        'validateOnSubmit' => true,
        'validateOnChange' => true,
        'validateOnType' => true,
        ),
    'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); 
$this->widget('bootstrap.widgets.TbAlert', array(
    'block' => true, // display a larger alert block?
    'fade' => true, // use transitions?
    'closeText' => '×', // close link text - if set to false, no close link is displayed
    'alerts' => array(// configurations per alert type
        'error' => array('block' => true, 'fade' => true, 'closeText' => '×'), // success, info, warning, error or danger
    ),
));
?>
<?php echo $form->hiddenfield($model,'id_trabajador',array('value'=>$datos->idasociado)); ?>
   <div class="well" >
        <fieldset>
            <legend>Datos del Aportante</legend>
            <div class="row">
                <div class="span2">
                  <?php echo CHtml::label('<strong>Cédula:</strong>',''); ?>
                  <?php echo CHtml::label("$datos->cedula",''); ?> 
               </div>
               <div class="span3">
                  <?php echo CHtml::label('<strong>Nombre y Apellido:</strong>',''); ?>
                  <?php echo $datos->nombre . ' '.$datos->apellidos; ?> 
               </div>
                <div class="span3">
                  <?php echo CHtml::label('<strong>Fecha Ingreso:</strong>',''); ?>
                  <?php echo $datos->fechaingreso; ?> 
               </div>
               <div class="span2">
                  <?php echo CHtml::label('<strong>Empresa:</strong>',''); ?>
                  <?php echo $datos->lugartrabajo0->descripcion; ?> 
               </div>
              
            </div>
            
        </fieldset>
    </div>
    
    <div class="alert alert-info"><center>
        <?php echo CHtml::label('<strong>Seleccione el tipo de crédito</strong>',''); ?>
        <?php
                            $t_credito = new CDbCriteria;  
                            $t_credito->condition = "idtrabajador=$datos->idasociado and status=1 and blnborrado=false"; 
                            //$t_credito->order = 'descripcion ASC'; 
                            echo CHtml::dropDownList('idcredito', '',                                         
                                             CHtml::listData(Credito::model()->findAll($t_credito),'id','tipocredito.descripcion'),
                                                   array(
                                                    'ajax' => array(
			                            'type'=>'POST', //request type
                                                    'url'=>CController::createUrl('reintegro/cargarCuotas/id'),
                                                    'update'=>'#id_cuotas',),
                                                    'prompt'=>'Seleccione...'));
         ?>
            <?php $s= Credito::model()->findAll($t_credito);
             if($s == NULL) echo "<center style='color: red;'><strong>Usted NO posee créditos Asignado</strong></center>";
            ?>
        </center></div>
    
    <hr />
    
    <div id='id_cuotas'>
        <?php echo CHtml::hiddenfield('selec',''); ?>
    </div>
    
    <div class="alert alert-info">
        <center>
            <strong>¿Que desea hacer su cuota?</strong>
        
        <?php
        $t_movimiento = new CDbCriteria;  
        $t_movimiento->condition = "blnborrado=false";
        echo CHtml::dropDownList('mvm_cuota', '',                                         
                         CHtml::listData(TipoMovimientocuota::model()->findAll($t_movimiento),'idmovimiento','descripcion'),
                               array(
                                'prompt'=>'Seleccione...'));
         ?>
       </center>
    </div>
     <hr />
     <center>
        <?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			'type' => 'success',
			'id' => 'btn_registrar',
                        'icon'=>'icon-ok',
			'label' => 'Solicitar Reintegro',

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

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