<?php
/* @var $this LiquidacionController */
/* @var $model Liquidacion */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'liquidacion-_migrar_form-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;
}
?>

        <h3>Pagar liquidación</h3>

    <p class="note">Los campos con <span class="required">*</span> son obligatorios.</p>

	<?php echo $form->errorSummary($model); ?>
        
        <div class="well" >
        <fieldset>
            <legend>Datos del Solicitante</legend>
            <div class="row">
                <div class="span1">
                  <?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 class="span2">
                  <?php echo CHtml::label('<strong>Num.Cuenta:</strong>',''); ?>
                  <?php echo $model->cuenta; ?> 
               </div>
            </div>
            
        </fieldset>
    </div>
        
      <div class="well">
	<div class="row-fluid">
        <?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-fluid">
		<?php echo $form->textFieldRow($model,'referencia'); ?>
	</div>
            <div class="row-fluid">
		<?php echo $form->labelEx($model,'Fecha referencia'); ?>
                <?php
      if ($model->fecha_pagado!='') {       
      $model->fecha_pagado=date('d-m-Y',strtotime($model->fecha_pagado));
      }
      $this->widget('zii.widgets.jui.CJuiDatePicker', array(
              'model'=>$model,
              'attribute'=>'fecha_pagado',
              'value'=>$model->fecha_pagado,
				'language' => 'es',
				'htmlOptions' => array('readonly'=>"readonly",'style'=>'width:140px'),
                //additional javascript options for the date picker plugin
              'options'=>array(
                      'autoSize'=>true,
                      'defaultDate'=>$model->fecha_pagado,
          //'dateFormat'=>'yy-m-d',
          'dateFormat'=>'dd-mm-yy',
          'buttonImage'=>Yii::app()->baseUrl.'/images/calendar.png',
                      'buttonImageOnly'=>true,
                      'buttonText'=>'Fecha referencia',
                      'selectOtherMonths'=>true,
                      'showAnim'=>'slide',
                      'showButtonPanel'=>true,
                      'showOn'=>'button',
                      'showOtherMonths'=>true,
                      'changeMonth' => 'true',
                      'changeYear' => 'true',
                  ),
      )); ?> 
		<?php echo $form->error($model,'fecha_pagado'); ?>
	</div>
	<div class="row-fluid">
		<?php echo $form->textFieldRow($model,'observacion'); ?>
	</div>

    </div>
	  <?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			'type' => 'success',
                        'icon'=>'icon-ok',
			'label' => 'Generar pago',

    ));?>

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

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