Exemplo 9 – Introducao as pesquisas com seleção de campos

Formulário HTML

[codesyntax lang="html4strict" container="pre"]
<html>
<head><title>Introducao as pesquisas</title></head>
<body>
Digite sua expressao de pesquisa, concatenando os campos conforme necessário
<form action="/cgi-bin/wxis.exe">
  <input type="hidden" name="IsisScript" value="curso/script9.xis">
<table>
<tr>
<td><select name="campo1">
  <option value="/(100,110,111)">Autor
  <option value="/(245)">Título
  <option value="/(690,653)">Assunto
</select> </td>
<td><input type="text" name="expressao1"></td>
  <td><select name="operador1">
  <option value="*">AND
  <option value="+">OR
  <option value="^">NOT
</select></td>
</tr>
<tr>
<tr>
<td><select name="campo2">
  <option value="/(100,110,111)">Autor
  <option value="/(245)">Título
  <option value="/(690,653)">Assunto
</select> </td>
<td><input type="text" name="expressao2"></td>
<td><select name="operador2">
  <option value="*">AND
  <option value="+">OR
  <option value="^">NOT
</select></td>
</tr>
<tr>
<td><select name=campo3>
  <option value="/(100,110,111)">Autor
  <option value="/(245)">Título
  <option value="/(690,653)">Assunto
</select> </td>
<td><input type="text" name="expressao3"></td>
<td></td>
</tr>
<tr>
<td>Qtd. <select name="quantidade">
  <option value="5">5
  <option value="10">10
</select></td>
<td><input type="submit" value="Pesquisar"></td>
<td><input type="reset" value="Limpar Campos"></td>
</tr>
</table>
</form>
</body>
</html>
[/codesyntax]

 

Script

[codesyntax lang="html4strict" container="pre"]
<IsisScript>
<section>
<display><pft>'Content-type: text/html'/#</pft></display>
 <field action="cgi" tag="2001">expressao1</field>
 <field action="cgi" tag="3001">campo1</field>
 <field action="cgi" tag="4001">operador1</field>
 <field action="cgi" tag="2002">expressao2</field>
 <field action="cgi" tag="3002">campo2</field>
 <field action="cgi" tag="4002">operador2</field>
 <field action="cgi" tag="2003">expressao3</field>
 <field action="cgi" tag="3003">campo3</field>
 <field action="cgi" tag="5000">quantidade</field>
 <field action="cgi" tag="6000">comeco</field>
<do task="search">
 <parm name="db">C:\bases\livro\livro</parm>
 <parm name="gizmo">C:\bases\gizmo\asc2ans</parm>
 <parm name="count"><pft>v5000</pft></parm>
 <parm name="from"><pft>if val(v6000)<1 then '1' else v6000, fi</pft></parm>
 <parm name="expression"><pft>
  v2001, v3001,
if p(v2002) then
  v4001,v2002,v3002, fi
if p(v2003) then
  v4002,v2003,v3003, fi
</pft></parm>
<field action="define" tag="1001">Isis_Current</field>
<field action="define" tag="1002">Isis_Total</field>
<display>
<pft>
'<h1>'v2001, v3001,
if p(v2002) then
  v4001,v2002,v3002, fi
if p(v2003) then
  v4002,v2003,v3003, fi
'</h1>'
</pft>
</display>
<loop>
<display>
<pft>v1001 '/' v1002 '<br>'
newline('<br>')@\bases\livro\form1.pft
'<hr>'
</pft>
</display>
</loop>
<!--Aqui está o botao de proxima pagina-->
<display>
<pft> if val(v1002)>val(v1001) then
 '<form action="/cgi-bin/wxis.exe" method="post">
 <input type="hidden" name="IsisScript" value="curso/script9.xis">
 <input type="hidden" name="expressao1" value="'v2001'">
 <input type="hidden" name="campo1" value="'v3001'">
 <input type="hidden" name="operador1" value="'v4001'">
 <input type="hidden" name="expressao2" value="'v2002'">
 <input type="hidden" name="campo2" value="'v3002'">
 <input type="hidden" name="operador2" value="'v4002'">
 <input type="hidden" name="expressao3" value="'v2003'">
 <input type="hidden" name="campo3" value="'v3003'">
 <input type="hidden" name="quantidade" value="'v5000'">
' /*Comentario*/ '
 <input type="hidden" name="comeco" value=" 'f(val(v1001)+1,0,0)'">
 <input type="submit" value="Próxima Página">
 <a href="#" onClick="history.go(-1)">
 <font face="arial" size="2"><b>Voltar</b></font></a>
</form>' fi
</pft>
</display>
</do>
</section>
</IsisScript>
[/codesyntax]

 

Was this helpful?

0 / 0

Deixe uma resposta 0

Your email address will not be published. Required fields are marked *