<!--#include virtual="/show/adminhead.asp"-->
<!--#include file="adminleft.asp"-->


<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<%
call logquanxian("g2",1)

Set fso=Server.CreateObject("Scripting.FileSystemObject")

link="admingongdan.asp?cact="

if request.QueryString("act")="off" then
id=request.QueryString("id")
if id="" then call PopErr("参数不完整")

sql="select * from aygongdan where aygdid="&id&"" 
rs.open sql,conn,1,3
	if not(rs.bof and rs.eof) then
	rs("aygdzt")=1
	rs.update
	end if
rs.close
call PopErr2("工单关闭成功！","admingongdan.asp")
end if


if request.QueryString("act")="del" then
id=request.QueryString("id")
sql="select * from aygongdan where aygdid="&id&"" 
rs.open sql,conn,1,3
if rs.bof and rs.eof then
call PopErr("未找到投诉！")
else

		set rsu=server.CreateObject("adodb.recordset")
		sqlu="select * from aygongdan where aygdshangid="&id&"" 
		rsu.open sqlu,conn,1,3
		if not(rsu.bof and rsu.eof) then
		do while not rsu.eof
		rsu.delete
		rsu.movenext  
		loop
		end if
		rsu.close
		
		
rs.delete
end if
call logadd(request.Cookies("aynameid"),"管理-工单删除成功"&id,0,0)
response.Redirect("admingongdan.asp")
rs.close
end if
%>

<title><%=webname%>-最高权限-工单管理</title> 

<DIV>

<%

sql="select * from aygongdan where aygdshangid=0 and aygdzt<>1 order by aygdid desc" 
rs.open sql,conn,1,1
%>
<DIV id=main1200> 
<%call webleft()%>
<DIV id=main_right>
<DIV id=main_right_content>
<STYLE>.apply_style {
	POSITION: absolute
}
.right_title A {
	LINE-HEIGHT: 27px; WIDTH: 126px; DISPLAY: inline-block; BACKGROUND: url(<%=ossurl%>images/bg22.gif) no-repeat; HEIGHT: 27px
}
.right_title A.current {
	BACKGROUND: url(<%=ossurl%>images/main_right_title_bg.gif) no-repeat; COLOR: #fff; FONT-WEIGHT: bold
}
.table_style_1 TD {
	HEIGHT: 38px
}
.table_style_home_info TD {
	PADDING-BOTTOM: 0px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; HEIGHT: 30px; PADDING-TOP: 0px
}
</STYLE>

<DIV class=right_titleadmin>&nbsp;&nbsp;未处理工单 [<a href="admingongdanok.asp">查看已处理工单</a>]</DIV>
<DIV class=main>
<form action="?act=edit" method="post" name="form" id="form">
  <TABLE width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1" style="MARGIN: 15px 0px">
  <TBODY>
  <TR>
    <TD align="center" class="border_right border_bottom">工单ID</TD>
    <TD align="center" class="border_right border_bottom">新回复</TD>
    <TD align="center" class="border_right border_bottom">商户名</TD>
    <TD align="center" class="border_right border_bottom">工单类别</TD>
    <TD align="center" class="border_right border_bottom">标题</TD>
    <TD align="center" class="border_bottom border_right">时间</TD>
    <TD align="center" class="border_bottom border_right">工单状态</TD>
    <TD align="center" class="border_bottom ">删</TD>
  </TR>
  <%
rs.pagesize=40
pagecount=rs.pagecount 
if request("page")="" then 
page=1
else
page=int(request("page")) 
end if
if page<=0 then page=1 
if request("page")="" then page=1
if not(rs.bof and rs.eof) then
rs.absolutepage=page
  do while not rs.eof
  %>
  <TR onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
    <TD align="center"  class="border_right border_bottom"><a href="admingongdanc.asp?id=<%=rs("aygdid")%>" target="_blank"><%=rs("aygdid")%></a></TD>
    <TD align="center"  class="border_right border_bottom">	<%
	if cint(rs("aygdisnew"))=0 then 
	response.Write "<span style=color:#00CC00>有新进展</span>"
	else
	response.Write "-"
	end if
	%></TD>

    <TD align="center"  class="border_right border_bottom">
<% 
set rsu=server.CreateObject("adodb.recordset")
sqlu="select * from ayname where aynameid="&rs("aygduid")&"" 
rsu.open sqlu,conn,1,1
if not(rsu.bof and rsu.eof) then%>
      <a href="adminuseredit.asp?id=<%=rs("aygduid")%>" target="_blank"><%=rsu("aytrueuser")%></a>
      <%end if
