/* 1.该软件个人非商业用途免费使用.
/* 2.免费使用禁止修改版权信息和官方推广链接.
/* 3.禁止任何衍生版本.
/* ---------------------------------------------------- */
define('NIUXAMS_LOGIN', true);
require 'common.php';
require 'func.tj.php';
$ac = $_REQUEST['ac'];
if ($ac == 'show') {
    acshow();
} else {
    if ($ac == 'click') {
        acclick();
    } else {
        if ($ac == 'query') {
            acquery();
        }
    }
}
/////////////////////////
function acshow()
{
    global $Pre;
    $conn = new mysql();
    if (insql($_POST['attj']) == '1') {
        tj();
    }
    $args = insql($_POST['args']);
    $ac = 1;
    $screenw = substr(insql($_POST['screenw']), 0, 6);
    $screenh = substr(insql($_POST['screenh']), 0, 6);
Example #2
0
    function searchUL($search, $opts = false)
    {
        if (!$search) {
            echo "No search given to searchUL";
        }
        $sql = $this->showTable(array("sql_only" => true, "where" => " AND {$this->_titleField} LIKE '%" . mes($search) . "%' "));
        $sql .= " LIMIT 100 ";
        $result = acquery($sql, $this->_db);
        ?>
<ul><?php 
        while ($row = mysql_fetch_assoc($result)) {
            extract($row);
            ?>
<li><?php 
            echo $row[$this->_idField];
            ?>
<span class="informal"> - <?php 
            echo $row["title"];
            ?>
</span></li><?php 
        }
        ?>
</ul><?php 
    }
    function dumpRecords($opts = false)
    {
        if (is_array($opts)) {
            extract($opts);
        }
        if ($header) {
            ?>
<textarea cols="160" rows="200"><?php 
        }
        // dump the master record.
        foreach ($this->tbl as $f) {
            $sets[] = " {$f['field']} = '" . mes($this->{$f}[field]) . "'";
        }
        $out = " INSERT INTO {$this->_table} SET " . implode(",", $sets);
        echo $out;
        // dump dependent records
        echo "\r\r\r\r";
        $this->getRelated();
        $tables_used = array($this->_table);
        foreach ($this->_related as $rel) {
            // get relations
            if ($rel['table'] != $this->_table) {
                $sql = "SELECT * FROM " . $rel['table'] . " WHERE {$this->indexField} = {$this->id} ";
                $result = acquery($sql, $rel['db']);
                while ($row = mysql_fetch_array($result)) {
                    extract($row);
                    $link = new DBOS($rel['table'], $row[0], $rel['db']);
                    $link->dumpRecords();
                    $tables_used[] = $rel['table'];
                }
            }
        }
        if ($header) {
            ?>
</textarea><?php 
        }
    }