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

228 lines
5.3 KiB
Plaintext

<!-- #include virtual = "lib/config.asp" -->
<%
set rsp = server.CreateObject("ADODB.RECORDSET")
p_sn = request("p_sn")
teamname = request("teamname")
'Response.Write today & "<BR>"
query = "SELECT * "
query = query & "FROM project "
query = query & "WHERE p_sn='" & p_sn & "' "
rsc.Open query, adoConn, 1
if rsc.RecordCount > 0 then
p_view_grade = rsc("p_view_grade")
query = "SELECT * "
query = query & "FROM depart "
query = query & "WHERE d_code = '" & Session("Depart_Code") & "' "
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 then
tmp_login_code = rsp("d_mcode") '해당부서를 가져옴
else
tmp_login_code = "99"
end if
rsp.Close
query = "SELECT * "
query = query & "FROM person "
query = query & "WHERE p_no = '" & Session("User_Number") & "' "
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 then
tmp_job_part = rsp("p_job_part") '임원(+김홍근)인지를 판단
else
tmp_job_part = "99"
end if
rsp.Close
'----------------------------------------------------------------------------
tmp_view_allow = "0" '(0 : 수행불가, 1 : 수행가능)
if p_view_grade = "1" then '전체 뷰 가능
tmp_view_allow = "1"
elseif p_view_grade = "2" then '연구부서 한정
if int(tmp_login_code) <= 2 or tmp_admin_chk = "1" then
tmp_view_allow = "1"
else
tmp_view_allow = "0"
end if
elseif p_view_grade = "3" then '해당부서 한정(사조, 마케팅)
if rsc("p_depart") = tmp_login_code or tmp_admin_chk = "1" then
tmp_view_allow = "1"
else
tmp_view_allow = "0"
end if
elseif p_view_grade = "4" then '부서장 한정
if Session("admin_Code") = "1" or tmp_admin_chk = "1" then
tmp_view_allow = "1"
else
tmp_view_allow = "0"
end if
elseif p_view_grade = "5" then '임원 한정
if tmp_job_part = "00" or tmp_admin_chk = "1" then
tmp_view_allow = "1"
else
tmp_view_allow = "0"
end if
end if
'----------------------------------------------------------------------------
'----------------------------------------------------------------------------
'최종확인(경영지원실 완료상태가 아니라면 뷰제한을 걸지 않음
if rsc("p_reg_mana") = "0" then
tmp_view_allow = "1"
end if
'----------------------------------------------------------------------------
'----------------------------------------------------------------------------
'특수로직 (정보분석부는 그냥 view 가능, 또는 p_view_grade가 정해지지 않는다면 프로젝트 완성이 아니므로 그냥 뷰 가능)
if tmp_login_code = "11" or p_view_grade = "" or isnull(p_view_grade) then
'tmp_view_allow = "1"
end if
'----------------------------------------------------------------------------
'----------------------------------------------------------------------------
'특수로직 (경영지원실은 그냥 view 가능)
if tmp_login_code = "13" then
tmp_view_allow = "1"
end if
'----------------------------------------------------------------------------
'----------------------------------------------------------------------------
'tmp_view_allow = "0"일 때 수행가능 허가를 맡았는지 체크
if tmp_view_allow = "0" then
query = "SELECT * "
query = query & "FROM view_allow "
query = query & "WHERE p_sn = '" & p_sn & "' "
query = query & " AND p_no = '" & Session("User_Number") & "' "
query = query & " AND flag <> 'N' "
query = query & "ORDER BY limit_date DESC "
rsp.Open query, adoConn, 1
if rsp.RecordCount > 0 then
if not isnull(rsp("limit_date")) and date() <= rsp("limit_date") then
tmp_view_allow = "1"
end if
tmp_flag = rsp("flag")
else
tmp_flag = ""
end if
rsp.Close
end if
'----------------------------------------------------------------------------
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<LINK rel="stylesheet" type="text/css" href="/lib/text.css">
<script src="/lib/function.js" type="text/javascript1.3"></script>
<title>
프로젝트 표시
</title>
<script language=javascript>
function goit(z,x,c)
{
if (c == 1)
{
document.pms.action = 'project_list2_dep.asp?p_sn=' + z + '&teamname=' + x;
document.pms.submit();
}
}
function clsit()
{
self.close();
}
function reqit(a)
{
document.pms.action = "project_list2_chk_req.asp?p_sn=" + a;
document.pms.submit();
}
</script>
</head>
<body onLoad="goit('<%=p_sn%>','<%=tmp_teamname%>','<%=tmp_view_allow%>')">
<form name="pms" method="post">
<%
if tmp_flag = "R" then
tmp_txt = "권한을 요청중 입니다"
else
tmp_txt = "권한을 요청하시겠습니까?"
end if
if tmp_view_allow = "0" then
%>
<table border="0" cellspacing="0" cellpadding="0" width="350" align="center">
<tr>
<td bgcolor="#B8B0A9" height="2">
</td>
</tr>
<tr bgcolor="#E6FFBB" align="center" height="35">
<td>
<p style="">
관람 권한이 없습니다. <%=tmp_txt%>
</p>
</td>
</tr>
<tr height="1">
<td colspan="4" bgcolor="#85DF66">
</tr>
<tr bgcolor="" align="center" height="30">
<td>
<%
if tmp_flag <> "R" then
%>
<input type="button" value="요 청" onClick="reqit('<%=p_sn%>')">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%
end if
%>
<input type="button" value="닫 기" onClick="clsit()">
</td>
</tr>
<tr>
<td bgcolor="#B8B0A9" height="2">
</td>
</tr>
</table>
<%
end if
%>
</form>
</body>
</html>
<%
else
alert2 "DB오류 입니다. 관리자에게 문의하세요"
end if 'if rsc.RecordCount > 0 then
rsc.Close
%>