CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Dynamically change image link property

Print topic Send  topic

Author Message
Zulu


Posts: 33
Posted: 09/09/2004, 10:55 AM

having trouble using image link. I have a page that shows an imagelink depending on a value in my db.

Let's say the field is a boolean and named isused. If the isuded is true the imagelink will an image and show the corresponding link. And if the isused contains false tha imagelink will show a different image and show no link.

PLS HELP
View profile  Send private message
dataobjx


Posts: 181
Posted: 09/09/2004, 11:07 AM

An alternative to using the Image link is to use a label field.

This is in .asp but you'll likely be able to translate it.

Function GRID_NAME_lblIssued_Before_Show()
Dim blnIssued
Dim sResult
Dim imageIssued
Dim imageNotIssued

imageIssued = "<image src=""../images/checkbox.gif"">"
imageNotIssued = "<image src=""../images/uncheckedbox.gif"">"

blnIssued = GRID_NAME.datasource.recordset.fields("Issued")
If blnIssued Then
sResult = imageIssued
Else
sResult = imageNotIssued
End If
GRID_NAME.lblIssued.value = sResult
End Function
_________________
www.DataObjx.net
www.mydigitalapps.com
View profile  Send private message
Zulu


Posts: 33
Posted: 09/11/2004, 6:56 AM

Thanks. I converted it to php and it worked fine. Thanks
View profile  Send private message
wayne186

Posts: 30
Posted: 01/01/2005, 3:10 PM

I am trying to do the same thing Zulu, can you post the code and how / where you placed it on your form. I am doing a php site and I have a grid with a report of appointments for the day, I want to show an image of a dollar bill called checkout.gif which leads to the checkout 1.php page if the boolean value in appointment_checkin is true in my database and an image called completed.gif with no link if the value is false.

I am afraid I am very much a gui kinda guy and so my coding experience is pretty poor. I am pretty much up to speed with CCS though and would appreciate a little guidance.

cheers. Wayne
View profile  Send private message
Zulu


Posts: 33
Posted: 01/01/2005, 11:59 PM

Use the following code in before show event. Pls note that the label Label1 used here (in your html page) has the HTML content type. Taking into account that appontment_checkin is the variable that comes from database query result.
--------------------------------------------------

Global $Label1;
if (appointment_checkin==false) {
$Label1->setvalue("<IMG SRC='./Images/completed.gif'>");
}
else {
$Label1->setvalue("<A HREF='./checkout1.php'><IMG SRC='./Images/checkout.gif'></A>");
}
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.