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

<%
act=SafeRequestform("act")

if act="add" then

selectp=trim(SafeRequestform("selectp"))
selectc=trim(SafeRequestform("selectc"))

aygdbiao=trim(SafeRequestform("aygdbiao"))
aygdcon=trim(SafeRequestform("aygdcon"))

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


if selectp="0" or selectc="0" then call PopErr("请填写工单类别")
if aygdbiao="" or aygdcon="" then call PopErr("请填写完整")

rs.open "select * from aygongdan",conn,1,3
rs.addnew
rs("aygduid")=clng(request.Cookies("aynameid"))
rs("aygdbiao")=aygdbiao
rs("aygdcon")=aygdcon
rs("aygddate")=now()
rs("aygdleibie")=selectp&"-"&selectc
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
call PopErr2("工单提交成功","mygongdan")
end if



%>
<script language=javascript>
function check_add()
{
   if(form1.selectp.value==="0")
   {alert("请选择工单类别");return false}
   if(form1.selectc.value==="0")
   {alert("请选择工单子类别");return false}
   if(form1.aygdbiao.value=="")
   {alert("请选择工单标题");return false}
   if(form1.aygdcon.value=="")
   {alert("请选择工单内容");return false}
}
</script>

<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="gexian"></div>

                    	<form action="" method="post" name="form1" id="form1"  onSubmit="return check_add()"> 
                        <table width="100%" class="neitableanquan">
						
           		  		<tr>
                            <td colspan="2" align="center" width="70">工单类别：</td>
                            <td colspan="2">
                            <select name="selectp" onChange="selectcityarea('selectp','selectc','form1');" class="reginput"> 
                            <option value="0" selected>选择工单类别
                            </select>&nbsp;&nbsp;
                            <select name="selectc" class="reginput">
                            <option value="0" selected>选择工单子分类
                            </select>
                            </td>
                       	  </tr>
           		  		<tr>
                            <td colspan="2" align="center" width="70">工单标题：</td>
                            <td><input name="aygdbiao" type="text" id="aygdbiao" size="60" maxlength="60" class="reginput"/></td>
                        </tr>

           		  		<tr>
                            <td colspan="2" align="center" width="70" height="190">工单内容：</td>
                            <td><textarea name="aygdcon" id="aygdcon" style="width:590px;" rows="4"></textarea></td>
                        </tr>
						<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>

           		  		<tr>
                          <td width="70" colspan="2" align="center">&nbsp;</td>
                            <td>
                            <input name="pic1" type="hidden" id="picurl1" value="" readonly="readonly" /> <input type="button" id="uploadButton1" value="添加图片1"/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="pic2" type="hidden" id="picurl2" value="" readonly="readonly" /> <input type="button" id="uploadButton2" value="添加图片2"/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="pic3" type="hidden" id="picurl3" value="" readonly="readonly" /> <input type="button" id="uploadButton3" value="添加图片3"/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="pic4" type="hidden" id="picurl4" value="" readonly="readonly" /> <input type="button" id="uploadButton4" value="添加图片4"/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="pic5" type="hidden" 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>
                            </td>
                        </tr>
           		  		<tr>
                            <td colspan="2" align="center" width="60"><input name="act" type="hidden" id="act" value="add" /></td>
                            <td colspan="2" height="60"><input type="submit" name="Submit" id="tijiao" value=" 提 交 工 单 " class="logindlreg"></td>
                       	  </tr>

                    </table>
            </form>

            <!-------------------------------------- 结束 -------------------------------------->
                   
                   
                   
            
                                                                 
                   
            <div class="gexian20"></div>
            <div class="mzsmbox2" style="padding-top:20px;">
            提示：请正确选择工单类别，以及详细说明。<br>
            </div>
          </div>
            
           
<script language="javascript">
cityareaname=new Array(4);
cityareacode=new Array(4);
 function first(preP,preC,formname,selectP,selectC,chengshi1,chengshi2)
   {
     a=0;	
	 
	  
if (selectP=='01')
  { a=1;tempoption=new Option('账户问题','01',false,true); }
else
  { tempoption=new Option('账户问题','账户问题'); }
eval('document.'+formname+'.'+preP+'.options[1]=tempoption;');
cityareacode[0]=new Array('账户信息修改','安全设置','代理系统','账务统计相关问题');
cityareaname[0]=new Array('账户信息修改','安全设置','代理系统','账务统计相关问题');



if (selectP=='02')
  { a=2;tempoption=new Option('商品问题','02',false,true); }
else
  { tempoption=new Option('商品问题','商品问题'); }
eval('document.'+formname+'.'+preP+'.options[2]=tempoption;');
cityareacode[1]=new Array('商品分类相关问题','商品相关问题','商品购买链接相关问题','卡密相关问题','卡密回收站');
cityareaname[1]=new Array('商品分类相关问题','商品相关问题','商品购买链接相关问题','卡密相关问题','卡密回收站');



if (selectP=='03')
  { a=3;tempoption=new Option('交易问题','03',false,true); }
else
  { tempoption=new Option('交易问题','交易问题'); }
eval('document.'+formname+'.'+preP+'.options[3]=tempoption;');
cityareacode[2]=new Array('订单相关问题','财务相关问题','结算相关问题');
cityareaname[2]=new Array('订单相关问题','财务相关问题','结算相关问题');



if (selectP=='04')
  { a=4;tempoption=new Option('套餐问题','04',false,true); }
else
  { tempoption=new Option('套餐问题','套餐问题'); }
eval('document.'+formname+'.'+preP+'.options[4]=tempoption;');
cityareacode[3]=new Array('套餐购买相关问题','套餐使用相关问题');
cityareaname[3]=new Array('套餐购买相关问题','套餐使用相关问题');



eval('document.'+formname+'.'+preP+'.options[a].selected=true;');

cityid=selectP;
    if (cityid!='0')
      {
        b=0;for (i=0;i<cityareaname[cityid-1].length;i++)
           {
             if (selectC==cityareacode[cityid-1][i])
               {b=i+1;tempoption=new Option(cityareaname[cityid-1][i],cityareacode[cityid-1][i],false,true);}
             else
               tempoption=new Option(cityareaname[cityid-1][i],cityareacode[cityid-1][i]);
            eval('document.'+formname+'.'+preC+'.options[i+1]=tempoption;');
           }
        eval('document.'+formname+'.'+preC+'.options[b].selected=true;');
      }
    }
 function selectcityarea(preP,preC,formname)
   {
     cityid=eval('document.'+formname+'.'+preP+'.selectedIndex;');
     j=eval('document.'+formname+'.'+preC+'.length;');
     for (i=1;i<j;i++)
        {eval('document.'+formname+'.'+preC+'.options[j-i]=null;')}
     if (cityid!="0")
       {
         for (i=0;i<cityareaname[cityid-1].length;i++)
            {
             tempoption=new Option(cityareaname[cityid-1][i],cityareacode[cityid-1][i]);
             eval('document.'+formname+'.'+preC+'.options[i+1]=tempoption;');
            }
       }
    }
</script>

<script language="javascript">
first("selectp","selectc","form1",0,0);
</script>



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



</div>








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


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

</body>
</html>