Gossamer Forum
Home : Products : DBMan : Customization :

Show image in the results?

Quote Reply
Show image in the results?
Hello,

Is it possible to show an image in my resulttable when a field has a specific value.
Example:
I have made an adressbook.
you can search for a persons phonenumber.
You type in the lastname and cityname and then you get a table with the results. This is working...
What i would like is the following
When a phonenumber starts with 06-53 you see also in the resulttable an image next to it.
like this:
06-53333333 Smile JOHN SMITH, NEW YORK
and another image when the number starts with 06-54
like this:
06-54333333 Blush WILIAM WEST, NEW YORK

My images are small JPG's (20px/20px) and are in my cgi-bin.
My DBMan is also in my cgi-bin
Does anybody know how to get this right.?
i've searched the forum already, but couldn't find anything that matches my problem.

greetings,
[removed by request]
The Netherlands (Europe)

Quote Reply
Re: Show image in the results? In reply to
Remembering your question regarding the syntax for your phone numbers I know what you are trying to do.

What I don't know how to do is to have it look at just the first part of your phone number fields to decide which graphic to display.

If you were just using specific images for each choice as:

06-1 - image1
06-2 - image2
06-57 - image3
06-967 - image4
06-53 - image5

You could just set something to define the photos like this:


$image1='img src="../images/06-1.gif" width="20" height="20" ALT="06-1" border=0 align=absmiddle'
$image2='img src="../images/06-2.gif" width="20" height="20" ALT="06-2" border=0 align=absmiddle'


if ($rec{'06nummer'} eq "06-1") {
print qq| $image1|;
}

else {

if ($rec{'06nummer'} eq "06-2") {
print qq| $image2|;
}

but since you do not have a select field which specifies each choice of phone I'm not sure how you would just check the beginning of the field to make the match?

Perhaps JPDeni will be back again soon and help to provide a solution.


Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Show image in the results? In reply to
Thanx LoisCSmile for your post!
I hope JPDeni knows how to do this.

greetings,
[removed by request]
The Netherlands (Europe)

Quote Reply
Re: Show image in the results? In reply to
Code:
if ($rec{'FieldName'} =~ /^06-53/) {
print qq|<image src=".....">|;
elsif ($rec{'FieldName'} =~ /^06-54/) {
print qq|<image src=".....">|;
}
You can tack on as many "elsif" statements as you want.

I wasn't gone. I was just busy over the weekend.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Show image in the results? In reply to
JP to the rescue Smile

Glad to see ya back! As always you are missed greatly when gone.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Show image in the results? In reply to
Hello JPDeni,
YiiiiHAaaaaaaa!! It's working great, Thanx..Smile

greetings,
[removed by request]
The Netherlands (Europe)