<?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");
//pregunta por ejecucion
if(isset($_GET['anno']) and isset($_GET['mes']) and isset($_GET['ids']) and isset($_GET['idj'])){
$anno=$_GET['anno'];
$mm=$_GET['mes'];
$ids=$_GET['ids'];
$idj=$_GET['idj'];
//$sqleje="SELECT * FROM tb_usuaprueba  where uap_anno='$anno' and uap_mes='$mm' and s_id='$ids' and j_id='$idj' and uap_tipoproc='3'";
$sqlrepro="select * from tb_horareprog".$anno." where uap_anno='$anno' and uap_mes='$mm' and hr_idserva='$ids' and j_id='$idj'";
$sqlejehrs="select * from tb_horaeje".$anno." where uap_anno='$anno' and uap_mes='$mm' and he_idserva='$ids' and j_id='$idj'";
//echo $sqlejehrs;
//$resulteje = mysqli_query($con,$sqleje);
$resultrepro = mysqli_query($con,$sqlrepro);
$resulthrseje = mysqli_query($con,$sqlejehrs);
if(mysqli_num_rows($resultrepro)==0 ){
echo "NO EXISTE PROGRAMACION DEL MES<br><input type='button' class='llenarnoboton' id='validaeje' name='validaeje' value='Generar Reporte' disabled>";
}else{
	
	if(mysqli_num_rows($resulthrseje)!=0){
	echo "<input type='button' class='llenarboton' id='validaeje' name='validaeje' value='Generar Reporte' onClick='GenerarReporte()' >";
	}else{
	echo "NO EXISTE EJECUCION DE TURNOS<BR><input type='button' class='llenarnoboton' id='validaeje' name='validaeje' value='Generar Reporte' disabled >";
	}
	
}
}
?>