<?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'];
}

?>
<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+"&ids="+ids+"&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 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+"&ids="+ids+"&ugid="+ugid;
}
function modjefaturas(){ 
   var ugid = document.getElementById("ugid").value;
   document.location= "../tools/jefatura.php?ugid="+ugid;
}
function modtpersonal(){ 
   var ugid = document.getElementById("ugid").value;
   document.location= "../tools/maintpersonal.php?ugid="+ugid;
}
function reportebackup(){ 
   var ugid = document.getElementById("ugid").value;
   document.location= "../backup/bkprogramacion.php?ugid="+ugid;
}

function migracionSGH(){ 
   var ugid = document.getElementById("ugid").value;
   document.location= "../migracion/migracion.php?ugid="+ugid;
}

function doherramientas(){ 
   var ugid = document.getElementById("ugid").value;
   document.location= "../tools/tools.php?ugid="+ugid;
}


</script> 
</head>
<body >
<form name='form1'>
<br><br>
<hr color='blue' size='10'>
<hr color='blue'>
<?php
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='BLUE'>ADMINISTRADOR DEL SIPA</font></td></tr>
	<br>
	<tr><td align='center'><b><?php setlocale(LC_TIME,"spanish"); 
	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='360'  height='100' align='center' ><tr>
	<td width='120' align='center' >
	<fieldset>
	<legend align='center'><font color='blue'>Usuarios</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'>Jefaturas</font></legend>			
		<img src='img/jefe3.png' width='60' height='60' onClick='modjefaturas()'>		
	<br>
	</fieldset>
	</td>
	<td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Tipo Personal</font></legend>			
		<img src='img/tper.jpg' width='60' height='60' onClick='modtpersonal()'>		
	<br>
	</fieldset>
	</td></tr>
    <td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Especialidad</font></legend>			
		<img src='img/modestado.jpg' width='60' height='60' onClick='ReportarDescMedico()'>		
	<br>
	</fieldset>
	</td><td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Areas</font></legend>			
		<img src='img/fichero.png' width='60' height='60' onClick='reportebackup()'>		
	<br>
	</fieldset>
	</td><td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Horarios</font></legend>			
		<img src='img/time.jpg' width='60' height='60' onClick='reportebackup()'>		
	<br>
	</fieldset>
	</td></tr>
	<td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Asig Horario</font></legend>			
		<img src='img/tools2.png' width='60' height='60' onClick='doherramientas()'>		
	<br>
	</fieldset>
	</td><td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Migracion</font></legend>			
		<img src='img/folderbk.png' width='60' height='60' onClick='migracionSGH()'>		
	<br>
	</fieldset>
	</td><td width='120'align='center'>
	<fieldset>
	<legend align='left'><font color='blue'>Backup</font></legend>			
		<img src='img/backup.png' width='60' height='60' onClick='reportebackup()'>		
	<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>