<!--#include file="../Include/Class_Conn.asp" -->
<!--#include file="../Include/Class_Main.asp" -->
<!--#include file="../Include/Class_Pass.asp" -->
<!--#include file="../Public/School_Cookies.asp" -->
<% 
Dim Schid,Username,Tmp,Temp(3)
Dim Cmd,Rs,Action

Action = Request.QueryString("action")
If Action = "submit" Then Call Submit() '//调用保存数据的函数

'//获取会员登陆的标记
If Not IsArray(Session("School")) Then 
 Response.write "<script>alert('-登录后才能进行该操作！-');location.href='../Public/MemberLogin.asp';</script>"
Else
 Username  = Session("School")(0)
 Schid     = Session("School")(2)
End if

'//调用存储过程
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Conn
Cmd.CommandText = "Sch_Account"
Cmd.CommandType = 4
Cmd.Parameters.Append Cmd.CreateParameter("@Schid",200,1,30)
Cmd.Parameters("@Schid") = Schid
Set Rs = Cmd.Execute
If Rs.Eof Then
 CloseRs
 Set Cmd = Nothing
 CloseDB
 Response.write "没有找到会员资料！"
 Response.End()
End if

Tmp = Rs.GetRows() '//将数据填充到数组

'//0院校名,1院校性质
'//如 Tmp(0,0) 表示院校名称
CloseRs
Set Cmd = Nothing

'//功能代码
SchoolName              = Tmp(0,0)
Properity               = Tmp(1,0)

If School_Memo <> "" Then School_Memo = Replace(School_Memo,"<br>",Chr(13))
SchoolType = Cls_SchoolType(Properity)


 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../Css/Style.css" type=text/css rel=stylesheet>
<title><%= Cls_WebName %> -- 院校会员管理中心 -- 院校帐号升级申请</title>
</head>
<script language="JavaScript" src="../js/jsdate.js"></script>
<body>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" bgcolor="#FFFFFF">
      <!--#include file="../Header/School_User.asp" --> <table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr> 
          <td height="4"></td>
        </tr>
      </table>
      <table width="950" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr> 
          <td width="175">
            <!--#include file="../Lefter/School_All.asp" -->
          </td>
          <td width="5">&nbsp;</td>
          <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="25"><img src="../Images/icon.gif" width="11" height="11" align="absmiddle"> 
                  <%= SchoolName %> [<%= SchoolType %>]</td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <form action="?action=submit" name="edit" method="post">
                <tr> 
                  <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="eeeeee">
                      <tr> 
                        <td bgcolor="#FFFFFF"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td height="2"></td>
                            </tr>
                          </table>
                          <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="eeeeee">
                            <tr> 
                              <td height="25" bgcolor="f5f5f5"><b><font color="#000000">&nbsp;帐号升级申请</font></b></td>
                            </tr>
                          </table>
                          <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td width="18%" height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 用户名： </td>
                              <td height="25"><input name="username" type="text" id="username" size="20" maxlength="30" value="<%= Username %>"> 
                              </td>
                            </tr>
                            <tr> 
                              <td width="18%" height="25" align="right" bgcolor="f9f9f9"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 密 码：</td>
                              <td height="25" bgcolor="f9f9f9"><input name="password" type="password" id="password" size="20" maxlength="20"></td>
                            </tr>
                            <tr> 
                              <td height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 开通日期：</td>
                              <td height="25"> <input name="begindate" type="text" id="begindate" size="16" maxlength="30" onclick="SD(this,'document.all.begindate')" value="<%= Date() %>"> 
                              </td>
                            </tr>
                            <tr bgcolor="f9f9f9"> 
                              <td height="25" align="right"><STRONG><FONT 
                  color=#ff6600>*</FONT></STRONG> 缴费类型：</td>
                              <td height="25"> <select name="level" id="level">
                                  <option value="1">一个月</option>
                                  <option value="2">两个月</option>
                                  <option value="3" selected>三个月</option>
                                  <option value="4">四个月</option>
                                  <option value="5">五个月</option>
                                  <option value="6">六个月</option>
                                  <option value="9">九个月</option>
                                  <option value="12">一年</option>
                                  <option value="24">两年</option>
                                  <option value="36">三年</option>
                                </select> </td>
                            </tr>
                          </table>
                          <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td height="2"></td>
                            </tr>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
                <tr> 
                  <td height="40" align="center"><input type="submit" name="submit" value=" 申请升级 " style="height:30px;"> 
                  </td>
                </tr>
              </form>
            </table></td>
        </tr>
      </table> 
      </td>
  </tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" bgcolor="#FFFFFF">
      <!--#include file="../Include/Footer.asp" -->
    </td>
  </tr>
</table>

</body>
</html>
<% 
Sub Submit() '保存会员申请升级的记录
 'Comid         = Session("Company")(2)
 Username      = Replace_Text(Request.Form("Username"))
 Password      = Replace_Text(Request.Form("Password"))
 Password      = Md5(Password)
 Level         = Replace_Text(Request.Form("Level"))
 BeginDate     = Replace_Text(Request.Form("BeginDate"))
 
 '根据用户提供的用户名和密码来查找该用户
 SQL = "Select VipFlag,VipApplyDate From [pH_School_Base] Where Username='"&Username&"' And Password='"&Password&"'"
 Set Rs = Conn.Execute(SQL)
 If Rs.Eof Then
  Response.Write "<script>alert('对不起！您提供的用户名或者密码不正确...');history.back(-1);</script>"
  Response.End()
 Elseif Rs(0) = 1 Then
  Response.Write "<script>alert('您已经是本站的高级会员...');history.back(-1);</script>"
  Response.End()
 Elseif Rs(1) <> "" Then
  Response.Write "<script>alert('您已经在想网站提出申请，客服人员会尽快联系您!\n请不要再次提出申请...');history.back(-1);</script>"
  Response.End()
 End if
 Rs.Close
 '更新申请
 SQL = "Update [pH_School_Base] Set VipDate='"&BeginDate&"',VipLevel="&Level&",VipApplyDate='"&Date()&"' Where Username='"&Username&"' And Password='"&Password&"'"
 Conn.Execute(SQL)
 
  Response.Write "<script>alert('申请成功！我们会尽快联系您...');history.back(-1);</script>"
  
End Sub

'//关闭数据库连接
CloseDB
 %>
