Files
KIN/project/project_AjaxCliSave.asp
2025-09-29 17:55:08 +09:00

106 lines
4.2 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<%
Response.CharSet="euc-kr"
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "cache-control", "no-staff"
Response.Expires = -1
set dbin = server.CreateObject("ADODB.CONNECTION")
flag = request("flag")
p_sn = request("p_sn")'프로젝트 코드
p_cli_company_cd = request("p_cli_company_cd")'클라이언트 회사코드
p_cli_per_cd = request("p_cli_per_cd")'클라이언트 회사 담당자 코드
p_client_type_cd = request("p_client_type_cd")'조사 업종
cli_depart = unescape(request("cli_depart"))'신규 클라 부서
cli_nm = unescape(request("cli_nm"))'신규 클라
cli_tel = request("cli_tel")'신규 클라 내선
cli_phone = request("cli_phone")'신규 클라 핸드폰
cli_email = request("cli_email")'신규 클라 메일
Dim html
select case flag
case "CliInfo"
query = "select * from project2.dbo.V_CLIENT_PERSON where p_cli_per_cd = '"&p_cli_per_cd&"'"
rsc.Open query, adoConn, 1
if not rsc.eof Then
Response.write clie_info(rsc("p_cli_per_cd"), rsc("p_cli_depart"), rsc("p_cli_per_nm"), rsc("p_cli_per_com_tel"), rsc("p_cli_per_tel"), rsc("p_cli_per_email"))
else
Response.write clie_info("", "", "", "", "", "")
End If
rsc.Close
case "CliPerson"
query = ""
query = query &" insert into project2.dbo.T_CLIENT_PERSON (p_cli_company_cd, p_cli_depart, p_cli_per_nm, p_cli_per_com_tel, p_cli_per_tel, p_cli_per_email, p_input_dt, p_input_user) "&VbCrlf
query = query &" values ('"&p_cli_company_cd&"', '"&cli_depart&"', '"&cli_nm&"', '"&cli_tel&"', '"&cli_phone&"', '"&cli_email&"', GETDATE(), '"&Session("User_Number")&"'); "&VbCrlf
dbin.Open adoConn
dbin.Execute query
dbin.Close
case "CliEdit"
query = ""
query = query &" Update project2.dbo.T_CLIENT_PERSON set "&VbCrlf
query = query &" p_cli_depart = '"&cli_depart&"', "&VbCrlf
query = query &" p_cli_per_nm = '"&cli_nm&"', "&VbCrlf
query = query &" p_cli_per_com_tel = '"&cli_tel&"', "&VbCrlf
query = query &" p_cli_per_tel = '"&cli_phone&"', "&VbCrlf
query = query &" p_cli_per_email = '"&cli_email&"', "&VbCrlf
query = query &" p_input_dt = GETDATE(), "&VbCrlf
query = query &" p_input_user = '"&Session("User_Number")&"' "&VbCrlf
query = query &" where p_cli_per_cd = '"&p_cli_per_cd&"' "&VbCrlf
dbin.Open adoConn
dbin.Execute query
dbin.Close
case else
End Select
Function clie_info(cli_per_cd, cli_per_depart, cli_per_nm, cli_per_tel, cli_per_phone, cli_per_email)
Dim html
html = ""
html = html & "<legend class='cnm2'></legend>"
html = html & " <table class='PerAdd'>"
html = html & " <tbody class='ui-widget-content'>"
html = html & " <tr>"
html = html & " <th>부서</th>"
html = html & " <td><input type='hidden' name='cli_per_cd' id='cli_per_cd' value='"&cli_per_cd&"' />"
html = html & " <input type='text' name='cli_depart' id='cli_depart' value='"&cli_per_depart&"' /></td>"
html = html & " </tr>"
html = html & " <tr>"
html = html & " <th>담당자 이름</th>"
html = html & " <td><input type='text' name='cli_nm' id='cli_nm' value='"&cli_per_nm&"' /></td>"
html = html & " </tr>"
html = html & " <tr>"
html = html & " <th>회사 전화번호</th>"
html = html & " <td><input type='text' name='cli_tel' id='cli_tel' value='"&cli_per_tel&"' /></td>"
html = html & " </tr>"
html = html & " <tr>"
html = html & " <th>담당자 핸드폰번호</th>"
html = html & " <td><input type='number' name='cli_phone' id='cli_phone' value='"&cli_per_phone&"' /></td>"
html = html & " </tr>"
html = html & " <tr>"
html = html & " <th>이메일</th>"
html = html & " <td><input type='text' name='cli_email' id='cli_email' value='"&cli_per_email&"' /></td>"
html = html & " </tr>"
html = html & " </tbody>"
html = html & " <tfoot>"
html = html & " <tr>"
html = html & " <td colspan='2'><button type='button' id='addOk'' style='width:100%;background-color:#ffffff;' class='ui-button ui-widget ui-corner-all'>저장</button></td>"
html = html & " </tr>"
html = html & " </tfoot>"
html = html & " </table>"
clie_info = html
End Function
%>