Forums
This topic is locked
image filtering
21 Jun 2002 21:17:43 dave dave posted:
have a plan of an office area. i need to highlght vacant offices in another colour.the access d/base has the words "vacant" or "occupied" in the same coloumn.
how can i filter which image to show based if the unit is vacant or occupied..????
of course the images will be text paths held in a column of the database.
fairly new users so keep it simple please.
cheers
dave
Replies
Replied 21 Jun 2002 22:00:32
21 Jun 2002 22:00:32 David Thomas replied:
Give us a bit more info on how the Database is set up.
(table names etc..)
There are a number of ways to do what you want. You can filter the records with SQL, or use a true/false system and display images using the "If" statement. All of which will be easier for people to answer when they know how you set your DB up.
"Nobody ever said this stuff was easy"
(table names etc..)
There are a number of ways to do what you want. You can filter the records with SQL, or use a true/false system and display images using the "If" statement. All of which will be easier for people to answer when they know how you set your DB up.
"Nobody ever said this stuff was easy"
Replied 22 Jun 2002 17:07:00
22 Jun 2002 17:07:00 dave dave replied:
the map of the offices is cut up so each office is a separate image and is assemled on a page with tables to look like a single plan of an office complex
here's the science bit...
if a unit is vacant i have an identical image but a different color which needs to apear when vacant, thereby the office plan will show availible units highlighted. as units become empty or tenants move in the colum holding the words Vacant/Occupied is altered which will in turn alter which image appears in the plan..
the db is a single access table on an asp/vbscript page
no rockets science at all.
i imagine the text path to the images would go into two separate columns, one for normal occupied images and another for vacant units
i could do with a simple easy way to filter which image appears based on the words occupied/vacant
I know handcoding of html/dhtml in my sleep and a good understanding of j/script but i must confess i leave ultradev to generate the asp/vbscript stuff.
if any othe rinfo needed just post and i will reply asap as in a fair hurry to impress a possible new client with this
Replied 22 Jun 2002 20:06:44
22 Jun 2002 20:06:44 aegis kleais replied:
Well, as you're outputting the code to build the image of the office space, you could just do something like the following:
Make a recordset called rcdOffice and then apply the following code after it:
room1 = rcdOffice.Fields.Item("fldRoomAvailable".Value
if room1 = "yes" then room1Img = "/images/room1_available.gif"
if room1 = "no" then room1Img = "/images/room1_notavailable.gif"
And then later on in your code when you need to place the image you could use:
<img src="<%= room1Img %>"width=300 height=100 alt="room1">
Make sense?
Make a recordset called rcdOffice and then apply the following code after it:
room1 = rcdOffice.Fields.Item("fldRoomAvailable".Value
if room1 = "yes" then room1Img = "/images/room1_available.gif"
if room1 = "no" then room1Img = "/images/room1_notavailable.gif"
And then later on in your code when you need to place the image you could use:
<img src="<%= room1Img %>"width=300 height=100 alt="room1">
Make sense?
Replied 24 Jun 2002 22:16:29
24 Jun 2002 22:16:29 dave dave replied:
nice idea, will give it a go..I'm gratefull you took the time and will let you know how it goes..
anyone out there with any other way to solve my problem..just post here
anyone out there with any other way to solve my problem..just post here