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

//$ugid='SCPHU1';
//$idj='1';
//$ids='2';
$sqlusu="select concat(up_nom,' ',up_apepat) as nom from tb_usuprog where ug_id='$ugid'";
$resultusu = mysql_query($sqlusu);
while ($row= mysql_fetch_array($resultusu)){
$usunombre = $row['nom'];
}
//conuslta jefatura
$sqlj="select j_desc from tb_jefatura where j_id='$idj'";
$resultj = mysql_query($sqlj);
while ($rowj= mysql_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 = mysql_query($sqlsj);
while ($rowsj= mysql_fetch_array($resultsj)){
$subjefatura = $rowsj['s_desc'];
}

//construytento listado
$sqllistado = "select a.ug_id as cod, a.ua_apepat as apepat, a.ua_apemat as apemat, a.ua_nom as nombre ";
$sqllistado = $sqllistado." from tb_usuasist a inner join tb_usudep b on ";
$sqllistado = $sqllistado." a.ug_id = b.ug_id where b.j_id='$idj' and b.s_id='$ids' and (a.ua_estado= 1 or a.ua_estado= 2) order by apepat, apemat, nombre";
//$sqllistado = $sqllistado." a.ug_id = b.ug_id where b.j_id='$idj' and b.s_id='$ids' and b.tp_id=1 and a.ua_idespec='2'";
//echo $sqllistado;
$resultlistado = mysql_query($sqllistado);
$sumap=0;
while ($rowl= mysql_fetch_array($resultlistado)){
$codigo=$rowl['cod'];
$apepat=$rowl['apepat'];
$apemat=$rowl['apemat'];
$nombre=$rowl['nombre'];
$letranom=substr($nombre, 0, 2);
$letraapemat=substr($apemat, 0, 2);
$nombrefijo= $letranom.". ".$apepat." ".$letraapemat.".";
$cadenalis=$cadenalis."<option value='".$codigo."' ";
$sumap=$sumap+1;
if($sumap==1){
$cadenalis=$cadenalis." selected ";
if($rowl['cod']!=''){
$primercodigo=$rowl['cod'];
}
}
$cadenalis=$cadenalis.">".$nombrefijo."</option>";

}
$cadenalis=$cadenalis."</select>";

//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='$primercodigo' order by dm_fechaini desc";
//echo $sqldm;
$resultdm = mysql_query($sqldm);
$cadenadm="<select size='4' style='width:22em;' id='dmselect' name='dmselect' ondblClick='modificardm()'>";
//$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>";

//seleecionado vacaciones programadas
$sqlvacaprog="select v_id as id, concat(date_format(v_fechaini,'%d/%m/%Y'),' - ', date_format(v_fechafin,'%d/%m/%Y'),' (', v_numdias,')') ";
$sqlvacaprog=$sqlvacaprog." as dias, v_periodo as periodo from tb_vacaciones where ug_id='$primercodigo' and v_estado=0 order by v_fechaini desc";
$resultvacaprog = mysql_query($sqlvacaprog);
$cadenavp="<select size='4' style='width:23em;' ondblClick='modificarestado()' id='listfechavp'>";
while ($rowvp= mysql_fetch_array($resultvacaprog)){
$codigo=$rowvp['id'];
$dias=$rowvp['dias']." ".$rowvp['periodo'];
$cadenavp=$cadenavp."<option value='".$codigo."'>".$dias."</option>";
}
$cadenavp=$cadenavp."</select>";

//seleecionado vacaciones ejecutadas
$sqlvacaeje="select v_id as id, concat(date_format(v_fechaini,'%d/%m/%Y'),' - ', date_format(v_fechafin,'%d/%m/%Y'),' (', v_numdias,')') ";
$sqlvacaeje=$sqlvacaeje." as dias, v_periodo as periodo from tb_vacaciones where ug_id='$primercodigo' and v_estado=1 order by v_fechaini desc";
$resultvacaeje = mysql_query($sqlvacaeje);
$cadenave="<select size='4' style='width:23em;'>";
while ($rowve= mysql_fetch_array($resultvacaeje)){
$codigo=$rowve['id'];
$dias=$rowve['dias']." ".$rowve['periodo'];
$cadenave=$cadenave."<option value='".$codigo."'>".$dias."</option>";
}
$cadenave=$cadenave."</select>";



//seleccionando al combo tipo de personal
$sqltpersonal = "select 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'>";
$cadenatp = "<option value='0'>TODOS</option>";
while ($rowtp= mysql_fetch_array($resulttpersonal)){
$cadenatp=$cadenatp."<option value='".$rowtp['cod']."'";
if($idtp==$rowtp['cod']){
$cadenatp=$cadenatp." selected ";
}
$cadenatp=$cadenatp." >".$rowtp['descripcion']."</option>";
}
$cadenatp=$cadenatp."</select>";

//seleccionando al comnbo especialidad
$sqlespecialidad = "select a.ua_idespec as cod, (select esp_desc from tb_especialidad where ua_idespec=a.ua_idespec) as descripcion from tb_areaespecialidad a where a.j_id='$idj' and a.s_id='$ids'";
//echo $sqlespecialidad;
$resultespecialidad = mysql_query($sqlespecialidad);
$cadenaesp = "<option value='0'>TODOS</option>";
//$cadenaesp="<select id='especialidad' name='especialidad'>";
while ($rowe= mysql_fetch_array($resultespecialidad)){
$cadenaesp=$cadenaesp."<option value='".$rowe['cod']."'";
if($idesp==$rowe['cod']){
$cadenaesp=$cadenaesp." selected ";
}
$cadenaesp=$cadenaesp.">".$rowe['descripcion']."</option>";
}
$cadenaesp=$cadenaesp."</select>";

//armando grupo correo
$sqldepa="select j_id as codj, 0 as cods ,j_abrev as nom from tb_jefatura where j_id='$idj'";
$sqlserv="select j_id as codj, s_id as cods, s_abrev as nom from tb_servicio where j_id='$idj'";
$resultdepa = mysql_query($sqldepa);
$resultserv = mysql_query($sqlserv);

$cadenamail="<table align='center' class='FacetFormTABLE'>";
$cadenamail=$cadenamail."<tr><td class='FacetFieldCaptionTDT' colspan='2' align='center'>MENSAJERIA</td></tr>";
$cadenamail=$cadenamail."<tr><td><b>Seleccione Remitente:</b></td><td><b>Escribe Mensaje:</b></td></tr><tr><td>";
$cadenamail=$cadenamail."<table align='center' class='FacetFormTABLE' height='150'>";
while ($rowj= mysql_fetch_array($resultdepa)){
$cadenamail=$cadenamail."<tr><td><input type='radio' id='msn' name='msn' value='".$rowj['cods']."'>".$rowj['nom']."</td></tr>";
}
while ($rows= mysql_fetch_array($resultserv)){
$cadenamail=$cadenamail."<tr><td><input type='radio' id='msn' name='msn' value='".$rows['cods']."'>".$rows['nom']."</td></tr>";
}
$cadenamail=$cadenamail."</table></td><td>";
$cadenamail=$cadenamail."<table align='center' class='FacetFormTABLE' height='150'>";
$cadenamail=$cadenamail."<tr><td align='center'><textarea name='msntexto' id='msntexto' cols='28' rows='6'></textarea></td></tr>";
$cadenamail=$cadenamail."</table></td></tr><tr><td align='center' colspan='2'><input type='button' value='Enviar' class='FacetButton' onClick='enviarmail()'></td></tr></table>";
		
//leer los mensajes enviados
$sqlmail = "select b.m_id as idm, b.ug_ids as cod, date_format(b.fecha,'%d/%m/%Y %h:%i:%s %p') as dia, a.ua_apepat as apepat, ";
$sqlmail = $sqlmail." a.ua_apemat as apemat, a.ua_nom as nombre from tb_mensajeria b inner join tb_usuasist a on a.ug_id=b.ug_ids ";
$sqlmail = $sqlmail." where b.j_id='$idj' and b.s_id='$ids' order by dia asc";
//echo $sqlmail;

$resultmail = mysql_query($sqlmail);
$cadenaleermail="<table align='center' class='FacetFormTABLE' width='300'><tr><td class='FacetFieldCaptionTDT' align='center'>BUZON DE MENSAJES</td></tr><tr><td><b>Seleccione Mensaje:</b></td></tr>";
$cadenaleermail=$cadenaleermail."<tr><td><table align='center' class='FacetFormTABLE' width='100'><tr><td class='FacetFieldCaptionTD' align='center'>Fecha y Hora Env</td><td class='FacetFieldCaptionTD' align='center'>Remitente</td><td class='FacetFieldCaptionTD' align='center'>Eliminar</td></tr>";
$cadenaleermail=$cadenaleermail."<tr><td colspan='2'><select id='leermail' name='leermail' size='6' onClick='funleermail()'>";
$p=0;
while ($rowm= mysql_fetch_array($resultmail)){
$codigo=$rowm['cod'];
$apepat=$rowm['apepat'];
$apemat=$rowm['apemat'];
$nombre=$rowm['nombre'];
//$letranom=substr($nombre, 0, 1);
$letraapemat=substr($apemat, 0, 1);
$nombrefijo= $nombre." ".$apepat." ".$letraapemat.".";
$p=$p+1;
$idm = $rowm['idm'];
$codigo =$rowm['cod'];
$idcodigo=$codigo." ".$idm;
if($p==1){
$idm0 = $rowm['idm'];
$codigo0 =$rowm['cod'];
$cadenaleermail=$cadenaleermail."<option value='".$idcodigo."' selected>&nbsp;&nbsp;".$rowm['dia']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$nombrefijo."</option>";
}else{
$cadenaleermail=$cadenaleermail."<option value='".$idcodigo."'>&nbsp;&nbsp;".$rowm['dia']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$nombrefijo."</option>";
}
}
/// mensajes de las jefaturas
//leer los mensajes enviados
$sqlmail = "select b.m_id as idm, b.ug_ids as cod, date_format(b.fecha,'%d/%m/%Y %h:%i:%s %p') as dia, a.up_apepat as apepat, ";
$sqlmail = $sqlmail." a.up_apemat as apemat, a.up_nom as nombre from tb_mensajeria b inner join tb_usuprog a on a.ug_id=b.ug_ids ";
$sqlmail = $sqlmail." where b.j_id='$idj' and b.s_id='$ids' order by dia desc";
$resultmail = mysql_query($sqlmail);
while ($rowm= mysql_fetch_array($resultmail)){
$codigo=$rowm['cod'];
$apepat=$rowm['apepat'];
$apemat=$rowm['apemat'];
$nombre=$rowm['nombre'];
//$letranom=substr($nombre, 0, 1);
$letraapemat=substr($apemat, 0, 1);
$nombrefijo= $nombre." ".$apepat." ".$letraapemat.".";
$p=$p+1;
$idm = $rowm['idm'];
$codigo =$rowm['cod'];
$idcodigo=$codigo." ".$idm;
if($p==1){
$idm0 = $rowm['idm'];
$codigo0 =$rowm['cod'];
$cadenaleermail=$cadenaleermail."<option value='".$idcodigo."' selected>&nbsp;&nbsp;".$rowm['dia']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$nombrefijo."</option>";
}else{
$cadenaleermail=$cadenaleermail."<option value='".$idcodigo."'>&nbsp;&nbsp;".$rowm['dia']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$nombrefijo."</option>";
}
}

//////////
$sqlmensaje="select m_mail as mail from tb_mensajeria where  m_id ='$idm0' and  j_id='$idj' and s_id='$ids' and ug_ids='$codigo0'";

//echo $sqlmensaje;
$resultmensaje = mysql_query($sqlmensaje);
while ($rowmsn= mysql_fetch_array($resultmensaje)){
$mensaje = $rowmsn['mail'];
}
$cadenaleermail=$cadenaleermail."</select></td><td align='center'><a href=''><img src='img/b_edit.png' onClick='eliminarmail()'></a></td></tr></table><tr><td><b>Leer Mensaje:</b></td></tr><tr><td>";
$cadenaleermail=$cadenaleermail."<table align='center' class='FacetFormTABLE' height='80'><tr><td align='center'>";
$cadenaleermail=$cadenaleermail."<div id='divleermail'><TEXTAREA name='msnleer' rows='5' cols='33'>".$mensaje."</TEXTAREA></div>";
$cadenaleermail=$cadenaleermail."</td></tr></table></td></tr></table>";

?>
<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 listardescansomedico(){ 
   //alert("hola mundo");
	var idj = document.getElementById('idj').value;
	var ids = document.getElementById('ids').value;
	//alert(ugid);
    window.open("descansomedico/listardescanso.php?idj="+idj+"&ids="+ids,"","height=500,width=850,scrollbars=YES");
}

function listarvacaciones(){ 
   //alert("hola mundo");
	var idj = document.getElementById('idj').value;
	var ids = document.getElementById('ids').value;
	//alert(ugid);
    window.open("vacaciones/listarvacaciones.php?idj="+idj+"&ids="+ids,"","height=500,width=850,scrollbars=YES");
}

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 modificardm(){ 
   //alert("hola mundo");
	var ugid = document.getElementById('dmlist').value;
	var idfecha = document.getElementById('dmselect').value;
	//alert(ugid);
    window.open("editardesmed.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= "adminpersonalasistencial.php?idj="+idj+"&ids="+ids+"&ugid="+ugid;
    
}
function AdministrarVacaciones(){ 
   var idj = document.getElementById("idj").value;
   var ids = document.getElementById("ids").value;
   var ugid = document.getElementById("ugid").value;
   document.location= "vacapersonalasistencial.php?idj="+idj+"&ids="+ids+"&ugid="+ugid;
    
}
function iniprogramacion(){ 
   var idj = document.getElementById("idj").value;
   var ids = document.getElementById("ids").value;
   var ugid = document.getElementById("ugid").value;
   document.location= "../programacion/programacionpersonal.php?idj="+idj+"&ids="+ids+"&ugid="+ugid;
}

function inireprogramacion(){ 
   var idj = document.getElementById("idj").value;
   var ids = document.getElementById("ids").value;
   var ugid = document.getElementById("ugid").value;
   document.location= "../programacion/reprogramacionpersonal.php?idj="+idj+"&ids="+ids+"&ugid="+ugid;
}

function iniejecutaturno(){ 
   var idj = document.getElementById("idj").value;
   var ids = document.getElementById("ids").value;
   var ugid = document.getElementById("ugid").value;
   document.location= "../programacion/ejecutaturno.php?idj="+idj+"&ids="+ids+"&ugid="+ugid;
}

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

function LeerProgDiaria(){
var idj = document.getElementById("idj").value;
   var ids = document.getElementById("ids").value;
   var ugid = document.getElementById("ugid").value;
   var fecha = document.getElementById("fecha").value;
   //document.location= "../reporte/programaciondeldia.php?idj="+idj+"&ids="+ids+"&ugid="+ugid+"&fecha="+fecha;
   var cadena = "../reporte/reprogramaciondeldia.php?idj="+idj+"&ids="+ids+"&ugid="+ugid+"&fecha="+fecha;
   window.open(cadena,"","height=500,width=800");
}
</script> 
</head>
<body >
<form name='form1'>
<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 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='blue'>Programacion Asistencial</font></legend>
	<table width='250'  height='100' align='center'><tr>
	<td width='100'>
	<fieldset>
	<legend align='left'><font color='red'>Seleccion Fecha</font></legend>
	
		<table align='center' class='FacetFormTABLE' width='100'>
		<tr><td class='FacetFieldCaptionTDT' align='center'>PROGRAMACION DIARIA<td><tr>
		<tr><td>
		<input type='text' id='fecha' name='fecha' size='15' value='<?php if(isset($_GET['ugid'])){ echo $fechaing;}?>'>
		<button id="f_rangeStart_trigger">...</button>
                <button id="f_clearRangeStart" onclick="clearRangeStart()">clear</button>
                <script type="text/javascript">
				  var LEFT_CAL = Calendar.setup({
                    //cont: "cont",
                    //weekNumbers: true,
                    //selectionType: Calendar.SEL_MULTIPLE,
                    //showTime: 12
                    // titleFormat: "%B %Y"
					})
                  new Calendar({
                          inputField: "fecha",
                          dateFormat: "%d/%m/%Y",
                          trigger: "f_rangeStart_trigger",
                          bottomBar: false,
                          onSelect: function() {
                                  var date = Calendar.intToDate(this.selection.get());
								  LEFT_CAL.setLanguage('es');
                                  LEFT_CAL.args.min = date;
                                  LEFT_CAL.redraw();
                                  this.hide();
                          }
                  });
                  function clearRangeStart() {
                          document.getElementById("fecha").value = "";
                          LEFT_CAL.args.min = null;
                          LEFT_CAL.redraw();
                  };
                </script>
		</td></tr>
		<tr><td align='center'>
		<button type='button' id='progd' style='width:100px' class='FacetButton' onClick='LeerProgDiaria()'>Consultar</button>
		</td></tr>
		</table>
	<br>
	</fieldset>
	</td><td width='50'></td>
	<td width='100'>
	<fieldset>
	<legend align='left'><font color='red'>Seleccion Opcion</font></legend>
	<br>
	<button type='button' id='pprog' style='width:150px' class='FacetButton' onClick='iniprogramacion()'>Programacion</button><br><br>
	<button type='button' id='pprog' style='width:150px' class='FacetButton' onClick='inireprogramacion()'>Reprogramacion</button><br><br>
	<button type='button' id='pprog' style='width:150px' class='FacetButton' onClick='iniejecutaturno()'>Ejecucion</button>
	<br>
	</fieldset>
	</td>
	</tr>
	<tr><td colspan='2' align='center'><button type='button' id='pprog' style='width:150px' class='FacetButton'onClick='AdministrarPersonal()'>Administracion Personal</button><br><br><button type='button' id='pprog' style='width:150px' class='FacetButton'onClick='AdministrarVacaciones()'>Administrar Vacaciones</button></td>
	<td align='center'><br><button type='button' id='pprog' style='width:150px' class='FacetButton' onClick='reporteProg()'>Reportes</button></td>
	</tr>
	</table></fieldset>
	<br>
	<fieldset>
	<legend align='left'><font color='blue'>Descanso Medico del Personal Asistencial</font></legend>
	<br>
		<table align='center' class='FacetFormTABLE' width='350'>
		<tr><td class='FacetFieldCaptionTD'colspan='3'><center>DESCANSO MEDICO</center></td></tr>
		<tr><td align='right'>Seleccione Tipo:</td><td colspan='2'>
					<?php echo "<select id='tipopersonaldm' name='tipopersonaldm' onChange='listarpersonaldiv(1)'>".$cadenatp; ?>
				    </td></tr>
		<tr><td align='right'>Especialidad:</td><td colspan='2'>
					<?php echo "<select id='especialidaddm' name='especialidaddm' onChange='listarpersonaldiv(1)'>".$cadenaesp; ?>
				    </td></tr>
		<tr><td align='center' colspan='3'>
			<table width='300'><tr><td width='160' align='center'>
				<div id='divdm'>
				<select name='dmlist' id='dmlist' size='4' style='width:22em;' onClick='listarfechadm()' onload='listarfechadm()'>
				<?php echo $cadenalis;?>
				</div>
				</td><td width='160' align='center'>
				<div id='fechadm'>
				<?php echo $cadenadm; ?>
				</div>
				</td><td align='center'>
				</select><img src='img/agregar.jpg' width='30'  height='30' onClick='agregarDM()'><br>
				<img src='img/reporte.png' width='30'  height='30' onClick='listardescansomedico()'>
				</td></tr>
				</table>
		</td></tr>
		</table>
	  <br>
	</fieldset>
	
	<br>
	<fieldset>
	<legend align='left'><font color='blue'>Vacaciones del Personal Asistencial</font></legend>
	<br>
		<table align='center' class='FacetFormTABLE' width='350'>
		<tr><td class='FacetFieldCaptionTD'colspan='3'><center>VACAC. PROGRAMADAS</center></td></tr>
		<tr><td align='right'>Seleccione Tipo:</td><td colspan='2'>
					<?php echo "<select id='tipopersonalvacaprog' name='tipopersonalvacaprog' onChange='listarpersonaldiv(2);listarvacaprog()'>".$cadenatp; ?>
				    </td></tr>
		<tr><td align='right'>Especialidad:</td><td colspan='2'>
					<?php echo "<select id='especialidadvacaprog' name='especialidadvacaprog' onChange='listarpersonaldiv(2);listarvacaprog()'>".$cadenaesp; ?>
				    </td></tr>
		<tr><td align='center' colspan='3'>
			<table width='300'><tr><td width='160' align='center'>
				<div id='divvacaprog'>
				<select id='vacaproglist' name='vacaproglist' style='width:22em;' size='4' onClick='listarvacaprog()' onload='listarvacaprog()'>
				<?php echo $cadenalis;?>
				</div>
				</td><td width='160' align='center'>
				<div id='vacaprog'>
				<?php echo $cadenavp; ?>
				</div>
				</td><td align='center'>
				<img src='img/agregar.jpg' width='30'  height='30' onClick='agregarVacaProg()'>
				<img src='img/reporte.png' width='30'  height='30' onClick='listarvacaciones()'>
				</td></tr>
				</table>
		</td></tr>
		</table>
		<br>
		<table align='center' class='FacetFormTABLE' width='350'>
		<tr><td class='FacetFieldCaptionTD'colspan='3'><center>VACAC. EJECUTADAS</center></td></tr>
		<tr><td align='right'>Seleccione Tipo:</td><td colspan='2'>
					<?php echo "<select id='tipopersonalvacaeje' name='tipopersonalvacaeje' onChange='listarpersonaldiv(3);listarvacaeje()'>".$cadenatp; ?>
				    </td></tr>
		<tr><td align='right'>Especialidad:</td><td colspan='2'>
					<?php echo "<select id='especialidadvacaeje' name='especialidadvacaeje' onChange='listarpersonaldiv(3);listarvacaeje()'>".$cadenaesp; ?>
				    </td></tr>
		<tr><td align='center' colspan='3'>
			<table width='300'><tr><td width='160' align='center'>
				<div id='divvacaeje'>
				<select id='vacaejelist' name='vacaejelist' style='width:22em;' size='4' onClick='listarvacaeje()' onload='listarvacaeje()'>
				<?php echo $cadenalis;?>
				</div>
				</td><td width='160' align='center'>
				<div id='vacaeje'>
				<?php echo $cadenave; ?>
				</div>
				</td></tr>
				</table>
		</td></tr>
		</table>
	<br>
	</fieldset>
	</td><td></td><td width='200' align='center'>
	<div id='divmail'>
	<div id='divlecturamail'>
			<?php echo $cadenaleermail; ?>
	</div>
	<br>
	
	    <?php echo $cadenamail; ?>
	</div>
	</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>