Page 1 of 1

Alert stops responding

Posted: Fri Dec 31, 2010 8:54 am
by batowiise
Hi all,

The code below is supposed to pop up an alert based on the condition specified. It works fine for about six (6) entries or transaction. On the seventh transaction, the alert stops responding.

<?php
session_start();
$username = $_SESSION['username'];

require_once("admin/db.php");
$result = mysql_query("SELECT * FROM users WHERE username='$username'") or die(mysql_error());
$rs = mysql_query("SELECT * FROM generalclaims") or die(mysql_error());
$rsdepartment = mysql_query("SELECT * FROM generalclaims WHERE department='FINANCE'") or die(mysql_error());
$rsgenapprovallevel = mysql_query("SELECT * FROM generalclaims") or die(mysql_error());

$pettycashapprover = mysql_result($result,0,'pettycashapprover');
$approvallevel = mysql_result($result,0,'approvallevel');
$userdepartment = mysql_result($result,0,'department');
$systemapprovallist = mysql_result($rs,0,'systemapprovallist');
$gendepartment = mysql_result($rsdepartment,0,'department');

if($_SESSION['username'] == $username && $pettycashapprover == 'YES' && $approvallevel == 'FIRST' && $userdepartment == 'FINANCE' && $systemapprovallist == 'FIRST'&& $gendepartment == 'FINANCE')
{
echo"<script>alert('Issues Pending for your approval.');</script>";
}

elseif($_SESSION['username'] == $username && $pettycashapprover == 'YES' && $approvallevel == 'SECOND' && $systemapprovallist == 'SECOND')
{
echo"<script>alert('Issues Pending for SECOND your approval.');</script>";
}

elseif($_SESSION['username'] == $username && $pettycashapprover == 'YES' && $approvallevel == 'THIRD' && $systemapprovallist == 'THIRD')
{
echo"<script>alert('Issues Pending for THIRD your approval.');</script>";
}
?>

I have cross checked the records in the database and everything is fine from the records in the database.

Can anyone help me out?

Regards.

Re: Alert stops responding

Posted: Sat Jan 01, 2011 5:33 am
by social_experiment
batowiise wrote:It works fine for about six (6) entries or transaction
Is this a pattern? The problem could be with the conditions that has to be met each time.