<!DOCTYPE html>
<html>

<head>
</head>

<body>
    <?php
    // 正式部署删除该文件。
    $act = @$_GET['act'] . '';
    if ($act == 'time')
        echo date('Y-m-d H:i:s') . '　　v' . phpversion();
    if ($act == 'db') {
        require '../zciyphp/comm.php';
        $db = new \ciy\db();
        $ret = $db->connect();
        if (!$ret->isconnected)
            die($ret->error);
        $cfg = webini('db');
        $dbname = $cfg['name'];
        $schema = $db->getraw('SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = ?', array($dbname));
        if (count($schema) == 0)
            die('应建立' . $dbname . '数据库实例');
        $csql = new \ciy\sql('zc_admin');
        $userrow = $db->getone($csql);
        if ($userrow === false) {
            if (strpos($db->error, 'exist') !== false)
                die('数据表没导入，需在' . $dbname . '中执行c5_ciyon.sql建立表');
            else
                die($db->error);
        }
        $ver = $db->getraw('SELECT VERSION() as ver');
        echo '数据库连接成功　　v' . $ver[0]['ver'];
        echo '<br/>登录账号: ' . $userrow['mobile'];
        echo '<br/>初始密码: 123654';
        echo '<br/><a href="/admin/" target="_blank">前往登录</a>';
        echo '<br/><a href="?act=phpinfo" target="_blank">显示PHPInfo</a>';
    }
    if ($act == 'phpinfo')
        echo phpinfo();
    ?>
</body>

</html>