⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 artadd.asp

📁 通用考勤系统
💻 ASP
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''版权:野马原创                    ''''
''''联系:ctplr@163.com          ''''
''''说明:需要新功能联系我      ''''
''''QQ:214297587                    ''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<script language=javascript>
<!--


function checkAll(){
  for(i=0;i<document.wztable.chknum.length;i++){
   document.wztable.chknum[i].checked=true;
}
}
 function uncheckAll(){
 for(i=0;i<document.wztable.chknum.length;i++){
   document.wztable.chknum[i].checked=false;
}
}

function switchAll()
{
 var num=document.wztable.chknum.length;
 if(num>1)
 {
 for(var i=0;i<num;i++) 
     {  
        if(document.wztable.chknum[i].checked==false)
        {
          document.wztable.chknum[i].checked=true;
        }
        else
        {
         document.wztable.chknum[i].checked=false;
        }
     } 
     }
     else
     {
       if(document.wztable.chknum.checked==false)
        {
          document.wztable.chknum.checked=true;
        }
        else
        {
         document.wztable.chknum.checked=false;
        }
     }
}



//-->
</script>
<!--#include file="check.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="ubbcode.asp"-->
<!--#include file="CHAR.ASP"-->
<!--#include file="../webinfo.ASP"-->
<link href=left.css rel=stylesheet>
<body   leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table background=../images/loginIn2.gif width=100%><tr>
<%
if session("qx")>3  then
response.write "<script >alert('您不能进入此页面');history.back();</script>"
else
act=request("action")
if act="" then 
act="dft"
end if
%>
<%
if request("action")="add" then
 if trim(request.form("title"))=empty then 
  response.write "<script>alert('没有输入标题!');history.back();</script>"
 elseif trim(request.form("text"))=empty then 
  response.write "<script>alert('没有输入内容!');history.back();</script>"
else
sql="select * from artic "
rs.open sql,cn,1,3
rs.addnew
rs("title")=request.form("title")
rs("text")=htmlencode2(replace(replace(request.form("text"),"<br>",""),"&nbsp;",""))
 rs("typeid")=request.form("typeid")
 if request.form("typeid")=1 then
 pclass="重要文档"
 rs("type")=pclass
 elseif request.form("typeid")=2 then
 pclass="操作说明"
 rs("type")=pclass
 end if
rs("publisher")=request.form("zz")
rs("time")=request.form("time")
rs.update
 rs.close
 response.write "<script>alert('添加文章成功!');location.href='artadd.asp';</script>"
 end if
end if
%>
<%
if request("action")="xiugaido" then

 if trim(request.form("title"))=empty then 
  response.write "<script>alert('没有输入标题!');history.back();</script>"
 elseif trim(request.form("text"))=empty then 
  response.write "<script>alert('没有输入内容!');history.back();</script>"
else
aid=request.form("id")
sql="select * from artic where id="&aid
rs.open sql,cn,1,3

rs("title")=request.form("title")
rs("text")=htmlencode2(replace(replace(request.form("text"),"<br>",""),"&nbsp;",""))
 rs("typeid")=request.form("typeid")
 if request.form("typeid")=1 then
 pclass="重要文档"
 rs("type")=pclass
 elseif request.form("typeid")=2 then
 pclass="操作说明"
 rs("type")=pclass
 end if
rs("publisher")=request.form("zz")
rs("time")=request.form("ptime")
rs.update
 rs.close
 response.write "<script>alert('修改文章成功!');location.href='artadd.asp';</script>"
 end if
 end if


 if request("action")="del" then
      aid=request("id")
      sql="delete from artic where id="&aid
      cn.Execute sql
      cn.close
      response.write "<script>location.href='artadd.asp';</script>"
end if

 if request("action")="alldel" then
        if request.form("chknum").count=0 then                                   
          response.write "<script>alert('没有选中任何文章!!');history.back();</script>"'    
         else
             for i=1 to request.form("chknum").count  
               pxh=request.form("chknum")(i)  
               sql2="delete from artic where id="&pxh
               cn.Execute sql2
             next
         cn.close
     response.write "<script>location.href='artadd.asp';</script>"
        end if
 end if

