Please help - Running background process in a menu

Hi -

Please can someone help me here.

I am trying to implement an alarm routine when the user has brought up our menu.
I’m currently using the below, which calls “geoFenceAlertOpaque”, geoFenceAlertOpaque checks to see if there are any alerts, and if so launches a modal app (called Alerts). Alerts then pop’s up showing the Alert etc.

PROBLEM:
It constantly refreshes the entire page, which I do not want to happen.
What I want to happen is the menu not be refreshed each time.

file_get_contents(“https://xxxxxxxxx/geoFenceAlertOpaque/geoFenceAlertOpaque.php?clientID=".$clientID."&userID=”.$userID);
$relrunAlert="<script>
setTimeout(function () { window.location.reload(); }, 10000);
//// just show current time stamp to see time of last refresh.
document.write(new Date());
</script>";
echo $relrunAlert;

I was thinking of a stored procedure to launch the Alerts app as new alerts are reported into the table, but:

  • I have never worked with stored procedures
  • I have no idea where to add it to the menu, nor what code to put in.
Please can someone help.

Thanks in advance.