<!--
 *  Guojiz网址导航系统
 *	www.guojiz.com
 *  作者：梦雨
 *  @ QQ50361804
-->
{include file="index/header"}
<body>
<div class="fly-panel fly-panel-user">
<div class="tpt—admin">
<fieldset class="layui-elem-field layui-field-title">
  <legend>修改</legend>
</fieldset>
 
  
<form class="layui-form">
      {if condition="$guojiz['fl'] eq 9"}
      <input type="hidden" name="fl" value="9">
      {/if}
  <div class="layui-form-item"  style="width: 300px;">
    <label class="layui-form-label">选择分类</label>
    <div class="layui-input-block">
    {if condition="$guojiz['fl'] eq 9"}
      <select name="tid" lay-verify="required" >
        <option value=""></option>
        <option value="1" {if condition="$guojiz['tid'] eq 1"}selected="selected"{/if}>内容管理</option>
        <option value="2" {if condition="$guojiz['tid'] eq 2"}selected="selected"{/if}>网址管理</option>
        <option value="3" {if condition="$guojiz['tid'] eq 3"}selected="selected"{/if}>综合管理</option>
        <option value="4" {if condition="$guojiz['tid'] eq 4"}selected="selected"{/if}>其他管理</option>
      </select>
      {else /}
      <select name="fl" lay-verify="required" >
        <option value=""></option>
        <option value="0" {if condition="$guojiz['fl'] eq 0"}selected="selected"{/if}>顶部导航</option>
        <option value="1" {if condition="$guojiz['fl'] eq 1"}selected="selected"{/if}>友情链接</option>
        <option value="2" {if condition="$guojiz['fl'] eq 2"}selected="selected"{/if}>底部链接</option>
      </select>
      {/if}
    </div>
  </div>
  <input type="hidden" name="id" value="{$guojiz.id}">
  <div class="layui-form-item">
    <label class="layui-form-label">标题</label>
    <div class="layui-input-block">
      <input type="text" name="name" value="{$guojiz.name}" required lay-verify="required" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">连接</label>
    <div class="layui-input-block">
      <input type="text" name="links" value="{$guojiz.links}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>
		<div class="layui-form-item">
          <label for="L_title" class="layui-form-label">排序</label>
          <div class="layui-input-block">
            <input type="text" name="px" value="{$guojiz.px}" autocomplete="off" class="layui-input" style="width: 300px;">
          </div>
        </div>
        
{if condition="$guojiz['fl'] eq 1"}     
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">到期时间</label>
      <div class="layui-input-inline">
        <input type="date" name="times" value="{$guojiz.times}" class="layui-input" placeholder="显示到期的时间">
      </div>
    </div>
  </div>
  {/if}  
        
<?php
if ($guojiz['times']>date('Y-m-d',time())) {
  //  echo $guojiz['times'];  
}
?>
      {if condition="$guojiz['fl'] neq 9"}
  <div class="layui-form-item">
    <label class="layui-form-label">新窗口</label>
    <div class="layui-input-block">
      <input type="radio" name="dj" value="0" title="默认" {if condition="$guojiz['dj'] eq 0"}checked{/if}>
	  <input type="radio" name="dj" value="1" title="新窗口" {if condition="$guojiz['dj'] eq 1"}checked{/if}>
    </div>
  </div>
{/if}
  
  <div class="layui-form-item">
    <div class="layui-input-block">
	  <button class="layui-btn" lay-submit="" lay-filter="links_edit">立即提交</button>
      <button class="layui-btn layui-btn-primary" onclick="history.go(-1);return false;">返回</button>
    </div>
  </div>

</form>
</div>
</div>
<script>
layui.use(['form', 'upload'],function(){
  var form = layui.form
  ,jq = layui.jquery;
  
 
  //提交
  form.on('submit(links_edit)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("links/edit")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          //location.href = '{:url("links/index")}';
          history.go(-1);return false;
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });

})
</script>
{include file="index_footer"}
</body>
</html>