40 lines
1.5 KiB
Plaintext
40 lines
1.5 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_project_no = r_call(request.getParameter("c_project_no"));
|
|
String c_bcb_period = r_call(request.getParameter("c_bcb_period"));
|
|
int n_bcb_period = Integer.parseInt(c_bcb_period);
|
|
|
|
if(c_project_no.equals("")){
|
|
%>
|
|
<script>
|
|
alert("Wrong Connection.");
|
|
location.href="/"
|
|
</script>
|
|
<%
|
|
}else{
|
|
String c_bcb_s_date = r_call(request.getParameter("c_s_1" ));
|
|
String c_bcb_e_date = r_call(request.getParameter("c_e_" + c_bcb_period ));
|
|
|
|
String sql_ok = "update tbl_project_plan set c_bcb_s_date = '"+ c_bcb_s_date +"', c_bcb_e_date = '"+ c_bcb_e_date +"', c_bcb_period = "+ c_bcb_period +" where c_relation=0 and c_project_no = "+ c_project_no;
|
|
stmt.execute(sql_ok);
|
|
|
|
sql_ok = " delete from tbl_project_plan_bcb_period where c_project_no = "+ c_project_no;
|
|
stmt.execute(sql_ok);
|
|
|
|
for(int i = 1; i < n_bcb_period + 1; i++){
|
|
sql_ok = " insert into tbl_project_plan_bcb_period (c_project_no, c_period_no, c_s_date, c_e_date ) values (";
|
|
sql_ok = sql_ok + c_project_no + "," + i + ",'" + r_call(request.getParameter("c_s_" + i)) + "','" + r_call(request.getParameter("c_e_" + i)) + "')";
|
|
stmt.execute(sql_ok);
|
|
}
|
|
%>
|
|
<script>
|
|
alert("Edit OK")
|
|
location.href="list.jsp?c_project_no=<%=c_project_no%>"
|
|
</script>
|
|
<%
|
|
}
|
|
%>
|
|
<%@include file="/include/db/db_close.jsp"%> |