Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Estou tentando adicionar um campo select para que o usuário possa selecionar que tipo de busca fará.. Por ator, titulo original e traduzido, diretor e parte da sinopse
A consulta
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/Cinex.asp" -->
<%
Dim filme__MMColParam
filme__MMColParam = "AAAAZZZZCXCAAJAJA"
if (Request.Form("titulo") <> "") then filme__MMColParam = Request.Form("titulo")
%>
<%
function preparaPalavra(str)
preparaPalavra = replace(str,"a","[a,á,à,ã,â,ä]")
preparaPalavra = replace(preparaPalavra,"e","[e,é,è,ê,ë]")
preparaPalavra = replace(preparaPalavra,"i","[i,í,ì,î,ï]")
preparaPalavra = replace(preparaPalavra,"o","[o,ó,ò,õ,ô,ö]")
preparaPalavra = replace(preparaPalavra,"u","[u,ú,ù,û,ü]")
preparaPalavra = replace(preparaPalavra,"c","[c,ç]")
preparaPalavra = preparaPalavraip = Request.ServerVariables("REMOTE_ADDR")
Dim categoria__MMColParam
categoria__MMColParam = Trim(Request.Form("id_genero"))
set filme = Server.CreateObject("ADODB.Recordset")
filme.ActiveConnection = MM_Cinex_STRING
if categoria__MMColParam = "" then
filme.Source = "SELECT * FROM filme WHERE titulo LIKE '%" + Replace(preparaPalavra(filme__MMColParam), "'", "''") + "%' OR titulo_original LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR direcao LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores1 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores2 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores3 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores4 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores5 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores6 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores7 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores8 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores9 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores10 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' ORDER BY titulo ASC"
else
filme.Source = "SELECT * FROM filme WHERE (titulo LIKE '%" + Replace(preparaPalavra(filme__MMColParam), "'", "''") + "%' OR titulo_original LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR direcao LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores1 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores2 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores3 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores4 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores5 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores6 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores7 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores8 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores9 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%' OR atores10 LIKE '%" + Replace(filme__MMColParam, "'", "''") + "%') AND id_genero = "&categoria__MMColParam&" ORDER BY titulo ASC"
End if
filme.CursorType = 0
filme.CursorLocation = 2
filme.LockType = 3
filme.Open()
filme_numRows = 0
%>
O campo da busca
<td> </td>
</tr>
<tr>
<td height="30">
<form name="form1" method="get" action="busca_simples.asp">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="210">
<input type="text" name="titulo" style="font-family : Verdana;font-size : 12px;width : 206px;">
</td>
<td>
<input type="image" border="0" name="Buscar" src="images/buscar.jpg" onClick="FDK_AddNonBlankValidation('form1','document.form1.titulo',true,'\'Digite o título do filme !\'');FDK_Validate('form1',true,false,'Atenção! Club Video Locadora');return document.MM_returnValue">
</td>
</tr>
</table>
</form>
</td>Carregando comentários...