www.gusucode.com > 漂亮的地方旅游景点景观介绍网站源代码 > admin/sys/zhengshu.asp
<!--#include file="../config.asp" --> <!--#include file="../../inc/page.asp" --> <% call zwtj() mytit=mytit&"<a href=""?lx="&lx&""">会员证书管理</a> > " dim lx lx=Trim(Request.QueryString("lx")) select case action case "add" mytit=mytit&"添加会员证书" call add() case "del" call del() case "show","" mytit=mytit&"会员证书列表" call show() case "ups" mytit=mytit&"编辑会员证书" call ups() case "aadd" call aadd() case "doup" call doup() end select '显示 sub show() sql="select * from Jw_hyml where lx="&lx&" order by id desc" call record(rs,sql,1) call head() %> <link href="../inc/mm.css" rel="stylesheet" type="text/css" /> <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#116BAE"> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td id="tit"><%= mytit %> || <a href="?action=add&lx=<%= lx %>">添加会员证书 </a></td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF"> <form name="form1" id="form1" method="post"> <tr> <td width="3%" align="center" bgcolor="#C5E0F3"><strong>ID</strong></td> <td width="21%" bgcolor="#C5E0F3"><strong>会员姓名</strong></td> <td width="26%" bgcolor="#C5E0F3"><strong>职位/职称</strong></td> <td width="47%" bgcolor="#C5E0F3"><strong>会员编号</strong></td> <td width="3%" align="center" bgcolor="#C5E0F3"><input type="checkbox" name="selectall" onClick="selectit()"/></td> </tr> <% dim i,sz sz=20 i=sz dim bgc %> <div style="display:none"><% call fenpage(sz,rs,10) %></div> <% do while not rs.eof and i>0 if i mod 2=0 then bgc="#D2E9FF" else bgc="#D2E1EE" end if %> <tr id="r<%=rs("id")%>" bgcolor=<%= bgc %> onMouseOver="museing(r<%=rs("id")%>,0,'<%= bgc %>')" onMouseOut="museing(r<%=rs("id")%>,1,'<%= bgc %>')"> <td align="center"><%= rs("id") %></td> <td><a href="?action=ups&id=<%= rs("id") %>&lx=<%= lx %>"><%= rs("names") %> </a></td> <td><%= rs("zhiwu") %></td> <td><%= rs("hybh") %></td> <td align="center"><input name="idstr" type="checkbox" value="<%= rs("id") %>" onClick="td_bgcolor(r<%=rs("id")%>,1);"></td> </tr> <% i=i-1 rs.movenext loop %> <tr> <td colspan="5" bgcolor="#C5E0F3"> <table width="100%" border="0" cellpadding="2" cellspacing="0"> <tr> <td width="11%"><input name="del" type="button" class="button_1" id="del" value="删除所选" onMouseUp="tjqr('您确定要删除?此操作无法逆转!','?action=del')" onMouseOver="this.className='button_2'" onMouseOut="this.className='button_1'"></td> <td width="89%" align="right"><% call fenpage(sz,rs,10) %></td> </tr> </table></td> </tr> </form> </table></td> </tr> </table></td> </tr> </table> <% call recordend(rs) call connend() call foot() end sub '添加 sub add() call head() %> <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#116BAE"> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td id="tit"><%= mytit %></td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF"> <form action="?action=aadd&lx=<%= lx %>" name="form1" id="form1" method="post"> <tr> <td width="15%" bgcolor="#D9ECF7">会员姓名:</td> <td width="85%" bgcolor="#D9ECF7"><input name="names" type="text" class="inp" id="names" size="50" onFocus="this.className='focus'" onBlur="this.className='inp'"></td> </tr> <tr> <td bgcolor="#D9ECF7">职位/职称:</td> <td bgcolor="#D9ECF7"><input name="zhiwu" type="text" class="inp" id="zhiwu" size="50" onFocus="this.className='focus'" onBlur="this.className='inp'"></td> </tr> <tr> <td bgcolor="#D9ECF7">会员编号:</td> <td bgcolor="#D9ECF7"><input name="hybh" type="text" class="inp" id="hybh" size="50" onFocus="this.className='focus'" onBlur="this.className='inp'"></td> </tr> <tr> <td colspan="2" bgcolor="#D9ECF7"><input name="del2" type="submit" class="button_1" id="del2" value="提交" onMouseOver="this.className='button_2'" onMouseOut="this.className='button_1'"></td> </tr> </form> </table> </td> </tr> </table> </td> </tr> </table> <% call connend() call foot() end sub '执行添加 sub aadd() dim names,zhiwu,hybh names=getForm("names",1,0) zhiwu=getForm("zhiwu",1,0) hybh=getform("hybh",1,0) call record(rs,"select top 1 * from Jw_hyml where 1=1",3) rs.addnew() rs("names")=names rs("zhiwu")=zhiwu rs("hybh")=hybh rs("lx")=lx rs.update() call recordend(rs) call connend() response.Redirect("?lx="&lx) end sub '修改 sub ups() set rs=conn.execute("select * from Jw_hyml where id="&id) if rs.eof then call cc("记录不存在!") end if call head() %> <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#116BAE"> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td id="tit"> <%= mytit %> || <a href="?action=add&lx=<%= lx %>">添加会员证书</a></td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF"> <form action="?action=doup&id=<%= id %>&lx=<%= lx %>" name="form1" id="form1" method="post"> <tr> <td bgcolor="#D9ECF7">会员姓名:</td> <td bgcolor="#D9ECF7"><input name="names" type="text" class="inp" id="names" size="50" onFocus="this.className='focus'" onBlur="this.className='inp'" value="<%= rs("names") %>"></td> </tr> <tr> <td bgcolor="#D9ECF7">职位/职称:</td> <td bgcolor="#D9ECF7"><input name="zhiwu" type="text" class="inp" id="zhiwu" size="50" onFocus="this.className='focus'" onBlur="this.className='inp'" value="<%= rs("zhiwu") %>"></td> </tr> <tr> <td bgcolor="#D9ECF7">会员编号:</td> <td bgcolor="#D9ECF7"><input name="hybh" type="text" class="inp" id="hybh" size="50" onFocus="this.className='focus'" onBlur="this.className='inp'" value="<%= rs("hybh") %>"></td> </tr> <tr> <td width="10" colspan="2" bgcolor="#D9ECF7"><input name="del2" type="submit" class="button_1" id="del2" value="提交" onMouseOver="this.className='button_2'" onMouseOut="this.className='button_1'"></td> </tr> </form> </table> </td> </tr> </table> </td> </tr> </table> <% call connend() call foot() end sub '执行修改 sub doup() dim names,zhiwu,hybh names=getForm("names",1,0) zhiwu=getForm("zhiwu",1,0) hybh=getform("hybh",1,0) conn.begintrans'事务开始 '更新记录 conn.execute("update Jw_hyml set [names]='"&names&"',zhiwu='"&zhiwu&"',hybh='"&hybh&"' where id="&id) if conn.errors.count>0 then ''有错误发生 conn.rollbacktrans''回滚 end if conn.CommitTrans ''提交事务 call connend() response.Redirect("?lx="&lx) end sub '删除 sub del() '删除单条记录 if id<>"" then conn.execute("delete * from Jw_hyml where id="&id) end if '批量删除 dim idstr,iid,i idstr=replace(Trim(Request.Form("idstr"))," ","") iid=split(idstr,",") for i=0 to ubound(iid) conn.execute("delete * from Jw_hyml where id="&iid(i)) next call connend() response.Redirect(request.ServerVariables("HTTP_REFERER")) end sub %>