<?php if(Perfil::model()->buscarcedula()=='0')
{
    ?>
<a href="index.php?r=perfil/create"><img src="<?php echo Yii::app()->request->baseUrl.'/images/boton.png'?>"></a>
<br>
<?php
}?>

<br>

<h1>Datos del empleado</h1>

<?php 

$perfil=$this->Obtener_perfil();
?>


<table style="width:100%">
    <tr>
        <td>    <div><strong>Trabajador:</strong> <?php echo $perfil['nombre']." ".$perfil['apellido'] ?></div>
    <div><strong>Cédula:</strong> <?php echo $perfil['cedula'] ?></div>
    <div><strong>Cargo:</strong> <?php 
    if($perfil['cargo_observacion']==""){
        echo $perfil['cargo'];
    }else{
        echo $perfil['cargo_observacion'];  
    }
    
   ?></div>
    <div><strong>Unidad Administrativa:</strong> <?php echo $perfil['unidad_administrativa'] ?></div>
    <div><strong>Fecha de Ingreso:</strong> <?php 
     $fechai=$perfil['fecha_ingreso'];
$fecha_m = explode("-", $fechai);
$dia_m =$fecha_m[2];
$mes_m =$fecha_m[1];
$anio_m=$fecha_m[0];
$fecha_inicio= $dia_m.'-'.$mes_m.'-'.$anio_m;   
 echo $fecha_inicio;
 
 ;
 ?></div>
   <!-- <div><strong>Condicion:</strong>--> <?php 
   // if($perfil['condicion_trabajador']=='EMPLEADO FIJO'){
    //    echo 'EMPLEADO CONTRATADO';
  //  }else{
    
  //  echo $perfil['condicion_trabajador'];
  //  }
            ?></div>
    <div><strong>Cuenta Bancaria:</strong> <?php echo $perfil['cuenta_bancaria'] ?>
    
        
       
    
    
    </div></td>
    
    <td>
         <div><strong>Fecha:</strong> <?php echo date("d-m-Y"); ?></div>
         

    </td> 
   
    
  </tr>
</table>

        
<div style=' text-align: center; border: 1px solid darkgoldenrod; color:  #ffffff; background-color: #ff8647;'></div>
<?php



 $cedula_validar= Yii::app()->user->name; 
 

$conexion= pg_connect("host=172.16.0.99 port=5432 dbname=intranet password=postgres user=postgres");

$habilitar_estatus= pg_query("SELECT estatus_recibo from usuario where usuario = '$cedula_validar' ");
$resultado_habilitar = pg_fetch_array($habilitar_estatus);


$estatus= $resultado_habilitar[0];

$conexion2= pg_connect("host=172.16.0.108 port=5432 dbname=enterprise_2016 password=postgres user=postgres");

$q=pg_query("SELECT h.codnom, h.codperi, h.fecdesper, h.fechasper, n.desnom "
                . " FROM sno_periodo h "
                . " inner join sno_nomina n "
                . " on n.codnom = h.codnom "
                . " where h.estatus_periodo = '0' "
                . "   order by h.codnom ");




      
 if($estatus == 1){
     
     
     


$this->widget('zii.widgets.jui.CJuiTabs',array(
   'themeUrl'=>Yii::app()->baseUrl.'/css/ui',//url of your themes for JUI
'theme'=>'t', //theme name the above url should have a folder named by the theme name specified here eg. /protected/extensions/jui/jquery/css/redmond/
'cssFile'=>'jquery-ui.css', // the css file in the theme folder
    'tabs'=>array(
        'Recibos de Pago'=>$this->renderPartial('_pago',
                        array('perfil'=>$perfil),true),
         'Constancias de Trabajo'=>$this->renderPartial('_constancias',
                        array('perfil'=>$perfil),true),
         'ARC'=>$this->renderPartial('_arc',
                        array('perfil'=>$perfil),true),
       
         'Habilitar Recibo de Pago'=>$this->renderPartial('_habilitar',
                        array('perfil'=>$perfil),true),
        
        //'StaticTab 2'=>array('content'=>'Content for tab 2', 'id'=>'tab2'),
        // panel 3 contains the content rendered by a partial view
        //'AjaxTab'=>array('ajax'=>$ajaxUrl),
    ),
    // additional javascript options for the tabs plugin
    'options'=>array(
        'collapsible'=>true,
    ),
));





}else if ($estatus == 0){
    
    
$this->widget('zii.widgets.jui.CJuiTabs',array(
   'themeUrl'=>Yii::app()->baseUrl.'/css/ui',//url of your themes for JUI
'theme'=>'t', //theme name the above url should have a folder named by the theme name specified here eg. /protected/extensions/jui/jquery/css/redmond/
'cssFile'=>'jquery-ui.css', // the css file in the theme folder
    'tabs'=>array(
        'Recibos de Pago'=>$this->renderPartial('_pago',
                        array('perfil'=>$perfil),true),
         'Constancias de Trabajo'=>$this->renderPartial('_constancias',
                        array('perfil'=>$perfil),true),
         'ARC'=>$this->renderPartial('_arc',
                        array('perfil'=>$perfil),true),
       
      
        
        //'StaticTab 2'=>array('content'=>'Content for tab 2', 'id'=>'tab2'),
        // panel 3 contains the content rendered by a partial view
        //'AjaxTab'=>array('ajax'=>$ajaxUrl),
    ),
    // additional javascript options for the tabs plugin
    'options'=>array(
        'collapsible'=>true,
    ),
));

    
}




?>
