Exemplo 4 – Exibindo registros da base livro com opção de visualização.

Formulário HTML

[codesyntax lang="html4strict" container="pre"]
<html>
 <head>
<title>Exibir registros da base livros</title>
</head>
<body>
 <h2>Exibindo faixa de registros</h2>
 <form action="/cgi-bin/wxis.exe" method="post">
 <input type="hidden" name="IsisScript" value="curso/script4.xis">
  Do MFN: <input type="Text" name="inicio"> 
  Até o MFN: <input type="Text" name="fim"> 
No formato:
<select name="formato">
 <option value="simples">Simples
 <option value="detalhado">Detalhado
</select>
<input type="submit" value="Processar">
</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">inicio</field>
 <field action="cgi" tag="2002">fim</field>
 <field action="cgi" tag="2003">formato</field>
 <flow action="jump"><pft>if a(v2001) or a(v2002) then 'ERRO2', fi </pft></flow>
 <flow action="jump"><pft>if val(v2001)>val(v2002) then 'ERRO1', fi </pft></flow>
 <do task="mfnrange">
 <parm name="db">C:\bases\livro\livro</parm>
 <parm name="gizmo">c:\bases\gizmo\asc2ans</parm>
<!--gizmo usado para converter caracteres acentuados-->
 <parm name="from"><pft>v2001</pft></parm>
 <parm name="to"><pft>v2002</pft></parm>
 <parm name="reverse">Off</parm>
 <loop>
 <field action="import" tag="2003">2003</field>
 <display>
 <pft>
if v2003='detalhado' then
  newline('<BR>')@\bases\livro\form1.pft,'<hr>',
else,
 mfn, '- ', mhl, v245'<br><hr>'
fi,
</pft>
</display>
</loop>
</do>
<flow action="exit">qqer texto e valido</flow>
  <label>ERRO1</label>
<display>O valor DESDE deve ser menor que o valor ATE</display>
<flow action="exit">qqer texto e valido</flow>
  <label>ERRO2</label>
<display>Um dos campos obrigatorios não foi preenchido</display>
<flow action="exit">qqer texto e valido</flow>
</section>
</IsisScript>
[/codesyntax]

Detalhado.htm

[codesyntax lang="html4strict" container="pre"]

<html>
<font face="Arial">
<br>
</font>
<table border="1" align="center" style="width=551">
<tr>
  <td style="width=105" align="right" rowspan="7">&nbsp;</td>
</tr>
<tr>
  <td style="width=105" align="right" colspan="2">
<p style="margin-right: -100" align="left">
<font face="Arial">[pft] if p(v30)then
'<a href="mailto:' v30 '">'v50,'</a>' fi[/pft]</font></td>
</tr>
<tr>
  <td align="right" width="535" colspan="2">
<p align="left"><font face="Arial">[pft]v60[/pft]</font></td>
</tr>
<tr>
  <td align="right" width="535" colspan="2">
<p align="left"><i><font face="Arial" size="2">[pft]if p(v80) then, MDL,
v80| : |V81|, |V82/, fi, '<br>'
 if p(v110) then, mhl,'('v110')'/fi, mdl, '<br>'
 if p(v90) then, mhl, v90'p.',' 'mdl, v91, /, fi, mdl,'<br>'
 if p(v140) then, 'ISBN: ', v140, fi,'<br>'
 if p(v100) then, 'IDIOMA: ', v100+| - | ,fi,'<br>'
 if p(v174) then, 'Esta obra é uma traducao.'/, fi,'<br>'
 if p(v173) then, 'Texto traduzido por: '(v173)/, fi,'<br>'
 if p(v172) then, 'Titulo original: ' (,v172/) fi/'<br>'
 if p(v120) then, 'NOTAS: '(|*|v120/)#,fi,
[/pft]</font></i></td>
</tr>
<tr>
  <td align="right" width="105"><font face="Arial">Descritores:</font></td>
  <td width="430"><font face="Arial">[pft]
'<a href="/cgi-bin/wxis.exe?IsisScript=curso/busca1.xis&formato=detalhado&expressao='v90'">'
v130'</a>'
[/pft]</font></td>
</tr>
<font face="Arial">[pft]
if p(v80) then
 '</font><tr><font face="Arial">'
 '</font><font face="Arial">'
 '</font><font face="Arial">'
 '</font></tr><font face="Arial">', fi,
(if p(v140) then
 '</font><tr><font face="Arial">'
 '</font><td align="right" width="105"><font face="Arial">Veja Arquivo!</font></td>
 <font face="Arial">'
 '</font><td width="430"><font face="Arial">'
 '<a href="http://localhost/curso/anexos/' v140 '">'
v140
'</a>'
'</font></td><font face="Arial">'
'</font></tr><font face="Arial">'
fi)
[/pft] </font>
</table>
</html>
[/codesyntax]

Was this helpful?

0 / 0

Deixe uma resposta 0

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