<!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"/>
    <meta http-equiv="Expires" CONTENT="0"/>
    <meta http-equiv="Cache-Control" CONTENT="no-cache"/>
    <meta http-equiv="Pragma" CONTENT="no-cache"/>
    <title>fast api</title>
    <script type="text/javascript" src="/min/?f=/js/information-system3.min.js,/js/common.js&v=20190128"></script>
</head>
<script type="text/javascript">
    function query() {
        $.ajax({
            type: "post",
            dataType: "json",
            url: "<?php echo site_url('apps/fastapi/index/query_post')?>",
            data: {
                "sql_text": $('#sqltextarea').val(),
                "database": $('#databasename').val(),
            },
            success: function (data, textStatus) {
                $('#resulttextarea').val(JSON.stringify(data, null, 4));
            },
            error: function () {
                $('#resulttextarea').val('查询异常');
            }
        })
    }
</script>
<body>
<h1>fast api</h1>
<div style="text-align: center">
    <textarea rows="12" cols="120" id="sqltextarea"></textarea>
    <br/>
    <ul style="list-style: none">
        <li>select top 30 * from Email_AutomaticSend order by m_sn desc</li>
        <li>select top 30 *  from ConfirmLineInfoTmp order by coli_sn desc</li>
        <li>select top 10 * from infocontents</li>
    </ul>
    <br/>
    <label><input type="radio" value="TOURMANAGER" id="databasename" name="databasename" checked/>Tourmanager</label>
    <label><input type="radio" value="INFOMANAGER" id="databasename" name="databasename"/>Infomanager</label>
    <button onclick="query()"> 提交查询</button>
    <hr/>
    <textarea rows="30" cols="120" style="height: 90%;width: 100%" id="resulttextarea"></textarea>
</div>
</body>
</html>
