[Cartoweb-users] Filter Error
Adriano Hantequeste Gomes
adrianohg at gmail.com
Wed Oct 4 10:26:12 EDT 2006
Hi All,
Very Thanks for atention of all.
When i try access the project on my web browser retur this error:
Fatal error: Declaration of ClientFilters::renderForm() must be
compatible with that of GuiProvider::renderForm() in
C:\wamp\www\cartoweb3\plugins\filtro\client\ClientFiltro.php on line 3
#############################
I create the folder "filtro" on "C:\wamp\www\cartoweb3\plugins" with
content the folder "client" and "server".
the "client" folder content the "ClientFiltro.php" with this code:
#############################
<?php
class ClientFilters extends ClientPlugin
implements ServerCaller, GuiProvider {
public function handleHttpPostRequest($request) {
$mes = $_POST["mes"];
$classe = $_POST["classe"];
$incid = $_POST["incidente"];
$incidente = strtoupper($incid);
}
public function renderForm($smarty) {
echo '<!-- Inicio do Filtro -->';
echo '<div id="Layer1" style="position:absolute; left:358px;
top:66px; width:511px; height:27px; z-index:1">';
echo ' <form action="geo.php" method="post" name="filtra">';
echo ' <table border="0" cellspacing="0" cellpadding="0">';
echo ' <tr>';
echo ' <td>Mês: ';
echo ' <select name="mes">';
echo ' <option value="">Escolha um Mês</option>';
echo ' <option value="1">Janeiro</option>';
echo ' <option value="2">Fevereiro</option>';
echo ' <option value="3">Março</option>';
echo ' <option value="4">Abril</option>';
echo ' <option value="5">Maio</option>';
echo ' <option value="6">Junho</option>';
echo ' <option value="7">Julho</option>';
echo ' <option value="8">Agosto</option>';
echo ' <option value="9">Setembro</option>';
echo ' <option value="10">Outubro</option>';
echo ' <option value="11">Novembro</option>';
echo ' <option value="12">Dezembro</option>';
echo ' </select> </td>';
echo ' <td>Classe: <select name="classe">';
echo ' <option value="">Escolha uma Classe</option>';
echo ' <option value="A">Pessoa</option>';
echo ' <option value="B">Patrimonio</option>';
echo ' <option value="C">Costumes</option>';
echo ' <option value="D">Adm. Publica</option>';
echo ' <option value="E">Toxico</option>';
echo ' <option value="F">Armas e Municoes</option>';
echo ' <option value="G">Diversos</option>';
echo ' <option value="H">Contravencoes</option>';
echo ' <option value="I">Transito</option>';
echo ' <option value="J">Bombeiro</option>';
echo ' </select> </td>';
echo ' <td>Incidente: <input name="incidente" type="text"
size="4" maxlength="4" /></td>';
echo ' <td><input name="submit" type="submit" id="submit"
value="Ok" /></td>';
echo ' </tr>';
echo ' </table>';
echo '</form></div>';
echo '<!-- Fim do Filtro -->';
}
public function buildRequest() {
// sends request to cartoserver
$filterRequest = new FilterRequest;
$filterRequest->classe = $classe;
$filterRequest->layer = 'COMPLETO2004';
return $filterRequest;
}
}
?>
#############################
And the "server" folder content the "ServerFiltro.php" with this code:
#############################
<?php
class ServerRequest extends ServerPlugin
implements ClientResponder {
public function initializeRequest($requ) {
$msMapObj = $this->serverContext->getMapObj();
for ($i = 0; $i < $msMapObj->numlayers; $i++) {
$msLayer = $msMapObj->getLayer($i);
if ($msLayer->name == $requ->layer) {
$filter = sprintf("classe = '%s'",
$requ->classe);
$msLayer->setFilter($filter);
}
}
}
}
?>
#############################
I put in "client.ini.in" of my project on
"C:\wamp\www\cartoweb3\projects\geo\client_conf" this code:
loadPlugins = filtro
#############################
--
Atenciosamente,
Adriano Hantequeste Gomes
Departamento de Geoprocessamento - GEO
Gerência de Estatística e Analise Criminal - GEAC
Secretaria de Estado da Segurança Pública e Defesa Social - SESP
Av. Marechal Mascarenhas de Moraes, 2355
Bento Ferreira - Vitória - Espírito Santo
CEP: 29.052-121
Telefone: 55 27 3334-4736
Fax: 55 27 3334-4735
Celular: 55 27 9225-4852
More information about the Cartoweb-users
mailing list