<!--#include file="../include/Conn.asp"-->
<!--#include file="../include/Char.asp"-->
<!--#include file="../include/md5.asp"-->
<!--#include file="Admin_Menu.asp" -->
<!--#include file="Admin_IsLogin.asp" -->
<!--#include file="../Include/html.inc"-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
</head>
<body text="#000000" >
<div align="center"><center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber68">
      <tr>
        <td valign="top"><table width="100%" border="0" cellpadding="2" cellspacing="1" bordercolor="#111111" class="tableBorder" id="AutoNumber70" style="border-collapse: collapse">
            <tr>
              <td width="100%" bgcolor="#7B9AE7"><p align="center" class="forumHeaderBackgroundAlternate style1"><strong>个 人 用 户 站 内 信 件 群 发</strong></td>
            </tr>
          </table>
            <form method=post action="Admin_sendsysmail.asp?stype=<%=request("stype")%>">
              <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tableBorder" id="AutoNumber71" style="border-collapse: collapse">
                <tr>
                  <td width="24%" bgcolor="#7B9AE7"> 　</td>
                  <td width="75%" bgcolor="#7B9AE7"> 　</td>
                </tr>
                <tr bgcolor="#D6DFF7">
                  <td width="24%"><p align="right">信件标题：</td>
                  <td width="75%"><input type="text" name="title" size="28" maxlength="20"></td>
                </tr>
                <tr bgcolor="#D6DFF7">
                  <td width="189%" colspan="2" align="center">信 件 内 容</td>
                </tr>
                <tr bgcolor="#D6DFF7">
                  <td width="189%" colspan="2"><p align="center">
                      <textarea rows="14" name="mailtext" cols="66"></textarea>
                        </td>
                </tr>
                <tr bgcolor="#D6DFF7">
                  <td width="189%" colspan="2"><p align="center">
                      <input type="submit" value="确　定　发　送" style="position: relative; height: 19">
                  </td>
                </tr>
                <tr bgcolor="#7B9AE7">
                  <td width="189%" colspan="2">　</td>
                </tr>
              </table>
          </form></td>
      </tr>
    </table>
  </center>
</div>
</body>
</html>
<% mailtext=htmlencode2(request("mailtext"))
   title=request("title")
   if mailtext="" then 
   Response.End
   end if
   if title="" then title="无标题" end if
   senduid="sysop"
   sendname="系统管理员"
   
   if request("stype")="person" then
   Set rs = Server.CreateObject("ADODB.Recordset")
   sql="select uname from person"
   rs.open sql,conn,1,1
   i=0
   do while not rs.eof
   who=rs("uname")
   SQL="insert into pmailbox(reid,senduid,sendname,title,sdate,mailtext,newmail) values('" & who & "','" & senduid & "','" & sendname & "','" & title & "',now(),'" & mailtext & "',0)" 
   conn.Execute SQL
   rs.MoveNext 
   i=i+1
   loop 
   rs.close 
   set rs=nothing
   set conn=nothing 
   mailnum=i
   response.write"<SCRIPT language=JavaScript>alert('信件发送成功,共发送"&mailnum&"封站内信件！');"
response.write"this.location.href='Admin_User.asp'</SCRIPT>" 
   end if%>
   
   <%if request("stype")="company" then
   Set rs = Server.CreateObject("ADODB.Recordset")
   sql="select uname from company"
   rs.open sql,conn,1,1
   i=0
   do while not rs.eof
   who=rs("uname")
   SQL="insert into cmailbox(reid,senduid,sendname,title,sdate,mailtext,newmail) values('" & who & "','" & senduid & "','" & sendname & "','" & title & "',now(),'" & mailtext & "',0)" 
   conn.Execute SQL
   rs.MoveNext 
   i=i+1
   loop 
   rs.close 
   set rs=nothing
   set conn=nothing
   mailnum=i 
response.write"<SCRIPT language=JavaScript>alert('信件发送成功,共发送"&mailnum&"封站内信件！');"
response.write"this.location.href='Admin_CUser.asp'</SCRIPT>"
end if %>
