<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="../Inc/Conn.asp" -->
<!--#include file="../Inc/SK.Session.asp" -->
<!--#include file="../Inc/SK.Funtion.asp" -->
<%if Not (getconfig("SK_Office")="0" AND (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK100000000") AND JudgePopedomTF(Session("UserName"),"SK100000300") AND JudgePopedomTF(Session("UserName"),"SK100000302")))) then Call ReturnError()%>
<%
if Not isnumeric(JCID(F("ID"))) then Call ReturnError10()
set rs=server.createobject("adodb.recordset")
sql="SELECT * from SK_OfficeDownload where SK_Del=0 and DownID="&JCID(F("ID"))&""
rs.Open sql,conn,1,3
if rs.eof and rs.bof then Call ReturnError4()

'Delete Begin
if RQ("Action")="DelFiles" and F("FID")<>"" then
set rs1=conn.execute("select * from SK_OfficeFiles where FilesID="&JCID(F("FID"))&"") 
set objfilesys=server.createobject("scripting.filesystemobject")
FilesPat=""&rs1("SK_Fname")
FilesPat=server.mappath(FilesPat)
if objfilesys.FILEExists(FilesPat) then
objfilesys.deleteFILE FilesPat
end if
conn.execute("delete from SK_OfficeFiles where FilesID="&JCID(F("FID"))&"")
'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="删除文件"
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End
Call Returnokback()
end if
'Delete end

'Mod
if RQ("Action")="Mod" and F("S_Di")<>"" and F("S_Title")<>"" and F("S_Content")<>"" then
Call ChkIsOuter()
set rs=server.createobject("adodb.recordset")
sql="select * from SK_OfficeDownload where DownID="&JCID(F("ID"))&""
rs.open sql,conn,1,3
rs("SK_Di")=NoCSSHackInput(F("S_Di"))
rs("SK_Title")=NoCSSHackInput(F("S_Title"))
rs("SK_Content")=NoCSSHackContent(F("S_Content"))
rs("SK_Locked")=NoCSSHackInput(F("S_Locked"))
rs("SK_Editor")=Session("UID")
rs("SK_ETime")=Now()
rs("SK_Del")="0"
rs.Update
rs.Close 
set rs=Nothing
'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="修改共享资源："&NoCSSHackInput(F("S_Title"))&""
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End
Call Returnokclose()
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>修改资源共享</title>
<META http-equiv=Page-Enter content=SKCRM>
<META http-equiv=Page-Exit content=SKCRM>
<META content="MSHTML 6.00.3790.2858" name=GENERATOR>
<LINK href="../images/style.css" type=text/css rel=stylesheet>

<script>
window.onbeforeunload = function()
{
if (document.body.offsetWidth-50 < event.clientX && event.clientY<0)
{
return "是否关闭当前窗口？关闭本窗口将放弃修改共享资源！";
}
}
</script>
<style type="text/css">
<!--
body {
margin: 5px 0px 5px 0px;
overflow-x: hidden;
}
ul,li{ margin:0; padding:0; list-style:none}
ul{ padding:1px; border:0px;}
li { border-bottom:1px dashed #eee; padding:4px}
-->
</style>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<TBODY>
<tr>
<td class="SK_Td_Top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="25"><img src="../images/tab_03.gif" width="12" height="25" /></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" valign="middle">修改共享资源</td>
<td width="54%"></td>
</tr>
</table></td>
<td width="16"><img src="../images/tab_07.gif" width="16" height="25" /></td>
</tr>
</table></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="../images/tab_12.gif"></td>
<td>

<form name="thisForm" id="form1" method="post" action="?Action=Mod" onSubmit="return Form1_Validator(this)"> 
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
  <td width="17%" class="SK_Text2">资源类别</td>
  <td width="83%" colspan="5" class="SK_Text1"><select name="S_Di">
<%
set rs2 = server.createobject("adodb.recordset")
rs2.open "SELECT * from SK_SystemCategory where SK_Di=3",conn,1,1
for BB=1 to rs2.recordcount
selected=""
if rs("SK_Di")=rs2("CategoryID") then selected="selected='selected'"
response.Write("<option "&selected&" value="&rs2("CategoryID")&">"&rs2("SK_Name")&"</option>")
rs2.movenext
next
rs2.close
set rs2=Nothing
%>
</select> <font color=red>*</font></td>
</tr>
<tr>
  <td class="SK_Text2">资源标题</td>
  <td colspan="5" class="SK_Text1"><input name="S_Title" type="text" size="40" value="<%=Rs("SK_Title")%>"></td>
</tr>

<tr>
  <td valign="top" class="SK_Text2">备　　注</td>
  <td colspan="5" class="SK_Text1">
    <IFRAME ID="eWebEditor1" SRC="<%=getconfig("SK_EditorPath")%>/ewebeditor.htm?id=S_Content&style=mini" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="300"></IFRAME>
<input type="hidden" name="S_Content" value="<%=Rs("SK_Content")%>"></td>
</tr>
<tr>
  <td valign="top" class="SK_Text2">审核状态</td>
  <td colspan="5" class="SK_Text1"><select name="S_Locked">
    <option value="0" <%if Rs("SK_Locked")="0" then Response.Write("selected")%>>是</option>
    <option value="1" <%if Rs("SK_Locked")="1" then Response.Write("selected")%>>否</option>
  </select>  </td>
</tr>
<tr>
  <td valign="top" class="SK_Text2">附　　件</td>
  <td colspan="5" class="SK_Text1"><!--文件列表开始-->
<%
Dim RsFiles,i
set rsFiles=Server.createobject("adodb.recordset")
sqlFiles="select * from SK_OfficeFiles where SK_PID="&Rs("DownID")&" order by FilesID asc"
rsFiles.open sqlFiles,conn,1,1
if rsFiles.eof and rsFiles.bof then Call ReturnError8()
%>
<%
i=0
while not rsFiles.eof
i=i+1
%>
<a href="SK.DownFiles.asp?Fid=<%=rsFiles("FilesID")%>" target="_blank">点击下载文件<%=i%></a> | <a onClick="return confirm('删除文件后将不能恢复，是否继续吗？')" href="?Action=DelFiles&ID=<%=Rs("DownID")%>&FID=<%=RsFiles("FilesID")%>">删除</a><br>
<%
rsFiles.movenext
wend
rsFiles.close
set rsFiles=Nothing
%>
</td>
</tr>

<tr>
<td colspan="6" class="SK_Text">
<input type="hidden" name="ID" value="<%=Rs("DownID")%>">
<INPUT class="button1" type="submit" value=" 保存 "> 
<input type="button" value=" 关闭 " onClick="window.opener.location.reload();window.close();" class="button1" /></td>
</tr>
</table>
</form>

</td>
<td width="8" background="../images/tab_15.gif"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="SK_Td_Foot">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" height="20"><img src="../images/tab_18.gif" width="12" height="20" /></td>
<td width="98%" class="SK_Td_Page"></td>
<td width="1%"><img src="../images/tab_20.gif" width="16" height="20" /></td>
</tr>
</table>

</td>
</tr>
</TBODY>
</table>
</body>
<%
Call CloseDB()
%>
</html>