换主页轮播的主题图片(4、删除)---轻开电子商务系统(企业入门级B2C网站)

 

换主页轮播的主题图片1


文件:site/links/img0.html中的表单(第11行最后一个td)

<td><if x="@{sys:canDo}"><a href="javascript:doDel('@{links:WE_ID}');" x=true>[删除]</a></if></td>
及16到23行的删除提示js函数(参数为reUrl和图片we_id)
<script>
function doDel(rid)
{
	if(!confirm('真的要删除吗?')){return;}
	var str = '@{sys:face}site/links/img0_del.chtml?reUrl=site/links/img0.html&WE_ID='+rid;
		location.href= str;
}
</script>
点“[删除]”并确定后跳转到文件site/links/img0_del.chtml( 轻开电子商务系统(企业入门级B2C网站) 的site/links/目录下 )
判断权限(安全第一)

<chtml>
	<Bag id=sys><we name=NodeID>a0.0</we></Bag>
</chtml>
<chtml file="base/ac/checkAcl.htm"/><!-- 引入权限检查文件 -->
<chtml>
<if x="@{sys:canDo}" else=1>
	<we x=true>
... ...
	</we>
	<script>alert("您没有权限!");location.href='@{sys:face}@{pPage:reUrl}'</script>
</if>
</chtml>
查询图片URI

<esql module=base id=link>select IMG_URL from images_base where WE_ID='@{pPage:WE_ID}'</esql>
删除图片
		<if x="@{link:IMG_URL}" else=1>
			<we/>
			<file act=del>@{link:IMG_URL}</file>
		</if>
删除表中的记录
<ESql module=base act=edit>Delete From images_base where WE_ID='@{pPage:WE_ID}'</ESql>
成功后提示并返回
<script>alert("删除成功!");location.href='@{sys:face}@{pPage:reUrl}'</script>
全部代码
<html>
<!-- 栏目节点 -->
<chtml>
	<Bag id=sys><we name=NodeID>a0.0</we></Bag>
</chtml>
<chtml file="base/ac/checkAcl.htm"/><!-- 引入权限检查文件 -->
<chtml>
<if x="@{sys:canDo}" else=1>
	<we x=true>
		<esql module=base id=link>select IMG_URL from images_base where WE_ID='@{pPage:WE_ID}'</esql>
		<!-- 删除图片 -->
		<if x="@{link:IMG_URL}" else=1>
			<we/>
			<file act=del>@{link:IMG_URL}</file>
		</if>
		<!-- 删除记录 -->
		<ESql module=base act=edit>Delete From images_base where WE_ID='@{pPage:WE_ID}'</ESql>
		<script>alert("删除成功!");location.href='@{sys:face}@{pPage:reUrl}'</script>
	</we>
	<script>alert("您没有权限!");location.href='@{sys:face}@{pPage:reUrl}'</script>
</if>
</chtml>
</html>
(文件:site/links/img0_del.chtml)在轻开电子商务系统(企业入门级B2C网站) 的site/links/目录下
轻松互联网开发平台(Easy Do IT)资源下载

开发实例:轻开企业入门级B2C电子商务网站,免费下载:http://download.csdn.net/detail/tx18/8818883

轻开平台会不定期升级为大家提供更多强大而Easy的功能,请留意下载最新的版本


  • 5
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 11
    评论
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值