123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>数据编辑器</title>
- <link href="{#_link("static/css/style.css")#}" rel="stylesheet" type="text/css" />
- <link href="{#_link("static/css/select.css")#}" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="{#_link("static/js/jquery.min.js")#}"></script>
- <script type="text/javascript" src="{#_link("static/js/jquery.idTabs.min.js")#}"></script>
- <script type="text/javascript" src="{#_link("static/js/select-ui.min.js")#}"></script>
- <script type="text/javascript" src="{#_link("static/js/jquery.bgiframe.min.js")#}"></script>
- <script type="text/javascript" src="{#_link("static/js/jquery.multiSelect.js")#}"></script>
- <script type="text/javascript" src="{#_link("static/js/tips.js")#}"></script>
- <script type="text/javascript" src="{#_link("static/js/notify-custom.min.js")#}"></script>
- <script type="text/javascript" src="{#_link('static/js/xheditor/xheditor-1.2.2.min.js')#}"></script>
- <script type="text/javascript" src="{#_link('static/js/xheditor/xheditor_lang/zh-cn.js')#}"></script>
- <script>
- $(document).ready(function(){
- $("#modifyForm").submit(function()
- {
- $('input').removeClass('input_error');
- $.post($(this).attr('action'), $(this).serialize(), function(r)
- {
- if(r == null)
- {
- $.notify("系统错误,请重试", "error");
- };
- if(typeof r.code != 'undefined' && r.code == 0)
- {
- $.notify("保存成功", "success");
- }
- else
- {
- $.notify((r.error || "保存失败"), "error");
- if(r.error && r.error.fields)
- {
- for(var field in r.error.fields)
- {
- $('input[name="fields['+field+']"]').addClass('input_error');
- }
- }
- if(r.error && r.error.opt && r.error.opt._save)
- {
- $.notify(r.error.opt._save, "error");
- }
- }
- }, 'json');
- return false;
- });
- });
- </script>
- </head>
- <body>
- <div class="place">
- <span>位置:</span>
- <ul class="placeul">
- <li><a href="{#$pathes.index#}">首页</a></li>
- <li><a href="{#_link("database/creator")#}?database={#$database#}&tableName={#$tableName#}">规则管理</a></li>
- <li><a href="{#$pathes.table#}?database={#$database#}&tableName={#$tableName#}">数据管理</a></li>
- <li>添加数据</li>
- </ul>
- </div>
- <div class="formbody">
- <div class="formtitle"><span>基本信息</span></div>
- <form name="modifyForm" id="modifyForm" method="POST" action="{#_link("api/database/add.json")#}?isAjax=1">
- <input type="hidden" name="database" value="{#$database#}" id="database" />
- <input type="hidden" name="tableName" value="{#$tableName#}" id="tableName" />
- <ul class="forminfo">
- {#foreach key=key item=item from=$fields#}
- <li><label>{#if isset($rules['rules']['alias'][$key]) && $rules['rules']['alias'][$key] != ''#}{#$rules['rules']['alias'][$key]#}{#else#}{#$key#}{#/if#}</label>
- {#if $rules['rules']['type'][$key] == 'mediumtext' || $rules['rules']['type'][$key] == 'text'#}
- <textarea name="fields[{#$key#}]" cols="100" rows="20" class="textinput {#if helper\globals::hasHtmlTag($item)#}xheditor{#/if#}"></textarea>
- {#else if $rules['rules']['type'][$key] == 'enum'#}
- <div class="vocation">
- <select class="select1" name="fields[{#$key#}]" id="fields[{#$key#}]">
- {#foreach key=set item=sitem from=$rules['rules']['setsArray'][$key]#}
- <option value="{#$sitem#}" {#if $item == $sitem#}selected{#/if#}>{#$sitem#}</option>
- {#/foreach#}
- </select>
- </div>
- {#else#}
- <input name="fields[{#$key#}]" type="text" class="dfinput" value="" />
- {#/if#}
- <i>{#if isset($rules['rules']['length'][$key]) && $rules['rules']['length'][$key] > 0 #}最大长度{#$rules['rules']['length'][$key]#}个字符{#else#}{#/if#}</i></li>
- {#/foreach#}
- <li><label> </label><input name="submit" type="submit" class="btn" value="确认保存"/></li>
- </ul>
- </form>
- </div>
- <script>
- $('.xheditor').xheditor({skin:'nostyle'});
- $(".select1").uedSelect({
- width : 345
- });
- </script>
- </body>
- </html>
|