<?php
//ini_set('display_errors',1);

date_default_timezone_set('America/Lima');
require_once ("../../config/Cado.php");
require_once("../hora/cHora.php");
$oHora = new cHora();
$dts=$oHora->mostrarTodos();
$num_rows= mysqli_num_rows($dts);

if($_POST['hini']==""){

$h = date('H');
$m = date('i');

if($m>30){
	$h = $h + 1;
	$m = '00';
}else if($m<30){
	$m = '30';
}


$val = $h.':'.$m.':00';
}
else{
	$val =  $_POST['hini'];
}

	while($dt1 = mysqli_fetch_array($dts))
	{
?>
	<option value="<?php echo $dt1['tb_hora_val']?>" <?php if($dt1['tb_hora_val']==$val)echo 'selected'?>><?php echo $dt1['tb_hora_nom']?></option>
<?php
	}
	mysqli_free_result($dts);
?>