<html>
<head>
<link rel="stylesheet" type="text/css" href="../../styles/Style.css">
<script language="JavaScript" type="text/javascript" src="../ajax.js"></script>
</head>
<body>
<?php

require_once("../../class/class.conectar.php");
require_once("../../class/class.jefaturas.php");
require_once("../../class/class.usuaprueba.php");
require_once("../../class/class.tipopersonal.php");

$Objcon = new Conectar();
$conex = $Objcon->con();

$idj=$_GET['idj'];
$ids=$_GET['ids'];

$ugid=$_GET['ugid'];
if(isset($_GET['tusu'])){
echo "<input type='hidden' id='tusu' name='tusu' value='1'>";
}else{
echo "<input type='hidden' id='tusu' name='tusu' value='0'>";
}

//nombre de la jefaturas
$Objj = new Jefaturas();
$res_jef = array();$res_serv = array();
$res_jef=$Objj->buscar_jefatura($conex,$idj);
$nomjefatura=$res_jef[0]['nom'];
if($ids!=0){
$res_serv=$Objj->buscar_jefatura_servicio($conex,$idj,$ids);
$nomservicio=$res_serv[0]['nom'];
}else{
$nomservicio="";
}


echo "<input type='hidden' id='idj' name='idj' value='".$idj."'>";
echo "<input type='hidden' id='ids' name='ids' value='".$ids."'>";
//echo "<input type='hidden' id='anno' name='anno' value='".$anno."'>";
//echo "<input type='hidden' id='mes' name='mes' value='".$mes."'>";
//echo "<input type='hidden' id='idtp' name='idtp' value='".$idtp."'>";
echo "<input type='hidden' id='ugid' name='ugid' value='".$ugid."'>";

$Objtp = new TipoPersonal();
$res_tp = array();
$res_tp = $Objtp->buscar_tipoper_dep($conex,$idj,$ids);
//combo tipo de personal
  //$sqltpersonal = "select a.tp_id as cod, (select tp_desc from tb_tipoperson where tp_id=a.tp_id) as descripcion from tb_areatipopersona a where a.j_id='$idj' and a.s_id='$ids'";
//echo $sqltpersonal;
  //$resulttpersonal = mysql_query($sqltpersonal);
//$cadenatp="<select id='tipopersonal' name='tipopersonal'>";
$a=0;
$idtp="";
$cadenatp = "<select id='progtp' >";
$cadenatp=$cadenatp."<option value=0>Seleccione</option>";
for($i=0;$i<count($res_tp);$i++){
$cadenatp=$cadenatp."<option value='".$res_tp[$i]['id']."'";
$cadenatp=$cadenatp." >".$res_tp[$i]['nom']."</option>";
}
$cadenatp=$cadenatp."</select>";

$arraymes = array();
$arraymes[] = array('idmes'=>'1','mes'=>'ENERO');
$arraymes[] = array('idmes'=>'2','mes'=>'FEBRERO');
$arraymes[] = array('idmes'=>'3','mes'=>'MARZO');
$arraymes[] = array('idmes'=>'4','mes'=>'ABRIL');
$arraymes[] = array('idmes'=>'5','mes'=>'MAYO');
$arraymes[] = array('idmes'=>'6','mes'=>'JUNIO');
$arraymes[] = array('idmes'=>'7','mes'=>'JULIO');
$arraymes[] = array('idmes'=>'8','mes'=>'AGOSTO');
$arraymes[] = array('idmes'=>'9','mes'=>'SETIEMBRE');
$arraymes[] = array('idmes'=>'10','mes'=>'OCTUBRE');
$arraymes[] = array('idmes'=>'11','mes'=>'NOVIEMBRE');
$arraymes[] = array('idmes'=>'12','mes'=>'DICIEMBRE');

?>
<br>
<table align='center'>
<form action="menuprogramacion.php" method="GET">
<tr><td align='center' class='LlenarJefatura' width='400'><?php echo $nomjefatura;?></td></tr>
<tr><td align='center' class='LlenarServicio' width='400'><?php echo $nomservicio;?></td></tr>
</table>
<br>
<table align='center'>
<tr><td align='center' colspan='2' class='LlenarTablaGarea'>CONSULTA DEL MES</td></tr>
<tr><td width='100' class ='FacetDataTextC'>Personal</td><td class ='FacetDataTextC' width='300'>
<?php echo $cadenatp;?>
</td></tr>
<tr><td class ='FacetDataTextC'>A&ntilde;o</td>
<td class ='FacetDataTextC'>
<?php
echo "<select name='anno' id='anno'>";
for ($i=2000;$i<2100;$i++){
echo "<option value='".$i."'";
if(date("Y",time())==$i){?> selected
<?php
$anno=$i;
} echo ">".$i."</option>";
}
echo "</select>";
?>
</td></tr>
<tr><td class ='FacetDataTextC'>Mes</td><td class ='FacetDataTextC'>
<?php
echo "<select name='mes' id='mes' >";
for ($i=0;$i<count($arraymes);$i++){
echo "<option value='".$arraymes[$i]['idmes']."'";
if(date("n",time())==$arraymes[$i]['idmes']){?> selected
<?php
$mm=$i+1;
} echo ">".$arraymes[$i]['mes']."</option>";
}
echo "</select>";
?>
</td></tr>
<?php
echo "<input type='hidden' id='idj' name='idj' value='".$idj."'>";
echo "<input type='hidden' id='ids' name='ids' value='".$ids."'>";
echo "<input type='hidden' id='anno' name='anno' value='".$anno."'>";
echo "<input type='hidden' id='mes' name='mes' value='".$mm."'>";
echo "<input type='hidden' id='idtp' name='idtp' value='".$idtp."'>";
echo "<input type='hidden' id='ugid' name='ugid' value='".$ugid."'>";
?>
<tr><td class ='FacetDataTextC'></td><td class ='FacetDataTextC'><input type='button' id='buscar' name='buscar' value='Consultar' onClick='listarpersonalfalta();'><input type='button' onclick='backReprogramacion()' value='Regresar'></td></tr>
</form>
</table>

<div id='divrepropersonal'>

</div>
</body>
</html>
