<!--#include file="Common/inc_usercheck.asp"-->
<!--#include file="Common/Inc_DatConn.asp"-->
<!--#include file="Common/Inc_Function.asp"-->
<!--#include file="Common/fy_ClsEmail.asp"-->
<%
response.buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
bbaction=changechr(Request("bbaction"))
Select case bbaction
  	Case "del"
		call fy_Delinfogq(RtnReplaceInt(request("id"),0))
 	Case "reup"
		call reup
	Case else
Dim intClsId,MemberKey
MemberKey =Session("intMemberKey")
intClsId =RtnReplaceInt(request("bid"),0)
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户中心 - <% =strSiteName%></title>
<meta name="Keywords" content="重庆信息网" />
<meta name="Description" content="重庆信息网" />
<link href="imger/css.css" type="text/css" rel="stylesheet">
<style type="text/css">
<!--
.STYLE11 {
	color: #FF0000;
	font-size: 14px;
}
.STYLE12 {font-size: 14px}
-->
</style>
</head>
<body>
<!--#include file="head.asp"-->
<table width="778" border="0" align="center" cellpadding="0" cellspacing="10" bgcolor="f2f2f2">
  <tr>
    <td width="26%" valign="top"><table width="100%" border="0" cellpadding="9" cellspacing="1" bgcolor="#e6e6e6">
        <tr>
          <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><img src="imger/user.gif" width="172" height="37"></td>
            </tr>
            <tr>
              <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
			  <tr>
			    <td width="100%" height="23" class="F16"><span class="STYLE11">·</span><a href="add.asp"><span class="STYLE2">信息发布</span></a></td>
			  </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
			  <tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="me.asp"><span class="STYLE2">信息管理</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
			  <tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="edit_user.asp"><span class="STYLE2">资料维护</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
						<tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="Feedback.asp"><span class="STYLE2">留言反馈</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
						<tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="sjgj.asp"><span class="STYLE2">会员升级</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
						<tr>
			    <td height="23" class="F16"><span class="STYLE11">·</span><a href="logout.asp"><span class="STYLE2">安全退出</span></a></td>
			    </tr><tr>
						  <td width="100%" height="1" colspan="2" background="images/dotline.gif"></td>
						</tr>
                  </table></td>
            </tr>
          </table></td>
        </tr>
      </table>
    </td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#e6e6e6">
      <tr>
        <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="10" cellpadding="0">
          <tr>
            <td height="24" background="imger/09.gif"><span class="STYLE6">≡</span> <span class="STYLE2"><b>您的位置：</b></span><span class="STYLE4">首页 &gt;&gt; 会员中心</span></td>
          </tr>
          <tr>
            <td background="imger/09.gif"><table cellSpacing="0" cellPadding="0" border="0">
					<tr>
						<td width="587" height="32" background="images/vxinxi.gif" align="center">
<font color="#000080"><b>信息管理</b></font></td>
					</tr>
				</table>
				<table cellSpacing="1" cellPadding="0" width="100%" bgColor="#f1f1f1" border="0">
					<tr>
						<td bgColor="#ffffff">
<table cellSpacing="0" cellPadding="0" width="100%" bordercolordark="#FFFFFF" borderColorLight="#3986CE" border="0">
            <tbody>
              <tr>
               <td vAlign="top" width="100%" align="center">
<table width="100%" height="20" border="0" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF"><tr> 
                          <td width="260" height="20" class="F16" bgcolor="#F0F0F0"><b>标题</b></td>
                          <td width="50" align="center" bgcolor="#F0F0F0"><b>有效期</b></td>
                          <td width="30" align="center" bgcolor="#F0F0F0"><b>审核</b></td>
                          <td width="30" align="center" bgcolor="#F0F0F0">
							<b>修改</b></td>
                          <td width="30" align="center" bgcolor="#F0F0F0"><b>删除</b></td>
                          <td width="60" align="center" bgcolor="#F0F0F0"><b>浏览</b></td>
                        </tr>
