<?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>
        <script type="text/javascript" src="<?php echo $base_url; ?>static/js/common.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' => $db['id'])); ?>">【<?php echo $db['mode'];?>】字段管理</a></li>
                <li>筛选设置</li>
            </ul>
        </div>
        <div class="formbody">
            <div class="usual">
                <div class="tabson">
                    <table class="tablelist">
                        <thead>
                            <tr>
                                <th width="100">ID</th>
                                <th>字段名</th>
                                <th>简称</th>
                                <th>类型</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            if ($fields){
                                foreach ($fields as $field){
                            ?>
                            <tr>
                                <td><?php echo $field['id'];?></td>
                                <td><?php echo $field['name'];?></td>
                                <td><?php echo $field['tag'];?></td>
                                <td><?php echo $field['_form'];?></td>
                                <td>
                                    <a href="<?php echo $base->get_url(array('c' => 'database', 'm' => 'filtrate', 'cid' => $cid, 'tid' => $db['id'], 'id' => $field['id']));?>" class="tablelink">[设置]</a>
                                </td>
                            </tr>
                            <?php
                                }
                            }
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>    
        <script>
            $(function(){
                $('.tablelist tbody tr:odd').addClass('odd');                
            });
        </script>
    </body>
</html>
