⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sms_modi.asp

📁 《学校机房作业管理系统》采用ASP+Aceesss+ ServU构架
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% 
'=========================================================
' 学校机房作业管理系统 V 1.0 [创建于200812122100]
' 授权发布网站:清远ABC-http://www.qyabc.com/
' 客服QQ:418322257   E-Mail:qystu@163.com
' 注意:如想得到关于本程序免费的技术支持,
' 必须承诺使用一周后,用平邮回寄“相关文件”文件夹中的“学校机房作业管理系统调查反馈表”表格。
' 作者博客:http://www.qyabc.com/u/qin/Default.aspx
'=========================================================
%>

<!--#include file="inc/config.asp" -->
<!--#include file="Connections/master.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="4,5,1,6,7"
MM_authFailedURL="login.asp?error=3"
MM_grantAccess=false
If session("QYABC_userid") <> "" Then
  If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>
<%
Dim Recordset1__MMColParam
'Recordset1__MMColParam = "1"
'If (Request.QueryString("mailId") <> "") Then 
  Recordset1__MMColParam = Request.QueryString("mailId")
'End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_master_STRING
Recordset1.Source = "SELECT fromUserId, toUserId, mailSubject, mailMessage, mailDateTime, mailId, fromUsername, toUsername, mailIsRead  FROM sms  WHERE mailId = " + Replace(Recordset1__MMColParam, "'", "''") + ""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改短信-<%=WebName%></title>
<link rel="SHORTCUT ICON" href="favicon.ico"/>
<link href="<%= SysCss %>" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!-- 限制输入字数函数。Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}
// End -->
</script>
<script language="JavaScript">
<!--
function checkform(){
if(document.form1.mailSubject.value=="")
  {
   alert("必须填写短信主题!");
   document.form1.mailSubject.focus();
   return false;
   }
if(document.form1.Content.value=="")
  {
   alert("必须填写短信内容!");
   document.form1.Content.focus();
   return false;
   }

}
//-->
</script>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="16%" valign="top"><table width="97%" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="center"><a href="sms_index.asp">收件箱</a><a href="admin_exercise_subject_add.asp"></a><a href="admin_news_index.asp"></a></td>
      </tr>
      <tr>
        <td align="center"><a href="sms_mysend_list.asp">发件箱</a><a href="admin_exercise_subject_mylist.asp"></a><a href="admin_news_index.asp"></a></td>
      </tr>
      <tr>
        <td align="center"><a href="sms_write.asp">编写短信</a><a href="admin_exercise_content_add.asp"></a><a href="admin_news_add.asp"></a></td>
      </tr>
      <tr>
        <td align="center"><a href="admin_exercise_content_mylist.asp"></a><a href="admin_news_add.asp"></a></td>
      </tr>
      <tr>
        <td align="center"><a href="admin_news_add.asp"></a></td>
      </tr>
    </table></td>
    <td width="84%" valign="top">
	<div align="center"> 
  <br>

  <%'if  (Recordset1.Fields.Item("toUsername").Value)-Session("MM_Usernum")=0 then%>
  <%if cint(Recordset1.Fields.Item("fromUserid").Value)= session("QYABC_userid") then%>
  <% if (Recordset1.Fields.Item("mailIsRead").Value)=true then %>
  <table width="770" border="0" align="center" cellpadding="4"  style="WORD-BREAK: break-all;table-layout:fixed" cellspacing="1" bgcolor="#99ccff">
    <tr bgcolor="#66B3FF"> 
      <td colspan="3">&nbsp;</td>
    </tr>
    <tr> 
      <td width="92">发信人:</td>
      <td colspan="2" bgcolor="#FFFFFF"><div align="left"><%=(Recordset1.Fields.Item("fromUserId").Value)%></div></td>
    </tr>
    <tr> 
      <td width="92">发信时间:</td>
      <td colspan="2" bgcolor="#FFFFFF"><div align="left"><%=(Recordset1.Fields.Item("mailDateTime").Value)%></div></td>
    </tr>
    <tr width="60" bgcolor="#FFFFFF"  onmouseout="javascript:this.bgColor='#ffffff'" onmouseover="javascript:this.bgColor='#C1E0FF'"> 
      <td width="92" bgcolor="#99ccff">信息主题:</td>
      <td colspan="2" bgcolor="#FFFFFF"><div align="left"><%=(Recordset1.Fields.Item("mailSubject").Value)%></div></td>
    </tr>
    <tr width="60" bgcolor="#FFFFFF"  onmouseout="javascript:this.bgColor='#ffffff'" onmouseover="javascript:this.bgColor='#C1E0FF'"> 
      <td width="92" valign="top" bgcolor="#99ccff">信息内容:</td>
      <td colspan="2" bgcolor="#FFFFFF"><%=(Recordset1.Fields.Item("mailMessage").Value)%></td>
    </tr>
    <tr> 
      <td width="92"><a href="delmysms.asp?ID=<%=(Recordset1.Fields.Item("mailId").Value)%>" target="_self" onclick="return confirm('温馨提示:删除后,将不能恢复。你确定删除此条信息吗?')"><img src="images/del2.gif" alt="删除信息" width="43" height="19" border="0"></a></td>
      <td width="431" align="left"><a href="sms_mysend_list.asp" target="_self"><img src="images/back.gif" width="16" height="15" border="0">返回收件箱</a></td>
      <td width="219"><div align="right">对方已读短信,不可修改此短信!</div></td>
    </tr>
  </table>
 <%  else%>
 <%
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables

