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

280 lines
13 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<%
Dim nm_obj, cd_obj 'opener에서 받을 객체
nm_obj = request("nm_obj")
cd_obj = request("cd_obj")
if nm_obj = "" or cd_obj = "" then
alert4 "잘못된 접근입니다."
else
query = " SELECT p_cli_company_cd, p_cli_company_nm FROM V_CLIENT_COMP "
query = query & " ORDER BY p_cli_company_nm "
rsc.Open query, adoConn, 1
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<LINK rel="stylesheet" type="text/css" href="/lib/text.css">
<title>
Client 인원 선택
</title>
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery-ajax-call.js"></script>
<script src="/js/jquery.form.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
//$('#cli_list').css('text-transform','uppercase');
});
function sel_p(cp_no, cp_name) {
var cp_no = $("#cp_list").val();
var cp_name = $("#cp_list option:selected").text();
var cli_name = $("#cli_list option:selected").text();
var f = document.cp_sel;
if (cp_name != ""){
if (f.cp_nm_list.value == "") {
f.cp_nm_list.value = cli_name+"_"+cp_name;
f.cp_cd_list.value = cp_no;
} else {
f.cp_nm_list.value = f.cp_nm_list.value + "," + cli_name+"_"+cp_name;
f.cp_cd_list.value = f.cp_cd_list.value + "," + cp_no;
}
$("#cp_list option:selected").remove();
}else{
alert("Client 인원을 선택해주세요");
}
}
function complete_sel() {
if (document.cp_sel.cp_cd_list.value != "") {
opener.document.<%=nm_obj %>.value = document.cp_sel.cp_nm_list.value;
opener.document.<%=cd_obj %>.value = document.cp_sel.cp_cd_list.value;
self.close();
} else {
alert("인원을 선택해주세요");
}
}
function delete_sel() {
location.href = "./client_search.asp?nm_obj=<%= nm_obj%>&cd_obj=<%= cd_obj%>";
}
function clear_form() {
var f = document.cp_sel;
f.cp_nm_list.value = "";
f.cp_cd_list.value = "";
}
function cursor_cli(val) {
var tmp_index = -1;
var live_chk = false;
if (val.trim() != "") {
$("#cli_list option").each(function (o) {
if($(this).text().toUpperCase().indexOf(val.toUpperCase()) > -1){
live_chk = true;
if (tmp_index == -1) {
if ($("#cli_list option").index($("#cli_list option:selected")) < $(this).index("#cli_list option")) {
tmp_index = $(this).index("#cli_list option");
}
}
}
});
if (live_chk == true) {
if (tmp_index == -1) {
$("#cli_list option").eq(0).prop("selected", true);
$("#cli_list option").eq(0).prop("selected", false);
cursor_cli(val);
} else {
$("#cli_list option").eq(tmp_index).prop("selected", true);
}
sel_cli();
} else {
alert("검색한 단어가 포함된 클라이언트가 없습니다.");
$("#cli_list option").prop("selected", false);
}
}
}
function sel_cli(){
if($("#cli_list").val() != null){
var param = { cli_com_cd : $("#cli_list").val(), cp_sel_list : $("#cp_cd_list").val() };
ajaxCallJson("client_search_ajax.asp", param, null, "post", "cp_list()", "", "null_list()");
}
}
function cp_list(){
$("#cp_list").html("");
$("#cp_list").append(ajaxResponse);
}
function null_list(){
$("#cp_list").html("");
}
function add_cp(){
if($("#cli_list").val() != null){
$("#info_popup").css("display", "block");
$("#info_popup_background").css("display", "block");
$("#add_mod_button").val("추가");
}else{
alert("Client 회사를 선택 후 이용하세요");
}
}
function mod_cp(){
if($("#cp_list").val() != null){
$("#info_popup").css("display", "block");
$("#info_popup_background").css("display", "block");
$("#add_mod_button").val("수정");
var param = { cli_com_cd : $("#cli_list").val(),
cli_per_cd : $("#cp_list").val() };
ajaxCallJson("client_search_ajax.asp", param, null, "post", "mod_cp_load()");
}else{
alert("Client 인원을 선택 후 이용하세요");
}
}
function add_mod_cp_close(){
$("#info_popup").css("display", "none");
$("#info_popup_background").css("display", "none");
$("#p_cli_depart").val("");
$("#p_cli_per_nm").val("");
$("#p_cli_per_nm").prop("readonly", false);
$("#p_cli_per_com_tel").val("");
$("#p_cli_per_tel").val("");
$("#p_cli_per_email").val("");
$("#p_cli_per_cd").val("");
}
function mod_cp_load(){
var cp_array = ajaxResponse.split("||");
$("#p_cli_depart").val(cp_array[0]);
$("#p_cli_per_nm").val(cp_array[1]);
$("#p_cli_per_nm").prop("readonly", true);
$("#p_cli_per_com_tel").val(cp_array[2]);
$("#p_cli_per_tel").val(cp_array[3]);
$("#p_cli_per_email").val(cp_array[4]);
$("#p_cli_per_cd").val($("#cp_list").val());
}
function add_mod_cp_save(){
var param = {
cli_com_cd : $("#cli_list").val(),
p_cli_per_cd : $("#p_cli_per_cd").val(),
p_cli_depart : escape($("#p_cli_depart").val()),
p_cli_per_nm : escape($("#p_cli_per_nm").val()),
p_cli_per_com_tel : escape($("#p_cli_per_com_tel").val()),
p_cli_per_tel : escape($("#p_cli_per_tel").val()),
p_cli_per_email : escape($("#p_cli_per_email").val())
};
ajaxCallJson("client_per_add_mod_ajax.asp", param, null, "post", "cp_save_complete()");
}
function cp_save_complete(){
if(ajaxResponse * 1 > 0){
alert("저장되었습니다");
add_mod_cp_close();
sel_cli();
}
}
</script>
</head>
<body onload="clear_form();">
<table border="0" cellspacing="0" cellpadding="0" style="margin: 10 0 0 10;width:600px;">
<tr><td align="center" style="font-family:'malgun gothic'; font-size:14px;font-weight:bold;background-color:#F2F2F2;padding:10 10 10 10;">Client 인원 선택</td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="margin: 10 0 0 10;width:600px;">
<tr>
<td style="vertical-align:top;width:300px;" align="left">
<table border="0" cellspacing="1" cellpadding="0" style="width:95%;height:340px;">
<tr>
<td align="center" style="font-weight:bold;color:#08298A;">Client 회사<br /><font color="red">(추가등록은 IT에 문의)</font></td>
</tr>
<tr>
<td align="center" style="font-weight:bold;border:1px solid gray;color:#08298A;width:80%;">
<select style='WIDTH: 220px; HEIGHT: 220px' size='2' name='cli_list' id='cli_list' onClick = "sel_cli();">
<%
Do While Not rsc.Eof
%>
<option value="<%=rsc("p_cli_company_cd")%>" title="<%=rsc("p_cli_company_nm")%>"><%=rsc("p_cli_company_nm")%></option>
<%
rsc.MoveNext
Loop
rsc.Close
set rsc = nothing
%>
</select>
<br />
↓검색할 클라이언트 명을 입력 후<br /> Enter를 누르세요<br />
<input type="text" value="" id="selPro" size="30" onkeypress="javascript:if(event.keyCode==13){cursor_cli(this.value); return false};" />
</td>
</tr>
</table>
</td>
<td style="vertical-align:top;width:300px;" align="right">
<table border="0" cellspacing="1" cellpadding="0" style="width:95%;height:340px;">
<tr>
<td align="center" style="font-weight:bold;color:#08298A;">Client 인원<br />&nbsp;</td>
</tr>
<tr>
<td align="center" style="font-weight:bold;border:1px solid gray;color:#08298A;width:80%;">
<select style='WIDTH: 220px; HEIGHT: 220px' size='2' name='cp_list' id='cp_list' ondblClick = "sel_p();" onkeypress = "javascript:if(event.keyCode==13)sel_p();"></select>
<br />
<br />
<input type="button" value="신규 담당자 추가" onclick="add_cp();" style="background-color:White;font-family:'malgun gothic';color:black;font-weight:bold;" /><br />
<input type="button" value="담당자 정보 수정" onclick="mod_cp();" style="background-color:White;font-family:'malgun gothic';color:black;font-weight:bold;" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<form name="cp_sel" method="post">
<table border="0" cellspacing="0" cellpadding="0" style="margin: 10 0 0 10;width:600px;">
<tr>
<td align="center">
<input type="text" value="" name="cp_nm_list" id="cp_nm_list" style="width:90%;" readonly />
<input type="hidden" value="" name="cp_cd_list" id="cp_cd_list" /><br />
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="center">
<input type="button" value="선택 완료" onclick="complete_sel();" style="background-color:White;font-family:'malgun gothic';color:black;font-weight:bold;" />&nbsp; &nbsp; &nbsp; &nbsp;
<input type="button" value="선택 내용 삭제" onclick="delete_sel();" style="background-color:White;font-family:'malgun gothic';color:black;font-weight:bold;" />
</td>
</tr>
</table>
</form>
<div style="filter: alpha(opacity=70);position:absolute; display:none; left:0px; top:0px; z-index:499;width:630px;height:490px;background-color: rgb(255,255,255); opacity:0.7;" id="info_popup_background">&nbsp;</div>
<div style="position:absolute; display:none; left:170px; top:150px; width:300px; height:180px;z-index:500; background-color:#E6E6E6;" id="info_popup">
<table border="0" cellspacing="0" cellpadding="0" style="margin: 10 0 0 10;width:100%;">
<tr>
<td align="right" style="padding-right:15px;width:40%;">담당자 부서 : </td>
<td align="left"><input type="text" value="" name="p_cli_depart" id="p_cli_depart" style="width:90%;font-size:12px;" /></td>
</tr>
<tr>
<td align="right" style="padding-right:15px;width:40%;"><font color="red">* 담당자 성명</font> : </td>
<td align="left"><input type="text" value="" name="p_cli_per_nm" id="p_cli_per_nm" style="width:90%;font-size:12px;" /></td>
</tr>
<tr>
<td align="right" style="padding-right:15px;width:40%;">담당자 회사전화 : </td>
<td align="left"><input type="text" value="" name="p_cli_per_com_tel" id="p_cli_per_com_tel" style="width:90%;font-size:12px;" /></td>
</tr>
<tr>
<td align="right" style="padding-right:15px;width:40%;">담당자 핸드폰 : </td>
<td align="left"><input type="text" value="" name="p_cli_per_tel" id="p_cli_per_tel" style="width:90%;font-size:12px;" /></td>
</tr>
<tr>
<td align="right" style="padding-right:15px;width:40%;">담당자 메일 : </td>
<td align="left"><input type="text" value="" name="p_cli_per_email" id="p_cli_per_email" style="width:90%;font-size:12px;" /></td>
</tr>
<tr><td colspan="2"><input type="hidden" value="" name="p_cli_per_cd" id="p_cli_per_cd" />&nbsp;</td></tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="" id="add_mod_button" onclick="add_mod_cp_save();" style="background-color:White;font-family:'malgun gothic';color:black;font-weight:bold;" />&nbsp; &nbsp;
<input type="button" value="취소" onclick="add_mod_cp_close();" style="background-color:White;font-family:'malgun gothic';color:black;font-weight:bold;" />&nbsp; &nbsp; &nbsp;
</td>
</tr>
</table>
</div>
</body>
</html>
<%
end if
%>