[maplab-users] code for custom query (Sorry for previous mail)

charley cheng chengcharlie2003 at yahoo.ca
Thu Aug 19 00:31:09 EDT 2004


Hi! Alberto,
For unknown reasons, my previous mail has been cut. I am terrible sorry for it! I have to send again.
 
Thank you very much  for you code! I  really need the code to display the only attributes in shapefile I want display.
 
Could you give me a little more explaination about your code?
INFO, NUM_FOGLIO, NUM_PART, AREA are the attributes in shapefile you want to display.
What is INFO_ID and ESPR1?
 
Thank you very much!
 
Charlie

Alberto Cavalli <alberto.cavalli at sintranet.it> wrote:
Hi dear, for the benefit of the ewsgroup I'm going to post the code to make
a custom query with some specification:
The file that need to be modificated is query.phtml.in the proximity of line
180 you can find a line like this: 
// loop and use key for titles
foreach ($aRows[0] as $key => $value)



starting fron here replace it with this code:

// loop and use key for titles (add here only the field of dbf that you
want to display)
foreach ($aRows[0] as $key => $value)
{
if (strcasecmp($key, "INFO") == "INFO" ||
strcasecmp($key, "NUM_FOGLIO") == "NUM_FOGLIO" ||
strcasecmp($key, "NUM_PART") == "NUM_PART" ||
strcasecmp($key, "AREA") == "AREA" )

$szReturnValue .= "face=\"Arial, Helvetica, sans-serif\" size=\"2\">".key."\n";
}
$szReturnValue .= "\n";

// loop through the results and format each row
foreach ( $aRows as $aRow )
{
// add a row for each
$szReturnValue .= "\n";

// loop and add a cell for each result (add here only the
field thath you don't want to display)
foreach ( $aRow as $key => $xCell )
{
if (strcasecmp($key, "INFO_ID") == 0 ||
strcasecmp($key, "ESPR1") == 0)
continue;
$szReturnValue .= "face=\"Arial, Helvetica, sans-serif\" size=\"2\">".$xCell."\n";
}

$szReturnValue .= "\n";
}



I hope that this one can help someone
bye
Alberto




















_______________________________________________
Maplab-users mailing list
Maplab-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/maplab-users



---------------------------------
Post your free ad now! Yahoo! Canada Personals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/maplab-users/attachments/20040819/76b8552d/attachment.htm


More information about the Maplab-users mailing list