If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then

  MM_editConnection = MM_master_STRING
  MM_editTable = "sms"
  MM_editColumn = "mailId"
  MM_recordId = "" + Request.Form("MM_recordId") + ""
  MM_editRedirectUrl = "sms_mysend_list.asp"
  MM_fieldsStr  = "mailSubject|value|Content|value|toUserId|value|fromUserId|value|toUsername|value|fromUsername|value"
  MM_columnsStr = "mailSubject|',none,''|mailMessage|',none,''|toUserId|',none,''|fromUserId|',none,''|toUsername|',none,''|fromUsername|',none,''"

  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next

  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If

End If
%>
<%
' *** Update Record: construct a sql update statement and execute it

If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then

  ' create the sql update statement
  MM_editQuery = "update " & MM_editTable & " set "
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_editQuery = MM_editQuery & ","
    End If
    MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
  Next
  MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId

  If (Not MM_abortEdit) Then
    ' execute the update
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If

End If
%>
 <form action="<%=MM_editAction%>" method="POST" name="form1" target="_self" id="form1"  onsubmit="return checkform()">
  <div align="center"> 
    <table width="100%" align="center">
      <tr valign="baseline"> 
        <td height="20" colspan="3" align="right" nowrap></td>
      </tr>
      <tr valign="baseline"> 
        <td width="160" align="right" nowrap>你要发送给:</td>
        <td width="188" align="right" nowrap> <div align="left"><%=(Recordset1.Fields.Item("toUsername").Value)%> </div></td>
        <td width="416" align="right" nowrap>&nbsp;</td>
      </tr>
      <tr valign="baseline"> 
        <td align="right" nowrap><div align="right">短信主题:</div></td>
        <td colspan="2" align="right" nowrap><div align="left"> 
            <input name="mailSubject" type="text" id="mailSubject" value="<%=(Recordset1.Fields.Item("mailSubject").Value)%>" size="85" maxlength="38">
          </div></td>
      </tr>
      <tr valign="baseline"> 
        <td rowspan="2" align="right" nowrap><TABLE width="100%" border=0 align="right">
            <TBODY>
              <TR> 
                <TD height=27 align="center" valign="top"><div align="right">短信内容:</div></TD>
              </TR>
            </TBODY>
          </TABLE></td>
        <td colspan="2" align="right" nowrap>&nbsp;</td>
      </tr>
      <tr valign="baseline">
        <td colspan="2" align="right" nowrap><textarea name="Content" style="display:none"><%=Server.HtmlEncode(Recordset1.Fields.Item("mailMessage").Value)%></textarea>
			<iframe ID="eWebEditor1" src="editor/ewebeditor.asp?id=Content&style=sms_system&originalfilename=d_originalfilename&savefilename=d_savefilename&savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="650" HEIGHT="350"></iframe></td>
      </tr>
      <tr valign="baseline"> 
        <td nowrap align="right"><input name="toUserId" type="hidden" id="toUserId" value="<%=(Recordset1.Fields.Item("toUserId").Value)%>"> 
          <input name="fromUserId" type="hidden" id="fromUserId" value="<%= session("QYABC_userid") %>">
          <input name="toUsername" type="hidden" id="toUsername" value="<%=(Recordset1.Fields.Item("toUsername").Value)%>"> 
          <input name="fromUsername" type="hidden" id="fromUsername" value="<%= session("QYABC_username") %>"></td>
        <td colspan="2"><div align="right"> 
            <input type="submit" value="修改短信">
          </div></td>
      </tr>
    </table>
  </div>

  <input type="hidden" name="MM_update" value="form1">
  <input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("mailId").Value %>">
 </form>
<% end if%>
  <% else%>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
</div>
<div align="center">你不可读别人的信息!
</div>
<div align="center">
  <% end if %>
	</td>
  </tr>
</table>
  <!--#include file="inc/bot.asp" -->
</div>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -