<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>Hi Ilham,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>To support multiple (any number) of criteria would be
more DHTML than PHP work, because of having to support any number of search
fields. It could be done, but at this stage I can't afford the time to do
it.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>By default it does a case-insensitive "string
contains". I don't really see much value in changing that. I don't want to add
clutter with controls that nobody would use, such as a "case sensitive"
checkbox.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>There is another way to achieve multiple-attribute
query, however. When MapServer does a PostGIS query, it does not
actually hardcode the attribute name, which makes it possible to put in any
"WHERE" syntax that PostGIS allows. To take advantage of this, make these
changes to searchlayers.phtml</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>on line 326-333 of searchresults.phtml, replace these
lines:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007> if
(!(is_numeric($searchstring)))</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007> {</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007> [...]</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007> }</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>with:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007> if
(strpos($searchstring,"=") === false) // allow use of postgis functions for
anything that sits between [ ], else do string
comparison<BR>
{<BR> if
(!(is_numeric($searchstring)))<BR>
{<BR>
$searchstring = Chr(34)."Lower(".$searchfield.") like
'%".strtolower($searchstring)."%'".Chr(34); // additional quotes due to PostGIS
related
bug<BR>
}<BR>
else<BR>
{<BR>
$searchstring =
$searchfield."=".$searchstring;<BR>
}<BR>
}<BR>
else<BR>
{<BR> $searchstring =
Chr(34).substr($searchstring, 1,
strlen($searchstring)-1).Chr(34);<BR>
}</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>By doing this, a user can specify a multi-attribute
query by preceding it with an equals sign. For example, you could use this as a
search string:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>=color like 'blue' AND number=5 AND (<SPAN
class=784043906-10052007><FONT size=2>date>'1 oct 2006' OR <SPAN
class=784043906-10052007><FONT size=2>date<'1 oct
2004')</FONT></SPAN></FONT></SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT><FONT face=Arial color=#0000ff
size=2><SPAN class=784043906-10052007><FONT
size=2></FONT></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007><FONT size=2>This is not a clean solution, but
hopefully an acceptable compromise.</FONT></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>regards,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007>Jacob</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=784043906-10052007></SPAN></FONT> </DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Ilham Adi Afdillah
[mailto:ilham.adi@gmail.com] <BR><B>Sent:</B> 10 May 2007 09:15<BR><B>To:</B>
Delfos, Jacob<BR><B>Cc:</B> chameleon@lists.maptools.org<BR><B>Subject:</B>
LocateByAttribute and WebGIS Analysis<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Hi Jacob and list,</DIV>
<DIV> </DIV>
<DIV>Jessica Fendos (on Wed Mar 21 16:48:17 2007) may have ask this(first)
questions.<BR>1. I try to add more field for the other criteria of my query
(multiple query),<BR>For the example : <BR><U>First Criteria :</U> I want the
user can search on LAYER1 from field SIZE, then they input the size of the
area in text field, <BR>and the <U>second criteria</U> : I want the user can
search on same layer (LAYER1) from field TYPE then they input blabla.. in text
field.<BR>so the result will match that 2 criteria.<BR>Can you tell me the
step by step to realize this, because I'm not really good enough in php?.
</DIV>
<DIV>
<P>2. is that query on LocateByAttribute use SQL operators 'AND' by default or
if I have to change it by myself, which file/line should I change to get the
multiple query result that using 'AND' SQL operators. I need to add it if the
first question can be realize. Because I'm feel it will can be used to GIS
Analysis on the web. </P>
<P>3. How Can I used the 'Match Case' and/or 'Macth Word Only' in the
LocateByAttribute widget.</P>
<P>Note : I store data in PostGIS/PostgreSQL</P>
<P> </P>
<P>Best Regards,</P>
<P> </P>
<P>Ilham Adi A.</P></DIV></BLOCKQUOTE></BODY></HTML>
<table><tr><td bgcolor=#ffffff><font color=#000000>This email and any attachments are intended solely for the named recipient and are confidential. The copying or distribution of them or any information they contain by anyone other than the named recipient is prohibited. If you have received this document in error, please notify the sender and delete all copies from your computer system and destroy all hard copies. It is the recipient's responsibility to check this email and any attachments to this email for viruses before use.<br>
</font></td></tr></table>