<?php
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'];
$idj = $_GET['idj'];
//$ids = $_GET['ids'];

//$ugid ='JEF2';
//$idj ='1';
//$ids ='0';

$sqlusu="select concat(up_nom,' ',up_apepat) as nom from tb_usuprog where ug_id='$ugid'";
$resultusu = mysqli_query($con, $sqlusu);
while ($row= mysqli_fetch_array($resultusu)){
$usunombre = $row['nom'];
}
//conuslta jefatura
$sqlj="select j_desc from tb_jefatura where j_id='$idj'";
$resultj = mysqli_query($con, $sqlj);
while ($rowj= mysqli_fetch_array($resultj)){
$jefatura = $rowj['j_desc'];
}
/*
//sub jefatura
$sqlsj="select s_desc from tb_servicio where j_id='$idj' and s_id='$ids'";
$resultsj = mysqli_query($con, $sqlsj);
if(mysqli_num_rows($resultsj)>0){
while ($rowsj= mysqli_fetch_array($resultsj)){
$subjefatura = $rowsj['s_desc'];
}
}else{
$subjefatura ="";
}
*/
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<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" />
<script type="text/javascript"> 
function agregarDM(){ 
   //alert("hola mundo");
	var ugid = document.getElementById('dmlist').value;
	//alert(ugid);
    window.open("descansomedico.php?ugid="+ugid,"","height=300,width=600,scrollbars=NO");
} 
function leerarea(){ 
   
	var elementos = document.getElementsByName('msn');
 for(var i=0; i<elementos.length; i++) {
  alert(" Elemento: " + elementos[i].value + "\n Seleccionado: " + elementos[i].checked);
  if(elelemtos[i].checked = true){
  //var id = elementos[i].value;
  alert(100);
  }
  
}

} 

function agregarVacaProg(){ 
   //alert("hola mundo");
	var ugid = document.getElementById('vacaproglist').value;
	//alert(ugid);
    window.open("vacacionesprog.php?ugid="+ugid,"","height=350,width=600,scrollbars=NO");
} 

function modificarestado(){ 
   //alert("hola mundo");
	var ugid = document.getElementById('vacaproglist').value;
	var idfecha = document.getElementById('listfechavp').value;
	//alert(ugid);
    window.open("editarvacaciones.php?ugid="+ugid+"&idfecha="+idfecha,"","height=300,width=600,scrollbars=NO");
} 

function AdministrarPersonal(){ 
   var idj = document.getElementById("idj").value;
   /*var ids = document.getElementById("ids").value;*/
   var ugid = document.getElementById("ugid").value;
   document.location= "listadopersonalasistencial.php?idj="+idj+"&ugid="+ugid;
    
}

function ReportarDescMedico(){ 
   var idj = document.getElementById("idj").value;
   /*var ids = document.getElementById("ids").value;*/
   var ugid = document.getElementById("ugid").value;
   document.location= "../reporte/descmed/listardescmed.php?idj="+idj+"&ugid="+ugid;
    
}

function ReportarHoraPermiso(){ 
   var idj = document.getElementById("idj").value;
   var ugid = document.getElementById("ugid").value;
   document.location= "../reporte/horapermiso/listarhorapermiso.php?idj="+idj+"&ugid="+ugid;
    
}

function ReportarLicenciatura(){ 
   var idj = document.getElementById("idj").value;
   var ugid = document.getElementById("ugid").value;
   document.location= "../reporte/licenciatura/listarlicencias.php?idj="+idj+"&ugid="+ugid;
    
}

function ReportarVacaciones(){ 
   var idj = document.getElementById("idj").value;
   var ugid = document.getElementById("ugid").value;
   document.location= "../reporte/vacaciones/listarvacaciones.php?idj="+idj+"&ugid="+ugid;
    
}

function VerTurnosPersonal(){ 
   var idj = document.getElementById("idj").value;
   var ugid = document.getElementById("ugid").value;
   document.location= "../reporte/buscarprogramacionadm.php?idj="+idj+ "&ugid="+ugid;
    
}

function iniprogramacion(){ 
   var idj = document.getElementById("idj").value;
   /*var ids = document.getElementById("ids").value;*/
   var ugid = document.getElementById("ugid").value;
   var tusu = document.getElementById("prog").value;
   document.location= "../programacion/programacionpersonal.php?idj="+idj+"&ids="+ids+"&ugid="+ugid+"&tusu="+tusu;
}

function reporteProg(){ 
   var idj = document.getElementById("idj").value;
   /*var ids = document.getElementById("ids").value;*/
   var ugid = document.getElementById("ugid").value;
   document.location= "../reporte/menureporteadmin.php?idj="+idj+"&ugid="+ugid;
}


</script> 
</head>
<body >
<form name='form1'>
<br><br>
<hr color='blue' size='10'>
<hr color='blue'>
<?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='ugid' name='ugid' value='".$ugid."'>";


?>
<table align='center' class='FacetFormTABLE' width='700' >
<tr><td class='FacetFieldCaptionTD' colspan='2'><font size='10'><?php echo "HI, ".$usunombre; ?></font></td><td width='20'></td><td align='center' class='FacetFieldCaptionTDT'><a href='../login.php'>Salir</a></td><td width='20'></td></tr>
<tr><td width='20'></td><td>
	<table align='center' class='FacetFormTABLE' width='400'>
	<tr><td class='FacetFieldCaptionTDT' align='center'><font color='red'><?php echo $jefatura;?></font></td></tr>
	<tr><td class='FacetFieldCaptionTDT' align='center'><?php //echo $subjefatura;?></td></tr>
	<br>
	<tr><td align='center'><b><?php date_default_timezone_set("America/Lima"); setlocale(LC_TIME,"es_PE.UTF-8"); 
	//setlocale(LC_TIME,"spanish"); 
	echo strftime("Hoy es %A, %d de %B del %Y."); //echo strftime("Hoy es %A, %d de %B del %Y." ,time()); ?></b></td><tr>
	</table>
	<fieldset>
	<legend align='left'><font color='red'>Administrar</font></legend>
	<table width='250'  height='100' align='center'><tr>
	<td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Personal</font></legend>			
		<img src='img/rrhh.jpg' width='60' height='60' onClick='AdministrarPersonal()'>		
	<br>
	</fieldset>
	</td><td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Reportes</font></legend>			
		<img src='img/reporteadm.jpg' width='60' height='60' onClick='reporteProg()'>		
	<br>
	</fieldset>
	</td></tr>
    <td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Desc Medicos</font></legend>			
		<img src='img/descmed.jpg' width='100' height='60' onClick='ReportarDescMedico()'>		
	<br>
	</fieldset>
	</td><td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Hora Permiso</font></legend>			
		<img src='img/time.jpg' width='60' height='60' onClick='ReportarHoraPermiso()'>		
	<br>
	</fieldset>
	</td></tr>
	<td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Licencias</font></legend>			
		<img src='img/licencia.bmp' width='60' height='60' onClick='ReportarLicenciatura()'>		
	<br>
	</fieldset>
	</td><td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Vacaciones</font></legend>			
		<img src='img/vacaciones.jpg' width='60' height='60' onClick='ReportarVacaciones()'>		
	<br>
	</fieldset>
	</td></tr>
	</table></fieldset>
	
	</td><td></td><td width='200' align='center'>
	
	</td><td></td></tr>
<tr>
<td colspan='3'>
		
</td><td colspan='2'>
		
</td></tr>
</table>

<hr color='blue'>
<hr color='blue' size='10'>
</form>
</body>
</html>