You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simple-yewu/frontend/views/menu/edit.php

94 lines
4.5 KiB

5 years ago
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/iCheck/custom.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="row">
5 years ago
<div class="col-sm-12">
<form role="form" class="form-horizontal data-from" id="theFrm">
<input type="hidden" name="id" value="<?=intval($info->id)?>">
<div class="form-group">
<label class="col-sm-2 control-label">菜单名称</label>
<div class="col-sm-4">
<input type="text" name="name" value="<?=$info->name?>" class="form-control">
</div>
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<select name="parent_id" class="form-control">
<option value="0"></option>
<?php
foreach($menu_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $info->parent_id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">图标</label>
<div class="col-sm-4">
<input type="text" name="icon" value="<?=$info->icon?>" class="form-control">
</div>
<label class="col-sm-2 control-label">路径</label>
<div class="col-sm-4">
<input type="text" name="path" value="<?=$info->path?>" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">排序</label>
<div class="col-sm-4">
<input type="text" name="order_id" value="<?=$info->order_id?>" class="form-control">
</div>
</div>
<div>
<div class="row">
5 years ago
<div class="col-sm-5 col-sm-offset-5">
<button class="btn btn-primary btn-save" type="button">
<strong><?=$info ? '保 存':'添 加'?></strong>
</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
5 years ago
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$(".btn-save").click(function(){
parent.layer.confirm('是否确认提交?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
5 years ago
var params = $("#theFrm").serialize();
$.post('/menu/save',params,function(obj){
if(obj.success) {
parent.layer.msg('保存成功');
parent.refreshList();
layer_close();
5 years ago
} else {
parent.layer.msg(data.msg);
5 years ago
}
},'json');
}, function(){
//
});
5 years ago
});
})
</script>
<?php $this->endBlock('footer_js'); ?>