<!--#include file="../Include/Conn.asp" -->
<!--#include file="../Include/const.asp" -->
<!--#include file="../Include/function.asp" -->
<% uname=session("puid")
fav=request("fav")
cname=request("cname")
if fav<>"" then 
set rs=server.createobject("adodb.recordset")
sql="select * from zp where id="&fav
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write"<SCRIPT language=JavaScript>alert('用户["&cname&"]不存在！');"
response.write"javascript:history.go(-1);</SCRIPT>"
end if
cname=rs("cname")
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from pfavorite where uname='"&uname&"'and fuid='"&fav&"'"
rs.open sql,conn,1,1
if not rs.eof then
response.write"<SCRIPT language=JavaScript>alert('已添加到职位库，请勿重复添加！');"
response.write"javascript:history.go(-1);</SCRIPT>"
response.end
end if
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from pfavorite"
rs.open sql,conn,3,3
rs.addnew
rs("uname")=uname
rs("fuid")=request("fav")
rs.update
rs.close
set rs=nothing
response.write"<SCRIPT language=JavaScript>alert('成功添加到职位库！');"
response.write"javascript:history.go(-1);</SCRIPT>"
end if %>