<?php

//mysqli_select_db("$sql_db");
include("../../class/class.conectar.php");
include("../../class/class.jefatura2.php");
include("../../class/class.servicio2.php");
include("../../class/class.blkpersonal2.php");
include("../../class/class.vacaciones2.php");

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

date_default_timezone_set("America/Lima"); setlocale(LC_TIME,"es_PE.UTF-8");

$idj=$_GET['idj'];
$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'>";
}

echo "<input type='hidden' id='idj' name='idj' value='".$idj."'>";
echo "<input type='hidden' id='ugid' name='ugid' value='".$ugid."'>";

//nombre de la jefatura
$Objj = new Jefatura();
$res_j = array();
$res_j = $Objj->buscar_jefaturaxidj($conex,$idj);

//combo jefatura
$cbjef = "";
$cbjef = $cbjef."<select id='cbjef' style='width: 250px;' onchange='listarpersonVAC();'>";
$cbjef = $cbjef."<option value='0'>Seleccione Area/Dpto</option>";

for($a=0;$a<count($res_j);$a++){
	$cbjef = $cbjef."<option value='".$res_j[$a]['id']."'";
	if($res_j[$a]['id'] == $idj){
		$cbjef = $cbjef." selected ";
	}
	$cbjef = $cbjef.">".$res_j[$a]['nom']."</option>";
}
$cbjef = $cbjef."</select>";


//combo servicio
$Objs = new Servicio();
$res_s = array();
$res_s = $Objs->buscar_servicioxidj($conex,$idj);

//nombre de servicio
$cbserv = "";
$cbserv = $cbserv."<select id='cbserv' onchange='listarpersonVAC();'>";
$cbserv = $cbserv."<option value='-1'>TODOS </option>";

for($b=0;$b<count($res_s);$b++){
$cbserv = $cbserv."<option value='".$res_s[$b]['ids']."'>".$res_s[$b]['nom']."</option>";
}
$cbserv = $cbserv."</select>";


//combo tipo de personal
$Obj_blk = new BlkPersonal();
$res_blk = array();
$res_blk = $Obj_blk->buscar_grupoocupacionalxidj($conex,$idj);
$cbtipoper = "";
$cbtipoper = $cbtipoper."<select id='cbtp' style='width: 200px;' onChange='listarpersonVAC();'>";
$cbtipoper = $cbtipoper."<option value='-1'>TODOS</option>";
	for($c=0;$c<count($res_blk);$c++){
		$cbtipoper = $cbtipoper."<option value='".$res_blk[$c]['id']."'>".$res_blk[$c]['nom']."</option>";
	}
$cbtipoper = $cbtipoper."</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');

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>SIPA - SISTEMA INTEGRADO DE LA PROGRAMACION ASISTENCIAL</title>
<link rel="stylesheet" type="text/css" href="../../styles/Style.css">
<link rel="shortcut icon" href="logo.ico" type="image/x-icon">
<script language="JavaScript" type="text/javascript" src="ajax.js"></script>
<script language="JavaScript">
		function go_frm_principal(){
				var idj = document.getElementById("idj").value;
				var ugid = document.getElementById("ugid").value;
				document.location= "../../personal/adminterminal.php?idj="+idj+"&ugid="+ugid;
		}

		function go_frm_admvaca(){
			var idj = document.getElementById("idj").value;
			var ugid = document.getElementById("ugid").value;
			document.location= "admvacaciones/main_personal.php?idj="+idj+"&ugid="+ugid;
		}
