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

    <!--#include file="../config.asp" -->
<!--#include file="../../inc/page.asp" -->
<% 
call zwtj()
call chkqx(3,8)

mytit=mytit&"<a href=""?"">调查管理</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 dc 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">添加调查</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">

<tr>
<td width="3%" align="center" bgcolor="#C5E0F3"><strong>ID</strong></td>
<td width="43%" bgcolor="#C5E0F3"><strong>调查主题</strong></td>
<td width="13%" align="center" bgcolor="#C5E0F3"><strong>类型</strong></td>
<td width="19%" align="center" bgcolor="#C5E0F3"><strong>时间</strong></td>
<td width="19%" align="center" 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,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&id=<%= rs("id") %>"><%= rs("mc") %> </a></td>
<td align="center">
<%
if rs("lx")=0 then 
Response.Write("单选")
else
Response.Write("多选")
end if
%></td>
<td align="center"><%= rs("ctim") %></td>
<td align="center"><input name="Submit" type="button" class="btn2" value="选项管理" onClick="window.location.href='xx.asp?dcid=<%= rs("id") %>'"><input name="Submit2" type="button" class="btn2" value="查看结果"></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="6" 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="?">调查管理</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 bgcolor="#D9ECF7">调查类型:</td>
<td bgcolor="#D9ECF7">
<select name="lx" class="inp" id="lx" style="width:100px;" onfocus="this.className='focus'" onblur="this.className='inp'">
<option value="0">单选</option>
<option value="1">多选</option>
</select></td>
</tr>
<tr>
<td width="10%" bgcolor="#D9ECF7">调查主题:</td>
<td width="90%" bgcolor="#D9ECF7">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="27%"><input name="mc" type="text" class="inp" id="mc" size="30" onfocus="this.className='focus'" onblur="out_mc();this.className='inp'"></td>
<td width="73%"><div id="cmc"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">调查说明:</td>
<td bgcolor="#D9ECF7"><textarea name="content" cols="60" rows="4" class="inp" id="content" onfocus="this.className='focus'" onblur="this.className='inp'"></textarea></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');
</SCRIPT>
<%
call connend()
call foot()
end sub

sub sadd()
dim lx,mc,content,xid
lx=getForm("lx",2,0)
content=getForm("content",1,1)
mc=getForm("mc",1,1)
if lx="" then 
lx=0
end if

call record(rs,"select * from dc where 1=1",3)
rs.addnew()
rs("lx")=lx
rs("content")=content
rs("mc")=mc
rs("ctim")=now
rs.update()
xid=rs("id")
call recordend(rs)

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

sub ups()
call head()
set rs=conn.execute("select * from dc 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="?">调查管理 </a> || <a href="?action=add">添加调查</a></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<form id="form1" name="form1" method="post">
<tr>
<td bgcolor="#D9ECF7">调查类型:</td>
<td bgcolor="#D9ECF7">
<select name="lx" class="inp" id="lx" style="width:100px;" onfocus="this.className='focus'" onblur="this.className='inp'">
<option value="0" <% If rs("lx")=0 Then Response.Write("selected") end if%>>单选</option>
<option value="1" <% If rs("lx")=1 Then Response.Write("selected") end if%>>多选</option>
</select></td>
</tr>
<tr>
<td width="10%" bgcolor="#D9ECF7">调查主题:</td>
<td width="90%" bgcolor="#D9ECF7">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="27%"><input name="mc" type="text" class="inp" id="mc" size="30" onfocus="this.className='focus'" onblur="out_mc();this.className='inp'" value="<%= rs("mc") %>"/></td>
<td width="73%"><div id="cmc"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">调查说明:</td>
<td bgcolor="#D9ECF7"><textarea name="content" cols="60" rows="4" class="inp" id="content" onfocus="this.className='focus'" onblur="this.className='inp'"><%= rs("content") %></textarea></td>
</tr>
<td colspan="2" bgcolor="#D9ECF7"></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&id=<%= id %>');
</SCRIPT>
<%
call recordend(rs)
call connend()
call foot()
end sub

sub doup()
dim lx,mc,content
lx=getForm("lx",2,0)
content=getForm("content",1,1)
mc=getForm("mc",1,1)
if lx="" then 
lx=0
end if
conn.execute("update dc set lx="&lx&",content='"&content&"',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 dc 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 dc where id="&iid(i))
conn.execute("delete * from dcxx where dcid="&iid(i))
next
call connend()
response.Redirect("?")
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 lx=GE("lx").value;
var content=escape(GE("content").value);

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