分类的数据转移的修改
作者:cmscn 日期:2005-06-17
打开admin_nsort.asp
①在dim ndim,nnum,cname,sname,ntit1,ntit2后面定义n_data_name②找到 <td width=10></td>
<td><a href='?nsort=<%response.write nsort%>&action=list' alt='在您发现<%response.write tit_fir%>排序等发生不正常时请点击,可进行有效的修覆'>重新排序</a></td>在其下面添加:
引用内容
<td width=10></td>
<td><a href='?jk_mod=data&nsort=<%response.write nsort%>'<%if jk_mod="data" then response.write " class=red"%>><%response.write ntit%>数据合并</a></td>
③找到select case action
case "up","down"
ntit2=tit_fir&"查看"
call joekoe_chk_order()
在其上方添加
引用内容
select case jk_mod
case "data"
call joekoe_chk_data()
case else
在sub joekoe_chk_js()上面添加:
引用内容
sub joekoe_chk_data()
%>
<table border=0>
<tr><td colspan=2 align=center height=30><b><%response.write ntit%>数据合并</b> (表:<%response.write n_data_name%>)</td></tr>
<%
dim csid1,csid2,cid1,sid1,cid2,sid2
if chk() then
csid1=trim(request.form("c_id1"))
csid2=trim(request.form("c_id2"))
if data_cs_nd(csid1,1)=false or data_cs_nd(csid2,2)=false then
call admin_error("请选择 "&ntit&"!")
response.write vbcrlf&"</table>"
exit sub
end if
call data_cid_sid(csid1)
cid1=cid
sid1=sid
call data_cid_sid(csid2)
cid2=cid
sid2=sid
sql="update "&n_data_name&" set c_id="&cid2&",s_id="&sid2&" where c_id="&cid1
if int(sid1)>0 then sql=sql&" and s_id="&sid1
call joekoe_cms.exec(sql,0)
call admin_msg("已成功编辑了合并"&ntit&"数据!","?jk_mod="&jk_mod&"&nsort="&nsort,1)
response.write vbcrlf&"</table>"
exit sub
end if
call form_first()
%>
<form action='?jk_mod=<%response.write jk_mod%>&nsort=<%response.write nsort%>' method=post>
<input type=hidden name=chk value='yes'>
<tr>
<td>从<%response.write tit_fir%>:</td>
<td ><%call joekoe_chk_data_select(1)%></td>
</tr>
<tr>
<td>转换到<%response.write tit_fir%>:</td>
<td><%call joekoe_chk_data_select(2)%></td>
</tr>
<tr><td colspan=2 align=center height=30><input type=submit value='进行<%response.write ntit%>数据合并' onclick="javascript:return click_return('合并当前选择的<%response.write ntit%>数据',0);"></td></tr>
</form>
</table>
<%
end sub
sub data_cid_sid(dcsid)
if isnumeric(dcsid) then
cid=dcsid
sid=0
else
cid=mid(dcsid,1,instr(dcsid,"_")-1)
sid=mid(dcsid,instr(dcsid,"_")+1,len(dcsid))
end if
end sub
function data_cs_nd(dc_var,dc_num)
dim csnd
data_cs_nd=true
csnd=joekoe_cms.code_form("csnd"&dc_num)
if len(dc_var)<1 then
data_cs_nd=false
exit function
end if
if csnd="yes" then
if isnumeric(dc_var) then
data_cs_nd=false
exit function
end if
end if
end function
sub joekoe_chk_data_select(cc_var)
dim sql2,rs2,sql3,rs3,csnd,now_id,n_id
csnd="no"
response.write "<select name=c_id"&cc_var&" size=1>"
sql3="select c_id,c_name from jk_class where nsort='"&nsort&"' order by c_order,c_id"
set rs3=joekoe_cms.exec(sql3,1)
do while not rs3.eof
n_id=int(rs3(0))
response.write vbcrlf&"<option value='"&n_id&"' class=bg_2>"&rs3(1)&"</option>"
sql2="select s_id,s_name from jk_sort where c_id="&n_id&" order by s_order,s_id"
set rs2=joekoe_cms.exec(sql2,1)
do while not rs2.eof
now_id=int(rs2(0))
csnd="yes"
response.write vbcrlf&"<option value='"&n_id&"_"&now_id&"'> "&rs2(1)&"</option>"
rs2.movenext
loop
rs2.close
set rs2=nothing
rs3.movenext
loop
rs3.close
set rs3=nothing
response.write "</select><input type=hidden name=csnd"&cc_var&" value='"&csnd&"'>"&redx&"如有二级分类,请选择一个二级分类"
end sub
找到joekoe_chk_dim()将原来这段定义改为:
引用内容
sub joekoe_chk_dim()
dim tmpsort
tmpsort=trim(request.querystring("nsort"))
nnum=-1
sql="select m_nsort,m_tit_fir,m_data_name from admin_menu where m_is_master=1 and m_is_nsort=1"
if jk_mod="batch" then
sql=sql&" and (m_on_power=1 or m_on_emoney=1)"
end if
sql=sql&" order by m_id"
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,1
if not rs.eof then
nnum=rs.recordcount-1
redim ndim(2,nnum)
for i=1 to nnum+1
ndim(0,i-1)=rs(0)
ndim(1,i-1)=rs(1)
ndim(2,i-1)=rs(2)
if tmpsort=ndim(0,i-1) then
nsort=tmpsort
ntit=ndim(1,i-1)
n_data_name=ndim(2,i-1)
end if
rs.movenext
next
if nsort="" then
nsort=ndim(0,0)
ntit=ndim(1,0)
n_data_name=ndim(2,0)
end if
ntit1=ntit
ntit=ntit&tit_fir
end if
rs.close
end sub
http://www.up173.com/forum_view.asp?forum_id=6&view_id=489
评论: 6 | 引用: 0 | 查看次数: 654
发表评论