c-innovacion2/resoft/field_manager_new/process/point/project/change.jsp

55 lines
1.7 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/include/db/db_connect.jsp"%>
<%@include file="/include/function/function.jsp"%>
<%request.setCharacterEncoding("utf-8");%>
<%
String c_no = r_call(request.getParameter("c_no"));
String c_home= r_call(request.getParameter("c_home"));
String c_project_no= r_call(request.getParameter("c_project_no"));
String c_now= r_call(request.getParameter("c_now"));
if(c_no.equals("")){
%>
<script>
alert("잘못 된 접속입니다.");
location.href="list.jsp"
</script>
<%
}else{
if(c_now.equals("1")){
String sql1=" SELECT a.c_name,(select c_name from tbl_project where c_no = a.c_project_no ) as p_name from tbl_point_project a where a.c_home = " + c_home + " and a.c_maker = 0 and a.c_use=0 and a.c_now = 1";
ResultSet rst = stmt.executeQuery(sql1);
if(rst.next()){
%>
<script>
alert("현재 [<%=rst.getString("p_name")%> - <%=rst.getString("c_name")%>] 평가가 진행중에 있습니다.\n평가를 종료 후 진행해 주세요.");
location.href="list.jsp?c_home=<%=c_home%>&c_project_no=<%=c_project_no%>"
</script>
<%
}else{
String sql_ok = "update tbl_point_project set c_now = "+ c_now +" where c_no = "+ c_no;
stmt.execute(sql_ok);
%>
<script>
alert("변경했습니다. ");
location.href="list.jsp?c_home=<%=c_home%>&c_project_no=<%=c_project_no%>"
</script>
<%
}
rst.close();
}else{
String sql_ok = "update tbl_point_project set c_now = "+ c_now +" where c_no = "+ c_no;
stmt.execute(sql_ok);
%>
<script>
alert("변경했습니다. ");
location.href="list.jsp?c_home=<%=c_home%>&c_project_no=<%=c_project_no%>"
</script>
<%
}
}
%>
<%@include file="/include/db/db_close.jsp"%>