<!--#include virtual="/incs/config.asp"-->
<%
chk_log()
chk_newpwr 4,19,0
''''''''''''''''''''''''''''''''
gid=SafeRequest("gid")
grd=SafeRequest("grd")
ms_mod=SafeRequest("ms_mod")
gnme=SafeRequest("gnme")
if gid="" or grd="" then
call errorpage(-2,"对不起，参数错误！")
end if
conn.open constr
query="select * from atosys"
rs.open query,conn,1,1
pl_dskqta_alm=trim(rs("pl_dskqta_alm"))
rs.close
query="select * from v_pdtlst where g_prd='"&grd&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品定义不存在！")
end if
g_nme=trim(rs("g_nme"))
g_db=trim(rs("g_db"))
temptag=left(g_db,3)
rs.close
if ms_mod="" then
ms_mod=temptag&"_rnw"
end if
query="select * from emlmod where ms_mod='sign'"
rs.open query,conn,1,1
if not rs.eof then
signature=rs("ms_bdy")
end if
rs.close
select case temptag
case "hst"
query="select * from v_hst where h_ftpusr='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"pl_dskqta_alm:"&pl_dskqta_alm&Vend
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"h_prd:"&rs("h_prd")&Vend
paras=paras&"h_yarcnt:"&rs("h_yarcnt")&Vend
paras=paras&"h_exptme:"&rs("h_exptme")&Vend
paras=paras&"freedomain:"&rs("h_ftpusr")&"."&rs("h_svrnme")&Vend
paras=paras&"h_svrip:"&rs("h_svrip")&Vend
paras=paras&"h_ftpusr:"&rs("h_ftpusr")&Vend
paras=paras&"h_ftppss:"&getpassoutcode(rs("h_ftppss"))&Vend
paras=paras&"g_tst:"&rs("g_tst")&Vend
paras=paras&"pl_hstctr_url:"&pl_hstctr_url&Vend
rs.close
case "ftp"
query="select * from v_ftp where f_ftpnme='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"pl_dskqta_alm:"&pl_dskqta_alm&Vend
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"f_prd:"&rs("f_prd")&Vend
paras=paras&"f_maxcns:"&rs("f_maxcns")&Vend
paras=paras&"f_yarcnt:"&rs("f_yarcnt")&Vend
paras=paras&"f_exptme:"&rs("f_exptme")&Vend
paras=paras&"f_svrip:"&rs("f_svrip")&Vend
paras=paras&"f_ftpnme:"&rs("f_ftpnme")&Vend
paras=paras&"f_ftppss:********"&Vend
paras=paras&"g_tst:"&rs("g_tst")&Vend
paras=paras&"pl_ftpctr_url:"&pl_ftpctr_url&Vend
rs.close
case "eml"
query="select * from v_eml where m_dme='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"pl_dskqta_alm:"&pl_dskqta_alm&Vend
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"m_prd:"&rs("m_prd")&Vend
paras=paras&"m_yarcnt:"&rs("m_yarcnt")&Vend
paras=paras&"m_exptme:"&rs("m_exptme")&Vend
paras=paras&"m_svrip:"&rs("m_svrip")&Vend
paras=paras&"m_dme:"&rs("m_dme")&Vend
paras=paras&"m_pss:********"&Vend
paras=paras&"g_tst:"&rs("g_tst")&Vend
paras=paras&"pl_emlctr_url:"&pl_emlctr_url&Vend
rs.close
case "sql"
query="select * from v_sql where sq_nme='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"pl_dskqta_alm:"&pl_dskqta_alm&Vend
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"sq_prd:"&rs("sq_prd")&Vend
paras=paras&"sq_yarcnt:"&rs("sq_yarcnt")&Vend
paras=paras&"sq_exptme:"&rs("sq_exptme")&Vend
paras=paras&"sq_svrip:"&rs("sq_svrip")&Vend
paras=paras&"sq_nme:"&rs("sq_nme")&Vend
paras=paras&"sq_pss:"&getpassoutcode(rs("sq_pss"))&Vend
paras=paras&"sq_ftpusr:"&rs("sq_ftpusr")&Vend
paras=paras&"sq_ftppss:"&getpassoutcode(rs("sq_ftppss"))&Vend
paras=paras&"g_tst:"&rs("g_tst")&Vend
paras=paras&"pl_sqlctr_url:"&pl_sqlctr_url&Vend
rs.close
case "dme"
query="select * from v_dme where d_dme='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"d_prd:"&rs("d_prd")&Vend
paras=paras&"d_yarcnt:"&rs("d_yarcnt")&Vend
paras=paras&"d_exptme:"&rs("d_exptme")&Vend
paras=paras&"d_dme:"&rs("d_dme")&Vend
paras=paras&"d_pss:********"&Vend
paras=paras&"g_tst:"&rs("g_tst")&Vend
paras=paras&"pl_dmectr_url:"&pl_dmectr_url&Vend
rs.close
case "dmc"
query="select * from v_dmc where d_dme='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"d_prd:"&rs("d_prd")&Vend
paras=paras&"d_yarcnt:"&rs("d_yarcnt")&Vend
paras=paras&"d_exptme:"&rs("d_exptme")&Vend
paras=paras&"d_dme:"&rs("d_dme")&Vend
paras=paras&"d_pss:********"&Vend
paras=paras&"pl_dmectr_url:"&pl_dmectr_url&Vend
rs.close
case "dmt"
query="select * from v_dmt where d_dme='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"d_prd:"&rs("d_prd")&Vend
paras=paras&"d_yarcnt:"&rs("d_yarcnt")&Vend
paras=paras&"d_exptme:"&rs("d_exptme")&Vend
paras=paras&"d_dme:"&rs("d_dme")&Vend
paras=paras&"d_pss:********"&Vend
paras=paras&"pl_dmectr_url:"&pl_dmectr_url&Vend
rs.close
case "adv"
query="select * from v_adv where v_nme='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"v_prd:"&rs("v_prd")&Vend
paras=paras&"v_yarcnt:"&rs("v_yarcnt")&Vend
paras=paras&"v_exptme:"&rs("v_exptme")&Vend
paras=paras&"v_steurl:"&rs("v_steurl")&Vend
paras=paras&"v_nme:"&rs("v_nme")&Vend
rs.close
case "dsn"
query="select * from v_dsn where k_nme='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"k_prd:"&rs("k_prd")&Vend
paras=paras&"k_yarcnt:"&rs("k_yarcnt")&Vend
paras=paras&"k_exptme:"&rs("k_exptme")&Vend
paras=paras&"k_nme:"&rs("k_nme")&Vend
rs.close
case "svr"
query="select * from v_svr where s_nme='"&gid&"'"
rs.open query,conn,1,1
if rs.eof then
call errorpage(-2,"对不起，该产品不存在！")
end if
ms_rec=rs("u_eml")
paras=""
paras=paras&"u_nme:"&rs("u_nme")&Vend
paras=paras&"g_nme:"&rs("g_nme")&Vend
paras=paras&"s_prd:"&rs("s_prd")&Vend
paras=paras&"s_svrip:"&trim(rs("s_svrip"))&Vend
paras=paras&"s_yarcnt:"&rs("s_yarcnt")&Vend
paras=paras&"s_exptme:"&rs("s_exptme")&Vend
paras=paras&"s_nme:"&rs("s_nme")&Vend
rs.close
end select
paras=paras&"pl_steurl:"&pl_steurl&Vend
paras=paras&"C:"&signature&Vend
''''###########3
if  ms_mod<>"" then
query="select * from emlmod where ms_mod='"&ms_mod&"'"
rs.open query,conn,1,1
if not rs.eof then
ms_ttl=trim(rs("ms_ttl"))
ms_bdy=trim(rs("ms_bdy"))
end if
rs.close
end if
''''###########3
'##############
if paras<>"" then
bdy_paras=split(paras,Vend)
for i=0 to ubound(bdy_paras)-1
bdy_para_nme=left(bdy_paras(i),instr(bdy_paras(i),":")-1)
bdy_para_value=replace(bdy_paras(i),bdy_para_nme&":","")
ms_bdy=replace(ms_bdy,"["&bdy_para_nme&"]",bdy_para_value)
next
end if
ms_ttl=replace(ms_ttl,"[pl_stenme]",pl_stenme)
'##############
%>
<!--#include virtual="/incs/top.asp"-->
<script language="javascript">
<!--
 //-->
 </script>
