📄 business.asp
字号:
</li>
</ul>
<ul>
<li class="name txtRig">所属行业:</li>
<li class="value">
<select name="classID" id="businessClassID">
<%=anysale.IDSelect("class",0,0,0,rs("classID"))%>
</select>
<span class="iArr" style="cursor:pointer;" title="点击选择行业" onclick="getPage('windows.asp?action=clickID&upValue=businessClass&table=class&parentID=0&groups=0&isuser=0&isselect=0');"> </span>
</li>
</ul>
<ul>
<li class="name txtRig"><span class="red">*</span> 供求标题:</li>
<li class="value"><input type="text" name="title" id="businessTitle" class="inpWidth" value="<%=rs("title")%>" maxlength="200" onblur="check('供求标题',this.value,'businessTitleNote',0,0,2,200)" /></li>
<li><span class="note" id="businessTitleNote"></span></li>
</ul>
<ul>
<li class="name txtRig"><span class="red">*</span> 计量单位:</li>
<li class="value"><input type="text" name="unit" id="businessUnit" class="inpWidth" value="<%=rs("unit")%>" maxlength="5" onblur="check('单位',this.value,'businessUnitNote',0,0,1,5)" /></li>
<li><span class="note" id="businessUnitNote"></span></li>
</ul>
<ul>
<li class="name txtRig"><span class="red">*</span> 单价:</li>
<li class="value"><input type="text" name="price" id="businessPrice" class="inpWidth" value="<%=rs("price")%>" maxlength="9" onblur="check('单价',this.value,'businessPriceNote',0,1,1,9)" /></li>
<li class="note"><span>元,洽谈请填:0</span><span id="businessPriceNote"></span></li>
</ul>
<ul>
<li class="name txtRig">图片:</li>
<li class="value">
<iframe name="upfile" src="upfile.asp?upValue=businessImage&ismark=1&ispre=1&group=1" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="no" style="width:100%;height:24px;"></iframe> <br />
<input type="text" name="image" id="businessImage" style="width:242px;height:17px;" value="<%=rs("image")%>" />
<input type="button" name="button" value="图库" onclick="getPage('windows.asp?action=images&upValue=businessImage');" class="button" onmouseover="this.className='buttonH'" onmouseout="this.className='button'" />
</li>
<li><span class="note">建议尺寸:300 x 300</span></li>
</ul>
<ul>
<li class="name txtRig"><span class="red">*</span> 供求内容:</li>
<li>
<textarea name="businessEditDetails" id="businessEditDetails" style="display:none"><%=rs("detail")%></textarea>
<iframe name="editor" src="editor/anysale.htm?groups=@@@1@@@1@@@0@@@id=businessEditDetails" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:318px;width:602px;"></iframe>
</li>
<li><span class="note" id="businessEditDetailsNote"></span></li>
</ul>
<%
dim period
period=cdate(anysale.formatDate(rs("endtime"),1))-cdate(anysale.formatDate(now(),1))
%>
<ul>
<li class="name txtRig">有效期:</li>
<li>
<input type="radio" name="period" value="7" <%if period=7 then response.write"checked=""checked""" end if%> /> 一周
<input type="radio" name="period" value="15" <%if period=15 then response.write"checked=""checked""" end if%> /> 两周
<input type="radio" name="period" value="30" <%if period=30 then response.write"checked=""checked""" end if%> /> 一个月
<input type="radio" name="period" value="90" <%if period=90 then response.write"checked=""checked""" end if%> /> 三个月
<input type="radio" name="period" value="180" <%if period=180 then response.write"checked=""checked""" end if%> /> 半年
<input type="radio" name="period" value="3650" <%if period>180 then response.write"checked=""checked""" end if%> /> 长期
<%if period<>7 and period<>15 and period<>30 and period<>90 and period<180 then%><input type="radio" name="period" value="<%=period%>" checked="checked" /> <%=period%> 天 <%end if%>
</li>
</ul>
<ul>
<li class="name txtRig">关键字:</li>
<li class="value"><input type="text" name="tags" id="businessTags" value="<%=rs("tags")%>" class="inpWidth" maxlength="250" onblur="check('关键字',this.value,'businessTagsNote',1,0,1,250)" /></li>
<li><span class="note" id="businessTagsNote">多个关键字用,号隔开</span></li>
</ul>
<ul>
<li class="name txtRig"><span class="red">*</span> 验证码:</li>
<li class="value"><input type="text" name="passcode" id="businessPasscode" onfocus="setCode('businessCode','businessPasscodeNote');" onblur="checkCode('验证码',this.value,'businessPasscodeNote')" size="8" maxlength="4" /><span id="businessCode"></span></li>
<li><span class="note" id="businessPasscodeNote"><strong>提示</strong>:点击文本框显示验证码</span></li>
</ul>
<ul>
<li class="name"> </li>
<li>
<input type="button" name="button" value="确 定"
onclick="if(
check('供求标题',$('businessTitle').value,'businessTitleNote',0,0,2,200) &&
check('单位',$('businessUnit').value,'businessUnitNote',0,0,1,5) &&
check('单价',$('businessPrice').value,'businessPriceNote',0,1,1,9) &&
check('内容',$('businessEditDetails').value,'businessEditDetailsNote',0,0) &&
check('关键字',$('businessTags').value,'businessTagsNote',1,0,1,250) &&
checkCode('验证码',$('businessPasscode').value,'businessPasscodeNote')
){getPage('user/business.asp?action=saveEdit','business',1,'businessEditForm');};"
class="button" onmouseover="this.className='buttonH'" onmouseout="this.className='button'" />
<input type="hidden" name="editID" value="<%=clng(request("editID"))%>" />
<input type="hidden" name="page" value="<%=clng(request("page"))%>" />
</li>
</ul>
</div>
</form>
<!---->
</div>
</li>
</ul>
<%
rs.close
set rs=nothing
end sub
sub saveAdd()
if not anysale.checkPost then
errNote=errNote+"<li>请不要从外部提交。</li>"
iserr=true
end if
'权限判断
dim rootID,upID,objFSO,preview
rootID=anysale.getValue("as_channel","rootID","channelID="&request.form("channelID"))
if rootID=1 then
if cint(anysale.asGroups(13))=0 then
anysale.errWin("<li>你所在的用户组没有发布供应的权限。</li>")
exit sub
end if
if cint(anysale.asGroups(14))>0 and cint(anysale.userInfo(0))>=cint(anysale.asGroups(14)) then
anysale.errWin("<li>你所在的用户组已超过发布供应"&cint(anysale.asGroups(14))&"条的总数。</li>")
exit sub
end if
end if
if rootID=2 then
if cint(anysale.asGroups(15))=0 then
anysale.errWin("<li>你所在的用户组没有发布求购的权限。</li>")
exit sub
end if
if cint(anysale.asGroups(16))>0 and cint(anysale.userInfo(1))>=cint(anysale.asGroups(16)) then
anysale.errWin("<li>你所在的用户组已超过发布求购"&cint(anysale.asGroups(16))&"条的总数。</li>")
exit sub
end if
end if
if rootID=3 then
if cint(anysale.asGroups(17))=0 then
anysale.errWin("<li>你所在的用户组没有发布服务的权限。</li>")
exit sub
end if
if cint(anysale.asGroups(18))>0 and cint(anysale.userInfo(2))>=cint(anysale.asGroups(18)) then
anysale.errWin("<li>你所在的用户组已超过发布服务"&cint(anysale.asGroups(18))&"条的总数。</li>")
exit sub
end if
end if
if request.form("channelID")="" or request.form("classID")="" or request.form("title")="" or request.form("unit")="" or request.form("price")="" or request.form("period")="" or request.form("passcode")="" then
errNote=errNote+"<li>请填好完整的供求信息。</li>"
iserr=true
end if
if cstr(session("getcode"))<>lcase(cstr(trim(request("passcode")))) then
errNote=errNote+"<li>您输入的确认码和系统产生的不一致,请重新输入。</li>"
iserr=true
end if
session("getcode")=""
if iserr then
anysale.errWin(errNote)
exit sub
end if
preview=replace(trim(request.form("image")),"upfile/","upfile/preview/")
dim rs,sql
set rs= server.createobject ("adodb.recordset")
set objFSO = server.createObject("scripting.fileSystemObject")
if request("action")="saveEdit" then
sql = "select * from as_business where userID="&anysale.userID&" and businessID="&clng(request.form("editID"))
rs.open sql,conn,1,3
rs("detail")=trim(request.form ("businessEditDetails"))
else
sql = "select * from as_business"
rs.open sql,conn,1,3
rs.addnew
rs("userID")=anysale.userID
rs("username")=anysale.username
rs("detail")=trim(request.form ("businessAddDetails"))
end if
rs("channelID")=request.form("channelID")
rs("classID")=request.form("classID")
rs("title")=trim(request.form ("title"))
rs("unit")=request.form ("unit")
rs("price")=trim(request.form ("price"))
rs("endtime")=now()+request.form("period")
if objFSO.fileExists(server.mapPath("../"&preview)) then
rs("preview")=preview
else
rs("preview")=request.form("image")
end if
rs("image")=request.form("image")
rs("tags")=replace(request.form("tags"),",",",")
rs("areaID")=clng(anysale.userArea)
rs("istrust")=cint(anysale.userTrust)
rs.update
set objFSO=nothing
rs.close
set rs=nothing
if request("action")="saveEdit" then
conn.execute("update as_upfile set ID="&clng(request.form("editID"))&" where userID="&anysale.userID&" and [group]=1 and ID=0")
sucNote="<li>修改成功!</li>|||<button onclick=""getPage('user/business.asp?page="&clng(request("page"))&"','business');winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">返 回</button>"
anysale.sucWin(sucNote)
else
call anysale.setValue("as_config","siteInfo","",rootID-1,clng(anysale.siteInfo(rootID-1))+1)
call anysale.setMoney(cint(anysale.asMoney(3)),"userID="&anysale.userID)
call anysale.setValue("as_user","userInfo","userID="&anysale.userID,rootID-1,clng(anysale.userInfo(rootID-1))+1)
upID=anysale.getValue("as_business","businessID","userID="&anysale.userID&" order by businessID desc")
conn.execute("update as_upfile set ID="&clng(upID)&" where userID="&anysale.userID&" and [group]=1 and ID=0")
sucNote="<li>添加成功!</li>|||<button onclick=""getPage('user/business.asp?action=add&index="&cint(request("index"))&"','businessAdd');winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">继 续</button>"
sucNote=sucNote+" <button onclick=""tabs.removeTab("&cint(request("index"))&");winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">关 闭</button>"
anysale.sucWin(sucNote)
end if
end sub
sub del()
if request("businessID")="" then
anysale.errWin("<li>请选择要删除的信息。</li>")
exit sub
end if
if request("isdel")="yes" then
dim id,i,channelID,rootID
id=replace(request("businessID")," ","")
id=split(id,",")
channelID=replace(request("channelID")," ","")
channelID=split(channelID,",")
for i=0 to UBound(id)
rootID=anysale.getValue("as_channel","rootID","channelID="&clng(channelID(i)))
anysale.userInfo(rootID-1)=anysale.userInfo(rootID-1)-1
call anysale.setValue("as_user","userInfo","userID="&anysale.userID,rootID-1,clng(anysale.userInfo(rootID-1))) '会员供求减
call anysale.setMoney(-cint(anysale.asMoney(4)),"userID="&anysale.userID) '会员金钱减
anysale.siteInfo(rootID-1)=anysale.siteInfo(rootID-1)-1
call anysale.setValue("as_config","siteInfo","",rootID-1,clng(anysale.siteInfo(rootID-1))) '系统供求减
conn.execute("delete from as_business where userID="&anysale.userID&" and businessID="& id(i)) '删除供求
call anysale.delfile(cint(request("delfile")),1,clng(anysale.userID),clng(id(i)))
next
sucNote="<li>删除成功!</li>|||<button onclick=""getPage('user/business.asp?page="&clng(request("page"))&"','business');winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">返 回</button>"
anysale.sucWin(sucNote)
else
infoNote="<li>请确认是否删除!</li><li><form name=""businessDelForm"" id=""businessDelForm"" method=""post""><input name=""delfile"" type=""checkbox"" value=""1"" checked=""checked"" /> 删除相关文件!</form></li>|||"
infoNote=infoNote+"<button onclick=""getPage('user/business.asp?action=del&businessID="&request("businessID")&"&channelID="&request("channelID")&"&page="&clng(request("page"))&"&isdel=yes','business',0,'businessDelForm');winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">确 定</button>"
infoNote=infoNote+" <button onclick=""winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">取 消</button>"
anysale.infoWin(infoNote)
end if
end sub
sub resend()
if request("editID")="" or not isnumeric(request("editID")) then
anysale.errWin("<li>请选择要更新的信息。</li>")
exit sub
end if
if request("issend")="yes" then
dim period,endtime
period=request("period")
if not isnumeric(period) then period=3650 end if
if period<7 then period=15 end if
endtime=now()+period
if isSqlDataBase=1 then
conn.execute("update as_business set addtime="&anysaleNow&",endtime='"&endtime&"' where datediff(d,addtime,"&anysaleNow&")>7 and businessID="&clng(request("editID")))
else
conn.execute("update as_business set addtime="&anysaleNow&",endtime='"&endtime&"' where datediff('d',addtime,"&anysaleNow&")>7 and businessID="&clng(request("editID")))
end if
sucNote="<li>操作成功!</li>|||<button onclick=""getPage('user/business.asp','business');winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">返 回</button>"
anysale.sucWin(sucNote)
else
infoNote="<li>只对发布超过7天的信息有效,请确认是否更新!</li>|||<button onclick=""getPage('user/business.asp?action=resend&editID="&request("editID")&"&period="&request("period")&"&issend=yes');winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">确 定</button>"
infoNote=infoNote+" <button onclick=""winClose();"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'"">取 消</button>"
anysale.infoWin(infoNote)
end if
end sub
call closeConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -