<span style="font-size:14px;"><ul class="list-group">
<? if ($categorys): ?>
<? foreach ($categorys as $category):?>
<li class="list-group-item" data-id="<? echo $category->id ?>">
<? echo $category->name?>
<a href="<? echo site_url('group/category/delete?id=' . $category->id) ?>" onclick="<?echo lang('confirm')?>">
<span class="glyphicon glyphicon-remove"></span></a>
</li>
<? endforeach;?>
<? else: ?>
<div class="alert alert-danger">暂时没有设置</div>
<? endif; ?>
</ul></span>
<span style="font-size:14px;"> <script>
require(["jquery","jqueryui"],function($) {
var d = window.top.dialog({
content: '配置已更新'
});
$(function() {
$( ".list-group").sortable({
stop: function( event, ui ) {
data = '';
$('li.list-group-item').each(function (){
data += ',' + $(this).attr('data-id');
});
$.post('/group/category/listorder',{data:data});
d.show();
setTimeout(function () {
d.close();
}, 1000);
}
}).disableSelection();
});
});
</script></span>
<span style="font-size:14px;">public function listorder() {
$data = explode(',', $this->input->post('data'));
$i = 1;
foreach ($data as $id) {
if (!$id)
continue;
$this->category_model->save($id, array(
'listorder' => $i,
));
$i++;
}
}
public function delete() {
$id = $this->input->get('id');
$this->category_model->delete($id);
messagebox(lang('success'), 'referer');
}</span>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有