<table cellspacing=2 cellpadding=0 width="100%" border=0>
  <tbody> 
  <tr> 
    <td  colspan=2 valign="middle"> 
      <table class=line cellspacing=0 cellpadding=0 width="100%" 
                  border=0 align="center">
        <tbody> 
        <tr> 
          <td valign=bottom width="25%" height=20><b>邮件通知发送</b></td>
          <td valign=bottom noWrap align=right 
                        width="75%">&nbsp;</td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=5></td>
        </tr>
        <tr> 
          <td align=middle width="100%" colspan=2 height=2  class=menuline></td>
        </tr>
        </tbody> 
      </table>
      <br>
    </td>
  </tr>
  <tr> 
    <td  colspan=2 valign="middle" height="28"> 
      <table border=0 cellpadding=0 
                        cellspacing=0 class=datalist align="center"  width="100%">
        <tbody> 
        <form action=snd_mng.asp method=post name=theform>
          <tr > 
            <th class=datalistheader align=center width="15%"> 
              <div align="center">项目</div>
            </th>
            <th  class=datalistheader  align=center>值</th>
          </tr>
          <tr  > 
            <td height="25" class=datalistgrida   align=center width="15%">产品名称</td>
            <td height="25" class=datalistgrida > 
              <input type="text" name="ms_mod" size="50" value="<%=gnme%>(<%=g_nme%>)">
            </td>
          </tr>
          <tr  > 
            <td height="25" class=datalistgrida   align=center width="15%">接收邮件人</td>
            <td height="25" class=datalistgrida > 
              <input type="text" name="ms_rec" size="50" value="<%=ms_rec%>">
            </td>
          </tr>
          <tr  > 
            <td height="25" class=datalistgrida   align=center>邮件模板</td>
            <td height="25" class=datalistgrida > 
              <select name="ms_mod" onchange="javascript:location.href='snd_frm.asp?grd=<%=grd%>&gid=<%=gid%>&gnme=<%=gnme%>&ms_mod='+this.options(this.options.selectedIndex).value;">
                <option value="no">其它</option>
                <% 
			query="select * from emlmod where ms_mod like '"&temptag&"%'"
				rs1.open query,conn,1,1
				while not rs1.eof 
				%>
                <option <%if ms_mod=trim(rs1("ms_mod")) then
				response.write " selected "
				end if %> value="<%=trim(rs1("ms_mod"))%>"><%=trim(rs1("ms_nme"))%></option>
                <%
				rs1.movenext
				wend
				rs1.close
				%>
              </select>
			  <%
	rsstr=""
	i=1
	j=0
	query="select * from emlmod where ms_mod like '"&temptag&"%'"
	rs.open query,conn,1,1
	while not rs.eof
	if (rs("ms_mod"))=ms_mod then
	j=i
	end if
	rsstr=rsstr&"|" &cstr(rs("ms_mod"))
	rs.movenext
	if not rs.eof then
	i=i+1
	end if
	wend
	rs.close
    rspre=j-1
	rspnext=j+1
	rsstrs=split(rsstr,"|")
	if rspre<=0 then
	rsprename=""
	else
	rsprename=rsstrs(rspre)
	end if
	if rspnext>i then
	rspnextname=""
	elseif rspnext<=ubound(rsstrs) then
	rspnextname=rsstrs(rspnext)
	end if
 	%>
      <input <%if rsprename="" then
	  response.write " disabled "
	  end if %> type="button" name="Submit32" value="上一个" class=btxx onClick="javascript:location.href='snd_frm.asp?grd=<%=grd%>&gid=<%=gid%>&gnme=<%=gnme%>&ms_mod=<%=rsprename%>';"  title="模板标志：<%=rsprename%>">
      <input <%if rspnextname="" then
	  response.write " disabled "
	  end if %> type="button" name="Submit32" value="下一个" class=btxx onClick="javascript:location.href='snd_frm.asp?grd=<%=grd%>&gid=<%=gid%>&gnme=<%=gnme%>&ms_mod=<%=rspnextname%>';"   title="模板标志：<%=rspnextname%>">
            </td>
          </tr>
          <tr  > 
            <td height="25" class=datalistgrida   align=center>是否使用HTML</td>
            <td height="25" class=datalistgrida > 
              <input type="radio" name="ms_ifhtm" value="0" <%if SafeRequest("ms_ifhtm")<>"1" then
			  response.write " checked"
			  end if %>>
              不使用 
              <input type="radio" name="ms_ifhtm" value="1" <%if SafeRequest("ms_ifhtm")="1" then
			  response.write " checked"
			  end if %>>
              使用 </td>
          </tr>
          <tr  > 
            <td height="25" class=datalistgrida   align=center>邮件标题</td>
            <td height="25" class=datalistgrida > 
              <input type="text" name="ms_ttl" size="60" value="<%=trim(ms_ttl)%>">
              <input type="hidden" name="gid"   value="<%=gid%>">
              <input type="hidden" name="grd"   value="<%=grd%>">
              <input type="hidden" name="ms_mod"   value="<%=ms_mod%>">
              <input type="hidden" name="gnme"   value="<%=gnme%>">

            </td>
          </tr>
          <tr  > 
            <td height="25" class=datalistgrida   align=center>邮件正文</td>
            <td height="25" class=datalistgrida >注意不要输入双引号。 </td>
          </tr>
          <tr  > 
            <td height="25"  class=datalistgrida  align=center>&nbsp; </td>
            <td height="25"  class=datalistgrida> 
              <textarea name="ms_bdy" cols="90" rows="30" class=normalform><%=ms_bdy%></textarea>
            </td>
          </tr>
          <tr  > 
            <td height="50"   class=datalistgrida align=center colspan="2"> 
              <input type="submit" name="Submit2" value="发 送" class=btxx>
              <input type="reset" name="Submit3" value="重 置" class=btxx>
              <input type="hidden" name="module" value="snd_snd" class=dud_button1>
            </td>
          </tr>
        </form>
        </tbody> 
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height=8></td>
        </tr>
      </table>
      <br>
    </td>
  </tr>
  </tbody> 
</table>
<!--#include virtual="/incs/bottom.asp"-->





