Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

odnanreef

Variaveis!!!

Recommended Posts

Preciso fazer o seguinte:

 

Quando o usuario selecionar um grupo de check box na primeira tela ele apresente na segunda tela exatamente o que o usuario selecionou, quando seleciono apenas uma empresa ele funciona mas quando seleciono duas ou mais não funciona.

 

O que preciso esta na segunda tela!!!

 

Ja recebi algumas respostas sobre isso, mas não entendi muito, pois não sou programador utilizo o Ultradev para fazer as páginas.

 

 

 

Tenho uma primeira tela:

 

Nessa tela tenho um formulario com check boxes de nome fixo e valores variaveis vindo do banco de dados.

 

<%

Dim Recordset1__MMColParam

Recordset1__MMColParam = "1"

if (Request.QueryString("codigo_da_subcategoria") <> "") then Recordset1__MMColParam = Request.QueryString("codigo_da_subcategoria")

%>

<%

set Recordset1 = Server.CreateObject("ADODB.Recordset")

Recordset1.ActiveConnection = MM_primeira_STRING

Recordset1.Source = "SELECT * FROM tabela_de_cadastro WHERE codigo_da_subcategoria = " + Replace(Recordset1__MMColParam, "'", "''") + ""

Recordset1.CursorType = 0

Recordset1.CursorLocation = 2

Recordset1.LockType = 3

Recordset1.Open()

Recordset1_numRows = 0

%>

<%

Dim titulo__MMColParam

titulo__MMColParam = "1"

if (Request.QueryString("codigo_da_subcategoria") <> "") then titulo__MMColParam = Request.QueryString("codigo_da_subcategoria")

%>

<%

set titulo = Server.CreateObject("ADODB.Recordset")

titulo.ActiveConnection = MM_primeira_STRING

titulo.Source = "SELECT * FROM tabela_de_subcategorias WHERE codigo_da_subcategoria = " + Replace(titulo__MMColParam, "'", "''") + ""

titulo.CursorType = 0

titulo.CursorLocation = 2

titulo.LockType = 3

titulo.Open()

titulo_numRows = 0

%>

<%

set rsregiao = Server.CreateObject("ADODB.Recordset")

rsregiao.ActiveConnection = MM_primeira_STRING

rsregiao.Source = "SELECT * FROM tab_regiao"

rsregiao.CursorType = 0

rsregiao.CursorLocation = 2

rsregiao.LockType = 3

rsregiao.Open()

rsregiao_numRows = 0

%>

<%

Dim Repeat1__numRows

Repeat1__numRows = -1

Dim Repeat1__index

Repeat1__index = 0

Recordset1_numRows = Recordset1_numRows + Repeat1__numRows

%>

<%

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

 

' create the list of parameters which should not be maintained

MM_removeList = "&index="

If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="

MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

 

' add the URL parameters to the MM_keepURL string

For Each Item In Request.QueryString

NextItem = "&" & Item & "="

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

MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))

End If

Next

 

' add the Form variables to the MM_keepForm string

For Each Item In Request.Form

NextItem = "&" & Item & "="

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

MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(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)

if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)

if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

 

' 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

%>

<%

Dim Repeat2__numRows

Repeat2__numRows = -1

Dim Repeat2__index

Repeat2__index = 0

rsregiao_numRows = rsregiao_numRows + Repeat2__numRows

%><html>

 

 

E na seguna tela:

 

<%

Dim Recordset1__MMColParam

Recordset1__MMColParam = "1"

if (Request.QueryString("selecao") <> "") then Recordset1__MMColParam = Request.QueryString("selecao")

%>

<%

set Recordset1 = Server.CreateObject("ADODB.Recordset")

Recordset1.ActiveConnection = MM_primeira_STRING

Recordset1.Source = "SELECT * FROM tabela_de_cadastro WHERE codigo_do_cadastro = " + Replace(Recordset1__MMColParam, "'", "''") + ""

Recordset1.CursorType = 0

Recordset1.CursorLocation = 2

Recordset1.LockType = 3

Recordset1.Open()

Recordset1_numRows = 0

%>

<%

Dim Repeat1__numRows

Repeat1__numRows = -1

Dim Repeat1__index

Repeat1__index = 0

Recordset1_numRows = Recordset1_numRows + Repeat1__numRows

%>

<%

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

 

' create the list of parameters which should not be maintained

MM_removeList = "&index="

If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="

MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

 

' add the URL parameters to the MM_keepURL string

For Each Item In Request.QueryString

NextItem = "&" & Item & "="

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

MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))

End If

Next

 

' add the Form variables to the MM_keepForm string

For Each Item In Request.Form

NextItem = "&" & Item & "="

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

MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(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)

if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)

if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

 

' 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

%>

<%

Dim Repeat2__numRows

Repeat2__numRows = -1

Dim Repeat2__index

Repeat2__index = 0

rsregiao_numRows = rsregiao_numRows + Repeat2__numRows

%>

 

 

Agradeço desde já a todos!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Lhe enviei um email sobre esse assunto, entre em contato! B)

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.