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

📄 info_edit.asp

📁 企业管理系统,黑色风格
💻 ASP
字号:
<!--#include file="i_login.asp"-->
<%
dim id,keyword,page,rs1
id=trim(request("id"))
keyword=trim(request("keyword"))
page=trim(request("page"))

select case mode
case "save"
call save_sub()
end select

set rs=conn.execute("select * from data_info where id="&id&"")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=rs("title")%></title>
<LINK href="images/style.css" type=text/css rel=stylesheet>
<script language="javascript" src="../inc/functions.js"></script>
<script language="javascript" src="images/color.js"></script>
<script language="javascript" src="../inc/prototype.js"></script>
<script language="javascript">
//--------------------------------------------ajax
function delpic_fun(id)
{
var request_url = "info_delpic.asp";       // 需要获取内容的url
var request_pars = 'mode=delpic&id='+id;//请求参数
 
var myAjax = new Ajax.Updater('result', request_url,{ // 将request_url返回内容绑定到id为result的容器中
method     : 'post', //HTTP请求的方法,get or post
parameters : request_pars, //请求参数
onFailure  : reportError, //失败的时候调用 reportError 函数
onLoading  : loading, //正在获得内容的时候
onComplete : done //内容获取完毕的时候
});

function loading(bid)
{
$('previewImage1').innerHTML='\<img src=\'images\/delpic.gif\' width=64 height=64  onload=\'ResizeImage(this, 64, 64);\' align=absmiddle  style=\"border:#EFEFEF solid 1px;\"\>';
}
function done(Request)
{
if(Request.responseTEXT=="ok"){
$('previewImage1').innerHTML='\<img src=\'images\/upimgbg.gif\' width=64 height=64  onload=\'ResizeImage(this, 64, 64);\' align=absmiddle style=\"border:#EFEFEF solid 1px;\"\>';
$('delpic').innerHTML='';
}else
{
$('previewImage1').innerHTML='\<img src=\'images\/errpic.gif\' width=64 height=64  onload=\'ResizeImage(this, 64, 64);\' align=absmiddle style=\"border:#EFEFEF solid 1px;\"\>';
}
}

function reportError(request)
{
$('previewImage1').innerHTML='\<img src=\'images\/errpic.gif\' width=64 height=64  onload=\'ResizeImage(this, 64, 64);\' align=absmiddle style=\"border:#EFEFEF solid 1px;\"\>';
}
}
</script>
<script type="text/javascript">
function chk(form)
{
if(form.classid.value=="" || form.title.value==""  ){
  if(form.classid.value==""){
  alert("请选择目录");
  form.classid.focus();
  }else{
   alert("请填写标题!");
   form.title.focus();
  }
  return false;
  }
  else
  {
  return true;
  } 
}
</script>
</head>
<body>
<iframe width="260" height="165" id="colourPalette" src="images/nc_selcolor.htm" style="visibility:hidden; position: absolute; left: 0px; top: 0px;border:1px gray solid" frameborder="0" scrolling="no" ></iframe>
<div style="padding:10px; text-align:center; font-size:18px; font-weight:bold;">
<%=rs("title")%></div>
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#C2BDBD">
  <form action="?mode=save&id=<%=id%>"  method="post" name="form1" enctype="multipart/form-data"  onSubmit="return chk(this);">
  <input name="REFERER" value="<%=Request.ServerVariables("HTTP_REFERER")%>" type="hidden"/>
   <tr>
     <td align="center" bgcolor="#CCCCCC">目录</td>
     <td align="left" bgcolor="#FFFFFF"><select name="classid" >
       <%
