Hello all
<P>I posted this message yesterday </P>
<P>Hello I am trying to create a graphic grid that will update the graphics according to what is in a paticular field within a mysql table. The grid is a representation of a theater seating section with lets say 50 seats. If the Ticket is available for a paticular seat, then the graphic on the grid associated with that seat would be Green. If the ticket has been sold then the graphic is red. Curently I have been able to get the graphic to update with the following code. </P>
<P><?php echo RegExpMatch ($Graphics->Value("Status", "Sold", true, "<img src=red.gif>", "<img src="green.gif>"
?></P>
<P> Now here is the problem. The above code works great if there are only two options in the Ticket Status Field, Sold and Available, but there are four possible options in the Ticket Status Field. They are as follows; Sold, Available, Season Holder and No Sale. I would like to replace the graphic with a blue image if the ticket is a Season Holder Ticket and replace the graphic with a black image if the Ticket is a No Sale Ticket. How would I or what would I do to the above code to get it to work with the four options. </P>
<P>Thanks Stan Forrest </P>
<P></P>
<P>Well needless to say nobody replied to the post leaving me to ponder the answer to my problem. I am making this post hoping that the answer to the above code will help someone else in the same situation. The answer to the code is as follows.</P>
<P> <b>Original Problem Code</b> <BR>
<?php echo RegExpMatch ($Graphics->Value("Status", "Sold", true, "<img src=red.gif>", "<img src=green.gif>"
?></P>
<P><b>Corrected Code<BR>
</b><?php echo RegExpMatch ($Graphics->Value("Status", "(Sold|Available|SeasonHolder|NoSale)", true, "<img src='\$1.gif'>", "<img src='failure.gif'>"
?></P>
<pre>
<FONT face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Notice that I added all of the variables to the known types in the following code<BR>
</FONT><font face="arial" color="red">("Sold|Available|SeasonHolder|NoSale"
<FONT color="black" face="arial">I then constructed four images with exactly the same name as the known types. I then added the variable <BR>
</FONT><FONT color="red" face="arial"><img src='\$1.gif'> </FONT><FONT color="black" face="arial">
This variable would then be replaced by the appropraite images depending upon what was in the Status field for a paticular record. Also please note that is it very important to protect the $ in $1.gif with a backslash
Hope this helps someone else in the same situation. Please note that the above code will work using the RegExpressionMatch function in Adobe Go-Live Version 6.
Thanks
Stan Forrest</FONT>