</script>
<link rel="stylesheet" type="text/css" href="styles/Style.css">
<link type="text/css" rel="stylesheet" href="src/css/jscal2.css" />
    <link type="text/css" rel="stylesheet" href="src/css/border-radius.css" />
    <!-- <link type="text/css" rel="stylesheet" href="src/css/reduce-spacing.css" /> -->

    <link id="skin-win2k" title="Win 2K" type="text/css" rel="alternate stylesheet" href="src/css/win2k/win2k.css" />
    <link id="skin-steel" title="Steel" type="text/css" rel="alternate stylesheet" href="src/css/steel/steel.css" />
    <link id="skin-gold" title="Gold" type="text/css" rel="alternate stylesheet" href="src/css/gold/gold.css" />
    <link id="skin-matrix" title="Matrix" type="text/css" rel="alternate stylesheet" href="src/css/matrix/matrix.css" />

    <link id="skinhelper-compact" type="text/css" rel="alternate stylesheet" href="src/css/reduce-spacing.css" />

    <script src="src/js/jscal2.js"></script>
	<script src="src/js/lang/en.js"></script>
    <!-- you actually only need to load one of these; we put them all here for demo purposes -->
     <script src="src/js/lang/es.js"></script>

    <!--link type="text/css" rel="stylesheet" href="demopage.css" /-->


</head>
<body onload="listarpersonVAC()">
<br>
<!--primera tabla -->
<table align='center' class='TableDiseno'>
<tr><td><font color='#0000FF'><b>SIPA - Sistema Integrado de la Programacion Asistencial</b></font></td><td></td><td></td></tr>
<tr><td colspan='3' align='center'>

<!-- tabla 2 -->
<table align='center'>
<tr><td colspan='2'><br></td></tr>

<tr><td colspan='2' align='center' class='LlenarTablaGarea'>
<!--tabla 3 -->
<table>
  <tr><td><img src='../img/vacaciones.jpg' width='70' height='50'></td><td class='LlenarTablaGareaTitulo'>REPORTE DE VACACIONES</td></tr>
  </table>
  <!-- cierre tabla 3 -->
</td></tr>
<tr><td colspan='2'><br></td></tr>
<tr><td width='130' class ='FacetDataTextC'>Area / Dpto</td><td width="260" class ='FacetDataTextC'>
  <?php echo $cbjef;?>
</td></tr>
<tr><td width='130' class ='FacetDataTextC'>Servicio</td><td width="260" class ='FacetDataTextC'>
  <?php echo $cbserv;?>
</td></tr>
<tr><td width='130' class ='FacetDataTextC'>Tipo de Personal</td><td width="260" class ='FacetDataTextC'>
  <?php echo $cbtipoper;?>
</td></tr>
<tr>
<td class ='FacetDataTextC'>A&ntilde;o</td>
<td class ='FacetDataTextC'>
<?php
echo "<select name='anno' id='anno' onchange='listarpersonVAC();'>";
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' onchange='listarpersonVAC();'>";
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>
<tr><td class ='FacetDataTextC'>Estado</td>
<td class ='FacetDataTextC'>
<?php
echo "<select name='cbest' id='cbest' onchange='listarpersonVAC();'>";
echo "<option value='0' selected> PROGRAMADAS </option>";
echo "<option value='1' > EJECUTADAS </option>";
echo "<option value='2' > SUSPENDIDAS </option>";
echo "</select>";
?>
</td></tr>
</table>
<!--cierre tabla 2 -->
</td></tr></table>
<table align="center">
<tr><td align='center' colspan='2'><img src='../img/icoexcel.png' width='30' height='30' onClick='exportaexcelVAC()' alt='Exportar Lista a Excel'><img src='../../img/home.png' width='70' height='60' onClick='go_frm_principal()' alt='Regresar al Menu Principal'><img src='../../img/copiar.png' width='45' height='40' onClick='reportarVAC()' alt='Reportar Vacaciones'></td></tr>
<tr><td align='center' colspan='2'><input type='button' id='btn_admvaca' value='Administrar Vacaciones' onClick='go_frm_admvaca()'></td></tr>
</table>
<!--cierrre tabla 1 -->
<br><br>
<div id='divDM'>
<?php
//$ids = -1;
//$idj = $idj;
//$ugid = $ugid;
//$mes = $mm;
//$anno = $anno;
//$est = 0;
//include("listarpersonalvaca.php");
?>
</div>
</body>
</html>
