Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
highlighting with db options with if statements
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 10/13/09 09:23 
Thanks that worked i see i had an extra ; in it compared to yours I was able to add a second if statement but get an error on the 3rd option is there anything special rules for more than 2 if statements


if ($_task['task_status'] == 'New') {
$dat[6]['style'] = 'background-color:#008000';
} else {
if ($_task['task_status'] == 'Completed')
$dat[6]['style'] = 'background-color:#FC0000';
} else {
if ($_task['task_status'] == 'Pending')
$dat[6]['style'] = 'background-color:#FFFF00';
}


_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 10/13/09 09:32 
"background-color: #FC0000;";

This would make no difference, it is part of the css not the php but it is only necessary if you have further css rules following it, eg "background-color: #FC0000; width: 50px; padding: 25px";

if ($_task['task_status'] == 'New') {
$dat[6]['style'] = 'background-color:#008000';
} else if($_task['task_status'] == 'Completed') {
$dat[6]['style'] = 'background-color:#FC0000';
} else if ($_task['task_status'] == 'Pending') {
$dat[6]['style'] = 'background-color:#FFFF00';
} else {
// catches everything else
$dat[6]['style'] = 'background-color:#FFFFFF';
}

Use "else if" for each if until the last one which can be just "else" to catch everything. Brackets are also in the wrong places


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 10/13/09 10:54 
Thanks for your help Steve it worked out perfect ....that was a good lesson.....


_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

< Previous12
 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.