Jump to content


Photo

Change colour of text after an if statement


  • Please log in to reply
15 replies to this topic

#1 simon_c

simon_c
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 October 2006 - 02:31 PM

Hi

I've been using PHPmaker, so cheated and don't know any PHP code really

I just want the following to change the colour to red to highlight the fact that an order has not been paid for yet, perhaps the text should be bold as well

Can any one add

style="color: #FF0000;"

To

<?php
if ($x_Date_funds_received == "")
$x_Date_funds_received = "Out standing";
echo FormatDateTime($x_Date_funds_received,5); ?>

This would be a great help and finish this project of

Many thanks

Simon

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 08 October 2006 - 02:40 PM

example only.

<head>
<style type="text/css">

P
{
color:#ff0000;
font-weight: bold;
}

</style></head>

<?php
 
if ($x_Date_funds_received == "") 
$x_Date_funds_received = "<P>Out standing</p>"; 
echo FormatDateTime

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 08 October 2006 - 02:43 PM

<?php
 
if ($x_Date_funds_received == "") 
$x_Date_funds_received = "<b><P color='#ff0000'>Out standing</p></b>"; 
echo FormatDateTime

?>

<?php

$text="<b><P color='#ff0000'>Out standing</p></b>";
 
if ($x_Date_funds_received == "") 
$x_Date_funds_received = $text; 
echo FormatDateTime

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 simon_c

simon_c
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 October 2006 - 02:54 PM

Many thanks that's brilliant

#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 08 October 2006 - 03:01 PM

I will be relising a css tutoral for those that find it hard soon ok, just add me to your buddy list ok.

good luck.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#6 simon_c

simon_c
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 October 2006 - 03:30 PM

Spoke to soon, can get it bold but not red

$text="<b><P color='#ff0000'>Out standing</p></b>";
if ($x_Date_funds_received == "")
$x_Date_funds_received = $text;
echo FormatDateTime($x_Date_funds_received,5);

I can't modify the header as this is set by PHPmaker and causes errors

Any ideas why it will not pick up on the text colour ?

#7 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 08 October 2006 - 03:34 PM

Try simple name color red.

$text="<P color='red'>Out standing</p>";
if ($x_Date_funds_received == "") 
$x_Date_funds_received = $text; 
echo FormatDateTime($x_Date_funds_received,5);


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#8 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 08 October 2006 - 03:45 PM

$text="<p style='color:#f00; font-weight:bold;'>Outstanding</p>";

That should do it for you (or point the way to what you want)
Legend has it that reading the manual never killed anyone.
My site

#9 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 08 October 2006 - 03:46 PM

andy quick quistion is that example classed as a inline css.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#10 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 08 October 2006 - 03:47 PM

andy quick quistion is that example classed as a inline css.


Yes indeed.
Legend has it that reading the manual never killed anyone.
My site

#11 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 08 October 2006 - 03:53 PM

thank you.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#12 simon_c

simon_c
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 08 October 2006 - 04:01 PM

$text="<b><P color='red'>Unpaid</p></b>";
if ($x_Date_funds_received == "")
$x_Date_funds_received = $text;
echo FormatDateTime($x_Date_funds_received,5);

Still shows in black text, don't worry 'Bold' is good enough to highlight the upaid accounts. Must be contradicting other code for the text colour set by PHPmaker.

Thanks for your help

#13 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 08 October 2006 - 04:09 PM

ok mate that why i use my relly good trust worvy notepad
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#14 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 08 October 2006 - 08:20 PM

if ($x_Date_funds_received == "") 
    echo '<span style="color:red;">Amount Outstanding</span>';
else
    echo FormatDateTime($x_Date_funds_received,5);


#15 simon_c

simon_c
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 11 October 2006 - 06:46 PM

You beauty - that fixed it

Thanks mainewoods

#16 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 11 October 2006 - 08:33 PM

you are welcome




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users