<%
Dim rdsInfo
Dim sqlInfo
Dim strInfoClass   '/供求信息类型/
Dim rdsTotalRec 
Dim intPage        '/当前页/
Dim intTotalRec	   '/所有记录/
Dim intInfoCount
Dim n,p,ii	       '/定义一些临时变量/
Dim strTopic
intPage = Replace(Trim(Request("Page")),"'","")
intPage = Replace(Trim(Request("Page"))," ","")
if intPage = "" then
	intPage = 1
else
	intPage = Clng(intPage)
end if
                      
set rdsInfo = Server.CreateObject("ADODB.Recordset")
if intClsId = 0 then
	set rdsTotalRec = Conn.Execute("Select Count(InfoKey) From Dat_Information Where MemberKey="& MemberKey &" and State = 1")
	intTotalRec = rdsTotalRec(0)
	sqlInfo = "Select * From Dat_Information Where MemberKey="& MemberKey &" Order By InfoKey Desc"
else
	set rdsTotalRec = Conn.Execute("Select Count(InfoKey) From Dat_Information Where MemberKey="& MemberKey &" and bid='"& intClsId &"' And State = 1")
	intTotalRec = rdsTotalRec(0)     
	sqlInfo = "Select * From Dat_Information Where bid= '"& intClsId &"' and MemberKey="& MemberKey& "  And State = 1 Order By InfoKey Desc"
end if
rdsInfo.Open sqlInfo,Conn,1,1
if not rdsInfo.EOF then
	if intTotalRec mod intInfoCot = 0 then
		n = intTotalRec \ intInfoCot
	else
		n = intTotalRec \ intInfoCot + 1
	end if
	rdsInfo.MoveFirst
	if intPage > n then intPage = n
	if intPage < 1 then intPage = 1
	rdsInfo.Move (intPage - 1) * intInfoCot
	do while not rdsInfo.EOF and intInfoCount < Clng(intInfoCot)
		intInfoCount = intInfoCount + 1
		xxlx=rdsInfo("InfoClass")
		if len(rdsInfo("Topic")) > 21 then
			strTopic = left(rdsInfo("Topic"),21) &".."
		else
			strTopic = rdsInfo("Topic")
		end if
		strcolor = rdsInfo("color")
		infoid=rdsInfo("InfoKey")
		CreateTime=rdsInfo("CreateTime")
%>
                        <tr> 
                          <td height="20" class="F16" width="260"><%if rdsInfo("tj")=true then%>&nbsp;<img border="0" src="images/arrow.gif" alt="推荐信息"><%else%>&nbsp;<img border="0" src="images/tu33.gif" alt="一般信息"><%end if%>&nbsp;<font color="#478B47"><span style="font-size: 9pt"><%call  gqlx(2,xxlx)%></span></font><a href="View_Info.asp?Id=<% = rdsInfo("InfoKey")%>" target="_blank" class="a01"><span style="font-size: 9pt"><%if  strcolor<>""  then%><font color="#<%=strcolor%>"><% = strTopic%></font><%else%><% = strTopic%><%end if%></span></a></td>
                          <td align="center"><%
			    yxq=rdsinfo("InfoDate")
fbsj=FormatTime(CreateTime,8)
dqsj=DateAdd( "d" ,yxq ,fbsj)
sysj=DateDiff ("d",date(),dqsj)
if sysj<0 then
response.write "<font color=#808080>过期</font> <a href=?bbaction=reup&id="&infoid&"><font color=#ff0000>重发</font></a>"
else
response.write "<font color=#ff0000>"&sysj&"</font>&nbsp;天"
end if
%></td>
                          <td width="30" align="center"><%if rdsInfo("state")=1 then%>已审<%else%><font color="#FF0000">未审<%end if%></font></td>
                          <td width="30" align="center">
							<a href="edit_info.asp?Id=<% = infoid%>">
							修改</a></td>
                          <td width="30" align="center"><a href="?bbaction=del&id=<% =infoid%>"  onclick="{if(confirm('确定删除选定的纪录吗?')){return true;}return false;}">
							删除</a></td>
                          <td width="50" align="center"><% = rdsInfo("Hits")%></td>
                        </tr>
                        <tr>
						  <td width="100%" colspan="6" height="1" background="images/dotline.gif"></td>
						</tr>
<%
  		rdsInfo.MoveNext
	loop
