Ir para conteúdo
Fórum Script Brasil
  • 0

Página De Detalhes


Guest - Fernando -

Pergunta

Guest - Fernando -

OLÁ!!

Estou tentando desenvolver uma página de detalhes de um determinado produto mais o sistema só mostro o último registro.

No endereço é mostrado o caminho certo mais só que ele sempre mostrao último produto alguém poderia mim ajundar?

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0
Guest - Fernando -

Este é o codigo da listagem de produtos

-----------------------------------------------------------------------------------------------

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<!--#include file="Connections/conexao.asp" -->

<%

Dim lista_ap

Dim lista_ap_numRows

Set lista_ap = Server.CreateObject("ADODB.Recordset")

lista_ap.ActiveConnection = MM_conexao_STRING

lista_ap.Source = "SELECT * FROM EMPREENDIMENTOS"

lista_ap.CursorType = 0

lista_ap.CursorLocation = 2

lista_ap.LockType = 1

lista_ap.Open()

lista_ap_numRows = 0

%>

<%

Dim Repeat1__numRows

Dim Repeat1__index

Repeat1__numRows = 5

Repeat1__index = 0

lista_ap_numRows = lista_ap_numRows + Repeat1__numRows

%>

<%

Dim MM_paramName

%>

<%

' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone

Dim MM_keepURL

Dim MM_keepForm

Dim MM_keepBoth

Dim MM_removeList

Dim MM_item

Dim MM_nextItem

' create the list of parameters which should not be maintained

MM_removeList = "&index="

If (MM_paramName <> "") Then

MM_removeList = MM_removeList & "&" & MM_paramName & "="

End If

MM_keepURL=""

MM_keepForm=""

MM_keepBoth=""

MM_keepNone=""

' add the URL parameters to the MM_keepURL string

For Each MM_item In Request.QueryString

MM_nextItem = "&" & MM_item & "="

If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then

MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))

End If

Next

' add the Form variables to the MM_keepForm string

For Each MM_item In Request.Form

MM_nextItem = "&" & MM_item & "="

If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then

MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))

End If

Next

' create the Form + URL string and remove the intial '&' from each of the strings

MM_keepBoth = MM_keepURL & MM_keepForm

If (MM_keepBoth <> "") Then

MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)

End If

If (MM_keepURL <> "") Then

MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)

End If

If (MM_keepForm <> "") Then

MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

End If

' a utility function used for adding additional parameters to these strings

Function MM_joinChar(firstItem)

If (firstItem <> "") Then

MM_joinChar = "&"

Else

MM_joinChar = ""

End If

End Function

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

<%

While ((Repeat1__numRows <> 0) AND (NOT lista_ap.EOF))

%>

<table width="100%" border="0" cellspacing="2" cellpadding="2">

<tr>

<td rowspan="5">&nbsp;</td>

<td>&nbsp;</td>

<td><%=(lista_ap.Fields.Item("id_empreendimento").Value)%></td>

</tr>

<tr>

<td>&nbsp;</td>

<td><%=(lista_ap.Fields.Item("bairro").Value)%></td>

</tr>

<tr>

<td>&nbsp;</td>

<td><%=(lista_ap.Fields.Item("cidade").Value)%></td>

</tr>

<tr>

<td>&nbsp;</td>

<td><%=(lista_ap.Fields.Item("dormitorios").Value)%></td>

</tr>

<tr>

<td>&nbsp;</td>

<td><A HREF="detalhes_ap.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "id_empreendimento=" & lista_ap.Fields.Item("id_empreendimento").Value %>">Detail</A></td>

</tr>

</table>

<%

Repeat1__index=Repeat1__index+1

Repeat1__numRows=Repeat1__numRows-1

lista_ap.MoveNext()

Wend

%>

</body>

</html>

<%

lista_ap.Close()

Set lista_ap = Nothing

%>

Link para o comentário
Compartilhar em outros sites

  • 0
Guest - Fernando -

Este é o codigo da PAGINA DE DETALHES

-----------------------------------------------------------------------------------------------

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<!--#include file="Connections/conexao.asp" -->

<%

Dim detalhes_ap

Dim detalhes_ap_numRows

Set detalhes_ap = Server.CreateObject("ADODB.Recordset")

detalhes_ap.ActiveConnection = MM_conexao_STRING

detalhes_ap.Source = "SELECT * FROM EMPREENDIMENTOS"

detalhes_ap.CursorType = 0

detalhes_ap.CursorLocation = 2

detalhes_ap.LockType = 1

detalhes_ap.Open()

detalhes_ap_numRows = 0

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

<table width="100%" border="0" cellspacing="2" cellpadding="2">

<tr>

<td width="32%">&nbsp;</td>

<td width="34%"><%=(detalhes_ap.Fields.Item("id_empreendimento").Value)%></td>

<td width="34%">&nbsp;</td>

</tr>

<tr>

<td>&nbsp;</td>

<td><%=(detalhes_ap.Fields.Item("bairro").Value)%></td>

<td>&nbsp;</td>

</tr>

<tr>

<td>&nbsp;</td>

<td><%=(detalhes_ap.Fields.Item("cidade").Value)%></td>

<td>&nbsp;</td>

</tr>

<tr>

<td>&nbsp;</td>

<td><%=(detalhes_ap.Fields.Item("dormitorios").Value)%></td>

<td>&nbsp;</td>

</tr>

<tr>

<td>&nbsp;</td>

<td>&nbsp;</td>

<td>&nbsp;</td>

</tr>

</table>

</body>

</html>

<%

detalhes_ap.Close()

Set detalhes_ap = Nothing

%>

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652k
×
×
  • Criar Novo...