83 lines
1.8 KiB
Plaintext
83 lines
1.8 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<%
|
|
cli_name = request("cli_name") '이름 검색에 사용된 Client Name
|
|
c_name = request("c_name") '새로 추가될 Client Name
|
|
c_type = request("c_type") '새로 추가될 Client Type
|
|
|
|
'Client 형태
|
|
dim tmp_cliform(99)
|
|
|
|
query = "SELECT * "
|
|
query = query & "FROM Client_Type "
|
|
query = query & "ORDER BY sort_key "
|
|
|
|
rsc.Open query, adoConn, 1
|
|
if rsc.RecordCount > 0 then
|
|
for i = 1 to rsc.RecordCount
|
|
|
|
tmp_cliform(int(rsc("c_type_code"))) = rsc("c_type_name")
|
|
|
|
rsc.MoveNext
|
|
next
|
|
end if
|
|
rsc.Close
|
|
|
|
query = "SELECT MAX(c_code) as c_code "
|
|
query = query & "FROM Client "
|
|
query = query & "WHERE c_code < 9900 "
|
|
|
|
rsc.Open query, adoConn, 1
|
|
tmp_code = rsc("c_code") + 1
|
|
rsc.Close
|
|
|
|
query = "SELECT * "
|
|
query = query & "FROM client "
|
|
query = query & "WHERE c_name = '" & c_name & "' "
|
|
|
|
rsc.Open query, adoConn, 1
|
|
if rsc.RecordCount > 0 then
|
|
tmp_result = "1"
|
|
else
|
|
tmp_result = "0"
|
|
end if
|
|
rsc.Close
|
|
|
|
if tmp_result = "0" then
|
|
query = "INSERT INTO Client "
|
|
query = query & "(c_code, c_name, c_type) "
|
|
query = query & "VALUES "
|
|
query = query & "('" & tmp_code & "', "
|
|
query = query & "'" & c_name & "', "
|
|
query = query & "'" & c_type & "')"
|
|
|
|
'Response.Write query
|
|
set dbin = server.CreateObject("ADODB.CONNECTION")
|
|
dbin.Open adoConn
|
|
dbin.Execute query
|
|
dbin.Close
|
|
%>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
|
|
<LINK rel="stylesheet" type="text/css" href="/lib/text.css">
|
|
<title>
|
|
클라이언트 추가
|
|
</title>
|
|
<script language=javascript>
|
|
function goit() {
|
|
document.pms.action = 'cli_search.asp'
|
|
document.pms.submit();
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body onLoad="goit()">
|
|
<form name="pms" method="post">
|
|
|
|
<input type="hidden" name="cli_name" value="<%=cli_name%>">
|
|
<%
|
|
else
|
|
alert2 "이미 등록되어 있는 이름입니다"
|
|
end if
|
|
set rsc = nothing
|
|
%> |