-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforo_general.asp
240 lines (206 loc) · 6.61 KB
/
foro_general.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<%@ Language=VBScript %>
<%
dim usuario
usuario = session("id")
session("destforo") = "foro_general.asp"
session("forogeneral") = 1
%>
<%
if isempty(session("id")) then
Response.Redirect("login.asp")
end if
dim db
dim rs
dim rs2
set db = server.CreateObject("SQLComandos.Comandos")
%>
<HTML>
<HEAD>
<link href="./theme/Master.css" rel="stylesheet" type="text/css">
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<SCRIPT LANGUAGE="javascript">
function Actualizar(foro) {
var destino;
var str;
var buscado;
var s = navigator.appVersion;
ss = s.substr(22,1);
if (ss.indexOf("6")==0)
{
destino = "nuevoforo2.asp"
}
else
{
destino = "nuevoforo.asp"
}
forma2.action= destino
forma2.foro.value=foro
forma2.accion.value = '1'
forma2.submit()
}
function Eliminar(foro) {
valor = confirm("Eliminar este foro.\nEsta accin no sera reversible, Desea Continuar?")
if (valor == true)
{
parent.principal.location = "./eliminar_foro.asp?foro="+foro
}
}
function Visitar(foro) {
forma2.action='desarrollo_foro.asp'
forma2.foro.value=foro
forma2.submit()
}
function Seleccion(Cat) {
form.submit()
return true
}
</SCRIPT>
<%
dim categoria
Categoria = Request.Form("categoria")
%>
<BODY onload="javascript:{if(parent.frames[0]&&parent.frames['opciones'].Go)parent.frames['opciones'].Go()}" >
<form name="forma2" action="" method="get">
<input name="foro" type="hidden" value="">
</form>
<form name="form" action ="foro_general.asp" method="post">
<div align="center">
<table border="0" cellspacing="0">
<tbody>
<tr><td>
<strong><font size="2" face="Arial, Helvetica, sans-serif">Seleccione una Categoria</font></strong>
</td></tr>
<tr>
<td align="center">
<select name="Categoria" size="1" onchange="return Seleccion(this)" >
<%
sql = "select id,descripcion from categoria where padre is null"
set rs = db.SQLSelect("DBBAECYS",sql)
if not rs.EOF then
%>
<%while rs.eof <> true %>
<option value="<%=rs("id")%>" <% if rs("id") = Categoria then Response.Write "selected" end if%>>-<%=rs("descripcion")%>-</option>
<%
sql2 = "select id,descripcion from categoria where padre = " & rs("id")
set rs2 = db.SQLSelect("DBBAECYS",sql2)
if not rs2.EOF then
%>
<%
while rs2.EOF <> true
%>
<option value="<%=rs2("id")%>" <% if rs("id") = Categoria then Response.Write "selected" end if%> >--<%=rs2("descripcion")%>--</option>
<%
rs2.MoveNext
wend
%>
<%
end if
set rs2 = nothing
%>
<%
rs.movenext
wend
end if
set rs = nothing
%>
</select>
</td></tr>
</tbody>
</table>
</div>
</form>
<%
sql = " select f.id idforo,f.titulo titulo ,f.descripcion descripcion,f.fecha_creacion,c.descripcion categoria, f.autor, a.id, a.nombre, a.apellido "
sql = sql & " from foro f, usuario a, categoria c "
sql = sql & " where a.id = f.autor "
sql = Sql & " and c.id = f.categoria "
sql = Sql & " and f.estado = 1 "
sql = Sql & " and f.activo = 1 "
if not isempty(Categoria) and Categoria <>"0" then
sql = sql & " and categoria = "& categoria
end if
sql = Sql & " order by c.descripcion, f.fecha_creacion asc "
set rs = db.SQLSelect("DBBAECYS",sql)
if not rs.EOF then
%>
<TABLE WIDTH=102% BORDER=0 CELLSPACING=2 CELLPADDING=2>
<%
while rs.EOF <> true
titulo = rs("titulo")
descripcion = rs("descripcion")
sql = "select count(id) Total from respuesta where foro = "& rs("idforo")
set rs2 = db.SQLSelect("DBBAECYS",sql)
if not rs2.EOF then
Total = rs2("total")
end if
set rs2 = nothing
Sql = "select max(fecha) FechaF from respuesta where foro =" & rs("idforo")
set rs2 = db.SQLSelect("DBBAECYS",sql)
if not rs2.eof then
fecha_ultima = rs2("FechaF")
end if
set rs2 = nothing
%>
<tr class="celdaBgBlueLeft" >
<td align="left">
<div align="left">
<%if rs("autor") = session("id") then%>
<!--
<img alt="Eliminar foro" src="imagenes/delete_forum.gif" onclick="javascript:Eliminar('<%=rs("idforo")%>')" width="15" height="15">
<img src="imagenes/edit_forum.gif" alt="Actualizar foro" onclick="javascript:Actualizar('<%=rs("idforo")%>')" width="15" height="15">
-->
<%end if%>
<img alt="Ir al foro" onclick="javascript:Visitar('<%=rs("idforo")%>')" src="imagenes/responder_foro.gif" WIDTH="15" HEIGHT="15"> </div> </tr>
<tr class="celdaBgBlue10">
<td>
<font size="1" face="Arial, Helvetica, sans-serif"><strong>Titulo:</strong></font>
<font size="2" face="Arial, Helvetica, sans-serif"><strong><%= titulo%></strong></font>
<font size="1" face="Arial, Helvetica, sans-serif"><strong>Fecha Creacion:</strong></font>
<font size="2" face="Arial, Helvetica, sans-serif"><strong> <%= Fecha %></strong></font>
<font size="1" face="Arial, Helvetica, sans-serif"><strong>Total Visitas:</strong></font>
<font size="2" face="Arial, Helvetica, sans-serif"><strong> <%= total%> </strong></font>
<font size="1" face="Arial, Helvetica, sans-serif"><strong> Ultima Visita: </strong></font>
<font size="2" face="Arial, Helvetica, sans-serif"><strong> <%= fecha_ultima%> </strong></font>
<br>
<font size="1" face="Arial, Helvetica, sans-serif"><strong> Autor: </strong></font>
<font size="2" face="Arial, Helvetica, sans-serif"><strong> <%= rs("nombre")%> <%= rs("apellido")%> </strong></font>
<font size="1" face="Arial, Helvetica, sans-serif"><strong> Categoria: </strong></font>
<font size="2" face="Arial, Helvetica, sans-serif"><strong> <%= rs("categoria")%> </strong></font>
<hr>
<font size="2" face="Arial, Helvetica, sans-serif"><%=rs("descripcion")%></font>
<br>
<%
sql = "select enlace,archivo from documento where foro = "& rs("idforo") & " and respuesta is null "
set rs2 = db.SQLSelect("DBBAECYS",sql)
if not rs2.eof then
%>
<hr>
<strong><font size="1" face="Arial, Helvetica, sans-serif">Documentos: </font></strong>
<%
while rs2.EOF <> true
%>
<strong><font size="2" face="Arial, Helvetica, sans-serif"><a href="foros/<%=rs2("archivo")%>" target="newpage"><%=rs2("enlace")%></a> </font></strong>
<%
rs2.MoveNext
wend
end if
set rs2=nothing
%>
</td>
</tr>
<%
rs.movenext
wend
%>
</TABLE>
<%
else
%>
<h2 align="center" >No Existen Foros para esta Categoria</h2>
<%
end if
set db = nothing
%>
</BODY>
</HTML>