Henrik 29 de mai. de 2008
valzinha 29 de mai. de 2008
<% @page contentType = "text/html" language = "java" import = "java.sql.*" %>
< jsp : useBean id = "con" class =" conexao . Conexao " />
<title>Consulta</title>
</head>
<body>
<form method=" get ">
<%
String pes_nome= request.getParameter(" pes_nome ");
System.out.println(" o que tem no request . getParameter ( pes_nome ) " + pes_nome);
con.setConsulta(" pessoa "," resp "," tete ","");
ResultSet temp1 = con.getResultSet();
temp1.next();
System.out.println(" tete 33 "+ temp1.getString(" resp "));
response.sendRedirect(" http : //localhost:8080/projeto/cadastro.jsp?responsa="+
temp1 . getString ( "resp" ) +
"&nasci=" + temp1 . getString ( "nasciment" ) +
"&sex=" + temp1 . getString ( "sexo" ) +
"&end1=" + temp1 . getString ( "ende" ) +
"&civil=" + temp1 . getString ( "esta_civil" ) +
"&curs=" + temp1 . getString ( "curso" ) +
"&instruc=" + temp1 . getString ( "instrucao" ) +
"&bene=" + temp1 . getString ( "bene" ) +
"&emal=" + temp1 . getString ( "email" ) +
"&espor=" + temp1 . getString ( "esporte" ) +
"®io=" + temp1 . getString ( "reg" ) +
"&bair=" + temp1 . getString ( "bairro" ) +
"&ceep=" + temp1 . getString ( "cep" ) +
"&telef=" + temp1 . getString ( "fone" ) +
"&car_trab=" + temp1 . getString ( "cart_trab" ) +
"&id=" + temp1 . getString ( "identi" ) +
"&cppf=" + temp1 . getString ( "cpf" ) +
"&piis=" + temp1 . getString ( "pis" ) +
"&nom_curs=" + temp1 . getString ( "nom_curso" ) +
"&bene2=" + temp1 . getString ( "op_bene2" ) +
"&bene3=" + temp1 . getString ( "op_bene3" ) +
"&bene1=" + temp1 . getString ( "op_bene1" ) +
"&ocup=" + temp1 . getString ( "ocup" ) +
"&estad=" + temp1 . getString ( "estado" ) +
"&t_espor=" + temp1 . getString ( "tipo_espot" ) +
"&i_espor=" + temp1 . getString ( "int_esport" ) +
"&intnome_espor=" + temp1 . getString ( "intnome_esport" ) +
"&estud=" + temp1 . getString ( "estuda" ) +
"&numca =" + temp1 . getString ( "num_casa" ) +
"&numco =" + temp1 . getString ( "num_compl" ));
%>
</ form >
</ body >
</ html >
valzinha 29 de mai. de 2008
<% @ page contentType = "text/html" language = "java" import = "java.sql.*" %>
<jsp:useBean id= "con" class= "conexao.Conexao" />
<HTML>
<HEAD>
<TITLE> SPD-Pesquisa</TITLE>
<LINK href= "../projeto/extensao_spd/spd.css" rel= stylesheet >
<LINK href= "../projeto/extensao_spd/modulo.css" rel= stylesheet >
<SCRIPT language= JavaScript
src= "../projeto/extensao_spd/js.validation.validateForm.js"
type= text/javascript ></SCRIPT>
<SCRIPT language= javacript src= "../projeto/extensao_spd/spd_utils.js"
type= text/javascript ></SCRIPT>
<SCRIPT language= JavaScript type= text/javascript >
/**
* Reseta a pesquisa pesquisa anterior
*/
function pes_limpar(){
document.frm_pesquisa.pes_num.value='';
document.frm_pesquisa.pes_nome.value='';
}
function val_pesquisa(){
var prot = document.getElementById('pes_num').value;
var nome = document.getElementById('pes_nome').value;
if((prot == "")&& (nome == "")){
alert("O campo 'Protocolo' ou 'Nome' deve ser preenchido");
}
else if(prot != "" ){
if(veri_num(prot) == false){
alert("O campo 'Protocolo' aceita somente números");
}
}
else if((prot != "")||(nome != "")){
document.frm_pesquisa.submit();
if((document.frm_pesquisa().equals(0)))
alert("Registro não encontrado");
}
function veri_num(num){
x = 0;
resp= true;
var tnum =num.length;
while(x < tnum ){
if((num.charAt(x)!=0)&&(num.charAt(x)!=1)&&(num.charAt(x)!=2)&&(num.charAt(x)!=3)&&
(num.charAt(x)!=4)&&(num.charAt(x)!=5)&&(num.charAt(x)!=6)&&(num.charAt(x)!=7)&&
(num.charAt(x)!=8)&&(num.charAt(x)!=9))
{
resp = false;
}
x= x+1;
}
return resp;
}
}
function tecla_pressionada(){
if ( event.keyCode = = 13)
document.forms['frm_pesquisa'].submit();
}
</SCRIPT >
<META content= "MSHTML 6.00.2900.3059" name= GENERATOR >
</HEAD>
<BODY>
<H2> Pesquisa</H2>
<DIV id= ajuda ><A
href= "javascript:Utils.cookieShow(div_pesquisa,%20cookie_pesquisa)" > [Pesquisar]</A> <A
href= "javascript:Utils.cookieShow(div_ajuda,%20cookie_ajuda)" > [Ajuda]</A></DIV>
<DIV id= div_ajuda > Clique no cadastro para edita-lo.</DIV>
<DIV class= div_aguarde id= div_aguarde ><IMG
src= ".../projeto/extensao_spd/loading.gif" > Aguarde...</DIV>
<FIELDSET id= div_pesquisa style= "DISPLAY: none" ><LEGEND> Pesquisa de Cadastros</LEGEND>
<FORM name= "frm_pesquisa" onKeyDown= "tecla_pressionada();" method= "post" action= "pesquisa.jsp" >
<TABLE style= "WIDTH: 490px" >
<TBODY>
<TR>
<TD><LABEL> Protocolo:</LABEL>
<INPUT style= "WIDTH: 200px" maxLength= 20 id= "pes_num" name= "pes_num" >
</TD>
</TR>
<TR>
<TD><LABEL> Nome:</LABEL>
<INPUT style= "WIDTH: 200px" maxLength= 20 id= "pes_nome" name= "pes_nome" >
</TD>
</TR>
</TBODY>
</TABLE>
<DIV style= "FLOAT: right; PADDING-TOP: 10px" ><input class= botao
name= "button" type= button onClick= pes_limpar() value= Limpar > <input
class= botao name= "button1" type= button onClick= val_pesquisa()
value= Pesquisar ></DIV>
</FORM>
</FIELDSET>
<TABLE class= listagem id= listagem >
<FORM name= "list" method= "get" >
<THEAD>
<TR>
<TH width= "513" > Protocolo</TH>
<TH width= "513" > Nome</TH>
</TR>
</THEAD>
<TBODY>
<%
try {
if ( request . getParameter ( "pes_nome" ) != null ){
System . out . println ( "tete 11 " + request . getAttribute ( "pes_nome" ));
con . setCosnome ( request . getParameter ( "pes_nome" ));
con . setConsulta ( "pessoa" , "resp" , request . getParameter ( "pes_nome" ), "" );
}
else {
System . out . println ( "tete 22 " + request . getParameter ( "pes_num" ));
con . setCosprot ( request . getParameter ( "pes_num" ));
con . setConsulta ( "pessoa" , "resp" , "" , request . getParameter ( "pes_num" ));
}
ResultSet temp = con . getResultSet ();
while ( temp . next ()){
%>
<TR class= escuro id= 3 >
<td width= "513" >
<%
out . print ( temp . getString ( "cod_pes" ));
%>
</td>
<td width= "513" ><a href= "http://localhost:8080/projeto/pescad.jsp" >
<%
out . print ( temp . getString ( "resp" ));
%> </a></td>
</TR>
<%
}
}
catch ( Exception e ){
e . printStackTrace ();
}
%>
</FORM>
<TR class= escuro id= 3 >
<td></td>
<td></td>
</TR>
<TR class= escuro id= 3 >
<td></td>
<td></td>
</TR>
<TR class= escuro id= 70 ></TR>
</TBODY>
</TABLE>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</BODY>
</HTML>