{% extends "layout.html" %}

{% block content %}
<div class="main-content pb55">
    <div class="container-fluid">
        <div class="pos-box bgw mtb15">
            <div class="position f14 c9 pull-left">
                <a class="plr10 c4" href="/">{{data['lan']['H1']}}</a>/<span class="plr10 c4">{{data['lan']['H2']}}</span>
            </div>
            <div class="search pull-right">
                <form target="hid" onsubmit='database.database_table_view($("#SearchValue").val())'>
                    <input type="text" id="SearchValue" class="ser-text pull-left" placeholder="{{data['lan']['SEARCH']}}" />
                    <button type="button" class="ser-sub pull-left" onclick='database.database_table_view($("#SearchValue").val())'></button>
                </form>
                <iframe name='hid' id="hid" style="display:none"></iframe>
            </div>
        </div>

        <div class="safe bgw mtb15 pd15">
            <div class="info-title-tips">
                <p><span class="glyphicon glyphicon-alert" style="color: #f39c12; margin-right: 10px;"></span> 请在添加数据库后，务必到<a class="btlink" href="/crontab">[计划任务]</a>页面添加定时备份任务，以确保您的数据安全。</p>
            </div>
            <div id="bt_database_table"></div>
        </div>
        <form id="toPHPMyAdmin" public-data="{{session['phpmyadminDir']}}/index.php"  action="/phpmyadmin/index.php" method="post" style="display: none;" target="_blank">
            <input type="text" name="pma_username" id="pma_username" value="" />
            <input type="password" name="pma_password" id="pma_password" value="" />
            <input type="text" name="server" value="1" />
            <input type="text" name="target" value="index.php" />
            <input type="text" name="db" id="db" value="" />
        </form>
    </div>
</div>

{% endblock %}

{% block scripts %}
<script type="text/javascript" src="{{g.cdn_url}}/js/bt_upload.js?version={{g['version']}}&repair={{data['js_random']}}"></script>
<script type="text/javascript" src="{{g.cdn_url}}/js/database.js?date={{g['version']}}&repair={{data['js_random']}}"></script>
<script type="text/javascript">
    bt.set_cookie('backup_path', "{{session['config']['backup_path']}}");
	{% if not data['isSetup'] %}
		layer.msg('{{data["lan"]["JS1"]}}<a href="/soft#i" style="color:#20a53a;float: right;">{{data["lan"]["JS2"]}}</a>',{icon:7,shade: [0.3, '#000'],time:0});
        $(".layui-layer-shade").css("margin-left", "180px");
    {% else %}
    // 	database.get_list();
    {% endif %}
</script>
<!-- <script src="{{g.cdn_url}}/js/upload.js?date={{g['version']}}"></script> -->
{% endblock %}