<html>
<head>
<title>DETALLE CAP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="../styles/Style.css">
<script language="JavaScript" type="text/javascript" src="ajax.js"></script>
<script type="text/javascript">
function CerrarVentana(){
//alert("hola mundo");
 window.close();
}
</script>
</head>
<body>
<?php

if(isset($_GET['ugid'])){

  include("../../class/class.conectar.php");
  include("../../class/class.blkpersonal2.php");
  include("../../class/class.usuasist2.php");

  $ugid=$_GET['ugid'];
  $Objcon = new Conectar();
  $conex = $Objcon->con();

  //buscar tipo contrato ocupado por el trabajador
  $Obj_blk = new BlkPersonal();
  $res_blk = array();
  $res_blk = $Obj_blk->buscar_contratopersonal($conex,$ugid);

  $Obj_p = new UsuarioAsistencial();
  $res_p = array();
  $res_p = $Obj_p->buscar_usuasist($conex,$ugid);
  $dni = $res_p[0]['dni'];
  $nombre = $res_p[0]['nombre'];
  $cab ="<br><table align='center' class='FacetFormTABLE' border='1' style='border-collapse: collapse ;border-spacing:  0px;'>";
  $cab = $cab."<tr><td colspan='2' class='FacetFieldCaptionTD' height='25' align='center'>DATOS DEL PERSONAL</td></tr>";
  $cab = $cab."<tr><td class='FacetFieldCaptionTD' width='140' height='20'>&nbsp;&nbsp;DNI</td><td width='320'>&nbsp;&nbsp;".$dni."</td></tr>";
  $cab = $cab."<tr><td class='FacetFieldCaptionTD' width='140' height='20'>&nbsp;&nbsp;APELLIDOS Y NOMBRES</td><td>&nbsp;&nbsp;".$nombre."</td></tr>";
    $cab = $cab."<tr><td colspan='2' align='center' valign='middle' height='35'><input type='hidden' id='ugid' value='".$ugid."'><button id='btnagregarmov' class='boton1' onClick='agregar_movcontrato()'>Agregar Mov. Contrato</button><button id='btnCerrar' class='boton1' onClick='CerrarVentana()'> Cerrar </button></td></tr>";
  $cab =$cab."</table>";
  echo $cab;



  $cad ="<br><table align='center' class='FacetFormTABLE' border='1' style='border-collapse: collapse ;border-spacing:  0px;'>";
  $cad =$cad."<tr><td colspan='12' class='FacetFieldCaptionTDT' align='center' height='25'>DETALLE DE LOS CONTRATOS DEL PERSONAL</td></tr>";
  $cad =$cad."<tr><td class='FacetFieldCaptionTD' align='center'  width='80'>NUM PLANILLA</td>";
  $cad =$cad."<td class='FacetFieldCaptionTD' align='center' width='220' height='20'>DIDAE / DPTO</td>";
  $cad =$cad."<td class='FacetFieldCaptionTD' align='center' width='220'>SERVICIO</td>";
  $cad =$cad."<td class='FacetFieldCaptionTD' align='center'  width='120'>GRUPO OCUPACIONAL</td>";
  $cad =$cad."<td class='FacetFieldCaptionTD' align='center'  width='120'>CARGO</td>";
  $cad =$cad."<td class='FacetFieldCaptionTD' align='center' width='100'>TIPO CONTRATO</td>";
  $cad =$cad."<td class='FacetFieldCaptionTD' align='center' width='80'v>FECHA INI</td>";
  $cad =$cad."<td class='FacetFieldCaptionTD' align='center' width='80'>FECHA FIN</td>";
    $cad =$cad."<td class='FacetFieldCaptionTD' align='center' width='40'>TIEMPO</td>";
  $cad =$cad."<td class='FacetFieldCaptionTD' align='center' width='40'>ESTADO</td>";
  $cad =$cad."<td class='FacetFieldCaptionTD' align='center' width='250'>OBSERVACIONES</td>";
    $cad =$cad."<td class='FacetFieldCaptionTD' align='center' width='20'>EDIT</td></tr>";

  for($a=0;$a<count($res_blk);$a++){
    $cad =$cad."<tr><td align='center'width='80'>".$res_blk[$a]['planilla']."</td>";
    $cad =$cad."<td align='center'width='220'>".$res_blk[$a]['jefatura']."</td>";
    $cad =$cad."<td  align='center' width='220'>".$res_blk[$a]['servicio']."</td>";
    $cad =$cad."<td  align='center'  width='120'>".$res_blk[$a]['tpersonal']."</td>";
    $cad =$cad."<td  align='center'  width='120'>".$res_blk[$a]['cargo']."</td>";
    $cad =$cad."<td  align='center' width='100'>".$res_blk[$a]['tcontrato']."</td>";
    $cad =$cad."<td  align='center' width='80'>".$res_blk[$a]['fechaini']."</td>";
    if($res_blk[$a]['fechaini']==$res_blk[$a]['fechafin']){
    $cad =$cad."<td  align='center' width='80'>-</td>";
    }else{
    $cad =$cad."<td  align='center' width='80'>".$res_blk[$a]['fechafin']."</td>";
    }
    $cad =$cad."<td  align='center' width='40'>".$res_blk[$a]['tiempo']."</td>";
    if($res_blk[$a]['estado']==1){
    $cad =$cad."<td  align='center' width='40'><img src='../img/green.png'></td>";
    }else{
    $cad =$cad."<td  align='center' width='40'><img src='../img/red.png'></td>";
    }
    $cad =$cad."<td  align='center' width='250'>".$res_blk[$a]['obs']."</td>";
    $cad =$cad."<td  align='center' width='20'><img src='../img/b_edit2.gif' onClick='edit_movcontrato()'></td></tr>";
  }

  $cad =$cad."</table>";
  echo $cad;
}

 ?>
</body>
</html>
