Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Boa Tarde Galera, estou com uma duvida um tanto besta....
Estou com problema no meu if mesmo que eu altere o valor do banco ele sempre me apresenta referente o primeiro if....
EMITIDA = minha coluna
1/0 = valor que está na coluna EMITIDA
IF request("EMITIDA")=1 THEN
v_emitida="<font color=blue><b>"&"EMITIDO"&"</b></font>"
end if
IF request("EMITIDA")=0 THEN
v_emitida="<font color=red><b>"&"PENDENTE"&"</b></font>"
END IF
Valew galera pela força...
>
velho o que você quiz dizer com 1/0? esta realmente vindo assim? 1/0???
E o request esta vindo do que? de um formou de uma querystring?
então o 1/0 a informação que vai ter no meu banco na coluna emitida ou vai ter 1 e emitido ou 0 de pendente
estou colocando o meu codigo logo abaixo.
<%
If session("usr_log_ok")="" Then
Response.Write "<font face='arial' size='2'>Você não está Logado no sistema!<br>"
Response.write "<a href='default.asp' class='texto8'>Clique aqui para se logar.</a></font>"
Session("pagina_restrita") = Request.ServerVariables("SCRIPT_NAME")&"?"&request.ServerVariables("QUERY_STRING")
Response.End()set conexao = Server.CreateObject("ADODB.Connection")
conexao.provider= "Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("..\bd\meu_banco.mdb")&";"
conexao.open
SQL = "select * from usuarios where id_usuario ="&session("usr_log_ok")
Set RS = Conexao.Execute(SQL)
If rs.eof then
Response.write "Ocorreu um Erro!"
Else
%>
<!-- #include file = "Sqlconexao.asp" -->
<script language="JavaScript">
function abrir(URL) {
var width = 600;
var height = 500;
var left = 99;
var top = 99;
window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
</script>
<%
'Response.Expires = 0
Dim objConn, objRs, strQuery, sql
'Dim strConnection
'Conectando com o banco de dados contato.mdb
'Set objConn = Server.CreateObject("ADODB.Connection")
'objConn.Open "DBQ=" & Server.MapPath("..\bd\bd_catalogo.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}","username","password"
'Seleciona da tabela contato
sql = "select * from tb_troca_devolucao where troca=1 and devolucao=0 order by data, loja desc"
set objRS = conexao.execute(sql) 'executa a cláusula sql
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<link href="../css.css" rel="stylesheet" type="text/css" />
<link href="css/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">.style2 {font-family: arial;
font-size: 10px;
color: #FFFFFF;
font-weight: bold;
}</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="Painel"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40"><table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td width="25%" rowspan="2"> </td>
<td width="14%" height="20"><a href="[http://www.hbf.com.br"](http://www.hbf.com.br) target="_blank" class="style2" style="text-decoration:none">SITE</a></td>
<td width="14%"><a href="[http://www.handbookfashion.com.br"](http://www.handbookfashion.com.br) target="_blank" class="style2" style="text-decoration:none">BLOG</a></td>
<td width="12%"><a href="[http://www.meuip.com.br"](http://www.meuip.com.br) target="_blank" class="style2" style="text-decoration:none">MEU IP 1 </a></td>
<td width="10%"><a href="[http://www.minhaconexao.com.br"](http://www.minhaconexao.com.br) target="_blank" class="style2" style="text-decoration:none">MEU IP 2</a></td>
<td width="25%" class="style2" style="text-decoration:none" >TELEFONES UTÉIS</td>
</tr>
<tr>
<td valign="top"><a href="[http://200.171.33.90/dskv/"](http://200.171.33.90/dskv/) target="_blank" class="style2" style="text-decoration:none">E-MAIL 1</a></td>
<td valign="top"><a href="[http://201.6.155.24/dskv/"](http://201.6.155.24/dskv/) target="_blank" class="style2" style="text-decoration:none">E-MAIL 2</a></td>
<td valign="top"><a href="[http://www.serasa.com.br"](http://www.serasa.com.br) target="_blank" class="style2" style="text-decoration:none">SERASA</a></td>
<td> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24%"> </td>
<td width="67%"><div align="right"><a href="../admmor/login_skip.asp" class="legenda"><strong>Sair</strong></a></div></td>
<td width="9%"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="35"> </td>
</tr>
<tr>
<td height="550" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3%"> </td>
<td width="95%" class="legenda">Você está logado como , <%=rs("nome_usuario")%></td>
<td width="2%"> </td>
</tr>
</table>
<p align="center"><span class="TITULO"> RELATÓRIO GERAL DE TROCA</span></p><br />
<%%>
<table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#eeeeee"><table width="500" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td width="1%" height="19" class="style10"> </td>
<td width="27%" class="legenda"><%=objRS("data")%></td>
<td width="43%" class="legenda"><a href="javascript:abrir('popup_troca.asp?id_troca_devolucao=<%=objrs("id_troca_devolucao")%>');" style="text-decoration:none; color:#666666"><%=objRS("loja")%></a></td>
<td width="29%" class="legenda">
<%
IF emitida=1 THEN
v_emitida="<font color=blue><b>"&"EMITIDO"&"</b></font>"
END IF
IF Emitida<>1 THEN
v_emitida="<font color=RED><b>"&"PENDENTE"&"</b></font>"
END IF
%>
<%=v_emitida%>
</td>
</tr>
</table></td>
</tr>
</table>
<%
objRS.MoveNext
WEnd
%></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%end if%>IF Cstr(request("EMITIDA"))="1" THEN
v_emitida="<font color=blue><b>"&"EMITIDO"&"</b></font>"
ElseIF Cstr(request("EMITIDA"))="0" THEN
v_emitida="<font color=red><b>"&"PENDENTE"&"</b></font>"
END IF
Valew Jonathandj, porem não aparece o resultado, é como se ele estivesse anulando e o campo fica em branco.
<%
If session("usr_log_ok")="" Then
Response.Write "<font face='arial' size='2'>Você não está Logado no sistema!<br>"
Response.write "<a href='default.asp' class='texto8'>Clique aqui para se logar.</a></font>"
Session("pagina_restrita") = Request.ServerVariables("SCRIPT_NAME")&"?"&request.ServerVariables("QUERY_STRING")
Response.End()set conexao = Server.CreateObject("ADODB.Connection")
conexao.provider= "Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("..\bd\meu_banco.mdb")&";"
conexao.open
SQL = "select * from usuarios where id_usuario ="&session("usr_log_ok")
Set RS = Conexao.Execute(SQL)
If rs.eof then
Response.write "Ocorreu um Erro!"
Else
%>
<!-- #include file = "Sqlconexao.asp" -->
<script language="JavaScript">
function abrir(URL) {
var width = 600;
var height = 500;
var left = 99;
var top = 99;
window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
</script>
<%
'Response.Expires = 0
Dim objConn, objRs, strQuery, sql
'Dim strConnection
'Seleciona da tabela contato
sql = "select * from tb_troca_devolucao where troca=1 and devolucao=0 order by data, loja desc"
set objRS = conexao.execute(sql) 'executa a cláusula sql
IF Cstr(request("EMITIDA"))="1" THEN
v_emitida="<font color=blue><b>"&"EMITIDO"&"</b></font>"
ElseIF Cstr(request("EMITIDA"))="0" THEN
v_emitida="<font color=red><b>"&"PENDENTE"&"</b></font>"
END IF
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<link href="../css.css" rel="stylesheet" type="text/css" />
<link href="css/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">.style2 {font-family: arial;
font-size: 10px;
color: #FFFFFF;
font-weight: bold;
}</style>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="Painel"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40"><table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td width="25%" rowspan="2"> </td>
<td width="14%" height="20"><a href="[http://www.hbf.com.br"](http://www.hbf.com.br) target="_blank" class="style2" style="text-decoration:none">SITE</a></td>
<td width="14%"><a href="[http://www.handbookfashion.com.br"](http://www.handbookfashion.com.br) target="_blank" class="style2" style="text-decoration:none">BLOG</a></td>
<td width="12%"><a href="[http://www.meuip.com.br"](http://www.meuip.com.br) target="_blank" class="style2" style="text-decoration:none">MEU IP 1 </a></td>
<td width="10%"><a href="[http://www.minhaconexao.com.br"](http://www.minhaconexao.com.br) target="_blank" class="style2" style="text-decoration:none">MEU IP 2</a></td>
<td width="25%" class="style2" style="text-decoration:none" >TELEFONES UTÉIS</td>
</tr>
<tr>
<td valign="top"><a href="[http://200.171.33.90/dskv/"](http://200.171.33.90/dskv/) target="_blank" class="style2" style="text-decoration:none">E-MAIL 1</a></td>
<td valign="top"><a href="[http://201.6.155.24/dskv/"](http://201.6.155.24/dskv/) target="_blank" class="style2" style="text-decoration:none">E-MAIL 2</a></td>
<td valign="top"><a href="[http://www.serasa.com.br"](http://www.serasa.com.br) target="_blank" class="style2" style="text-decoration:none">SERASA</a></td>
<td> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24%"> </td>
<td width="67%"><div align="right"><a href="../admmor/login_skip.asp" class="legenda"><strong>Sair</strong></a></div></td>
<td width="9%"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="35"> </td>
</tr>
<tr>
<td height="550" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3%"> </td>
<td width="95%" class="legenda">Você está logado como , <%=rs("nome_usuario")%></td>
<td width="2%"> </td>
</tr>
</table>
<p align="center"><span class="TITULO"> RELATÓRIO GERAL DE TROCA</span></p><br />
<% <table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#eeeeee"><table width="500" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td width="1%" height="19" class="style10"> </td>
<td width="27%" class="legenda"><%=objRS("data")%></td>
<td width="43%" class="legenda"><a href="javascript:abrir('popup_troca.asp?id_troca_devolucao=<%=objrs("id_troca_devolucao")%>');" style="text-decoration:none; color:#666666"><%=objRS("loja")%></a></td>
<td width="29%" class="legenda">
<%=v_emitida%>
</td>
</tr>
</table></td>
</tr>
</table>
<%%></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>Valew
Response.Write request("EMITIDA") retorna o que?
Não está retornando resposta alguma...
Retorna em branco...
Já verificou se o parâmetro está sendo passado corretamente?
Qual a melhor forma de verificar ?
ser for pelo form de um
request.form("nomecampo")
se for por uma querystring
request.querystring("nomedavariavel")
O request já retorna independente de ser po url ou form
velho o que você quiz dizer com 1/0? esta realmente vindo assim? 1/0???
E o request esta vindo do que? de um formou de uma querystring?