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_no = r_call(request.getParameter("c_no"));
|
|
String c_name = r_call(request.getParameter("c_name"));
|
|
String c_eng_name = r_call(request.getParameter("c_eng_name"));
|
|
String c_site_name = r_call(request.getParameter("c_site_name"));
|
|
String c_main_type = r_call(request.getParameter("c_main_type"));
|
|
String c_institute = r_call(request.getParameter("c_institute"));
|
|
String c_master = r_call(request.getParameter("c_master"));
|
|
String c_tel = r_call(request.getParameter("c_tel"));
|
|
String c_exp = r_call(request.getParameter("c_exp"));
|
|
|
|
String sql1=" SELECT c_no from tbl_field where c_eng_name = '" + c_eng_name + "' and c_no <> " + c_no;
|
|
ResultSet rst = stmt.executeQuery(sql1);
|
|
if(rst.next()) {
|
|
%>
|
|
<script>
|
|
alert("The same field name already exists.\nPlease change the field name.");
|
|
parent.document.bcb.c_eng_name.focus();
|
|
</script>
|
|
<%
|
|
|
|
}else{
|
|
String sql_ok = "";
|
|
sql_ok = "update tbl_field set c_eng_name='"+ c_eng_name +"',c_name='"+ c_name +"',c_site_name='"+ c_site_name +"',c_institute='"+ c_institute +"',c_master='"+ c_master +"',c_tel='"+ c_tel +"',c_exp='"+ c_exp +"',c_main_type="+ c_main_type +" where c_no = " + c_no;
|
|
stmt2.execute(sql_ok);
|
|
%>
|
|
<script>
|
|
alert("Edit OK");
|
|
parent.location.href="list.jsp"
|
|
</script>
|
|
<%
|
|
}
|
|
rst.close();
|
|
%>
|
|
<%@include file="/include/db/db_close.jsp"%> |