<?php

include("../bd/sql_variables.php");
$con= mysqli_connect("$sql_host", "$sql_usuario", "$sql_pass","$sql_db") or die(header ("No Disponible Servidor de Base de Datos"));


$idj=$_GET['idj'];
$ids=$_GET['ids'];
$idtp=$_GET['idtp'];
$idga=$_GET['idga'];
$ida=$_GET['ida'];
$idh=$_GET['idh'];

$asksql = "select * from areahora where j_id='$idj' and s_id='$ids' and a_id='$ida' and ga_id='$idga' and h_id='$idh'";
//echo $asksql;
$resultask = mysqli_query($con,$asksql);
if(mysqli_num_rows($resultask)==0){
$insertsql ="insert into areahora values('$ids','$idj','$ida','$idga','$idh','1')";
$resultserv = mysqli_query($con,$insertsql);
echo "<script type='text/javascript'>window.opener.location.reload(); window.close();</script>";
}

?>