만들구있는데 포인트지급까진 완료됬고 한계정당 시간 24시간기준으로 포인트를 1일 1회 지급하고싶은데 어떻게해야하나요..
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%@ page import ="java.sql.*,java.util.*,java.util.Calendar" %>
<%request.setCharacterEncoding("euc-kr"); %>
<%response.setCharacterEncoding("euc-kr");
String unick=(String)session.getAttribute("usernick") ;
if (unick==null) {
//("세션이 종료되었습니다.");
response.sendRedirect("Home.jsp");
}
String upoint = (String)session.getAttribute("userpoint");
String uid = (String)session.getAttribute("userid");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
function send(){
document.reply.method = "post"
document.reply.action = "reply_output.jsp";
document.reply.submit();
}
</script>
</head>
<center><b><img src=image/check.png></b></center>
<body>
<p><p>
<fieldset style="border-color: #8f0100;">
<form action=reply_output.jsp name=reply>
<table width="600" height="50" border=0 align="center" style="border-collapse:collapse; border:4; solid ;border-color:#8F0100;">
<tr>
<input type = hidden value=<%=upoint %> name=upoint>
<input type = hidden value=<%=uid %> name=uid>
<td width="100" align=center><img src=image/memo.png width=80 heigth=80></td>
<td width="400"><input type="text" size="50" name=des style="border-color:#8F0100">
<input type=hidden value=<%=unick %> name=nick>
</td>
<td width="100" align=center><input type=image src=image/button.png width=50 height=26 action=reply_output.jsp" onclick="alert('하루에한번투표가능합니다.')">
</tr>
</form>
<div>
<%
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin://localhost:1521/ORCL";
Connection conn = DriverManager.getConnection(url,"SCOTT","tiger");
Statement stmt = conn.createStatement();
ResultSet rs1=stmt.executeQuery("select count(*) from reply");
rs1.next();
int total=rs1.getInt(1);
//현재 페이지
int a = 0;
int nowPage = 0;
int nowBlock = 0; //현재 블럭+
int totalRecord = total;
int numPerPage = 10;
int pagePerBlock = 15;
int totalPage = 0;
int totalBlock = 0;
int beginPerPage = 0;
if(request.getParameter("nowPage")!=null){
nowPage = Integer.parseInt(request.getParameter("nowPage"));
nowBlock = Integer.parseInt(request.getParameter("nowBlock"));
}
beginPerPage = nowPage * numPerPage;
totalPage =(int)Math.ceil((double)totalRecord / numPerPage);
totalBlock =(int)Math.ceil((double)totalPage / pagePerBlock);
%>
<%
PreparedStatement pstmt2 = null;
// String strSQL ="select name,contents,wdate from reply where news_num=?";
//String strSQL ="select num,nick,des,TO_CHAR(wdate,'YY-MM-DD HH24:MI') wdate from reply where num between "+beginPerPage+" and "+(beginPerPage+numPerPage)+" order by num desc";
String strSQL ="select num,nick,des,TO_CHAR(wdate,'YY-MM-DD HH24:MI') wdate from reply order by num desc";
pstmt2 = conn.prepareStatement(strSQL);
//pstmt2.setInt(1, num);
ResultSet rs=pstmt2.executeQuery();
%>
<%
int cnt=0;
while(rs.next())
{
if(cnt==beginPerPage) {
for (int i = beginPerPage;i < (beginPerPage+numPerPage); i++) {
if (i==totalRecord) break;
out.println("<table border=0 width=600 align=center>");
out.println("<tr><td align='center'width=95>");
out.println(rs.getString("nick")+"</td><td width=400 >");
out.println(rs.getString("des")+"</td><font size=1><b><td align=center width=105>");
out.println(rs.getString("wdate")+"</td></tr><b></font>");
rs.next();
cnt +=1;
}
}
cnt +=1;
}
%>
</table><br><br></form></fieldset>
<%
%>
<!-- 검색폼 끝 -->
<table width="650" border="0" align=center>
<tr>
<td><br><br></td>
</tr>
<tr>
<!--페이징 및 블럭 처리 시작 -->
<td align="center" > Go to Page
<%
if(totalRecord !=0){ %>
<!-- 이전 블럭 -->
<% if (nowBlock > 0) {%>
<a href="Reply.jsp?nowBlock=<%=nowBlock - 1 %>&nowPage=<%=((nowBlock - 1) *
pagePerBlock)%>">
[이전 <%=pagePerBlock %>]</a>
<%}%>
<%
for (int i = 0; i < pagePerBlock; i++) { %>
<a href="Reply.jsp?nowBlock=<%=nowBlock %>&nowPage=<%=(nowBlock*pagePerBlock) + i %>">
[<%=(nowBlock * pagePerBlock) + i + 1 %>]</a>
<% if ((nowBlock * pagePerBlock) + i + 1 == totalPage) break; %>
<!-- 다음 블럭 -->
<% if(totalBlock>nowBlock+1){%>
<a href="Reply.jsp?nowBlock=<%=nowBlock+1 %>&nowPage=<%=(nowBlock+1)*pagePerBlock %>">
[다음 <%=pagePerBlock %>]</a>
<%}%>
<%}
}else{
out.println("등록된 게시물이 없습니다.");
}
%>
</td>
</table>
<br>
<table align=center border="0" width="80%">
<tr>
<td align="center">Total : <%=totalRecord%> Articles(<font color=#8F0100>
<%=nowPage+1%>/<%=totalPage%>Pages</font>)</td>
</tr>
</table>
<Table align=center>
<form name="reply" method="post">
<input type="hidden" name="num" value="">
<input type="hidden" name="nowPage" value="<%=nowPage%>">
<input type="hidden" name="nowBlock" value="<%=nowBlock%>">
</form>
<form name="reply" method="post">
<input type="hidden" name="reload" value="true">
<input type="hidden" name="nowPage" value="0">
<input type="hidden" name="nowBlock" value="0">
</form>
</table>
<%
pstmt2.close();
conn.close();
%>
</div>
--------------------------------------------------------------------------------------------------
<%-- <%@ page language="java" contentType="text/html; charset=EUC-KR" --%>
<%-- pageEncoding="EUC-KR"%> --%>
<%-- <%@page import="java.sql.*,java.util.*,java.util.Calendar"%> --%>
<%-- <% --%>
// request.setCharacterEncoding("euc-kr");
<%-- %> --%>
<%-- <% --%>
// response.setCharacterEncoding("euc-kr");
<%-- %> --%>
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->
<!-- <html> -->
<!-- <head> -->
<!-- <meta http-equiv="Content-Type" content="text/html; charset=EUC-KR"> -->
<%-- <% --%>
// String num = request.getParameter("num");
// String nick = request.getParameter("nick");
// String des = request.getParameter("des");
// String point = request.getParameter("upoint");
// String id = request.getParameter("uid");
// Class.forName("oracle.jdbc.driver.OracleDriver");
// String url = "jdbc:oracle:thin://localhost:1521/ORCL";
// Connection conn = DriverManager
// .getConnection(url, "SCOTT", "tiger");
// PreparedStatement pstmt2 = null;
// ResultSet rs = null;
// String strSQL = "INSERT INTO reply(num,nick,des,wdate)";
// strSQL = strSQL + "VALUES(reply_seq.nextval,?,?,sysdate)";
// pstmt2 = conn.prepareStatement(strSQL);
// pstmt2.setString(1, nick);
// pstmt2.setString(2, des);
// rs = pstmt2.executeQuery();
// rs.next();
// strSQL ="update member set point=?+50 where id=?";
// pstmt2 = conn.prepareStatement(strSQL);
// pstmt2.setString(1, point);
// pstmt2.setString(2, id);
// pstmt2.executeUpdate();
// rs.close();
// pstmt2.close();
// conn.close();
// response.sendRedirect("Reply.jsp");
<%-- %> --%>
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%@page import="java.sql.*,java.util.*,java.util.Calendar"%>
<%
request.setCharacterEncoding("euc-kr");
%>
<%
response.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<%
String num = request.getParameter("num");
String nick = request.getParameter("nick");
String des = request.getParameter("des");
String id = request.getParameter("uid");
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin://localhost:1521/ORCL";
Connection conn = DriverManager
.getConnection(url, "SCOTT", "tiger");
PreparedStatement pstmt2 = null;
String strSQL = "INSERT INTO reply(num,nick,des,wdate)";
strSQL = strSQL + "VALUES(reply_seq.nextval,?,?,sysdate)";
pstmt2 = conn.prepareStatement(strSQL);
pstmt2.setString(1, nick);
pstmt2.setString(2, des);
pstmt2.executeUpdate();
strSQL ="update member set point=point+50 where id=?";
pstmt2 = conn.prepareStatement(strSQL);
pstmt2.setString(1, id);
pstmt2.executeUpdate();
pstmt2.close();
conn.close();
response.sendRedirect("Reply.jsp");
%>
댓글 1개
게시글 목록
| 번호 | 제목 |
|---|---|
| 27980 | |
| 7164 | |
| 31729 | |
| 31726 | |
| 31725 | |
| 31720 | |
| 31711 | |
| 7159 | |
| 27974 | |
| 19734 | |
| 19730 | |
| 19729 |
PHP
[알고리즘] 배열 역순
|
| 27969 | |
| 7142 | |
| 19728 |
jQuery
remove()를 이용하여 엘리먼트 삭제하기
|
| 19725 | |
| 7130 | |
| 19722 |
jQuery
동일 엘리먼트 순번 알아내기
2
|
| 19719 | |
| 7124 | |
| 19718 | |
| 19717 | |
| 19716 |
jQuery
position() 메서드 객체에 대한 좌표값
|
| 19715 | |
| 7122 | |
| 30959 | |
| 19714 | |
| 31710 |
jQuery Mobile
jQuery Mobile 강좌 19. Select Menus
|
| 31709 |
jQuery Mobile
jQuery Mobile 강좌 18. Text Inputs
|
| 19713 | |
| 7117 | |
| 19712 | |
| 7111 | |
| 31708 |
jQuery Mobile
jQuery Mobile 강좌 17. Form Basic
|
| 31707 |
jQuery Mobile
jQuery Mobile 강좌 16. Filters
|
| 19710 | |
| 31706 |
jQuery Mobile
jQuery Mobile 강좌 15. List Content
|
| 31705 |
jQuery Mobile
jQuery Mobile 강좌 14. List Views
|
| 31704 |
jQuery Mobile
jQuery Mobile 강좌 13. Layout Grids
|
| 19709 | |
| 19707 | |
| 31703 |
jQuery Mobile
jQuery Mobile 강좌 12. Tables
|
| 19706 |
jQuery
class가 있는지 없는지 체크하기
|
| 31702 |
jQuery Mobile
jQuery Mobile 강좌 11. Collapsibles
|
| 19705 |
PHP
배열에서 중복 값 없애기
|
| 31701 |
jQuery Mobile
jQuery Mobile 강좌 10. Panels
|
| 19704 | |
| 31700 |
jQuery Mobile
jQuery Mobile 강좌 9. Navigation Bars
|
| 31699 |
jQuery Mobile
jQuery Mobile 강좌 8. Toolbars
|
| 31698 |
jQuery Mobile
jQuery Mobile 강좌 7. Popups
|
| 7107 | |
| 19703 |
JavaScript
str_pad 자릿수만큼 특정문자로 채우기
|
| 31697 |
jQuery Mobile
jQuery Mobile 강좌 6. Icons
|
| 31696 |
jQuery Mobile
jQuery Mobile 강좌 5. Buttons
|
| 19702 | |
| 19701 | |
| 31695 |
jQuery Mobile
jQuery Mobile 강좌 4. Transitions
|
| 27965 | |
| 31694 |
jQuery Mobile
jQuery Mobile 강좌 3. Pages
|
| 19700 | |
| 31693 |
jQuery Mobile
jQuery Mobile 강좌 2. Install
|
| 19699 | |
| 31692 |
jQuery Mobile
jQuery Mobile 강좌 1. Introduction
|
| 31691 |
jQuery Mobile
jQuery Mobile 강좌 0.home
|
| 19698 | |
| 19697 | |
| 19696 |
jQuery
마우스 오버 위치에 따라 툴팁 생성 및 자동 이동
|
| 19694 | |
| 19693 |
jQuery
제이쿼리 동적으로 생성된 객체에 이벤트 생성하기
|
| 19692 | |
| 19691 | |
| 19690 |
JavaScript
shuffle 배열섞기
|
| 19689 |
jQuery
제이쿼리 모음 사이트
|
| 19688 |
PHP
1원팁] IP 대역 비교
|
| 19687 | |
| 7105 | |
| 30955 | |
| 7100 | |
| 19681 |
PHP
input 쉽게 관리하기
5
|
| 7097 | |
| 19678 |
JavaScript
서버시간을 사용한 전자시계
2
|
| 7089 | |
| 7086 | |
| 7084 | |
| 7082 | |
| 19677 | |
| 30953 | |
| 7080 | |
| 7077 | |
| 7071 | |
| 7070 | |
| 7066 | |
| 19676 |
JavaScript
구글 웹사이트 번역기를 내 사이트에 달기
|
| 19674 | |
| 27961 | |
| 7063 | |
| 7061 | |
| 19669 | |
| 7060 | |
| 20842 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기