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

$ugid=$_GET['ugid'];

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

//tipo de horas programadas
$cadenathrs = "";
$cadenathrs = $cadenathrs."<select id='cbthrs'>";
$cadenathrs = $cadenathrs."<option value='0'>PROGRAMADAS</option>";
$cadenathrs = $cadenathrs."<option value='1'>REPROGRAMADAS</option>";
$cadenathrs = $cadenathrs."<option value='2'>EJECUTADAS</option>";
$cadenathrs = $cadenathrs."</select>";
//echo $ugid;
//nombre de la jefatura
$sqljefatura = "select j_id as idj, j_desc as nom from tb_jefatura";
$cadenajef = "";
$cadenajef = $cadenajef."<select id='cbjef' onChange='mostrarservicio();mostrartipopersonal()'>";
$askjef=false;
$resultjefatura = mysqli_query($con,$sqljefatura);
$cadenajef = $cadenajef."<option value='0'>Seleccione Area/Dpto</option>";
while ($rowj= mysqli_fetch_array($resultjefatura)){
	$cadenajef = $cadenajef."<option value='".$rowj['idj']."'>".$rowj['nom']."</option>";
	if($askjef==false){
	$idj=$rowj['idj'];
	$askjef=true;
	}
}
$cadenajef = $cadenajef."</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></tr>
<tr><td>

<!-- 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/folderbk.png' width='50' height='50'></td><td class='LlenarTablaGareaTitulo'>MIGRACION SIPA A SGH</td></tr>
  </table>
  <!-- cierre tabla 3 -->
</td></tr>
<tr><td colspan='2'><br></td></tr>
<tr><td width='130' class ='FacetDataTextC'>Tipo de Horas</td><td width="260" class ='FacetDataTextC'>
  <?php echo $cadenathrs;?>
</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'>
  <div id='divserv'></div>
</td></tr>
<tr><td width='130' class ='FacetDataTextC'>Tipo de Personal</td><td width="260" class ='FacetDataTextC'>
  <div id='divtpper'></div>
</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>
<tr><td colspan='2' align='center' class ='FacetDataTextC'><input type='button' value='Generar TXT' id='backup' name='backup' onClick='doMigracion()'></td></tr>
</table>

</td></tr>
</table>
<!--cierrre tabla 1 -->
<table align="center">
<tr><td align='center' colspan='2'><img src='../img/home.png' width='70' height='60' onClick='RegresarMPA()' alt='Regresar al Menu Principal'></td></tr>
</table>

</body>
</html>

