<!--#include file="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<%
If Request.QueryString("action")="del" Then
Set rs=Conn.Execute("Delete * From [Honor_Img] Where ID="&Clng(Request("id")))
JaSys("管理员" & session("ManagerUser") & "删除ID为"&Request("id")&"<font color=red>企业形象</font>成功")
Response.Redirect "Manage_Img.asp"
End if
%>
<html>
<head>
<titel></titel>
<LINK href="admin/admin.css" type=text/css rel=stylesheet>
</head>
<body>
<%
If Request.QueryString("action")="add" Then
titel=server.htmlencode(Trim(Request("titel")))
img=server.htmlencode(Trim(Request("img")))
If Request.Form("ok")="确定" Then 
  If titel="" or img="" Then
  Response.Write("<script language=""JavaScript"">alert(""名称和图片地址都不能为空!"");history.go(-1);</script>")
  Response.end
  Else
Set rsa = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From [Honor_Img] Where (ID is Null)"
rsa.open Sql,conn,1,3
rsa.AddNew
rsa("Titel")=titel
rsa("Image")=img
rsa("Type_Honor")=false
rsa("Type_Img")=true
rsa.Update
rsa.Close
Set rsa=Nothing
JaSys("管理员" & session("ManagerUser") & "添加<font color=red>企业形象["&titel&"]</font>成功")
Response.Redirect "Manage_Img.asp"
End if
End if
Call MainForm
End if

If Request.QueryString("action")="update" Then
titel=server.htmlencode(Trim(Request("titel")))
img=server.htmlencode(Trim(Request("img")))
Set rsh = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From [Honor_Img] Where ID="&Clng(Request("id"))
rsh.open Sql,conn,1,1
Call MainForm
If Request.Form("ok")="确定" Then 
  If titel="" or img="" Then
  Response.Write("<script language=""JavaScript"">alert(""名称和图片地址都不能为空!"");history.go(-1);</script>")
  Response.end
  Else
rsh.Close
Set rsh=Nothing
Sql = "Update [Honor_Img] Set [Titel]='"&titel&"',[Image]='"&img&"',[Type_Honor]=false,[Type_Img]=true Where ID="&Clng(Request("id"))
Conn.Execute (Sql)
JaSys("管理员" & session("ManagerUser") & "修改ID为"&Request("id")&"<font color=red>企业形象为["&titel&"]</font>成功")
Response.Redirect "Manage_Img.asp"
End if
End if
End if
Sub MainForm
%>
<table width="100%" height="35%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <p>&nbsp;</p>
      <p><br>
        <strong>企业形象管理</strong></p>
      <form name="form1" method="post" action="">
        <table width="550" border="0" cellspacing="2" cellpadding="2" class=tableBorder>
          <tr> 
            <td>荣誉名称 </td>
            <td><input type="text" name="titel" <%If Request.QueryString("action")="update" Then Response.Write "value=" &rsh("Titel")%> maxlength="30" size="30"></td>
          </tr>
          <tr> 
            <td>荣誉证书</td>
            <td> <input name="img" type="text" id="img" <%If Request.QueryString("action")="update" Then Response.Write  "value='" &rsh("Image")&"'"%> maxlength="100" size="40"> 
              <font color="#FF0000"> * 图片地址</font></td>
          </tr>
          <tr> 
            <td height="30" colspan="2"> <div align="center"> 
                <input name="ok" type="submit" value="确定">
                &nbsp; 
                <input name="reset" type="reset" value="取消">
              </div></td>
          </tr>
          <tr> 
            <td>图片上传</td>      
          </tr>
<tr> 
                  <td colspan="2"><div align="center"> 
            <iframe name="ad" frameborder=0 width=100% height=50 scrolling=no src="../Uploada.asp"></iframe>
                    </div></td>
                </tr>
        </table>
      </form>
      <br> </td>
  </tr>
</table>
<%End Sub
Call CloseConn()%>
</body>
</html>