www.gusucode.com > 漂亮的地方旅游景点景观介绍网站源代码 > admin/back/xx.asp

    <!--#include file="../config.asp" -->
<!--#include file="../../inc/page.asp" -->
<% 
call zwtj()
call chkqx(3,8)
dim dcid
dcid=Trim(Request.QueryString("dcid"))
mytit=mytit&"<a href=""dc.asp"">调查管理</a> > <a href=""?dcid="&dcid&""">选项管理</a>"

select case action
case "del"
call del()
case "show",""
call show()
case "add",""
call add()
case "sadd",""
call sadd()
case "ups",""
call ups()
case "doup",""
call doup()
end select

'显示
sub show()
sql="select * from dcxx where dcid="&dcid&" order by id asc"
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&dcid=<%= dcid %>">添加选项</a></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
<form name="form1" id="form1" method="post" action="?action=del&amp;dcid=<%= dcid %>">

<tr>
<td width="4%" align="center" bgcolor="#C5E0F3"><strong>ID</strong></td>
<td width="61%" bgcolor="#C5E0F3"><strong>选项主题</strong></td>
<td width="31%" align="center" bgcolor="#C5E0F3"><strong>票数</strong></td>
<td width="4%" align="center" bgcolor="#C5E0F3"><input type="checkbox" name="selectall" onClick="selectit()"/></td>
</tr>
<% 
dim i,sz
sz=20
i=sz
dim bgc,cs,cssm,j
%>
<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&amp;id=<%= rs("id") %>&amp;dcid=<%= dcid %>"><%= rs("mc") %> </a></td>
<td align="center"><%= rs("num") %></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="4" bgcolor="#C5E0F3">
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="9%"><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="91%" 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 %> || <a href="?dcid=<%= dcid %>">选项管理</a></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<form action="" name="form1" id="form1" method="post">
<tr>
<td width="10%" bgcolor="#D9ECF7">票数:</td>
<td width="90%" bgcolor="#D9ECF7">
<input name="num" type="text" class="inp" id="num" onFocus="this.className='focus'" onBlur="out_mc();this.className='inp'" value="0" size="30"/>
</td>
</tr>
<tr>
<td bgcolor="#D9ECF7">选项:</td>
<td bgcolor="#D9ECF7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="27%"><textarea name="mc" cols="60" rows="6" class="inp" id="mc"></textarea></td>
<td width="73%"><div id="cmc"></div></td>
</tr>
</table></td>
</tr>

<tr>
<td colspan="2" bgcolor="#D9ECF7"><div id="msg"></div></td>
</tr>
<tr>
<td colspan="2" bgcolor="#D9ECF7"><input onclick="goo('?action=aadd')" name="go" type="button" class="button_1" id="go" value="提交" onmouseover="this.className='button_2'" onmouseout="this.className='button_1'">
<input name="reset" type="reset" class="button_1" id="reset" value="重置" onmouseover="this.className='button_2'" onmouseout="this.className='button_1'"/></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<SCRIPT language="javascript" event="onkeydown" for="document">
if(event.keyCode==13&&event.srcElement.type!='button'&&event.srcElement.type!='submit'&&event.srcElement.type!='reset'&&event.srcElement.type!='textarea'&&event.srcElement.type!='')
goo('?action=sadd&dcid=<%= dcid %>');
</SCRIPT>
<%
call connend()
call foot()
end sub

sub sadd()
dim mc,num
num=getForm("num",2,0)
mc=getForm("mc",1,1)

conn.execute("insert into dcxx (dcid,mc,num) values ("&dcid&",'"&mc&"',"&num&")")

if err.number>0 then 
call errs("有错误发生")
end if
call errs(0)
end sub

sub ups()
call head()
set rs=conn.execute("select * from dcxx where id="&id)
%>
<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="?dcid=<%= dcid %>">选项管理 </a> || <a href="?action=add&amp;dcid=<%= dcid %>">添加选项</a></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<form action="" name="form1" id="form1" method="post">
<tr>
<td width="10%" bgcolor="#D9ECF7">票数:</td>
<td width="90%" bgcolor="#D9ECF7"><input name="num" type="text" class="inp" id="num" onFocus="this.className='focus'" onBlur="out_mc();this.className='inp'" value="<%= rs("num") %>" size="30"/>
</td>
</tr>
<tr>
<td bgcolor="#D9ECF7">选项:</td>
<td bgcolor="#D9ECF7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="27%"><textarea name="mc" cols="60" rows="6" class="inp" id="mc" onfocus="this.className='focus'" onblur="this.className='inp'"><%= rs("mc") %></textarea></td>
<td width="73%"><div id="cmc"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" bgcolor="#D9ECF7"><div id="msg"></div></td>
</tr>
<tr>
<td colspan="2" bgcolor="#D9ECF7"><input onclick="goo('?action=aadd')" name="go" type="button" class="button_1" id="go" value="提交" onmouseover="this.className='button_2'" onmouseout="this.className='button_1'">
<input name="reset" type="reset" class="button_1" id="reset" value="重置" onmouseover="this.className='button_2'" onmouseout="this.className='button_1'"/></td>
</tr>
</form>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
<SCRIPT language="javascript" event="onkeydown" for="document">
if(event.keyCode==13&&event.srcElement.type!='button'&&event.srcElement.type!='submit'&&event.srcElement.type!='reset'&&event.srcElement.type!='textarea'&&event.srcElement.type!='')
goo('?action=doup&dcid=<%= dcid %>&id=<%= id %>');
</SCRIPT>
<%
call recordend(rs)
call connend()
call foot()
end sub

sub doup()
dim mc,num
num=getForm("num",2,0)
mc=getForm("mc",1,1)

conn.execute("update dcxx set num="&num&",mc='"&mc&"' where id="&id)

if err.number>0 then 
call errs("有错误发生")
end if
call errs(0)
end sub

'删除
sub del()
'删除单条记录
if id<>"" then
conn.execute("delete * from dcxx 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 dcxx where id="&iid(i))
next
call connend()
response.Redirect("?dcid="&dcid)
end sub
%>
<script language="javascript" src="/<%= hturl %>/inc/chk.js"></script>
<script language="javascript">
function goo(act)
{
var chk=true;
if (!out_mc()){chk=false;}

if (chk==true){
GE("go").disabled="disabled";
GE("reset").disabled="disabled";

var mc=escape(GE("mc").value);
var num=GE("num").value;

var Ajax = new oAjax(act,backs);
var arrKey = new Array("mc","num");
var arrValue =new Array(mc,num);
Ajax.Post(arrKey,arrValue);
GE("msg").innerHTML=loading;
function backs(str)
{
if(str=="0")
{
GE("msg").innerHTML=ok+"&nbsp;&nbsp;操作成功";
window.location.href="?dcid=<%= dcid %>"
}
else
{
GE("msg").className="d_err";
GE("msg").innerHTML=err+"&nbsp;&nbsp;"+unescape(str);
GE("go").disabled="";
GE("reset").disabled="";
}
}
}
}
</script>