<?php

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");

$ugid=$_GET['ugid'];


//listado de descanso medico
$sqldm="select dm_id as id, concat(date_format(dm_fechaini,'%d/%m/%Y'),' - ', date_format(dm_fechafin,'%d/%m/%Y'),' (', dm_numdias,')') ";
$sqldm=$sqldm." as dias, dm_obs from tb_descmed where ug_id='$ugid' order by dm_fechaini desc";
//echo $sqldm;
$resultdm = mysql_query($sqldm);
$cadenadm="<select size='4' style='width:22em;' id='dmselect' name='dmselect'>";
$cadenadm="<select size='4' style='width:22em;' id='dmselect' name='dmselect'>";
while ($rowdm= mysql_fetch_array($resultdm)){
$codigo=$rowdm['id'];
$dias=$rowdm['dias'];
$cadenadm=$cadenadm."<option value='".$codigo."'>".$dias."</option>";
$sqldmdetalle ="";
}
$cadenadm=$cadenadm."</select>";

//seleccionando al personal
$sqlp = "select concat(ua_apepat,' ',ua_apemat,' ',ua_nom) as nombre from tb_usuasist where ug_id='$ugid'";
//echo $sqltc;
$resultp = mysql_query($sqlp);
while ($rowp= mysql_fetch_array($resultp)){
$nombre = $rowp['nombre'];
}
?>
<html>
<head>
<title>DESCANSO MEDICO DEL PERSONAL ASISTENCIAL</title>
<link rel="stylesheet" type="text/css" href="styles/Style.css">
<script language="JavaScript">
function cerrarVentana(){
window.close();
}
</script>
<head>
<body>
<br><br>
<table align='center' class='FacetFormTABLE'>
<tr><td colspan='2' align='center' class='FacetFieldCaptionTDT'>PERSONAL ASISTENCIAL</td></tr>
<tr><td colspan='2' align='center'><?php echo $nombre; ?></td></tr>
<tr><td align='center' class='FacetFieldCaptionTDT'>DESCANSO MEDICO</td></tr>
<tr><td align='center'><?php echo $cadenadm; ?></td></tr>
<tr><td align='center'><input type='button' value='Cerrar' onClick='cerrarVentana()'></td></tr>
</table>
</body>
</html>