else
%>
						<tr>
						  <td width="100%" colspan="6" height="25">&nbsp;<font color="#FF0000">对不起!本系统没有您的任何供求信息</font>...</td>
						</tr>
<%
end if
rdsInfo.Close
set rdsInfo = nothing

if intPage - 1 mod 10 = 0 then
	p = (intPage - 1) \ 10
else
	p = (intPage - 1) \ 10
end if
%>
                      </table>
<table border="0" width="98%" cellspacing="0" cellpadding="0" align="center">
	    <form method="post" action="?" name="Form2">
	    <input type="hidden" name="KeyWord" value="<% = strKeyWord%>">
	    <tr>
		  <td width="10%" height="30" valign="middle">共<b><%= intTotalRec %></b>条</td>
		  <td width="80%" height="30" valign="middle"><div align="center">
			<%
				if intPage = 1 then
					Response.Write "<font face=webdings>9</font>   "
				else
					Response.Write "<a href='?Page=1&KeyWord="& strKeyWord &"' title=首页><font face=webdings>9</font></a>   "
				end if
				if p * 10 > 0 then Response.Write "<a href='?Page="&Cstr(p*10)&"&KeyWord="& strKeyWord &"' title=上十页><font face=webdings>7</font></a>   "
				Response.Write "<b>"
				for ii = p * 10 + 1 to P * 10 + 10
					   if ii = intPage then
				          Response.Write "<font color=""#FF0000"">"+Cstr(ii)+"</font> "
					   else
					      Response.Write "<a href='?Page="&Cstr(ii)&"&KeyWord="& strKeyWord &"'>"+Cstr(ii)+"</a>   "
					   end if
					if ii = n then exit for
				next
				Response.Write "</b>"
				if ii < n then Response.Write "<a href='?Page="&Cstr(ii)&"&KeyWord="& strKeyWord &"' title=下十页><font face=webdings>8</font></a>   "
				if intPage=n then
					Response.Write "<font face=webdings>:</font>   "
				else
					Response.Write "<a href='?Page="&Cstr(n)&"&KeyWord="& strKeyWord &"' title=尾页><font face=webdings>:</font></a>   "
				end if
			%>			</div>
			</td><td width="10%" height="30" valign="middle"><input type="text" name="Page" size="2" maxlength="10" value="<%= intPage %>" class="face"> <input type="submit" value="Go" name="submit" class="button">
</td>
		</tr>
		</form>
	  </table>
               </td>
              </tr>
            </tbody>
            </table>
</td>
					</tr>
				</table></td>
          </tr>
          
        </table></td>
      </tr>
    </table>      </td>
  </tr>
</table>
<!--#include file="boot.asp"-->
</body>
</html><%End Select
sub reup
id=RtnReplaceInt(Request("id"),0)
'if is_sqldata=0 then
'conn.execute("Update Dat_Information Set CreateTime=now() Where InfoKey = ("&id&")")
'else
'conn.execute("Update Dat_Information Set CreateTime=getdate() Where InfoKey = ("&id&")")
'end if
'conn.execute("Update Dat_Information Set state=0 Where InfoKey = ("&id&")")
'Response.Redirect "me.asp?id="&Session("intMemberKey")&""

'---------------------
	Dim editinfo
            set editinfo = Server.CreateObject("ADODB.Recordset")
			editinfo.Open "Dat_Information Where MemberKey="&Session("intMemberKey")&" and InfoKey = "&id,Conn,3,3
			topic=editinfo("topic")
			email=editinfo("Email")
			ContactMan=editinfo("ContactMan")
			if Session("gqjb")="0" then'非高级会员判断推荐信息扣点
			tj=editinfo("tj")
			if tj=1 then
                 tian=editinfo("InfoDate")
                 pdsf=session("point")-(tian*addinfopoint)
                 if pdsf < 0 then
                    editinfo("tj") = 0
                 else
                    conn.execute("Update Dat_Member Set Point="&pdsf&" Where MemberKey = ("&Session("intMemberKey")&")")
                    session("point")=pdsf
                 end if

			end if
			else
			sh=0
			end if
	mailcode= cint(8688*Rnd+1000)
	editinfo("mailcode") =md5(mailcode,16)
	editinfo("CreateTime") =now()
