コード例 #1
0
ファイル: x4IndexLib.php プロジェクト: KlabsTechnology/andro
function x4index_dropdown($table_id_fk)
{
    // Strip a leading slash from the value
    $gpletters = gp('gp_letters');
    // Pull the rows from handy library routine.
    $rows = RowsForSelect($table_id_fk, $gpletters, array(), '', true);
    ob_start();
    foreach ($rows as $idx => $row) {
        $prev = $idx == 0 ? '' : $rows[$idx - 1]['skey'];
        $next = $idx == count($rows) - 1 ? '' : $rows[$idx + 1]['skey'];
        $s = $row['skey'];
        $tds = '';
        $x = -1;
        foreach ($row as $colname => $colvalue) {
            $x++;
            if ($colname == 'skey') {
                continue;
            }
            if ($x == 1) {
                $value = $colvalue;
            }
            $tds .= "<td>{$colvalue}";
        }
        echo "<tr id='as{$s}' \n                 x_prev='{$prev}' x_next='{$next}' x_skey='{$s}'\n                 x_value='{$value}'\n            onmouseover='x4Select.mo(this,{$s})'\n            onclick=\"x4Select.click('{$value}')\";                \n            >" . $tds;
    }
    ri('x4Select', 'rows', ob_get_clean());
}
コード例 #2
0
function index_hidden_dropdown()
{
    // Get the target table that we need
    $table_id_fk = gp('gp_dropdown');
    // Strip a leading slash from the value
    $gpletters = trim(gp('gp_letters'));
    # KFD 7/21/08, experiment
    $matches = aFromGP('match_');
    // Pull the rows from handy library routine.
    if (gp('gpv') == '2') {
        # KFD 7/21/08
        $rows = RowsForSelect($table_id_fk, $gpletters, $matches, '', true);
        #$rows=RowsForSelect($table_id_fk,$gpletters,array(),'',true);
    } else {
        $rows = rowsForSelect($table_id_fk, $gpletters);
    }
    // KFD 11/4/07.  If "version 2", then turn into a table
    if (gp('gpv') == '2') {
        ob_start();
        echo "androSelect|";
        echo "<table>";
        foreach ($rows as $idx => $row) {
            $prev = $idx == 0 ? '' : $rows[$idx - 1]['skey'];
            $next = $idx == count($rows) - 1 ? '' : $rows[$idx + 1]['skey'];
            $s = $row['skey'];
            $tds = '';
            $x = -1;
            foreach ($row as $colname => $colvalue) {
                $x++;
                if ($colname == 'skey') {
                    continue;
                }
                if ($x == 1) {
                    $value = $colvalue;
                }
                $tds .= "<td>{$colvalue}";
            }
            echo "<tr id='as{$s}' \n                     x_prev='{$prev}' x_next='{$next}' x_skey='{$s}'\n                     x_value='{$value}'\n                onmouseover='androSelect_mo(this,{$s})'\n                onmouseout = 'aSelect.hasFocus = false;'\n                onclick=\"androSelect_click('{$value}')\";                \n                >" . $tds;
        }
        echo ob_get_clean();
        return;
    }
    // Echo out the return
    foreach ($rows as $row) {
        echo $row['_value'] . "###" . $row['_display'] . "<br>";
    }
    if (Errors()) {
        $he = hErrors();
        syslog(LOG_INFO, $he);
    }
}