function get_field_computed_source($tablename, $fieldname)
{
    $csource = get_blob_content('SELECT F.RDB$COMPUTED_SOURCE' . ' FROM RDB$RELATION_FIELDS R' . ' INNER JOIN RDB$FIELDS F' . ' ON F.RDB$FIELD_NAME=R.RDB$FIELD_SOURCE' . " WHERE R.RDB\$FIELD_NAME='" . $fieldname . "'" . " AND R.RDB\$RELATION_NAME='" . $tablename . "'");
    return $csource;
}
function get_domain_check($dname)
{
    return substr(get_blob_content('SELECT RDB$VALIDATION_SOURCE' . ' FROM RDB$FIELDS' . " WHERE RDB\$FIELD_NAME='" . $dname . "'"), 6);
}
示例#3
0
//       $col  : column containing the blob
//       $where: sql-where-clause specifying the primary keys to fetch the blob
require './inc/script_start.inc.php';
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    $table = get_request_data('table', 'GET');
    $col = get_request_data('col', 'GET');
    $where = get_request_data('where', 'GET');
} else {
    $table = get_request_data('table');
    $col = get_request_data('col');
    $where = get_request_data('where');
    $s_wt['blob_as'][$col] = get_request_data('blobtype');
}
$imageurl = 'showimage.php?where=' . urlencode($where) . '&table=' . $table . '&col=' . $col;
$imageurl .= '&' . uniqid('UNIQ_');
$blob = get_blob_content(sprintf('SELECT %s FROM %s %s', $col, $table, $where));
$title = build_title(sprintf('Blob from %s %s', $table, $where), FALSE);
echo html_head($title) . '<body bgcolor="' . $s_cust['color']['area'] . "\">\n" . js_window_resize(BLOB_WINDOW_WIDTH, BLOB_WINDOW_HEIGHT) . '<form method="post" action="' . url_session($_SERVER['PHP_SELF']) . '" name="showblob_form">' . "\n" . hidden_field('table', htmlentities($table)) . hidden_field('col', htmlentities($col)) . hidden_field('where', htmlentities($where)) . "<table>\n<tr>\n<td>\n" . get_selectlist('blobtype', $blob_types, $s_wt['blob_as'][$col], TRUE) . "</td>\n<td>\n" . '<input type="submit" name="change_blobtype" value="Change Type">' . "\n" . "</td>\n<td width=\"50\">\n</td>\n<td>\n" . '<input type="button" value="Close" onClick="self.close()">' . "\n" . "</td>\n</tr>\n<table>\n" . "</form>\n";
$blobas = isset($s_wt['blob_as'][$col]) && $s_wt['blob_as'][$col] != '' ? $s_wt['blob_as'][$col] : 'hex';
switch ($blobas) {
    case 'png':
    case 'jpg':
    case 'gif':
        echo '<img src="' . $imageurl . "\">\n";
        break;
    case 'text':
        echo '<pre align="left">' . htmlspecialchars($blob) . "</pre>\n";
        break;
    case 'html':
        echo $blob;
        break;
//                published under the terms of the GNU General Public Licence v.2,
//                see file LICENCE for details
// GET-Variables specifying the blob
//
//       $table: table containing the blob
//       $col  : column containing the blob
//       $where: sql-where-clause specifying the primary keys to fetch the blob
require './inc/configuration.inc.php';
require './inc/session.inc.php';
session_start();
localize_session_vars();
require './lang/' . (isset($s_cust) ? $s_cust['language'] : LANGUAGE) . '.inc.php';
require './inc/functions.inc.php';
$dbhandle = db_connect() or ib_error();
$table = $_GET['table'];
$col = $_GET['col'];
$where = $_GET['where'];
$sql = sprintf('SELECT %s FROM %s %s', $col, $table, $where);
$blob = get_blob_content($sql);
switch ($s_wt['blob_as'][$col]) {
    case 'png':
        header('Content-Type: image/png');
        break;
    case 'jpg':
        header('Content-Type: image/jpg');
        break;
    case 'gif':
        header('Content-Type: image/gif');
        break;
}
echo $blob;