Hey All,
I have a php script in 'jsAlerts.php' which calls an alert in 'alerts.js' on condition of an empty query result from a specific table.
Upon clicking the resulting alert's 'OK' button users are redirected to the php module wherein the undesired empty table condition may be remedied. However, the alert is triggered with just about every mouse click even while endeavoring to remedy the empty result condition (adding records to the table). How might I alter this script to call the alert -- say... every 5 minutes while the condition is true?
//Prep periodAlert query
if ($today == date ('Y-m-d')){
$period_time_end = $timedate->handle_offset(date("Y-m-d H:"), $timedate->dbDayFormat, false);
$select_emailman = " SELECT id, deleted FROM emailman WHERE id !='' AND deleted !=1 ";
$result = mysql_query($select_emailman)or die ("Query failed - select_emailman"); // Run the query.
$numresults=mysql_query($select_emailman);
$numrows=mysql_num_rows($numresults);
// If we have no results, periodAlert
if ($numrows == 0){
$this->periodAlert();
}
}
Here's the alert
function periodAlert(){
var r=confirm("Press a button")
if (r==true)
{
window.location = 'index.php?action=DetailView&module=Campaigns&action=index'
}
}
Thanks in advance!