Page 1 of 1

Else If

Posted: Fri Mar 05, 2010 6:15 am
by Jay87
I have the following else if statement (i edited out most of the echo):

Code: Select all

if     ($days>2 && ($item['statusid']<2) && ($_SESSION['level']>2)) [color=#FF0000]{[/color]
         echo "<tr  style=\"color:green;\".............
[color=#FF0000]}[/color] elseif ((($date2-$date1)/60)>-15 && $item['date']==NULL)  [color=#FF8000]{[/color] 
     echo "<tr  style=\"color:orange;\".............
[color=#FF8000]}[/color] elseif ($item['priority']==1 && ($_SESSION['level']>2)) [color=#FF0000]{[/color]
     echo "<tr  style=\"color:red;\".............
[color=#FF0000]}[/color] elseif ($item['statusid']==15 && ($_SESSION['level']>2)) [color=#FF0000]{[/color]
    echo "<tr onclick=\"document.location='viewcall.php?id=".............
[color=#FF0000]}[/color] elseif ($_SESSION['level']>2) [color=#FF8000]{[/color]
    echo "<tr onclick=\"document.location='viewcall.php?id=".............
[color=#FF8000]}[/color] else   [color=#FF0000]{[/color]
    echo "<tr onclick=\"document.location='viewcall.php?id="............
[color=#FF0000]}[/color]
I am unsure about the brackets used in the statement i.e.

Code: Select all

if     [color=#FF0000]([/color]$days>2 && [color=#0000FF]([/color]$item['statusid']<2[color=#0000FF])[/color] && [color=#008000]([/color]$_SESSION['level']>2[color=#008000])[/color][color=#FF0000])[/color]
As the code runs but not exactly as it should but doesn't stop the page from loading...

Am i using the brackets right in the Else If statement?

Re: Else If

Posted: Fri Mar 05, 2010 8:06 am
by Jay87
Anyone?

Re: Else If

Posted: Fri Mar 05, 2010 2:40 pm
by jraede
I don't see where you're trying to stop the page from loading...? The code looks like it should work.