<?php if (!defined('ROOT')){ echo 'Deny ...'; exit; } extract($data); ?>
<!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>MAIN</title>
        <link href="<?php echo $base_url; ?>static/css/style.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo $base_url; ?>static/css/select.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="<?php echo $base_url; ?>static/js/jquery.js"></script>
        <script type="text/javascript" src="<?php echo $base_url; ?>static/js/select-ui.min.js"></script>
    </head>

    <body>

        <div class="place">
            <span>位置：</span>
            <ul class="placeul">
                <li><a href="<?php echo $base->get_url(array('c' => 'frame', 'm' => 'main')); ?>">首页</a></li>
                <li><a href="<?php echo $base->get_url(array('c' => 'database', 'cid' => $cid)); ?>">数据模型</a></li>
                <li><a href="<?php echo $base->get_url(array('c' => 'database', 'm' => 'fields', 'cid' => $cid, 'id' => $tid)); ?>">【<?php echo $db['mode'];?>】字段管理</a></li>
                <li>新增字段</li>
            </ul>
        </div>

        <div class="formbody" style="margin-top: 10px;">
            <div class="usual"> 
                <?php echo form::start('form1');?>
                <?php echo form::nonce($admin['id'], 'createField');?>
                <?php echo form::input_hidden('cid', $cid);?>
                <?php echo form::input_hidden('tid', $tid);?>
                <div class="tabson">
                    <?php echo form::tip($admin['username'], '新增字段');?>
                    <ul class="forminfo">
                        <?php 
                        echo form::select('类型', '_form', 1, $_forms, 'type::name', 137);
                        echo form::radio('输入项', '_must', 1,  array(
                            array('id' => 0, 'name' => '选填'),
                            array('id' => 1, 'name' => '必填')
                        ), 'id::name::0');
                        echo form::input(array(
                            'title' => '字段名',
                            'name' => 'name',
                            'must' => 1,
                            'placeholder' => '请输入字母',
                            'style' => 'width: 137px;',
                            'value' => '',
                            'readonly' => 0
                        ));
                        echo form::input(array(
                            'title' => '简称',
                            'name' => 'tag',
                            'must' => 1,
                            'placeholder' => '请输入汉字',
                            'style' => 'width: 137px;',
                            'value' => '',
                            'readonly' => 0
                        ));
                        echo form::select('关联', 'connect_id', 0, $connect, 'id::tag', 137);
                        echo form::textarea(array(
                            'title' => '默认值',
                            'name' => 'content',
                            'must' => 0,
                            'placeholder' => '',
                            'style' => 'height: 200px;',
                            'value' => '',
                            'readonly' => 0
                        ));
                        echo form::submit('提交', 'btn88');
                        ?>
                    </ul>
                </div>
                <?php echo form::end();?>
                <?php echo form::onclick('form1', 'btn88', '提交', $base->get_url(array('c' => 'database', 'm' => 'createFieldAJAX')), $base->get_url(array('c' => 'database', 'm' => 'fields', 'cid' => $cid, 'id' => $tid)));?>
            </div> 
        </div>
    </body>
</html>
