 |
<%
Dim bInValid, sOrigQuery, sSearchString, iPos, iCnt, sWord, sChoice, sSQLString
Dim conn, rs, iCtr, cmd, iRecCnt, sNewURL,s ,x ,ch, link,lPageStart , lPageEnd,nt, RSFOTO
Dim lTotalRecords, iPageSize, iTotalPages, bOnePage, lCtr, bNoRecords, iPage, bLastPage
Dim sNextQuery, sQuery, sPageQuery, sPrevQuery, link2, link3, randomNews, AdvObject, adHTML
set conn = Server.CreateObject("ADODB.Connection")
set cmd = Server.CreateObject("ADODB.Command")
set rs = Server.CreateObject("ADODB.Recordset")
set RSFOTO = Server.CreateObject("ADODB.Recordset")
conn.open CONEXAO_PRODUCAO
set cmd.activeconnection = conn
'nt = request(rs("not_codigo"))
if ("searchbutton") <> "Search" then bInValid = false
if not bInvalid then
dim sQueryStrings()
sOrigQuery = Request("search")
s=""
for x=1 to len(sOrigQuery)
ch=mid(sOrigQuery,x,1)
if asc(ch)<>34 then
ch=mid(replace(sOrigQuery,"+",chr(32)),x,1)
s=s & ch
end if
next
sOrigQuery = s
sSearchString = sOrigQuery & " "
iPos = 1
iCnt = 1
do While len(sSearchString)
redim preserve sQueryStrings(iCnt)
iPos = instr(iPos, sSearchString, " ") + 1
sWord = Mid(sSearchString,1,iPos - 2)
if trim(sWord) <> "" Then
sQueryStrings(iCnt) = Mid(sSearchString,1,iPos - 2)
iCnt = iCnt + 1
end if
sSearchString = Mid(sSearchString, iPos)
iPos = 1
Loop
iCnt = uBound(sQueryStrings)
'var_nome = rs("cad_nome")
'not_codigo=" & Request.QueryString("nt")
sSQLString = "SELECT * FROM NOTICIAS WHERE not_sessao=5 ORDER BY not_data desc"
for iCtr = 1 to iCnt
' sSQLString = sSQLString & " WHERE (NOT_TEXTO LIKE '%" & sQueryStrings(ictr) & "%' OR NOT_RESUMO LIKE '%" & sQueryStrings(ictr) & "%' OR NOT_TITULO LIKE '%" & sQueryStrings(ictr) & "%'and not_sessao=1)"
' sSQLString = sSQLString & " WHERE NOTICIAS.not_codigo = NOTICIAS2.not_codigo "
if iCtr < iCnt then sSQLString = sSQLString & " AND "
next
'sSQLString = sSQLString & " ORDER BY not_data, not_resumo, not_titulo, not_texto"
cmd.CommandType = 1
cmd.CommandText = sSQLString
rs.Open cmd,, 1, 1
iRecCnt = rs.recordcount
if iRecCnt > 0 then
rs.MoveLast
rs.MoveFirst
iRecCnt = rs.recordcount
end if
end if 'bInvalid
iPageSize = 5
iPage = cint(Request.QueryString("Page"))
if iPage = 0 then iPage = 1
if not rs.Eof and not rs.bof then
rs.MoveLast
iTotalPages = int(iRecCnt / iPageSize)
if iRecCnt MOD iPageSize <> 0 then iTotalPages = iTotalPages + 1
if iRecCnt <= iPageSize then
rs.MoveFirst
bOnePage = true
lPageEnd = iRecCnt
lPageStart = 1
iTotalPages = 1
else
lPageStart = ((iPage - 1) * iPageSize) + 1
lPageEnd = lPageStart + (iPageSize - 1)
if lPageEnd >= iRecCnt Then
lPageEnd = iRecCnt
bLastPage = true
end if
if iPage > 1 then
rs.AbsolutePosition = ((iPage - 1) * iPageSize) + 1
else
rs.MoveFirst
end if
end if
else
bNoRecords = true
end if
%> <%
Function MostraImagem(noticia)
Dim x, NomeImg, Arquivo, SQL
SQL = "select foto_txt_arquivo from FOTOS where foto_nr_noticia=" & noticia
RSFOTO.open SQL, conn
if not RSFOTO.EOF then
Arquivo = RSFOTO("foto_txt_arquivo")
for x=1 to len(Arquivo)
if mid(right(Arquivo,x),1,1)="\" then
exit for
else
NomeImg = mid(right(Arquivo,x),1,1) & NomeImg
end if
next
else
NomeImg = ""
end if
RSFOTO.Close
MostraImagem = NomeImg
End Function
%>
<%
Function MostraImagem2(noticia)
Dim x, NomeImg, Arquivo, SQL
'SQL = "select foto_txt_arquivo from FOTOS where foto_nr_noticia=" & noticia
SQL = "select foto_txt_arquivo from FOTOS where foto_nr_noticia=" & noticia & " and foto_flg_destaque=false"
RSFOTO.open SQL, conn
if not RSFOTO.EOF then
Arquivo = RSFOTO("foto_txt_arquivo")
for x=1 to len(Arquivo)
if mid(right(Arquivo,x),1,1)="\" then
exit for
else
NomeImg = mid(right(Arquivo,x),1,1) & NomeImg
end if
next
else
NomeImg = ""
end if
RSFOTO.Close
MostraImagem2 = NomeImg
End Function
%>
| |
Apresentamos
os artigos com temas jurídicos já
publicados em nosso Portal: |
| |
Você poderá lê-los
ou fazer o download. |
|
 |
<%
for lCtr = lPageStart to lPageEnd
sPrevQuery = "&Page=" & iPage
link = "detalhe_artigo.asp?nt=" & RS("not_codigo")& sPrevQuery & "&search=" & sOrigQuery & "&searchbutton=OK"
link2 = "../upload/" & RS("download")
link3 = "envie_para_um_amigo.asp?nt=" & RS("not_codigo")
%>
 |
<%
rs.MoveNext
next
'end if
%>
<%if bOnePage = false and bNoRecords = false then%><%if iPage > 1 then
sPrevQuery = "search=" & sOrigQuery & "&searchbutton=OK" & "&Page=" & iPage - 1 %>
anterior
<% else%> <%end if%>
|
|
<%if bLastPage = false then
sNextQuery = "search=" & sOrigQuery & "&searchbutton=OK" & "&Page=" & iPage + 1 %>
próximo
<%end if%>
|
<%end if%> <%
if rs.state <> 0 then rs.close
set rs = nothing
set cmd = nothing
conn.close
set conn = nothing
%> |
|
 |
|
|