Change the topic image of homepage carousel (4. delete) --- light open e-commerce system (enterprise entry level B2C website), E-commerce system B2C
Connect (
Change the topic image for homepage carousel 1)
File: Form in site/links/img0.html (the last td in line 11th)
<Td> <if x = "@ {sys: canDo}"> <a href = "javascript: doDel ('@ {links: WE_ID }'); "x = true> [delete] </a> </if> </td>
And the js function (the parameter is reUrl and the image we_id) when lines 16 to 23 are deleted)
<Script> function doDel (rid) {if (! Confirm ('Are you sure you want to delete it? ') {Return;} var str =' @ {sys: face} site/links/im1__del.chtml? ReUrl = site/links/img0.html & WE_ID = '+ rid; location. href = str ;}</script>
Click "[delete]" and click OK to jump to the file.
Site/links/im1__del.chtml(In
Light open e-commerce system (enterprise entry level B2C website)Under the site/links/directory)
Determine Permissions(Security First)
<Chtml> <Bag id = sys> <we name = NodeID> a0.0 </we> </Bag> </chtml> <chtml file = "base/ac/checkAcl.htm "/> <! -- Introduce the permission check file --> <chtml> <if x = "@ {sys: canDo}" else = 1> <we x = true> ...... </we> <script> alert ("You do not have permission! "); Location. href = '@ {sys: face }@{ pPage: reUrl}' </script> </if> </chtml>
Query image URI
<esql module=base id=link>select IMG_URL from images_base where WE_ID='@{pPage:WE_ID}'</esql>
Delete Image
<if x="@{link:IMG_URL}" else=1><we/><file act=del>@{link:IMG_URL}</file></if>
Delete records in a table
<ESql module=base act=edit>Delete From images_base where WE_ID='@{pPage:WE_ID}'</ESql>
Prompt and return after success
<Script> alert ("deleted successfully! "); Location. href = '@ {sys: face }@{ pPage: reUrl}' </script>
All code
<Html> <! -- Topic node --> <chtml> <Bag id = sys> <we name = NodeID> a0.0 </we> </Bag> </chtml> <chtml file = "base/ ac/checkAcl.htm "/> <! -- Import the permission check file --> <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> <! -- Delete an image --> <if x = "@ {link: IMG_URL}" else = 1> <we/> <file act = del >@{ link: IMG_URL }</file> </if> <! -- Delete record --> <ESql module = base act = edit> Delete From images_base where WE_ID = '@ {pPage: WE_ID} '</ESql> <script> alert ("deleted successfully! "); Location. href = '@ {sys: face} @ {pPage: reUrl}' </script> </we> <script> alert (" You do not have permission! "); Location. href = '@ {sys: face }@{ pPage: reUrl}' </script> </if> </chtml> (File: site/links/im1__del.chtml) in
Light open e-commerce system (enterprise entry level B2C website)Under the site/links/directory
Download Easy Do IT resources
Development Instance:Lightweight enterprise entry-level B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8818883
The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please note thatDownload the latest version