if act="dft"  then
%><center>
<td align=center><img src=images/wzlist.GIF><br><b><font color=yellow>
您只能修改自己的文章,请用真实账号发布文章!<br>
[<a href="?action=publish">发表文章</a>]
</td></tr></table>

<% 
num=wenzhangnum
rs.PageSize=num
if Request.QueryString("page")<>"" then 
curpage=cint(Request.QueryString("page")) 
else
curpage=1
end if
sql="select * from artic order by id desc"
rs.open sql,cn,1,1

pagenum=rs.PageCount  
if curpage>pagenum then 
curpage=pagenum
end if 
rs.AbsolutePage =curpage
if (rs.eof and rs.bof)  then 
response.write "<br><font color=red size=5>没有记录</font>"
else
      response.write"<form name=wztable action=?action=alldel method=post><table border=0>"
response.write "<tr><td class=tdhead align=center><b>标题</b></td><td class=tdhead align=center><b>发布者</b></td><td class=tdhead align=center   > <b>类别</b></td><td class=tdhead align=center><b>发布时间</b></td><td class=tdhead align=center><b>可执行操作</b></td></tr>"
      do while not rs.eof and num>0 
 id=rs("id")
title=rs("title")
pclass=rs("type")
zz=rs("publisher")
ptime=rs("time")
%>
<tr>
<td    align=center class=td1><a href=../artview.asp?id=<%=id%>  title="点击察看全文"  target=_blank><%=title %></a></td> 
<td   align=center class=td2>  <%=zz%> </td>
   <td   align=center class=td1> <%=pclass%></td>
<td   align=center class=td2><%=ptime%></td>

<td  class=td1 align=center><%if session("qx")=1 then%><a href="?id=<%=id%>&action=xiugai">修改</a><%elseif (zz=session("name")) then%><a href="?id=<%=id%>&action=xiugai">修改</a><%else%>您不能操作<%end if%>
   <% if session("qx")=1 then %> 
   <a href="?action=del&id=<%=id%>&pname=<%=title%>"  onclick="{if(confirm('想清楚了吗?\n\n真的删除吗?')){return true;}return false;}">删除</a> <input type=checkbox value=<%=id%> name=chknum><%end if%>
   </td></tr>
<%  rs.movenext
num=num-1
loop
%>
<tr><td colspan=8 align=right class=td3>
<input type=button value="全选" onClick="checkAll()" class=bbox>
<input type=button value="全否" onClick="uncheckAll()" class=bbox>
<input type=button value="反选" onClick="switchAll()" class=bbox>
<input type=submit value="删除所选"  class=ibox onclick="{if(confirm('确定要删除这些文章?')){return true;}return false;}">
 </td>
</tr></table>
</form>

<%
response.write"</table>"
end if

rs.close
set rs=nothing



 
Response.Write "<center>一共有[<font color=red>"&pagenum&"</font>]页  "



Response.Write "[<a href=artadd.asp?page=1>首 页</a>]  "
if curpage>1 then 
Response.Write "[<b><a name=up href=artadd.asp?page=" & (curpage-1) & " >上一页</a></b> ]&nbsp;"
end if

if curpage<pagenum then
Response.Write "[<b><a name=down href=artadd.asp?page=" & (curpage+1) & " >下一页</a></b>] "
end if 

