<?php
/* @var $this ClienteController */
/* @var $model Cliente */
?>


            <div class="row justify-content-end">
              
                <div class="col-6 text-right" >
                   
                    
                        <?php echo CHtml::link('<i class="fa fa-list"></i> CLIENTES FILTRAR', 
                                Yii::app()->createUrl('cliente/filtrar'), array('class'=>'btn btn-primary','data-toggle' => "tooltip", 
                                    'data-original-title' => 'LISTA DE CLIENTES FILTRAR')); ?>  
   
                
                    
                </div>
        </div>

     
             <div class="row  mt-4 mb-3">
            <div class="col-12 text-danger">
                <h5 class="text-uppercase">Informacion del Prestamo</h5> 
           </div>
        </div>
            
            <div class="row  mt-4 mb-3">
                <div class="col-12">
                             <div class="table-responsive">
                    <table  class="table">
                      <thead>
                        <tr>

                            <th class="text-center">NRO/PAGOS</th>
                            <th class="text-center">ATRASOS</th>
                            <th class="text-center">CAPTOR</th>
                            <th class="text-center">ESTATUS</th>
                            <th class="text-center">DIA PAGO</th>
                            

                        </tr>
                      </thead>
                      <tbody>
                          
                        
                        <tr>
                     
                            <?php   

                            $prestamos=Prestamo::model()->find(array('condition'=>'id_cliente='.$model->id_cliente.' and borrado!=1 ','order'=>'id_cliente desc')); 

                            ?>
                            
                            <?php if(!empty($prestamos)){
                                ?>
                            
                            <td class="text-center"><?php echo Pagos::cuotasCanceladas($prestamos->id_prestamo);   ?></td>
                            <td class="text-center"><?php echo Pagos::atrazos($prestamos->id_prestamo);   ?></td>

                            <?php
                                
                            }else{ ?>
                            <td></td>
                            <td></td>

                            <?php  } ?>
                            
                            <td class="text-center"><?php echo $model->id_captador;   ?></td>
                            
                                 <?php if(!empty($prestamos)){
                                ?>
                               <td class="text-center"><?php 
                               
                               $estatus= Pagos::estatusPrestamo($prestamos->id_prestamo); 
                               
                                 echo Prestamo::estatusClass($estatus);
                               ?></td>
                            
                            
                              <?php  }  else {
                                ?>
                            <td class="text-center">SIN/CREDITO</td>
                            <?php
                            } ?>
                           <?php if(!empty($prestamos)){
                                ?>
                            <td class="text-center"><?php echo Pagos::prestamoIDSemana($prestamos->id_prestamo);   ?></td>   
                            
                            <?php  }  else {
                                ?>
                             <td class="text-center">SIN/CREDITO</td>
                            <?php
                            } ?>

                        </tr>
                       
                      </tbody>
                    </table>                    
                  </div>
                </div>
                <div class="col-12 mt-4">
                    
                    
                             <div class="table-responsive">
                    <table  class="table">
                      <thead>
                        <tr>
                            <th style="background-color:#FF3333;">OBSERVACION</th>
                        </tr>
                      </thead>
                      <tbody>
                          
                        
                        <tr>

                            

                              <?php
                               if(!empty($model->observacion)){
                               ?>
                      
                             <td   style="background-color:#FF3333; color: #FFFFFF;border-radius:10px; ">

                             <?php echo $model->observacion;   ?>
                     
                             </td>

                              <?php
                              }else{ 
                              ?>
<td>
</td>

<?php
}
?>

                        </tr>
                       
                      </tbody>
                    </table>                    
                  </div>
                </div>
            </div>
            
            
            
            <div class="row  mt-4 mb-3">
            <div class="col-12 text-danger">
                <h5 class="text-uppercase">Foto del Cliente:</h5> 
           </div>
        </div>
<div class="row">
    <div class="col-12 text-center ">

                        <img src="<?php echo Yii::app()->request->baseUrl.'/upload/'.$model->foto_cliente;  ?>" 
                             id="imagen"  class="img-fluid" style="max-width: 300px;margin-right:  15px;">
                    </div> 
</div>
   

<div class="row justify-content-center mt-4 mb-3">
            <div class="col-12 text-danger">
                <h5 class="text-uppercase">Datos personales:</h5> 
           </div>
        </div>

<div class="row justify-content-center">
    <div class="col-12 col-sm-12 col-md-6 col-md-6 col-xl-6">
        
        
        
        <?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id_cliente',
		'nombre',
            
	
	),
)); ?>

        
      </div>
    
    
    
    <div class="col-12 col-sm-12 col-md-6 col-md-6 col-xl-6">
        
             <?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'dni',
		'apellido',
	),
)); ?>
        
    </div>
</div>  

 <div class="row justify-content-center mt-4 mb-3">
            <div class="col-12 text-danger">
                <h5 class="text-uppercase">Información de Contacto:</h5> 
           </div>
        </div>
            
            <div class="row justify-content-center">
   
    
    
    <div class="col-12 col-sm-12 col-md-6 col-md-6 col-xl-6">
        
             <?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'celular',

	),
)); ?>
        
    </div>
</div> 
            
            
            

<div class="row justify-content-center mt-4 mb-3">
            <div class="col-12 text-danger">
                <h5 class="text-uppercase">Foto de la Local:</h5> 
           </div>
</div>

<div class="row">
      <div class="col-12 text-center ">
                        <img src="<?php echo Yii::app()->request->baseUrl.'/upload/'.$model->foto_local;  ?>" id="imagen2"  class="img-fluid" style="max-width: 300px;margin-right: 15px;">
      </div> 
</div>



<div class="row justify-content-center mt-4 mb-3">
            <div class="col-12 text-danger">
                <h5 class="text-uppercase">Dirección:</h5> 
           </div>
        </div>

<div class="row justify-content-center">
    <div class="col-12 col-sm-12 col-md-6 col-md-6 col-xl-6">
        
        
        
        <?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'lt',
		'id_distrito',
	),
)); ?>

        
      </div>
    
    
    
    <div class="col-12 col-sm-12 col-md-6 col-md-6 col-xl-6">
        
             <?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(

		'direccion',
		'mz',
		'id_zona',
	

	),
)); ?>
        
    </div>
</div>  


            
            
            
            

<div class="row justify-content-center mt-3 mb-3">
            <div class="col-12 text-danger">
                <h5 class="text-uppercase">Información del Trabajo:</h5> 
           </div>
        </div>

<div class="row justify-content-center">
    <div class="col-12 col-sm-12 col-md-6 col-md-6 col-xl-6">
        
        
        
        <?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id_empleo',

	),
)); ?>

        
      </div>
 
</div> 



<div class="row justify-content-center mt-3 mb-3">
            <div class="col-12 text-danger">
                <h5 class="text-uppercase">Captador y Gestor:</h5> 
           </div>
        </div>

<div class="row justify-content-center">
    <div class="col-12 ">
               <?php $this->widget('zii.widgets.CDetailView', array(
                'data'=>$model,
                'attributes'=>array(
                        'id_captador',
                        'id_gestor',

                ),
)); ?>

    </div>
</div>






 



<div class="row justify-content-center mt-3 mb-3">
    <div class="col-12 text-danger">
        <h5 class="text-uppercase">Informacion de Auditoria:</h5> 
   </div>
</div>



<div class="row justify-content-center">
    <div class="col-12 ">

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(

		'id_usuario_creador',
                'dtmfecha_creacion',
            
		'id_usuario_modificador',

		
		'dtmfecha_modificacion',

	),
)); 

?>    </div>
</div>
     
                
                
                
                
                
                