call site_class_showpid(0,"&nbsp;")
function site_class_showpid(byval classid,byval str)
dim rs,request_id
if str="&nbsp;" then
response.Write("<option value="""">请选择</option>")
end if
set rs=conn.execute("select id,name from data_Categorys where classid="&classid&" order by  orderby,id")
 while not rs.eof
 response.Write("<option value="""&rs("id")&""">"&str&rs("name")&"</option>")
 site_class_showpid  cint(rs("id")),str & "&nbsp;"
 rs.movenext
 wend
 rs.close
 set rs=nothing
end function
%>
     </select>
       <script language="javascript">document.form1.classid.value='<%=rs("classid")%>';</script>       </td>
    </tr>
   <tr>
     <td width="10%" align="center" nowrap bgcolor="#CCCCCC">标题</td> 
     <td width="90%" align="left" nowrap bgcolor="#FFFFFF"><input name="title" type="text" class="input" id="title" value="<%=rs("title")%>" size="60"> 
<input type="hidden" name="color" id="color" value="<%=rs("color")%>">
                <img src="images/rect.gif" width="18" height="17" border=0 style="cursor:pointer;background-Color:<%=rs("color")%>;" title="选取颜色!" onClick="Getcolor(this,'color');">&nbsp;
                <label></label></td>
    </tr>

   <tr bgcolor="#FFFFFF">
     <td align="center" nowrap bgcolor="#CCCCCC">外联</td>
     <td align="left" nowrap><input name="link" type="text" class="input" id="link" value="<%=rs("link")%>" size="60"></td>
    </tr>
   <tr bgcolor="#FFFFFF">
     <td align="center" bgcolor="#CCCCCC">图片</td> 
    <td align="left"><table border="0" cellspacing="5" cellpadding="0">
         <tr>
           <td width="64" height="64" align="center" valign="middle" id="previewImage1">
		   <%
		   if trim(rs("img_s"))<>"" then
		   response.Write("<img src="""&rs("img_s")&"?"&getkey(6)&""" width=""64"" height=""64"" border=""0"" onload=""ResizeImage(this, 64, 64);"" style=""border:#EFEFEF solid 1px;"" align=absmiddle/>")
		   else
		   response.Write("<img src=""images/upimgbg.gif"" width=""64"" height=""64"" border=""0"" onload=""ResizeImage(this, 64, 64);"" style=""border:#EFEFEF solid 1px;"" align=absmiddle/>")
		   end if%>		   </td>
           <td><span style=" float:left;">
             <input name="file1" type="file" id="file1" 
      style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; MARGIN-BOTTOM: 2px; PADDING-BOTTOM: 3px; PADDING-TOP: 4px" 
onchange="document.getElementById('previewImage1').innerHTML = '\<img src=\''+this.value+'\' width=64 height=64  onload=\'ResizeImage(this, 64, 64);\' align=absmiddle\>';" />
           </span></td>
           <td id="delpic" style="padding-left:5px; padding-right:5px;">
		   <%if trim(rs("img_s"))<>"" then %>
		   <span style="cursor:hand; color:#0066FF; text-decoration:underline" onClick="delpic_fun('<%=rs("id")%>');">删除图片</span>
		   <%end if%>		   </td>
           <td align="center" valign="bottom"  style="padding-left:5px; padding-right:5px;" nowrap><span onClick="javascript:showList(show);" style="cursor:pointer;color:#0000ff;">详细信息↓</span></td>
         </tr>
     </table></td>
    </tr><tr bgcolor="#FFFFFF" id="show" style="display:none">
     <td height="22" align="center" bgcolor="#CCCCCC">SEO</td>
     <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="9%" align="center" bgcolor="#E8F8FF">关键字</td>
        <td width="91%" align="left"><label>
          <textarea name="keywords" cols="45" rows="5" class="input" id="keywords"><%=rs("keywords")%></textarea>
        </label></td>
        </tr>
      <tr>
        <td align="center" bgcolor="#E8F8FF">描述</td>
        <td align="left"><textarea name="Description" cols="45" rows="5" class="input" id="Description"><%=rs("Description")%></textarea></td>
        </tr>
    </table></td>
   </tr>
   <tr bgcolor="#FFFFFF">
     <td height="22" align="center" bgcolor="#CCCCCC">内容</td>
     <td align="left"><input name="content" type="hidden" value="<%
	content=rs("content")
	if content<>"" then
	response.Write server.HTMLEncode(content)
	end if
	%>">
         <iframe ID="js2" src="../ewebeditor/ewebeditor.htm?id=content&style=gray" frameborder="0" scrolling="no" width="100%" HEIGHT="350"></iframe></td>
   </tr>
  <tr bgcolor="#FFFFFF">
    <td height="22" colspan="2" align="center" bgcolor="#CCCCCC"><label>
      <input type="submit" name="Submit" value=" 保 存 " >
    </label></td>
    </tr>
  </form>
</table>  
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set con=nothing
%>

<%
sub save_sub
%>
<!--#include FILE="../inc/upload.inc"-->
<%
dim REFERER
dim classid,title,img,content,color,link
dim request_keywords,request_Description
dim file,upload,fileExt,ranNum,picname,formName,filename
dim myfile(),i
set upload=new upload_bird ''建立上传对象

REFERER=trim(upload.form("REFERER"))

classid=trim(upload.form("classid"))
title=trim(upload.form("title"))
content=trim(upload.form("content"))
color=trim(upload.form("color"))
link=trim(upload.form("link"))


request_keywords=trim(upload.form("keywords"))
request_Description=trim(upload.form("Description"))

if classid="" or (title="" and title_en="") then
call msg("未填写完整!","-1")
end if
Set rs = Server.CreateObject("ADODB.RecordSet") 
rs.Open "select * from data_info where id="&id&"", Conn, 1,2
rs("classid")=classid
rs("classnames")=get_classnames_c(classid)
rs("title")=title
rs("content")=content
rs("color")=color
rs("link")=link


rs("keywords")=request_keywords
rs("Description")=request_Description

rs.update
'------------------上传图片
i=0
for each formName in upload.file ''列出所有上传了的文件
    Set file=upload.file(formName)  ''生成一个文件对象
    If file.filesize>1 Then
	    '说明有文件数据
        If file.filesize>c_size*1024 Then
	      set file=nothing
          set upload=nothing
	      call msg("Please choose picture (must be within "&c_size&"KB size)。","-1")
        End If
          fileExt=lcase(right(file.filename,4))
        if fileEXT <>"" and fileEXT<>".gif" and fileEXT<>".jpg" then
	      call msg("Wrong file format (only for .Gif, or .Jpg file), please check.","-1")
        end if
		ReDim Preserve myfile(i)
		 set myfile(i)=file
		i=i+1 
	End If
	set file=nothing
Next 
i=0
for each file in myfile 
        i=i+1
        picname=year(now)&month(now)&"/info_"&rs("id")&lcase(right(file.filename,4))
		picname_s=year(now)&month(now)&"/info_"&rs("id")&"_s"&lcase(right(file.filename,4))
        filename=c_pic&picname
		filename_s=c_pic&picname_s
		call myfind(filename)
        file.SaveAs Server.mappath(filename)'保存文件
		rs("img")=get_img_s(filename,filename,c_info_width,c_info_height)
		rs("img_s")=get_img_s2(filename,filename_s,c_info_width_s,c_info_height_s)
		set file=nothing
Next 
rs.update
'--------------------------
rs.close
set rs=nothing
if instr(REFERER,"info_add.asp")>0 then
response.Write("<meta http-equiv=""refresh"" content=""0;URL=info.asp"">")
else
response.Write("<meta http-equiv=""refresh"" content=""0;URL="&REFERER&""">")
end if
response.end()
end sub
%>

⌨️ 快捷键说明

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