%@ page language ="java" %>
<%@ page import ="java.sql.*" %>
<%@ page import ="db.*" %>
<%!
ResultSet rs=null;
ResultSet rsk=null;
ResultSet rs1=null;
ResultSet rs2=null;
ResultSet rs3=null;
ResultSet rs9=null;
int j=0;
int row_con=2;
int k=0;
int hits=0;
int count=0;
String qs="";
String detail="";
String user_session="";
int jok_cat=0;
String category="";
String title="";
int limitePorPagina = 10;
String arr1="";
String arr2="";
String theam="";
%>
<%
qs=request.getQueryString();
String [] arr= qs.split("@");
arr1=arr[0]; //jjoke pk id
arr2=arr[1]; //limit 1
k=Integer.valueOf(arr1).intValue();
%>
<%
Connection con=ConnectionFactory.getConnection();
Statement sttheam = con.createStatement();
rs=sttheam.executeQuery("select * from theams where display='Y'");
while(rs.next())
{
theam=rs.getString("color_pg");
}
rs.close();
sttheam.close();
%>
<%
Statement st1 = con.createStatement();
rsk=st1.executeQuery("select joke_detail, jokes_hit, joke_brief, Fk_joke_catg from jokes where Pk_joke_id="+k);
if(rsk.next())
{
detail=rsk.getString("joke_detail");
title=rsk.getString("joke_brief");
count=rsk.getInt("jokes_hit");
jok_cat=rsk.getInt("Fk_joke_catg");
//out.print("hit="+count);%>
<%}
rsk.close();
st1.close();
%>
<%
Statement stcatg = con.createStatement();
ResultSet rscatg=stcatg.executeQuery("select Jokes_catg from jokes_catg where j_catg_id="+jok_cat);
if(rscatg.next())
{
category=rscatg.getString("Jokes_catg");
}
rscatg.close();
stcatg.close();
%>
Welcome to Smscontest.com
|
|
|
|
|
| |
|
| <% count=count+1;
Statement stct = con.createStatement();
stct.executeUpdate("Update jokes set jokes_hit="+count+" where Pk_joke_id="+k);
stct.close();
%> |
| <%=title%> |
 |
|
<%=detail%> |
|
| TITLE |
READ BY |
|
RANK |
<%
Statement stmt = con.createStatement();
Statement declaracao2 = con.createStatement();
ResultSet rtst=stmt.executeQuery("select * from jokes where joke_show='Y' and Fk_joke_catg="+jok_cat+" LIMIT " + arr2 + "," + String.valueOf(limitePorPagina));
ResultSet rsnew = declaracao2.executeQuery("Select count(*) as c from jokes where joke_show='Y' and Fk_joke_catg="+jok_cat);
rsnew.next();
int totalregs = Integer.parseInt(rsnew.getString("c"));
int totalpgs = Math.round(totalregs / limitePorPagina);
if ((totalregs % limitePorPagina) > 0) totalpgs++;
int pr = Integer.valueOf(arr2).intValue();
try{
while (rtst.next())
{
%>
| @1" class="tdbgrt"><%=rtst.getString("joke_brief")%> |
|
<%=rtst.getString("jokes_hit")%> |
|
<%=rtst.getString("joke_rank")%> |
<% }
}
catch(SQLException e) { out.println("SQL Error" + e); }
%>
|
<%
if (pr > 10) {row_con=1;
%>
[First]
[Previous]
<%
}//if (pr > 0)
if (pr < (totalpgs * limitePorPagina) - limitePorPagina) {row_con=1;
%>
[Next]
[Last]
<%
}//if (cont < totalpgs)
%> |
<%
if(row_con<1)
{%>
| |
|
|
|
<%}%>
|
|
|
|
|
|
|
|
|
|
|
|
<%
j=0;
%>
<%
//rs2.close();
//st2.close();
rtst.close();
con.close();
%>
<%
count=0;
theam="";
if(con!=null)
{
con.close();
}
%>