<!--#include file="head.asp"-->
<style>body{background-color: #fff;}</style>

<%
if SafeRequest("act")="zhuijia" then

id=SafeRequest("id")
zhuicon=SafeRequestform("zhuicon")

aygdpic1=trim(SafeRequestform("pic1"))
aygdpic2=trim(SafeRequestform("pic2"))
aygdpic3=trim(SafeRequestform("pic3"))
aygdpic4=trim(SafeRequestform("pic4"))
aygdpic5=trim(SafeRequestform("pic5"))

if trim(zhuicon)="" then call PopErr("请填写回复内容")
if id="" then call PopErr("参数不完整")

sql="select * from aygongdan where aygdid="&id&" and aygduid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,3
	if not(rs.bof and rs.eof) then
	rs("aygdisnew")=0
	rs("aygdzt")=0
	rs.update
	end if
rs.close


sql="select * from aygongdan" 
rs.open sql,conn,1,3
rs.addnew
rs("aygdhdate")=now()
rs("aygduid")=clng(request.Cookies("aynameid"))
rs("aygdhuifu")=0
rs("aygdshangid")=id
rs("aygdcon")=zhuicon
if aygdpic1<>"" then rs("aygdpic1")=aygdpic1
if aygdpic2<>"" then rs("aygdpic2")=aygdpic2
if aygdpic3<>"" then rs("aygdpic3")=aygdpic3
if aygdpic4<>"" then rs("aygdpic4")=aygdpic4
if aygdpic5<>"" then rs("aygdpic5")=aygdpic5
rs.update
rs.close

'title="来自"&webname&"-投诉有了新的进展"     
'body=webname&"提醒您：<br><br>您的投诉得到了新的回复，请使用查询密码进行查看，可再次回复或撤销投诉。登录地址"&weburl&"tousu"
'msbody="您的投诉得到了新的回复，使用查询密码进行查看，可再次回复或撤销投诉。登录地址"&weburl&"tousu"
'conn.Execute("Insert Into mailto(mto,mti,mcon) values('"&trim(jubaomail)&"','"&trim(title)&"','"&trim(body)&"')")
'conn.Execute("Insert Into mailto(mfs,mto,mcon) values('1','"&trim(ayjuname)&"','"&msbody&"')")
	
call logadd(request.Cookies("aynameid"),"工单回复成功",0,0)
call PopErr2("工单回复成功！","mygongdan")
end if

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

sql="select * from aygongdan where aygdid="&id&" and aygduid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,3
	if not(rs.bof and rs.eof) then
	rs("aygdzt")=1
	rs.update
	end if
rs.close

call logadd(request.Cookies("aynameid"),"工单关闭成功",0,0)
call PopErr2("工单关闭成功！","mygongdan")
end if
%>
<link rel="stylesheet" href="/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="/kindeditor/lang/zh-CN.js"></script>

<main>
<div  class="container">
<div class="ui-lrctnei">
<%call userleft()%>
<div class="r"> 
<div class="ui-content">
                        
					
                            
<div class="neiye">

                            
            
            <!-------------------------------------- 开始 -------------------------------------->	
                    <div class="neibiaoti"></div>
                    <div class="neibiaoti2">我的工单</div>	
                    <div class="gexian20"></div>				
                	<div class="neitable">
					<table>
                        <tr class="hd">
        					<td>工单ID</td>
                            <td>工单类别</td>
                            <td>工单标题</td>
                            <td>工单状态</td>
                            <td>相关操作</td>
                      </tr>
                      
					<%
                    id=SafeRequest("id")
                    if id="" then call PopErr2("参数有误！","gongdan")
                    
                    sql="select * from aygongdan where aygdid="&id&" and aygduid="&request.Cookies("aynameid")&" and aygdshangid=0" 
                    rs.open sql,conn,1,1
                    if not(rs.bof and rs.eof) then
                    %>
                    <form action="?act=zhuijia&id=<%=id%>" method="post" name="form1" id="form1">
                  		<tr>
                       	  <td><%=rs("aygdid")%></td>
                            <td><%=trim(rs("aygdleibie"))%></td>
                          	<td><%=trim(rs("aygdbiao"))%></td>
                			<td>
							<%
                            if cint(rs("aygdzt"))=0 then response.Write("处理中")
                            if cint(rs("aygdzt"))=2 then response.Write("待查看")
                            if cint(rs("aygdzt"))=1 then response.Write("完结")
                            %>
                            </td>
                            <td>
						 	<%if cint(rs("aygdzt"))<>1 then%>

                            <a style="color:#F60" onClick="javascript:return confirm('您确定要关闭工单吗？');" href="?act=off&id=<%=rs("aygdid")%>">【关闭工单】</a>
                            <%else%>
                            【已关闭】
                            <%end if%>
                            </td>

                        </tr>
                        
					
                        <tr>
        					<td colspan="5">
                            
                            
	<table style="border:#FFF">
    <tr>
      <td style="text-align:left" width="220">&nbsp;<%=rs("aygddate")%>&nbsp;我的提问：</td>
      <td style="text-align:left">
	  <%con=Replace(trim(rs("aygdcon")),CHR(13), "<br>")%>
	  <%=con%>
      <% 
	  if trim(rs("aygdpic1"))<>"" then response.Write "<br><br><a href="&trim(rs("aygdpic1"))&" target=_blank><img src="&trim(rs("aygdpic1"))&" width=100 height=100/></a>&nbsp;"
	  if trim(rs("aygdpic2"))<>"" then response.Write "<a href="&trim(rs("aygdpic2"))&" target=_blank><img src="&trim(rs("aygdpic2"))&" width=100 height=100/></a>&nbsp;"
	  if trim(rs("aygdpic3"))<>"" then response.Write "<a href="&trim(rs("aygdpic3"))&" target=_blank><img src="&trim(rs("aygdpic3"))&" width=100 height=100/></a>&nbsp;"
	  if trim(rs("aygdpic4"))<>"" then response.Write "<a href="&trim(rs("aygdpic4"))&" target=_blank><img src="&trim(rs("aygdpic4"))&" width=100 height=100/></a>&nbsp;"
	  if trim(rs("aygdpic5"))<>"" then response.Write "<a href="&trim(rs("aygdpic5"))&" target=_blank><img src="&trim(rs("aygdpic5"))&" width=100 height=100/></a>&nbsp;"
	  if trim(rs("aygdpic1"))<>"" or trim(rs("aygdpic2"))<>"" or trim(rs("aygdpic3"))<>"" or trim(rs("aygdpic4"))<>"" or trim(rs("aygdpic5"))<>"" then response.Write "<br><br>"
	  %>
      </td>
    </tr>
    
        <%
		set rs2=server.CreateObject("adodb.recordset")
		sql2="select * from aygongdan where aygduid="&request.Cookies("aynameid")&" and aygdshangid="&rs("aygdid")&"" 
		rs2.open sql2,conn,1,1
		if not(rs2.bof and rs2.eof) then
		do while not rs2.eof%>
        <tr>
          <td style="text-align:left">
                    <%
                    con=Replace(trim(rs2("aygdcon")),CHR(13), "<br>")
                    if cint(rs2("aygdhuifu"))=1 then
                    response.Write "&nbsp;<span style=color:#F60>"&rs2("aygdhdate")&"&nbsp;管理回复：</span>"
                    else
                    response.Write "&nbsp;"&rs2("aygdhdate")&"&nbsp;我的提问："
                    end if
                    %></td>
          <td style="text-align:left"><%=con%>
          <%
          if trim(rs2("aygdpic1"))<>"" then response.Write "<br><br><a href="&trim(rs2("aygdpic1"))&" target=_blank><img src="&trim(rs2("aygdpic1"))&" width=100 height=100/></a>&nbsp;"
          if trim(rs2("aygdpic2"))<>"" then response.Write "<a href="&trim(rs2("aygdpic2"))&" target=_blank><img src="&trim(rs2("aygdpic2"))&" width=100 height=100/></a>&nbsp;"
          if trim(rs2("aygdpic3"))<>"" then response.Write "<a href="&trim(rs2("aygdpic3"))&" target=_blank><img src="&trim(rs2("aygdpic3"))&" width=100 height=100/></a>&nbsp;"
          if trim(rs2("aygdpic4"))<>"" then response.Write "<a href="&trim(rs2("aygdpic4"))&" target=_blank><img src="&trim(rs2("aygdpic4"))&" width=100 height=100/></a>&nbsp;"
          if trim(rs2("aygdpic5"))<>"" then response.Write "<a href="&trim(rs2("aygdpic5"))&" target=_blank><img src="&trim(rs2("aygdpic5"))&" width=100 height=100/></a>&nbsp;"
          if trim(rs2("aygdpic1"))<>"" or trim(rs2("aygdpic2"))<>"" or trim(rs2("aygdpic3"))<>"" or trim(rs2("aygdpic4"))<>"" or trim(rs2("aygdpic5"))<>"" then response.Write "<br><br>"
          %>
          </td>
        </tr>
   		<%
		rs2.movenext 
		loop
		end if
		%>
    
<script>
			KindEditor.ready(function(K) {
				var uploadbutton1 = K.uploadbutton({
					button : K('#uploadButton1')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_gongdan.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, '');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl1').val(urlcon);
							con1.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton1.fileBox.change(function(e) {
					uploadbutton1.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton2 = K.uploadbutton({
					button : K('#uploadButton2')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_gongdan.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl2').val(urlcon);
							con2.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton2.fileBox.change(function(e) {
					uploadbutton2.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton3 = K.uploadbutton({
					button : K('#uploadButton3')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_gongdan.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl3').val(urlcon);
							con3.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton3.fileBox.change(function(e) {
					uploadbutton3.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton4 = K.uploadbutton({
					button : K('#uploadButton4')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_gongdan.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl4').val(urlcon);
							con4.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton4.fileBox.change(function(e) {
					uploadbutton4.submit();
				});
			});
			
			KindEditor.ready(function(K) {
				var uploadbutton5 = K.uploadbutton({
					button : K('#uploadButton5')[0],
					fieldName : 'imgFile',
					url : '/kindeditor/asp/upload_gongdan.asp?dir=image',
					afterUpload : function(data) { 
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							urlcon=url.replace("/kindeditor/asp/../../","/"); 
							K('#picurl5').val(urlcon);
							con5.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=100 height=100/></a>';
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton5.fileBox.change(function(e) {
					uploadbutton5.submit();
				});
			});
		</script>
    <%if cint(rs("aygdzt"))<>1 then%>
    <tr>
      <td style="text-align:center">工单回复：</td>
      <td style="text-align:left">
        <br />
        <textarea name="zhuicon" cols="80" rows="5" id="zhuicon" style="line-height:15px"></textarea><br />
        <input name="pic1" type="hidden" class="ke-input-text" id="picurl1" value="" readonly="readonly" /> <input type="button" id="uploadButton1" value="添加图片1" />
        &nbsp;&nbsp;<input name="pic2" type="hidden" class="ke-input-text" id="picurl2" value="" readonly="readonly" /> <input type="button" id="uploadButton2" value="添加图片2" />
        &nbsp;&nbsp;<input name="pic3" type="hidden" class="ke-input-text" id="picurl3" value="" readonly="readonly" /> <input type="button" id="uploadButton3" value="添加图片3" />
        &nbsp;&nbsp;<input name="pic4" type="hidden" class="ke-input-text" id="picurl4" value="" readonly="readonly" /> <input type="button" id="uploadButton4" value="添加图片4" />
        &nbsp;&nbsp;<input name="pic5" type="hidden" class="ke-input-text" id="picurl5" value="" readonly="readonly" /> <input type="button" id="uploadButton5" value="添加图片5" />
        <br><span id="con1"></span>&nbsp;&nbsp;<span id="con2"></span>&nbsp;&nbsp;<span id="con3"></span>&nbsp;&nbsp;<span id="con4"></span>&nbsp;&nbsp;<span id="con5"></span><br>
        <input type="submit" name="Submit" value="  工  单  回  复  " class="logindlreg"/>
        <input name="aygdid" type="hidden" id="aygdid" value="<%=rs("aygdid")%>" /><br><br>
       </td>
       </tr>
    <%end if%> 
    

  </table>
                            
                            </td>
                      </tr>
    				</form>
					<%
                    end if
                    rs.close
                    %> 



                    </table>
            		</div>
            <!-------------------------------------- 结束 -------------------------------------->
                        
            
            


                                                                 
                   
            <div class="gexian20"></div>
            <div class="mzsmbox2" style="padding-top:20px;">
            提示：请重点说明需要帮助的详细内容，或上传相关截图！
            </div>

            </div>
            
           




        <div class="clearfix"></div>



</div>








</div>
</div>
</div>
</div>
</main>


<footer>
<div class="container">
</div>
</footer>

</body>
</html>