<%@language="VBscript"%>
<%Response.Expires=0%>
<!--#include file="../../config.asp"-->
<html>
<head>
<title>在线问卷调查系统_修改email</title>
<META NAME="robots" CONTENT="none">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../../inc/manage.css" type="text/css">
<script language="javascript">    
function checkform()
{
	if(document.regform.email.value.length!=0)
	  {
		if (document.regform.email.value.charAt(0)=="." ||        
			 document.regform.email.value.charAt(0)=="@"||       
			 document.regform.email.value.indexOf('@', 0) == -1 || 
			 document.regform.email.value.indexOf('.', 0) == -1 || 
			 document.regform.email.value.lastIndexOf("@")==document.regform.email.value.length-1 || 
			 document.regform.email.value.lastIndexOf(".")==document.regform.email.value.length-1)
		 {
		  alert("Email地址格式不正确！");
		  document.regform.email.focus();
		  return false;
		  }
	   }
	else
	  {
	   alert("Email不能为空！");
	   document.regform.email.focus();
	   return false;
	   }	
}
</script>
</head>
<body bgcolor="#FFFFFF" leftMargin="0" marginwidth="0" topmargin="0">
<!--#include file="../../manage/checkuserflag.asp"-->
<%call CheckUserFlag("22")%>
<table width="100%" border="0" cellspacing="0" cellpadding="2" align="center">
  <tr> 
    <td width="23%" height="26" align="left" background="../../images/s3wcn_bt.gif"><font face="webdings" color="#666666">8</font>      <span style="FONT-SIZE: 14px"><b><font color="#666666">资源管理 -> 新增邮件</font></b></span></td>
    <td width="77%" align="right" background="../../images/s3wcn_bt.gif"><a href="../../manage/password.asp"><font color="#000000">修改密码</font></a> | <a href="../../manage/out.asp"> <font color="#000000">退出管理</font></a></td>
  </tr>
  <tr> 
    <td height="1" colspan="2" bgcolor="#446CC1"></td>
  </tr>
</table>
<%
Set ObjDCW = Server.CreateObject("dc_data100_v1_0.C_A_Config") 

me_page=request.form("me_page")
'response.write "当前是第几条：" & me_page & "<br>"

productid=Request("productid") '问卷ID号字符串
'response.write "productid=" & productid & "<br>"
'response.end

dim totalPut'总记录数
maxperpage=1'每页最大数
dim CurrentPage'当前页
dim i,j
if not isempty(request("me_page")) then
   currentPage=cint(request("me_page"))
else
   currentPage=1
end if

dim D_data

survey_record=ObjDCW.read_record(D_data,DataPathFile,"email_list","email_id,email,email_user,email_mob,email_tel,email_fax,email_company,email_address,email_dep_id,email_gk"," where email_id in ( " & productid & " ) order by email_id desc")'读出记录,结果保存在D_data数组中
'A_M_D_ID--部门ID update_date 更新日期
if survey_record=0 then 
   response.write "<p align='center'>对不起，没有您要查询的信息</p>" 
elseif survey_record=1 then
	'response.write "总记录数=" & UBound(D_data)
	'response.end
	totalput = UBound(D_data)'总记录数
	aaa=ObjDCW.setpage(D_data,totalput,maxperpage,currentPage,Num_b,Num_o)'设置分页
	showContent totalput,MaxPerPage,currentPage,Num_b,Num_o
end if

function showContent(totalput,MaxPerPage,currentPage_s,Num_b_s,Num_o_s)%>
<%
for h=Num_b_s to Num_o_s step 1'------------------------开始--------------------------------------
		survey_rec=D_data(h)
		myrs=split(survey_rec,",")
		newsort=myrs(2)
%><br>
<table width="96%" border="0" cellspacing="1" cellpadding="1" class=p9 align="center" bgcolor="D8E7FE">
  <form action="email_edit_ok.asp" method="post" name="form1" onSubmit="return checkform(this);">
  <tr align="left"> 
      <td height="25" background="../../images/s3wcn_bt.gif" >&nbsp;&nbsp;<font face="webdings" color="#666666">8</font> 
      <img src="../images/pixel.gif" width="320" height="1"><span style="FONT-SIZE: 14px"><b><font color="#666666">修改</font><font color="#666666">Email信息</font></b></span></td>
  </tr>
  <tr align="right" bgcolor="#FFFFFF" height=20> 
    <td align="right"><b> <font color="#666666">注意：</font></b><font color="#666666">请在20分钟以内完成提交，否则输入无效!</font>&nbsp;</td>
  </tr>  
  <%if totalput>1 then%>
           <tr> 
            <td height="24" align="center"><strong>分批修改</strong>(总<font color=red><%=totalput%></font>条): 当前是第<FONT color=red><%=currentPage_s%></font>条  <%show_page totalput,currentPage_s%> 
                      <input type="text" name="goto_page" value=<%=currentPage_s%> class=p9 size=4 style="border: 1px solid rgb(200,200,200)" maxlength=4>
                      <input style="height:19;WIDTH: 42px" class="s02" hideFocus type="button" value="GoTo" name="cmd_goto" onClick="javascript:viewPage(document.all.goto_page.value);">
            </td>
          </tr>
  <%end if%> 
  <tr align="center" bgcolor="#FFFFFF">
    <td height="35"><br>
        <table border="1" cellpadding="2" cellspacing="0" class="p9" bordercolor="#cccccc" bordercolordark="#FFFFFF" bordercolorlight="#cccccc" width="99%">
          <tr>
            <td width="21%" height="30" align="right">所属部门：</td>
            <td>
              <select name="bm" id="bm" style="WIDTH: 260px; COLOR: navy; font-size:9pt">    
                <%
				if Session("DC_Manage_DepartmentID")<>0 then
					sql_email=" where A_M_D_ID=" & myrs(8)
				else
					sql_email=" where A_M_D_company_id=" & Session("DC_Manage_CompanyID")
				end if
				email_s=ObjDCW.read_record(D_data,DataPathFile,"A_Manage_Department","A_M_D_ID,A_M_D_Name",sql_email & " order by A_M_D_ID")
				myrs_root_count=ubound(D_data)
				if Session("DC_Manage_DepartmentID")=0 then
					Response.Write "<option value='0' style='color:black;background:#f0f0f0'>-</option>"
				end if
				for i=0 to myrs_root_count-1 step 1
					myrs_root=split(D_data(i),",")
					if myrs(8)=myrs_root(0) then
						Response.Write "<option value='"&myrs_root(0)&"' style='color:black;background:#f0f0f0' selected=""selected"">" & myrs_root(1)
					else
						Response.Write "<option value='"&myrs_root(0)&"' style='color:black;background:#f0f0f0'>" & myrs_root(1)
					end if
					response.write "</option>"
				next
