public function storechangei (Request $request ) {
if ($request ->isPost()){
$data =input();
$mk =[
'busname' =>$data ['busname' ],
'address' =>$data ['address' ],
'produce' =>$data ['produce' ]
];
$list =Db::table('xc_store' )->where('id' ,$data ['id' ])->update($mk );
if ($list ){
return json(['status' =>'success' ]);
}
}else {
$id =input('id' );
$list =Db::table('xc_store' )->where('id' ,$id )->select();
$this ->assign('list' ,$list );
return $this ->fetch('store/gcbqxiugai' );
}
}
<!DOCTYPE HTML>
<html >
<head >
<meta charset ="utf-8" >
<meta name ="renderer" content ="webkit|ie-comp|ie-stand" >
<meta http-equiv ="X-UA-Compatible" content ="IE=edge,chrome=1" >
<meta name ="viewport" content ="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv ="Cache-Control" content ="no-siteapp" />
<link rel ="Bookmark" href ="/favicon.ico" >
<link rel ="Shortcut Icon" href ="/favicon.ico" />
<link rel ="stylesheet" type ="text/css" href ="__HUI__/h-ui/css/H-ui.min.css" />
<link rel ="stylesheet" type ="text/css" href ="__HUI__/h-ui.admin/css/H-ui.admin.css" />
<link rel ="stylesheet" type ="text/css" href ="__LIB__/Hui-iconfont/1.0.8/iconfont.css" />
<link rel ="stylesheet" type ="text/css" href ="__HUI__/h-ui.admin/skin/default/skin.css" id ="skin" />
<link rel ="stylesheet" type ="text/css" href ="__HUI__/h-ui.admin/css/style.css" />
<script type ="text/javascript" src ="__LIB__/jquery/1.9.1/jquery.min.js" > </script >
<title > 新建网站权限 - 管理员管理 - H-ui.admin v3.1</title >
<meta name ="keywords" content ="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载" >
<meta name ="description" content ="H-ui.admin v3.1,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。" >
</head >
<body >
<article class ="page-container" >
<form action ="" method ="post" class ="form form-horizontal" id ="form-admin-permission-add"
enctype ="multipart/form-data" >
{volist name="list" id="v"}
<input type ="hidden" class ="input-text" value ="{$v.id}" name ="id" >
<div class ="row cl" >
<label class ="form-label col-xs-4 col-sm-3" > 商家名称:</label >
<div class ="formControls col-xs-8 col-sm-9" >
<input type ="text" class ="input-text" value ="{$v.busname}" name ="busname" >
</div >
</div >
<div class ="row cl" >
<label class ="form-label col-xs-4 col-sm-3" > 商家地址:</label >
<div class ="formControls col-xs-8 col-sm-9" >
<input type ="text" class ="input-text" value ="{$v.address}" name ="address" >
</div >
</div >
<div class ="row cl" >
<label class ="form-label col-xs-4 col-sm-3" > 商家简介:</label >
<div class ="formControls col-xs-8 col-sm-9" >
<input type ="text" class ="input-text" value ="{$v.produce}" name ="produce" >
</div >
</div >
{/volist}
<div class ="row cl" >
<div class ="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3" >
<button type ="submit" class ="btn btn-success radius" id ="admin-permission-save" name ="admin-permission-save" > <i class ="icon-ok" > </i > 确定</button >
</div >
</div >
</form >
</article >
<script type ="text/javascript" src ="__LIB__/layer/2.4/layer.js" > </script >
<script type ="text/javascript" src ="__HUI__/h-ui/js/H-ui.min.js" > </script >
<script type ="text/javascript" src ="__HUI__/h-ui.admin/js/H-ui.admin.js" > </script >
<script type ="text/javascript" src ="__LIB__/jquery.validation/1.14.0/jquery.validate.js" > </script >
<script type ="text/javascript" src ="__LIB__/jquery.validation/1.14.0/validate-methods.js" > </script >
<script type ="text/javascript" src ="__LIB__/jquery.validation/1.14.0/messages_zh.js" > </script >
<script type ="text/javascript" >
$(function () {
$(".permission-list dt input:checkbox" ).click(function () {
$(this ).closest("dl" ).find("dd input:checkbox" ).prop("checked" ,$(this ).prop("checked" ));
});
$(".permission-list2 dd input:checkbox" ).click(function () {
var l =$(this ).parent().parent().find("input:checked" ).length;
var l2=$(this ).parents(".permission-list" ).find(".permission-list2 dd" ).find("input:checked" ).length;
if ($(this ).prop("checked" )){
$(this ).closest("dl" ).find("dt input:checkbox" ).prop("checked" ,true );
$(this ).parents(".permission-list" ).find("dt" ).first().find("input:checkbox" ).prop("checked" ,true );
}
else {
if (l==0 ){
$(this ).closest("dl" ).find("dt input:checkbox" ).prop("checked" ,false );
}
if (l2==0 ){
$(this ).parents(".permission-list" ).find("dt" ).first().find("input:checkbox" ).prop("checked" ,false );
}
}
});
$('#form-admin-permission-add' ).submit(function (evt) {
evt.preventDefault();
var shuju = $(this ).serialize();
$.ajax({
url:'{$Request.url}' ,
data:shuju,
dataType:'json' ,
type:'post' ,
success:function (msg) {
if (msg.status=='success' ){
layer.alert('修改成功' , {icon: 6 },function () {
parent.window.location.href=parent.window.location.href;
layer_close();
});
}else {
layer.alert('修改失败,【' +msg.errorinfo+'】' , {icon: 5 });
}
}
});
});
});
</script >
</body >
</html >
<?php
return [
'view_replace_str' => [
'__HUI__' => '/static/index/static' ,
'__LIB__' => '/static/index/lib' ,
'__TEMP__' => '/static/index/temp' ,
'__LAYER__' => '/static/index/layer' ,
'__JS__' => '/static/index/js' ,
'__CSS__' => '/static/index/css' ,
'__xiche__' => 'http://yfj.sharexwd.top/xiche' ,
],
];
<td class ="td-manage" >
<a title ="删除" href ="javascript:;" onclick ="deletes(this,{$v['id']})" class ="ml-5" style ="text-decoration:none" > <i class ="Hui-iconfont" > </i > </a >
<a title ="修改" href ="javascript:;" onclick ="member_edit('编辑','{:url(\'index/store/storechangei\',[\'id\'=>$v.id])}','4','','510')" class ="ml-5" > <i class ="Hui-iconfont" > </i > </a >
</td >
script
function member_edit (title,url,id,w,h) {
layer_show(title,url,w,h);
}