<?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><a href="<?php echo $base->get_url(array('c' => 'database', 'm' => 'search', 'cid' => $cid, 'tid' => $db['id'])); ?>">筛选设置</a></li>
                <li><?php echo $rs['tag'];?>【<?php echo $rs['name'];?>】</li>
            </ul>
        </div>
        <div class="formbody" style="margin-top: 10px;">
            <div class="usual"> 
                <div class="tabson">
                    <?php echo form::tip($admin['username'], '设置筛选项');?>
                    <ul class="forminfo">
                        <?php          
                        echo form::nonce($admin['id'], 'setOption');
                        echo form::textarea(array(
                            'title' => '筛选值',
                            'name' => 'content',
                            'must' => 0,
                            'placeholder' => '',
                            'style' => 'height: 200px;',
                            'value' => $rs['_options'],
                            'readonly' => 0
                        ));
                        ?>
                        <li>
                            <label>&nbsp;</label>
                            <font color="gray">留空为文本搜索, 格式：值1=内容1, 如：=不限{换行}1,10=1-10</font>
                        </li>
                        <li><label>&nbsp;</label><input name="btn88" type="button" class="btn btn88" value="提交" onclick="_save();"></li>
                    </ul>
                </div>
            </div> 
        </div>    
        <script>
            function _save(){
                var v = $('.dfarea').val();
                $.post('<?php echo $base->get_url(array('c' => 'database', 'm' => 'optionAJAX'))?>', {content: v, _nonce: $('#_nonce').val(), id: <?php echo $rs['id'];?>}, function (ret){
                    if (ret == 'ok'){
                        alert('设置成功');
                        location.reload();
                    }else{
                        alert(ret);
                    }
                });
            }
        </script>
    </body>
</html>
