162 lines
3.4 KiB
Plaintext
162 lines
3.4 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<%
|
|
set rsp = server.CreateObject("ADODB.RECORDSET")
|
|
|
|
p_sn = request("p_sn")
|
|
|
|
del_chk = "0" '값이 1이라면 삭제할 수 없음
|
|
|
|
'===========================================================
|
|
'문서내용 테이블에서 현재 프로젝트 관련 문서가 있는지 판별, 있다면 삭제할 수 없음
|
|
'-----------------------------------------------------------
|
|
query = "SELECT * "
|
|
query = query & "FROM 문서내용 "
|
|
query = query & "WHERE p_sn like '%" & p_sn & "%' "
|
|
query = query & " AND del_yes_no = 'no' "
|
|
|
|
if tmp_admin_chk = "1" then
|
|
Response.Write query & "<BR>"
|
|
end if
|
|
rsp.Open query, adoConn, 1
|
|
if rsp.RecordCount > 0 then
|
|
|
|
if instr(1, rsp("p_sn"), ",") then
|
|
|
|
tmp_txt = split(replace(rsp("p_sn"), " ", ""))
|
|
|
|
for i = 0 to UBOUND(tmp_txt)
|
|
|
|
if p_sn = tmp_txt(i) then
|
|
|
|
del_chk = "1"
|
|
|
|
end if
|
|
|
|
next
|
|
|
|
else
|
|
|
|
if p_sn = replace(rsp("p_sn"), " ", "") then
|
|
|
|
del_chk = "1"
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
rsp.Close
|
|
|
|
|
|
|
|
'job 테이블에서 현재 프로젝트 관련 문서가 있는지 판별, 있다면 삭제할 수 없음
|
|
'-----------------------------------------------------------
|
|
query = "SELECT * "
|
|
query = query & "FROM job "
|
|
query = query & "WHERE j_p_sn = '" & p_sn & "' "
|
|
|
|
if tmp_admin_chk = "1" then
|
|
Response.Write query & "<BR>"
|
|
end if
|
|
rsp.Open query, adoConn, 1
|
|
if rsp.RecordCount > 0 then
|
|
|
|
del_chk = "2"
|
|
|
|
end if
|
|
rsp.Close
|
|
|
|
|
|
|
|
if del_chk = "0" then
|
|
|
|
'로그삽입(p_sn, p_subject, p_budget, user)
|
|
query = "SELECT * "
|
|
query = query & "FROM project "
|
|
query = query & "WHERE p_sn = '" & p_sn & "' "
|
|
|
|
if tmp_admin_chk = "1" then
|
|
Response.Write query & "<BR>"
|
|
end if
|
|
rsp.Open query, adoConn, 1
|
|
if rsp.RecordCount > 0 then
|
|
|
|
p_subject = rsp("p_subject")
|
|
p_budget = rsp("p_budget")
|
|
|
|
end if
|
|
rsp.Close
|
|
|
|
query = "INSERT INTO project_log "
|
|
query = query & "(p_sn, p_subject, p_budget, p_log, p_date, p_time, p_user, p_user_name, p_user_ip) "
|
|
query = query & "VALUES "
|
|
query = query & "('" & p_sn & "', "
|
|
query = query & "'" & p_subject & "', "
|
|
query = query & "'" & p_budget & "', "
|
|
query = query & "'프로젝트 삭제', "
|
|
query = query & "'" & year(date) & "-" & zeroformat(month(date),2) & "-" & zeroformat(day(date),2) & "', "
|
|
query = query & "'" & time() & "', "
|
|
query = query & "'" & Session("User_Number") & "', "
|
|
query = query & "'" & Session("loginuser") & "', "
|
|
query = query & "'" & Session("USERIP") & "')"
|
|
|
|
if tmp_admin_chk = "1" then
|
|
Response.Write query & "<BR>"
|
|
end if
|
|
adoconn.execute query
|
|
|
|
|
|
|
|
'프로젝트 테이블에서 삭제
|
|
query = "DELETE "
|
|
query = query & "FROM project "
|
|
query = query & "WHERE p_sn = '" & p_sn & "' "
|
|
|
|
if tmp_admin_chk = "1" then
|
|
Response.Write query & "<BR>"
|
|
end if
|
|
adoconn.execute query
|
|
|
|
|
|
|
|
'프로젝트 가등록 테이블에서 삭제
|
|
query = "DELETE "
|
|
query = query & "FROM project_pre "
|
|
query = query & "WHERE p_sn = '" & p_sn & "' "
|
|
|
|
if tmp_admin_chk = "1" then
|
|
Response.Write query & "<BR>"
|
|
end if
|
|
adoconn.execute query
|
|
|
|
end if
|
|
'===========================================================
|
|
%>
|
|
|
|
<html>
|
|
<script>
|
|
function goit(x) {
|
|
|
|
if (x == 0)
|
|
{
|
|
alert('삭제되었습니다');
|
|
self.close();
|
|
}
|
|
else if (x == 1)
|
|
{
|
|
alert("프로젝트 관련 문서가 존재하여 삭제할 수 없습니다. 다시 확인해 주세요");
|
|
history.back();
|
|
}
|
|
else if (x == 2)
|
|
{
|
|
alert("업무일지 기록이 존재하여 삭제할 수 없습니다. 다시 확인해 주세요");
|
|
history.back();
|
|
}
|
|
}
|
|
</script>
|
|
<body onLoad="goit('<%=del_chk%>')">
|
|
<form name="pms" method="post">
|
|
<input type="hidden" name="p_sn" value="<%=p_sn%>">
|
|
</form>
|
|
</body>
|
|
</html> |