Beispiel #1
0
/**
 * This file is a part of MyWebSQL package
 *
 * @file:      modules/describe.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2014 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
function processRequest(&$db)
{
    if (getDbName() == '' || !isset($_REQUEST['name'])) {
        echo view('invalid_request');
        return;
    }
    if ($db->getTableDescription($_REQUEST['name'])) {
        createSimpleGrid($db, __('Table Description') . ': [' . htmlspecialchars(getDbName()) . ']');
    }
}
Beispiel #2
0
/**
 * This file is a part of MyWebSQL package
 *
 * @file:      modules/infodb.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2012 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
function processRequest(&$db)
{
    if (getDbName() == '') {
        echo view('invalid_request');
        return;
    }
    if ($db->queryTableStatus()) {
        createSimpleGrid($db, __('Database summary') . ': [' . htmlspecialchars(getDbName()) . ']');
    }
}
Beispiel #3
0
/**
 * This file is a part of MyWebSQL package
 *
 * @file:      modules/query.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2014 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
function processRequest(&$db)
{
    // first time query will be from request, then we will get it from session (applying limit scenario)
    $table_select = v($_REQUEST["id"]) == 'table' ? true : false;
    if ($table_select) {
        $query = selectFromTable($db);
    } else {
        $query = simpleQuery($db);
    }
    if (!$query) {
        createErrorGrid($db, $query);
        return;
    }
    loadDbVars($db);
    if ($db->query($query)) {
        if (!$db->hasResult()) {
            $info = getCommandInfo($query);
            if ($info['dbAltered']) {
                Session::set('db', 'altered', true);
            } else {
                if ($info['setvar'] == TRUE && is_scalar($info['variable']) && is_scalar($info['value'])) {
                    setDbVar($info['variable'], $info['value']);
                }
            }
            createInfoGrid($db);
        } else {
            // if it is a data result set, show it as result grid, otherwise in simple grid layout
            $query_type = getQueryType($query);
            if ($query_type['can_limit']) {
                createResultGrid($db);
            } else {
                createSimpleGrid($db, __('Query') . ': ' . $query);
            }
        }
    } else {
        createErrorGrid($db, $query);
    }
}
Beispiel #4
0
/**
 * This file is a part of MyWebSQL package
 *
 * @file:      modules/infovars.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2012 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
function processRequest(&$db)
{
    if ($db->queryVariables()) {
        createSimpleGrid($db, __('Server Variables'));
    }
}