<?php
//session_start();
include("../../bd/sql_variables.php");
$db_conexion= mysql_connect("$sql_host", "$sql_usuario", "$sql_pass") or die(header ("No Disponible Servidor de Base de Datos"));
mysql_select_db("$sql_db");

$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'>";
}

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='ugid' name='ugid' value='".$ugid."'>";

//nombre de la jefatura
$sqljefatura = "select j_id as idj, j_desc as nom from tb_jefatura where j_id='$idj'";
$cadenajef = "";
$cadenajef = $cadenajef."<select id='cbjef' onchange='listarpersonVAC();'>";
$askjef=false;
$resultjefatura = mysql_query($sqljefatura);
while ($rowj= mysql_fetch_array($resultjefatura)){
	$cadenajef = $cadenajef."<option value='".$rowj['idj']."'>".$rowj['nom']."</option>";
	if($askjef==false){
	$idj=$rowj['idj'];
	$askjef=true;
	}
}
$cadenajef = $cadenajef."</select>";

//nombre de servicio
$sqlserv = "select s_id as ids, s_desc as nom from tb_servicio where j_id='$idj'";
$cadenaserv = "";
$cadenaserv = $cadenaserv."<select id='cbserv' onchange='listarpersonVAC();'>";
$cadenaserv = $cadenaserv."<option value='-1'>TODOS </option>";
$cadenaserv = $cadenaserv."<option value='0'>DEPENDENCIA DIRECTA </option>";
$resultserv = mysql_query($sqlserv);
while ($rows= mysql_fetch_array($resultserv)){
$cadenaserv = $cadenaserv."<option value='".$rows['ids']."'>".$rows['nom']."</option>";
}
$cadenaserv = $cadenaserv."</select>";



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='ugid' name='ugid' value='".$ugid."'>";
//combo tipo de personal
$sqltpersonal = "select distinct(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=1;
$idtp="";
$cadenatp = "<select id='cbtp' onchange='listarpersonVAC();'>";
$cadenatp=$cadenatp."<option value='0' selected>TODOS</option>";
while ($rowtp= mysql_fetch_array($resulttpersonal)){
$cadenatp=$cadenatp."<option value='".$rowtp['cod']."'";
if($a==0){
$cadenatp=$cadenatp." selected ";
$a=1;
$idtp=$rowtp['cod'];
}
$cadenatp=$cadenatp." >".$rowtp['descripcion']."</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');

?>
<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>

<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>
<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 $cadenajef;?>
</td></tr>
<tr><td width='130' class ='FacetDataTextC'>Servicio</td><td width="260" class ='FacetDataTextC'>
  <?php echo $cadenaserv;?>
</td></tr>
<tr><td width='130' class ='FacetDataTextC'>Tipo de Personal</td><td width="260" class ='FacetDataTextC'>
  <?php echo $cadenatp;?>
</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='regresarMPterm()' alt='Regresar al Menu Principal'><img src='../../img/copiar.png' width='45' height='40' onClick='reportarVAC()' alt='Reportar Vacaciones'></td></tr>
</table>
<!--cierrre tabla 1 -->

<div id='divDM'>
<?php
$ids = -1;
$idj = $idj;
$ugid = $ugid;
$mes = $mm;
$anno = $anno;
$est = 0;
include("listarpersonalvaca.php");
?>
</div>
</body>
</html>