%>
              </select></td>
          </tr>
          <tr>
            <td height="30" align="right">Email：</td>
            <td><input name="email" type="text" id="email" value="<%=myrs(1)%>" size="60"> 
            <font color=red>*</font></td>
          </tr>
          <tr>
            <td height="30" align="right">联系人：</td>
            <td><input name="lxr" type="text" id="lxr" value="<%=myrs(2)%>" size="60">
           </td>
          </tr>
          <tr>
            <td width="21%" height="30" align="right">单位：</td>
            <td><input name="dw" type="text" id="dw" value="<%=myrs(6)%>" size="60"></td>
          </tr>
          <tr>
            <td height="30" align="right">地址：</td>
            <td><input name="dz" type="text" id="dz" value="<%=myrs(7)%>" size="60"></td>
          </tr>
          <tr>
            <td width="21%" height="30" align="right">手机：</td>
            <td><input name="mob" type="text" id="mob" value="<%=myrs(3)%>" size="60"></td>
          </tr>
          <tr>
            <td width="21%" height="30" align="right">电话：</td>
            <td><input name="tel" type="text" id="tel" value="<%=myrs(4)%>" size="60"></td>
          </tr>
          <tr>
            <td width="21%" height="30" align="right">传真：</td>
            <td><input name="fax" type="text" id="fax" value="<%=myrs(5)%>" size="60"></td>
          </tr>
          <tr>
            <td width="21%" height="30" align="right">是否公开：</td>
            <td><label>
              <input name="gk" type="radio" id="radio" value="0" <%if myrs(9)="False" then response.write "checked"%>>
              否
              <input type="radio" name="gk" id="radio2" value="1" <%if myrs(9)="True" then response.write "checked"%>>
            是</label></td>
          </tr>   
        </table>
        <br>
      </td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF">
      <td height="40">
        <input type="hidden" name="email_id" value="<%=myrs(0)%>">
        <input type="hidden" name="productid" value="<%=productid%>">
        <input type="hidden" name="me_page" value="<%=currentPage_s%>">
        <input type="hidden" name="total_page" value="<%=totalput%>">
      <input type="submit" name="Submit" value="保存" class=p9 style="WIDTH: 85px; HEIGHT: 24px;">
      &nbsp;&nbsp; 
      <input type="reset" name="Submit2" value="取消" class=p9 style="WIDTH: 85px; HEIGHT: 24px;">
      &nbsp;&nbsp; 
      <input type="button" name="button1" value="返回" class=p9 style="WIDTH: 85px; HEIGHT: 24px;" onClick="javascript:back_list();">
      </td>
  </tr>
  </form>
  <tr align="center">
    <td height="1">
<%if totalput>1 then%>
<form action="email_edit.asp" method=post name="frm_page">
<input type="hidden" name="me_page">
<INPUT type="hidden" name="productid" value="<%=productid%>">
<!--<INPUT type="hidden" name="catalogid" value="<%=catalogid%>">-->
</form>
<%end if%>
<!-- 下面表单返回到修改时的问卷列表页-->
<form action="email_list.asp" method=post name="frm_back">
<input type="hidden" name="me_page" value=<%=request.Cookies("back_page")%>>
<input type="hidden" name="keyword" value=<%=request.Cookies("back_keyword")%>>
<!--<input type="hidden" name="catalogid" value=<%=request.Cookies("back_catalogid")%>>
<input type="hidden" name="type_id" value=<%=request.Cookies("back_type_id")%>>-->
</form>
<script language="javascript">
  function back_list(){
      document.frm_back.submit(); 
  }
</script>    
    </td>
  </tr>
</table>
<%
next'------------------结束---------------------
end function
%>
<!--#include file="include/showpage.asp"-->
</body>
</html>