<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
  • ⓒ KOICA.    All right reserved.
TOP
<% Calendar currentCalendar = Calendar.getInstance(); int strYear = currentCalendar.get(Calendar.YEAR); int strMonth = currentCalendar.get(Calendar.MONTH) + 1; String visit_ok = ""; if(!visit_show_no.equals("0")){ String sql_visit = "select c_no from tbl_visit "; sql_visit = sql_visit + " where c_home = 0 "; sql_visit = sql_visit + " and c_show_no = " + visit_show_no + " "; sql_visit = sql_visit + " and c_project_no = " + visit_project_no + " "; sql_visit = sql_visit + " and c_year = " + strYear + " "; sql_visit = sql_visit + " and c_month = " + strMonth + " "; ResultSet rs_vist = stmt.executeQuery(sql_visit); if(rs_vist.next()){ visit_ok = "update tbl_visit set c_visit = c_visit + 1 "; visit_ok = visit_ok + " where c_home = 0 and c_project_no = "+ visit_project_no +" and c_show_no = " + visit_show_no + " and c_c_no =0 "; visit_ok = visit_ok + " and c_year = " + strYear + " and c_month = " + strMonth + " "; }else{ visit_ok = "insert into tbl_visit(c_home,c_project_no,c_show_no,c_c_no,c_year,c_month,c_visit)values("; visit_ok = visit_ok + "0,"+ visit_project_no +"," + visit_show_no + ",0," + strYear + "," + strMonth + ",1)"; } rs_vist.close(); stmt2.execute(visit_ok); } %> <%}%>