Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/12/2011, 08:37
mchaco
 
Fecha de Ingreso: diciembre-2011
Ubicación: Ccs
Mensajes: 7
Antigüedad: 12 años, 4 meses
Puntos: 0
Pregunta Como hacer un buscador php por medio de filtro

Holaaa

Estoy realizando un proyecto de migración plsql a php en ambos lenguajes tengo deficiencias. Debo pasar este código plsql a php:

if filtropor=1 then

varc:=varc||' and serv_enlace like ''%'||upper(parametro)||'%''';
end if;

if filtropor=2 then

varc:=varc||' and serv_orden like ''%'||upper(parametro)||'%''';

end if;

if filtropor=3 then

varc:=varc||' and proy_nombre like ''%'||upper(parametro)||'%''';
end if;

varc:=varc||' order by port_slot_port_stm1umg,port_slot_port_eqp'



--htp.p('***'||varc||'***');

cont:=0;

open c for varc;

fetch c into result,stm1,slot_port;

while c%found loop

cont:=cont+1;

fetch c into result,stm1,slot_port;

end loop;


Estoy haciendolo mediante un switch, pero veo q da error en el dreamweaver, entonces si me pueden orientar sombre el tema y decirme que tengo mal o como deberia hacerlo.

<?php
$filtro;
switch (filtro1);
case 1:
$filtro.=" AND B.SERV_ENLACE LIKE '%".strtoupper($_POST[''])."'";
endswitch;

switch (filtro2);
case 2:
$filtro.=" AND B.SERV_ORDEN LIKE '%".strtoupper($_POST[''])."'";
endswitch;

switch (filtro3);
case 3:
$filtro.=" AND E.PROY_NOMBRE LIKE '%".strtoupper($_POST[''])."'";
endswitch;

$filtro.=" ORDER BY SLOT_PORT_STM1UMG, SLOT_EQP, PORT_EQP";
?>



Nota: Es que necesito hacer un buscador ya les paso el html:

<form action="pantallas/Consultar/.php" id="busca">
<b>Seleccione:</b><br>
<br>

Buscar por:
<select name="CONSUL_BUSCA" id="CONSUL_BUSCA">
<option value="0" selected>Enlace</option>
<option value="5">Orden de Servicio</option>
<option value="7">Proyecto</option>
</select>&nbsp; &nbsp;
<tr>
<td>Par&aacute;metros de B&uacute;squeda:</td>
<td><input name="busqueda" type="busqueda" /></td>
</tr>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

<tr><td align="right" colspan="2"><input style="FONT-SIZE: 9px; COLOR: #000099; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: #ffffff" type="submit" value="Aceptar" /></td></tr>
</form>
<hr>
<div id="resultadosbusca"></div>


La idea es que cuando el usuario ingrese por ejemplo una orden de servicio y le de clic en aceptar aparesca la tablas con los datos que correspondan a esa orden. El query ya lo tengo listo. solo me falta ese buscador por filtro.
Espero me puedan ayudar. Por favor!! Gracias.