Código PHP:
//ENTRADA DE PROVEEDORES Y VISITAS
if ($tarjeta = $_POST['cbarras2']){
$consulta2 = ("SELECT CONVERT(char(8), GETDATE(), 108) AS HORA");
$resultado2 = sqlsrv_query($conex,$consulta2);
while($lista = sqlsrv_fetch_array($resultado2)){
$HORA = $lista['HORA'];
}
$actualizar = "update proveedor_vis set horaout='$HORA'
where card_acceso='$tarjeta'
AND horaout is null";
header("Refresh: 1; URL=index.php");
$que = sqlsrv_query($conex,$actualizar,array(), array( "Scrollable" => SQLSRV_CURSOR_KEYSET ));
//sqlsrv_close($conex);
}
if($tarjeta >= '3000000' && $tarjeta <= '8000020')
$sql_emp_nogaf="SELECT * FROM empleados WHERE no_emp='$tarjeta'";
$resultado_nogaf=sqlsrv_query($conex,$sql_emp_nogaf, array(), array( "Scrollable" => SQLSRV_CURSOR_KEYSET ));
print'<script language="javascript">window.open("//192.168.100.5/bitacora/registro_entrada.php", "MsgWindow", "width=500, height=410, top=100, left=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes")</script>';
//FINALIZA REGISTRO