39 lines
1.4 KiB
Plaintext
39 lines
1.4 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_name = r_call(request.getParameter("c_name"));
|
|
String c_id = r_call(request.getParameter("c_id"));
|
|
String c_pass = r_call(request.getParameter("c_pass"));
|
|
String c_position = r_call(request.getParameter("c_position"));
|
|
String c_part = r_call(request.getParameter("c_part"));
|
|
String c_phone = r_call(request.getParameter("c_phone"));
|
|
String c_email = r_call(request.getParameter("c_email"));
|
|
|
|
String sql1=" SELECT c_no from tbl_manager where c_id = '" + c_id + "' ";
|
|
ResultSet rst = stmt.executeQuery(sql1);
|
|
if(rst.next()) {
|
|
%>
|
|
<script>
|
|
alert("An administrator with the same ID already exists.\nPlease change your ID..");
|
|
parent.document.bcb.c_eng_name.focus();
|
|
</script>
|
|
<%
|
|
|
|
}else{
|
|
String sql_ok = "";
|
|
sql_ok = "insert into tbl_manager (c_relation, c_name,c_id,c_pass,c_part,c_position,c_phone,c_email,c_use,c_date) values(";
|
|
sql_ok = sql_ok + "0,'" + c_name + "','" + c_id + "',SHA2('" + c_pass + "',512),'" + c_part + "','" + c_position + "','" + c_phone + "','" + c_email + "',0,now())";
|
|
stmt2.execute(sql_ok);
|
|
%>
|
|
<script>
|
|
alert("Insert OK");
|
|
parent.location.href="list.jsp"
|
|
</script>
|
|
<%
|
|
}
|
|
rst.close();
|
|
%>
|
|
<%@include file="/include/db/db_close.jsp"%> |