[maplab-users] code for custom query

Alberto Cavalli alberto.cavalli at sintranet.it
Tue Aug 17 11:42:00 EDT 2004


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 .= "<td bgcolor=\"E2EFF5\"><font
face=\"Arial, Helvetica, sans-serif\" size=\"2\">".key."</font></td>\n";
             }
                   $szReturnValue .= "</tr>\n";

            // loop through the results and format each row
             foreach ( $aRows as $aRow )
              {
                 // add a row for each
                     $szReturnValue .= "</tr>\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 .= "<td bgcolor=\"E2EFF5\"><font
face=\"Arial, Helvetica, sans-serif\" size=\"2\">".$xCell."</font></td>\n";
                 }

                   $szReturnValue .= "</tr>\n";
              }



I hope that this one can help someone
bye
Alberto






















More information about the Maplab-users mailing list