Select case clng(sh)
  	Case clng(1)'管理员审核
		editinfo("State") = 0
 	Case clng(0)'直接发布
		editinfo("State") = 1
	Case clng(2)'邮件审核
		editinfo("State") = 0
End Select

			editinfo.Update
			editinfo.Close
			set editinfo = nothing
			'Response.Redirect "me.asp?id="&Session("intMemberKey")&""
Select case clng(sh)
  	Case clng(1)'管理员审核
Response.write("<script>alert(""信息重发成功，请等待管理员的审核！"");location.href=""me.asp?id="&Session("intMemberKey")&""";</script>")
Response.end
 	Case clng(0)'直接发布
Response.write("<script>alert(""信息重发成功！"");location.href=""me.asp?id="&Session("intMemberKey")&""";</script>")
Response.end
	Case clng(2)'邮件审核
SendTomail
Response.write("<script>alert(""重发并未完成,请打开邮件"&email&"验证信息!"");location.href=""me.asp?id="&Session("intMemberKey")&""";</script>")
Response.end
End Select
end sub

sub SendTomail()'-----------------------------------------------
HomePage="http://"&request.servervariables("server_name")&replace(lcase(request.servervariables("url")),"me.asp","")
	FriendName=ContactMan
	FriendEmail=email
	FromName=mailform
	mailbiaoti="重发信息邮件验证"
	if FriendName="" then
		errmsg=errmsg & "<br><li>收信人姓名不能为空！</li>"
		founderr=true
	end if
	if Not fyChkEmail(FriendEmail) then
   		errmsg=errmsg & "<br><li>收信人的Email地址有错误！</li>"
   		founderr=true
	end if
	if FromName="" then
		errmsg=errmsg & "<br><li>发信人姓名不能为空！</li>"
		founderr=true
	end if
	if founderr then
		Response.Write errmsg
		exit sub
	end if
mailbody="<div align=center><table border=0 width=100% cellspacing=0 cellpadding=0 height=93>"
mailbody=mailbody&"<tr><td height=31>&nbsp;<b><font color=#FF0000>"&FriendName&"</font></b> 你好：</td>"
mailbody=mailbody&"</tr><tr><td height=31>&nbsp;&nbsp;&nbsp;&nbsp; 欢迎您在 <a href="&strSiteUrl&" target=_blank><font color=#FF0000>"&strSiteName&"</font></a>&nbsp; 发布信息，您发布的信息，"
mailbody=mailbody&"您发布的信息<font color=#FF0000>"&topic&"</font> 还没有经过验证，请点击以下按钮验证：</td>"
mailbody=mailbody&"</tr><tr><td height=31><form method=POST action="&HomePage&"mailinfo.asp target=_blank>"
mailbody=mailbody&"<br>&nbsp;&nbsp;&nbsp; <input type=hidden name=mailcode value="&mailcode&">"
mailbody=mailbody&"<input type=hidden name=id value="&id&"><input type=submit value=确定发布此信息 name=strsubmit>&nbsp;&nbsp;&nbsp; <input type=submit value=删除此信息 name=strsubmit>"
mailbody=mailbody&"</form></td></tr><tr><td height=31><b><font color=#FF0000>注：此按钮只能操作一次!</font></b></td></tr></table></div>"
	Dim FYEmail
	Set FYEmail = New Cls_SendMail
	FYEmail.SendObject = Cint(mailser)	'设置选取组件
	FYEmail.ServerLoginName = mailname	'您的邮件服务器登录名
	FYEmail.ServerLoginPass = mailpass	'登录密码
	FYEmail.SendSMTP = mailsmtp			'SMTP地址
	FYEmail.SendFromEmail = mailform		'发送来源地址
	FYEmail.SendFromName =strSiteName		'发送人信息
	If FYEmail.ErrCode = 0 Then
		FYEmail.SendMail FriendEmail,mailbiaoti,mailbody	'执行发送邮件
	End If
	If FYEmail.ErrCode <> 0 Then
		Response.write FYEmail.Description
	else
		Response.write "恭喜您，已经成功发送邮件！"
	end if
end sub
%>
