<h3>Aprobar Solicitud de Reintegro</h3>
<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'),
)); 
function cambio_fecha($fecha){
    $fecha_final=date('d/m/Y', strtotime($fecha));
    return $fecha_final;
}

 $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
    ),
));

 ?>
    <div class="well" >
        <fieldset>
            <legend>Datos del Solicitante</legend>
            <div class="row">
                <div class="span2">
                  <?php echo CHtml::label('<strong>Cédula:</strong>',''); ?>
                  <?php echo $model->trabajador->cedula; ?> 
               </div>
               <div class="span2">
                  <?php echo CHtml::label('<strong>Nombre y Apellido:</strong>',''); ?>
                  <?php echo $model->trabajador->nombre . ' '.$model->trabajador->apellidos; ?> 
               </div>
                <div class="span2">
                  <?php echo CHtml::label('<strong>Fecha Ingreso:</strong>',''); ?>
                  <?php echo cambio_fecha($model->trabajador->fechaingreso); ?> 
               </div>
               <div class="span2">
                  <?php echo CHtml::label('<strong>Empresa:</strong>',''); ?>
                  <?php echo $model->trabajador->lugartrabajo0->descripcion; ?> 
               </div>
              
                <div class="span2">
                  <?php echo CHtml::label('<strong>Fecha Solicitud:</strong>',''); ?>
                  <?php echo cambio_fecha($model->fecha_solicitud); ?> 
               </div>
            </div>
            
        </fieldset>
    </div>
    
    <div class="well" >
        <fieldset>
            <legend>Datos de Cr&eacute;dito</legend>
            <div class="row">
                <div class="span3">
                  <?php echo CHtml::label('<strong>Tipo de Cr&eacutedito:</strong>',''); ?>
                  <?php echo $model->credito->tipocredito->descripcion; ?>
                </div>
                <div class="span2" >
                  <?php echo CHtml::label('<strong>Monto Aprobado:</strong>',''); ?>
                   <?php echo Yii::app()->numberFormatter->formatCurrency($model->credito->monto_credito,''); ?>
                </div>
                <div class="span2">
                  <?php echo CHtml::label('<strong>Fecha del Cr&eacutedito:</strong>',''); ?>
                  <?php echo $model->credito->fecha_aprobacion; ?>
                </div>
                <div class="span2" >
                  <?php echo CHtml::label('<strong>Monto Cuotas:</strong>',''); ?>
                  <?php echo Yii::app()->numberFormatter->formatCurrency($model->credito->cuota_pagar,''); ?>
                </div>
                <div class="span2" >
                  <?php echo CHtml::label('<strong>Interes(%):</strong>',''); ?>
                  <?php echo $model->credito->interes; ?>
                </div>
           </div>
           </fieldset>
    </div>
            

       <div class="well" >
        <fieldset>
            <legend>Datos del Reintegro</legend>
             <div class="row">
                <div class="span2">
                  <?php echo CHtml::label('<strong>Cuota Num.</strong>',''); ?>
                   <?php echo $model->credito_pago->numero_cuota; ?> 
                </div>
                 <div class="span2" >
                   <?php echo CHtml::label('<strong>Monto Cuota.</strong>',''); ?>
                  <?php echo CHtml::label("<strong>".Yii::app()->numberFormatter->formatCurrency($model->credito_pago->cuota,'')."</strong>",''); ?>
                </div>
                
                <div class="span2" >
                 <?php echo CHtml::label('<strong>Fecha Pago.</strong>',''); ?>
                  <?php echo cambio_fecha($model->credito_pago->fechapago); ?>
                </div>
            
              <div class="span2" >
                 <?php echo CHtml::label('<strong>Tipo Movimiento.</strong>',''); ?>
                  <?php echo $model->mvmCuota->descripcion; ?>
                </div>
            
            <div class="span2" >
                 <?php echo CHtml::label('<strong>Monto del Reintegro.</strong>',''); ?>
                 <?php echo CHtml::label("<strong>".Yii::app()->numberFormatter->formatCurrency($model->monto_reintegro,'')."</strong>",''); ?>
                <?php echo $form->hiddenfield($model,'monto_reintegro',array('value'=>$model->monto_reintegro)); ?>
                </div>
             </div>
        </fieldset>
      </div>

   
        <center>
        <hr />
        <?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			'type' => 'success',
			'id' => 'btn_registrar',
                        'icon'=>'icon-ok',
			'label' => 'Aprobar Solicitud',

    ));
              ?>
         <?php $this->widget('bootstrap.widgets.TbButton', array(
			'type' => 'danger',
			'id' => 'btn_registrar',
			'label' => 'Denegar Solicitud',
                        'icon'=>'icon-remove',
                        'url' => Yii::app()->createUrl('/reintegro/denegarReintegro', array('id'=>$model->idreintegro)),

    ));
              ?>
            <?php $this->widget('bootstrap.widgets.TbButton', array(
			'type' => 'info',
			'id' => 'btn_registrar',
			'label' => 'Regresar',
                        'icon'=>'icon-circle-arrow-left',
                        'url' => Yii::app()->createUrl('/reintegro/admin'),

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

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