📄 ks.supplyadd.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="../KS_Cls/KS.Supply.asp"-->
<!--#include file="../KS_Editor/FCKeditor/fckeditor.asp"-->
<%
Dim KSCls
Set KSCls = New User_MySupply
KSCls.Kesion()
Set KSCls = Nothing
Class User_MySupply
Private KS,KSUser
Private CurrentPage,totalPut
Private RS,MaxPerPage,ComeUrl
Private Verific,ChannelID
Private GQID,BigClassID,SmallClassID,Title,Price,TypeID,ValidDate,GQContent,ContactMan,Tel,CompanyName,Address,Province,City,Email,Zip,Fax,HomePage,I,UserDefineFieldArr,UserDefineFieldValueStr,PhotoUrl,Visitor,KeyWords
Private Sub Class_Initialize()
MaxPerPage =12
Set KS=New PublicCls
Set KSUser = New UserCls
End Sub
Private Sub Class_Terminate()
Set KS=Nothing
Set KSUser=Nothing
End Sub
Public Sub Kesion()
ChannelID=KS.ChkClng(KS.S("ChannelID"))
If ChannelID=0 Then ChannelID=8
If KS.C_S(ChannelID,6)<>8 Then Response.End()
if conn.execute("select usertf from ks_channel where channelid=" & channelid)(0)=0 then
Response.Write "<script>alert('本频道关闭投稿!');window.close();</script>"
Exit Sub
end if
ComeUrl=Request.ServerVariables("HTTP_REFERER")
Call KSUser.Head()
Select Case KS.S("Action")
Case "AddSave","EditSave"
Call GQInfoSave()
Case "Add","Edit"
Call GetGQInfo()
Case "Del"
Call Del()
Case Else
Call Main()
End Select
End Sub
Sub Del()
IF Cbool(KSUser.UserLoginChecked)=false Then
response.write "<script>alert('对不起,请先登录!');location.href='login.asp';</script>"
response.End()
end if
Dim ID:ID=KS.S("ID")
ID=KS.FilterIDs(ID)
If ID="" Then Call KS.Alert("你没有选中要删除的信息!",ComeUrl):Response.End
Conn.Execute("Delete From KS_GQ Where username='" & ksuser.username & "' and verific<>1 and ID In(" & ID & ")")
if ComeUrl="" then
Response.Redirect("../index.asp")
else
Response.Redirect ComeUrl
end if
End Sub
Sub Main()
IF Cbool(KSUser.UserLoginChecked)=false Then
Response.Write "<script>top.location.href='Login.asp';</script>"
Exit Sub
End If
%>
<SCRIPT language=javascript src="../KS_Inc/showtitle.js"></script>
<SCRIPT language=javascript>
function unselectall()
{
if(document.myform.chkAll.checked)
{
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != 'chkAll'&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
</SCRIPT>
<%
If KS.S("page") <> "" Then
CurrentPage = KS.ChkClng(KS.S("page"))
Else
CurrentPage = 1
End If
Dim Param:Param=" Where UserName='"& KSUser.UserName &"'"
Verific=KS.S("Status")
If Verific="" or not isnumeric(Verific) Then Verific=4
IF Verific<>4 Then
Param= Param & " and Verific=" & Verific
End If
IF KS.S("Flag")<>"" Then
IF KS.S("Flag")=0 Then Param=Param & " And Title like '%" & KS.S("KeyWord") & "%'"
End if
If KS.S("ClassID")<>"" And KS.S("ClassID")<>"0" Then Param=Param & " And tID='" & KS.S("ClassID") & "'"
Dim Sql:sql = "select a.*,foldername from KS_GQ a inner join ks_class b on a.tid=b.id "& Param &" order by AddDate DESC"
Select Case Verific
Case 0
Call KSUser.InnerLocation("待审信息列表")
Case 1
Call KSUser.InnerLocation("已审信息列表")
Case Else
Call KSUser.InnerLocation("所有信息列表")
End Select
%>
<table width="98%" height=20 border=0 align="center" cellPadding=0 cellSpacing=0 borderColor=#111111 id=AutoNumber3 style="BORDER-COLLAPSE: collapse">
<tr>
<td width=23 height=20> </td>
<td width=160 height=20><B> <font color=#ffffff><SPAN style="FONT-SIZE: 10.5pt">我发布的信息</SPAN></font></B></td>
<td width=12 height=20> </td>
<td width=583 height=20><p align=right><font color=#ff0000><a href="?Action=Add"><font color=red>·发布供求主题</font></a> ·<a href="User_MySupply.asp?Status=0">未审核[<%=conn.execute("select count(id) from ks_gq where Verific=0 and username='"& KSUser.UserName &"'")(0)%>]</a> ·<a href="User_MySupply.asp?Status=1">已审核[<%=conn.execute("select count(id) from ks_gq where Verific=1 and username='"& KSUser.UserName &"'")(0)%>]</a> </p></td>
</tr>
</table>
<table width="98%" height="22" border="0" align="center" cellpadding="1" cellspacing="1" class="border">
<tr class='title'>
<td width="5%" height="22" align="center">选中</td>
<td width="10%" align="center">交易类型</td>
<td width="35%" height="22" align="center">主题名称</td>
<td width="10%" height="22" align="center">信息录入</td>
<td width="18%" height="22" align="center">添加时间</td>
<td width="10%" height="22" align="center">状态</td>
<td height="22" align="center">管理操作</td>
</tr>
<%
Set RS=Server.CreateObject("AdodB.Recordset")
RS.open sql,conn,1,1
If RS.EOF And RS.BOF Then
Response.Write "<tr><td class='tdbg' height=30 colspan=7 align=center valign=top>没有你要的信息!</td></tr>"
Else
totalPut = RS.RecordCount
If CurrentPage < 1 Then
CurrentPage = 1
End If
If (CurrentPage - 1) * MaxPerPage > totalPut Then
If (totalPut Mod MaxPerPage) = 0 Then
CurrentPage = totalPut \ MaxPerPage
Else
CurrentPage = totalPut \ MaxPerPage + 1
End If
End If
If CurrentPage = 1 Then
Call showContent
Else
If (CurrentPage - 1) * MaxPerPage < totalPut Then
RS.Move (CurrentPage - 1) * MaxPerPage
Call showContent
Else
CurrentPage = 1
Call showContent
End If
End If
End If
%> <tr class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'">
<%dim rss,sqls,count
set rss=server.createobject("adodb.recordset")
sqls = "select * from KS_Class Where ChannelID=8 And Tn<>'0' order by FolderOrder"
rss.open sqls,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rss.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rss("id"))%>","<%=trim(rss("TN"))%>","<%= trim(rss("foldername"))%>");
<%
count = count + 1
rss.movenext
loop
rss.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.ClassID.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.ClassID.options[document.myform.ClassID.length] = new Option(subcat[i][2], subcat[i][0]);
}
}
}
</script>
<form action="User_MySupply.asp" method="post" name="myform">
<td colspan=7 height="45" align="center">
信息搜索:
<select name="Flag">
<option value="0">标题</option>
<option value="1">关键字</option>
</select>
<%
BigClassID=ks.s("BigClassID")
dim rsb,sqlb
set rsb=server.createobject("adodb.recordset")
sqlb = "select * from ks_Class where channelid=8 and tj=2 order by folderorder"
rsb.open sqlb,conn,1,1
if rsb.eof and rsb.bof then
response.write "请先添加栏目。"
else
%>
<select class="face" name="BigClassID" onChange="changelocation(this.value)" size="1">
<% Dim N
do while not rsb.eof
N=N+1
' If N=1 and KS.S("Action")<>"Edit" Then bigclassid=rsb("id")
If BigClassID=rsb("id") then
%>
<option value="<%=trim(rsb("id"))%>" selected><%=trim(rsb("FolderName"))%></option>
<%else%>
<option value="<%=trim(rsb("id"))%>"><%=trim(rsb("FolderName"))%></option>
<%end if
rsb.movenext
loop
end if
rsb.close
%>
</select>
<select class="face" name="ClassID">
<option value="" selected>不指定小类</option>
<%dim rsss,sqlss
set rsss=server.createobject("adodb.recordset")
sqlss="select * from ks_class where tn='"&bigclassid&"' and channelid=8 order by FolderOrder"
rsss.open sqlss,conn,1,1
if not(rsss.eof and rsss.bof) then
do while not rsss.eof
if SmallClassID=rsss("id") then%>
<option value="<%=rsss("id")%>" selected><%=rsss("FolderName")%></option>
<%else%>
<option value="<%=rsss("id")%>"><%=rsss("FolderName")%></option>
<%end if
rsss.movenext
loop
end if
rsss.close
%>
<%if ks.s("classid")<>"" then%>
<option value="<%=ks.s("classid")%>" selected="selected"><%=ks.c_c(ks.s("classid"),1)%></option>
<%end if%>
</select>
关键字
<input type="text" name="KeyWord" class="textbox" value="关键字" size=20> <input class="button" type="submit" name="submit1" value=" 搜 索 ">
</td>
</form>
</tr>
</table>
<%
End Sub
Sub ShowContent()
Dim I
Response.Write "<FORM Action=""User_MySupply.asp?Action=Del"" name=""myform"" method=""post"">"
Do While Not RS.Eof
%>
<tr class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'">
<td height="20" align="center">
<INPUT id="ID" onClick="unselectall()" type="checkbox" value="<%=RS("ID")%>" name="ID">
</td>
<td align="center"><%=KS.GetGQTypeName(RS("TypeID"))%></td>
<td align="left">[<%=RS("FolderName")%>]
<%Dim PhotoStr:PhotoStr=RS("PhotoUrl")
if PhotoStr="" Or IsNull(PhotoStr) Then PhotoStr=KS.GetDomain & "images/Nopic.gif"%>
<a title="<table width=80 border=0 align=center><tr><td><img src='<%=PhotoStr%>' border=0 width='130' height='80'></td></tr></table>" href="../Supply/ShowInfo.asp?id=<%=rs("id")%>" target="_blank" class="link3"><%=KS.GotTopic(trim(RS("title")),25)%></a></td>
<td align="center"><%=rs("UserName")%></td>
<td align="center"><%=formatdatetime(rs("AddDate"),2)%></td>
<td align="center">
<%Select Case rs("Verific")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -