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
|
 |
 |
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 |
 |
 |
Zulu
Posts: 33
|
| Posted: 09/11/2004, 6:56 AM |
|
Thanks. I converted it to php and it worked fine. Thanks
|
 |
 |
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
|
 |
 |
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>");
}
|
 |
 |