rsu.close
%>
    </TD>
    <TD align="center"  class="border_right border_bottom"><%=trim(rs("aygdleibie"))%></TD>
    <TD align="center" class="border_right border_bottom" style="font-weight: bold"><a href="admingongdanc.asp?id=<%=rs("aygdid")%>" target="_blank"><%=trim(rs("aygdbiao"))%></a></TD>
    <TD align="center" class="border_bottom border_right"><%=rs("aygddate")%></TD>
    <TD align="center" class="border_bottom border_right">
      <%if cint(rs("aygdzt"))=0 then response.Write "<span style='color: #FF0000'>处理中</span>"
	if cint(rs("aygdzt"))=1 then response.Write "<span style='color: #009933'>处理完毕</span>"
	if cint(rs("aygdzt"))=2 then response.Write "<span style='color: #009933'>待商户回复</span>"
	%>    </TD>
    <TD align="center" class="border_bottom"><a href="?act=del&id=<%=rs("aygdid")%>">删</a> 
     <a onClick="javascript:return confirm('您确定要关闭工单吗？');" href="?act=off&id=<%=rs("aygdid")%>">【关闭工单】</a>
    </TD>
  </TR>
<%n=n+1
rs.movenext  '指针向下移动
if n>=rs.pagesize then exit do  
loop
end if
rs.close%>
  <TR>
    <TD colspan="8" align="left">
<%if pagecount=0 then   
response.write("首页 ")
elseif page=1 then       
response.write("首页 ")
else%>                   
<a href="<%=link%>&page=1">首页</a>
<%end if

if pagecount=0 then   
response.write("上页&nbsp;")
elseif page=1 then       
response.write("上页&nbsp;")
else%>                   
<a href="<%=link%>&page=<%=page-1%>">上页</a>&nbsp;
<%end if

if pagecount>20 then
if page<=10 then 
aa=1
bb=20
aabu=""
bbbu=" … "
elseif page>=11 then 
aa=page-9
bb=page+10
aabu=" …"
bbbu=" … "
	if bb>=pagecount then 
	aa=pagecount-20
	bb=pagecount
	aabu=" … "
	bbbu=""
	end if
end if
response.Write aabu
for aa=aa to bb
if page=aa then
response.Write("<a href="&link&"&page="&aa&"><strong>"&aa&"</strong></a>&nbsp;")
else
response.Write("<a href="&link&"&page="&aa&">"&aa&"</a>&nbsp;")
end if
next
response.Write bbbu

else

for i=1 to pagecount
if page=i then
response.Write("<a href="&link&"&page="&i&"><strong>"&i&"</a></strong>&nbsp;")
else
response.Write("<a href="&link&"&page="&i&">"&i&"</a>&nbsp;")
end if
next

end if

if pagecount=0 then 
response.write("下页&nbsp;")
elseif page=pagecount then 
response.write("下页&nbsp;")
else%>                    
<a href="<%=link%>&page=<%=page+1%>">下页</a>
<%end if%>
<%if pagecount=0 then  '总页数为0 显示空
response.write("尾页 ") 
elseif page=pagecount then 
response.write("尾页 ")
else%>                    
<a href="<%=link%>&page=<%=pagecount %>">尾页</a>
<%end if

if pagecount<>0 then 
response.Write page&"/"&pagecount
end if
response.Write "&nbsp;共"&zongshu&"条"
%>	</TD>
    </TR>
  </TBODY></TABLE>
	</form>



</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>
<SCRIPT>
$(function(){
$('.left_title').each(function(){
   $(this).click(function(){
	   var index=$('.left_title').index(this);
	   if($(this).next().hasClass('hide_m')){
		   $(this).next().removeClass('hide_m');
           $(this).next().show();		 
		   $(this).find('img').attr('src','<%=ossurl%>images/expansion.gif');
		   $.cookie('m_index_'+index,'',{expires:0});
	   } else {
	       $(this).next().hide();
		   $(this).next().addClass('hide_m');
		   $(this).find('img').attr('src','<%=ossurl%>images/shrank.gif');		   
		   $.cookie('m_index_'+index,'none',{expires:365});
	   }
   })
})

$('.left_title').each(function(){
	var index=$('.left_title').index(this);
    $(this).next().css('display',$.cookie('m_index_'+index) ? $.cookie('m_index_'+index) : '');
	if($.cookie('m_index_'+index)){
	    $(this).next().addClass('hide_m');
	}
	$(this).find('img').attr('src',$.cookie('m_index_'+index) ? '<%=ossurl%>images/shrank.gif' : '<%=ossurl%>images/expansion.gif');
})
})

</SCRIPT>


<!--#include virtual="/show/footadmin.asp"-->

