接(
文件: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/目录下
开发实例:轻开企业入门级B2C电子商务网站,免费下载:http://download.csdn.net/detail/tx18/8818883
轻开平台会不定期升级为大家提供更多强大而Easy的功能,请留意下载最新的版本
换主页轮播的主题图片(4、删除)---轻开电子商务系统(企业入门级B2C网站)
原文地址:http://blog.csdn.net/tx18/article/details/46597907