1.申请页面:shengqing.asp
2.写入数据库代码 shengqingSave.asp
建个表:shengqingjilu
字段:
id 编号
S_name 申请人
num 请假天数
S_content 备注
S_ok 审批判断
S_time 申请时间
等根据你需要再加
<%@LANGUAGE="VBSCRIPT" CodePage="65001"%>
<%
Response.CharSet = "utf-8"
Session.CodePage = "65001"
%>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select top 1 * from shengqingjilu"
rs.open sql,conn,1,3
rs.addnew
rs("S_name")=trim(request.form("S_name"))
rs("num")=trim(request.form("num"))
rs("S_content")=trim(request.form("S_content"))
rs("S_ok")=false '待审批 ,当为true 通过审批 否则为 未通过审批 根据这个进行判断
rs.Update
rs.Close
set rs=nothing
response.write ""
response.End
%>
3.申请记录/审核页面:
<%
sqlstr="select * from shengqingjilu order by id desc"
set rs=server.CreateObject("adodb.recordset")
rs.open sqlstr,conn,1,1
if rs.eof or rs.bof then
response.Write "
还没有申请信息!"
else
do while not (rs.eof or rs.bof)
%>
| [">删除] 时间:<%=rs("s_time")%> |
<% response.Write("编辑 ") if rs("S_ok")=true then response.Write("已通过审批") else response.Write("未通过审批") end if %> |
申请人:<%=rs("S_name")%> |
请假天数:<%=rs("num")%> |
备注:<%=rs("S_content")%> |
<%
rs.movenext
loop
end if
%>
4.审批代码
if request("action")="s_ok" then
strIDs=request("id")
s_ok=request("s_ok")
strSQL="update shengqingjilu set s_ok="&s_ok&" Where id=" & strIDs & ""
conn.execute strSQL
end if