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

//listado de horas permiso
$sqlhper="SELECT hrp_id as id, ug_id as cod, concat(date_format(hrp_fecha,'%d/%m/%Y'),'-',date_format(hrp_horaini,'%k:%i %p'),'-',date_format(hrp_horafin,'%k:%i %p'),' (',hrp_numhora,')') as hora "; 
$sqlhper=$sqlhper." FROM tb_horapermiso where  ug_id='$ugid' order by hrp_fecha desc";

echo $sqlhper;

$resulthper = mysqli_query($con, $sqlhper);
$cadenahrsper="<select size='4' style='width:22em;' id='hrselect' name='hrselect' ondblClick='modificarhrsper()' onClick='listarhrsfechalic()'>";
//$cadenadm="<select size='4' style='width:22em;' id='dmselect' name='dmselect'>";
while ($rowhper= mysqli_fetch_array($resulthper)){
$codigo=$rowhper['id'];
$horas=$rowhper['hora'];
$cadenahrsper=$cadenahrsper."<option value='".$codigo."' >".$horas."</option>";
$sqldmdetalle ="";
}
$cadenahrsper=$cadenahrsper."</select>";

///
echo $cadenahrsper;


				
?>