<?php
error_reporting(0); 
include("../../config/qiantai.php");
session_start();
if(!isset($_SESSION['username'])){echo "<script>alert('请重新登录!')</script><script>top.location.href='/index$dshz'</script>";exit;}
$username=ubo($_SESSION['username']);
$type="where name='$username'";
$user=queryall(user,$type);
$userid=$user['userid'];
if(!$user){echo "<script>alert('请重新登录!')</script><script>top.location.href='/index$dshz'</script>";exit;}
$ids=ubo($_GET['ids']);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="gb2312">
<title>修改分类</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<link rel="stylesheet" href="/layui/css/layui.css" media="all" />
<script src='/2019newui/js/jquery.min.js' type="text/javascript"></script>
<script src="/layui/layui.js"></script>
<script src="/2019newui/js/bootstrap.min.js"></script>
</head>
<body>
<div class="x-body">
<form class="layui-form" name="FormInfo" id="FormInfo">
<input type="hidden" name="lx"  value="fledit">
<input type="hidden" name="ids"  value="<?php echo $ids?>">
<div class="layui-form-item">
<div class="layui-input-inline" style="width:90%;margin:0 auto;" >
<select name="fl"   id="fl" >
<option value='请选择'>请选择分类</option>
<?php 
$result = mysql_query("SELECT * FROM  dlfl where userid='$userid'");
$count = mysql_num_rows($result);
?>
<?php if($count == 0){?><option value='0'>暂无分类</option><?php }?>
<?php
$query = mysql_query("SELECT * FROM  dlfl where userid='$userid'");
while($a = mysql_fetch_array($query)) {
?>  
<option value='<?php echo $a[id]?>'><?php echo $a[name]?></option>
<?php }?>
</select>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-inline"  style="width:90%;margin:0 auto;">
<button class="layui-btn"  lay-submit="" lay-filter="FormInfo" style="width:100%;" >立即修改</button>
</div>
</div>
</form>
</div>
<script>
layui.use(['form', 'layedit', 'laydate', 'element', 'jquery', 'layer'], function(){
var form = layui.form
,layer   = layui.layer
,layedit = layui.layedit
,element = layui.element
,$= layui.jquery
,laydate = layui.laydate;
form.on('submit(FormInfo)', function (data) {
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type:'POST',
url : "/post<?php echo $dshz?>",
data:$("#FormInfo").serialize(),
dataType:'json',
success:function(result){
if(result.zt == '1'){
layer.closeAll('loading');
layer.msg('修改成功');
parent.location.href='/shipin<?php echo $dshz?>';
}else{
layer.closeAll('loading');
layer.msg(result.msg);
}
}	
});
return false;
});
});
</script>
</body>
</html>