Response.Write "  [<a href=artadd.asp?page="&pagenum&">尾 页</a>]"
Response.Write "  当前是第[<font color=red>"&curpage&"</font>]页</center>"
rs.Close 
set rs=nothing
cn.close
set cn=nothing
end if
%>
<% if request("action")="publish" then
%>
<table background=../images/loginIn2.gif width=100% ><tr>
<td align=center><img src=images/subwz.GIF><br><b><font color=yellow>[<a href='javascript:history.back()'>返回</a>]</font></b>
</td></tr></table>
<form action="?action=add" method=post>
  <table border=0 width=100% cellpadding=0 cellspacing=0>
    <tr> 
      <td width="10%" align=center class=td1>标题</td>
      <td width="36%"   class=td1><input type=text  class=ibox  name=title size=40></td>
      <td width="12%" align=center  class=td1>选择栏目</td>
      <td width="42%"   class=td1>
	   <select name=typeid  class=abox >
	  <option value=1 selected>重要文档</option>
	  <option value=2 >操作说明</option>
	  </select>
	  </td>
    </tr>
    <tr> 
      <td align=center  class=td2>作者</td>
      <td   class=td2><input class=ebox name=zz type=text id="zz" value=<%=session("name")%> size=20></td>
      <td align=center class=td2>时间:</td>
      <td  class=td2><input  class=ebox  name=time type=text id="time" value=<%=now()%> size=20></td>
    </tr>
	 <tr> 
      <td   colspan=4 background="../images/loginLine.gif" height="3" ></td>
      
    </tr>
    <tr> 
      <td colspan="4" align=center class=td1><!--#include file="ubb.asp"--> <!--#include file="ubb1.asp"--> 
     </td></tr><tr><td class=td2 colspan="4"  align=center >
   <textarea name=text  class=fbox  rows=15 cols=80><%= text%></textarea></td>
    </tr>
    <tr> 
      <td   colspan=4 background="../images/loginLine.gif" height="3"></td>
      
    </tr>
    <tr> 
      <td colspan="4" align="center"> <input type=submit class=ebox value="提交"> 
        &nbsp;&nbsp; &nbsp; &nbsp; <input type=reset class=ebox></font>
        </td>
    </tr>
  </table>
</form>

<%
end if
if request("action")="xiugai" then
aid=request("id")
sql="select * from artic where id="&aid
rs.open sql,cn,1,1
title=rs("title")
text=rs("text")
typeid=rs("typeid")
zz=rs("publisher")
ptime=rs("time")

 rs.close
 %>
 <center>
<table background=../images/loginIn2.gif width=100% ><tr>
<td align=center><img src=images/xgwz.GIF><br><b><font color=yellow>[<a href='javascript:history.back()'>返回</a>]</font></b>
</td></tr></table>
<form action="?action=xiugaido" method=post>
  <table border=0 width=100%>
    <tr> 
      <td width="10%" align=center bgcolor=#0055aa>标题</td>
      <td width="36%" align=center bgcolor=#0055aa><input name=title type=text value="<%=title%>" size=40></td>
      <td width="12%" align=center bgcolor=#0055aa>选择栏目</td>
      <td width="42%" align=center bgcolor=#0055aa>
	  <select name=typeid>
	  <option value=1 <% if typeid=1 then%>selected<%end if%>>重要文档</option>
	  <option value=2  <% if typeid=2 then%>selected<%end if%>>操作说明</option>
	  </select>
	  </td>
    </tr>
    <tr> 
      <td align=center bgcolor=#000099>作者</td>
      <td align=center bgcolor=#000099><input name="zz"  type=text   value=<%=zz%> size=20></td>
      <td align=center bgcolor=#000099>时间:</td>
      <td align=center bgcolor=#000099><input name="ptime"  type=text   value=<%=ptime%> size=20></td>
    </tr>
	 <tr> 
      <td   colspan=4 background="../images/loginLine.gif" height="3"></td>
      
    </tr>
    <tr> 
      <td colspan="4" align=center  bgcolor=#0055aa><!--#include file="ubb.asp"--> <!--#include file="ubb1.asp"--> 
  </td></tr><tr><td bgcolor=#000099 colspan="4"  align=center >
   <textarea name=text rows=15 cols=80><%=text%></textarea></td>
    </tr>
    <tr> 
      <td   colspan=4 background="../images/loginLine.gif" height="3"></td>
      
    </tr>
    <tr> 
      <td colspan="4" align="center"><input type=hidden  name=id  value=<%=aid%>> <input type=submit class=ibox value="提交"> 
        &nbsp;&nbsp; &nbsp; &nbsp; <input type=reset class=ibox></font>
        </td>
    </tr>
  </table>
</form>
<%

end if
end if%>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -