<?php

/*
 * ----------------------------------------------------
 * 程序名称: 牛叉广告管理系统(NiuXams)
 * 程序功能: 实现专业的广告投放、管理和统计等管理系统！
 * 程序开发: 牛叉软件(NiuXSoft.com)
 * 版权所有: [NiuXams] (C)2013-2099 NiuXSoft.com
 * 官方网站: www.niuxsoft.com  Email: niuxsoft@163.com
 * ----------------------------------------------------
 * 使用条款:
 * 1.为构建创新型经济社会,请尊重保护知识产权！
 * 2.该软件个人非商业用途免费使用.
 * 3.免费使用禁止修改版权信息和官方推广链接.
 * 4.禁止任何衍生版本.禁止任何非法修改源代码贩卖.
 * ----------------------------------------------------
 */

defined('NIUX_INCLUDED') or exit('Access Denied.');
require './mo_head.php';
?>
<style>
    h3 {
        width: 14em;
        padding: .3em;
    }
    .text {
        width: 40em;
        font-size: 1em;
        padding: .6em;
    }
    .tip {
        margin-left: 12px;
        padding: .3em;
        display: inline-block;
    }
</style>
<script>
    $(function () {
        $("#submit").click(function () {
            if (checkInput('#name', /^.{1,210}$/)) {
                loading();
                $.ajax({
                    type: "POST",
                    url: location.href,
                    data: {
                        menu: "submit",
                        id: <?php echo $id ?>,
                        name: $("#name").val()
                    },
                    success: function (msg) {
                        loaded();
                        if (msg == "1") {
                            dialog('恭喜你，添加成功！是否继续添加？', 1, location.href);
                        } else if (msg == "2") {
                            dialog('恭喜你，修改成功！是否继续修改？', 1, location.href);
                        } else {
                            dialog(msg);
                        }
                    }
                });
            }
        });
    });
</script>
<div class="fullScreen">
    <h2 class="ptb hd ui-widget-content"><?php echo $title ?></h2>
    <div class="plr ptb">
        <h3 class="fl">名称</h3>
        <input class="text fl ui-widget-content ui-corner-all" id="name" value="<?php echo htmlspecialchars($name) ?>" placeholder="不超过70个汉字">
        <span class="tip clear">*</span>
    </div>
    <div class="ptb hd ui-widget-content"></div>
    <div class="plr ptb">
        <h3 class="fl"></h3>
        <button type="button" class="button" id="submit"> 完 成 </button>
        <span class="tip clear"></span>
    </div>
</div>
<?php
require './mo_foot.php';
