当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_foreignDropdown函数代码示例

本文整理汇总了PHP中PMA_foreignDropdown函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_foreignDropdown函数的具体用法?PHP PMA_foreignDropdown怎么用?PHP PMA_foreignDropdown使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_foreignDropdown函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_foreignDropdown

            echo $field_name_appendix_md5;
            ?>
"
                <?php 
            echo $unnullify_trigger;
            ?>
                tabindex="<?php 
            echo $tabindex + $tabindex_for_value;
            ?>
"
                id="field_<?php 
            echo $idindex;
            ?>
_3">
                <?php 
            echo PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], $data, $cfg['ForeignKeyMaxLimit']);
            ?>
            </select>
            <?php 
            // still needed? :
            unset($foreignData['disp_row']);
        } elseif ($cfg['LongtextDoubleTextarea'] && strstr($field['pma_type'], 'longtext')) {
            ?>
            &nbsp;</td>
        </tr>
        <tr class="<?php 
            echo $odd_row ? 'odd' : 'even';
            ?>
">
            <td colspan="5" align="right">
                <?php 
开发者ID:fathitarek,项目名称:cop5725-dbms-project,代码行数:31,代码来源:tbl_change.php

示例2: _getForeignKeyInputBox

    /**
     * Provides html elements for search criteria inputbox
     * in case the column is a Foreign Key
     *
     * @param array  $foreignData         Foreign keys data
     * @param string $column_name         Column name
     * @param int    $column_index        Column index
     * @param array  $titles              Selected title
     * @param int    $foreignMaxLimit     Max limit of displaying foreign elements
     * @param array  $criteriaValues      Array of search criteria inputs
     * @param string $column_id           Column's inputbox's id
     * @param bool   $in_zoom_search_edit Whether we are in zoom search edit
     *
     * @return string HTML elements.
     */
    private function _getForeignKeyInputBox($foreignData, $column_name, $column_index, $titles, $foreignMaxLimit, $criteriaValues, $column_id, $in_zoom_search_edit = false)
    {
        $html_output = '';
        if (is_array($foreignData['disp_row'])) {
            $html_output .= '<select name="criteriaValues[' . $column_index . ']"' . ' id="' . $column_id . $column_index . '">';
            $html_output .= PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], '', $foreignMaxLimit);
            $html_output .= '</select>';
        } elseif ($foreignData['foreign_link'] == true) {
            $html_output .= '<input type="text" id="' . $column_id . $column_index . '"' . ' name="criteriaValues[' . $column_index . ']" id="field_' . md5($column_name) . '[' . $column_index . ']" class="textfield"' . (isset($criteriaValues[$column_index]) && is_string($criteriaValues[$column_index]) ? ' value="' . $criteriaValues[$column_index] . '"' : '') . ' />';
            $html_output .= <<<EOT
<a target="_blank" onclick="window.open(this.href, 'foreigners', 'width=640,height=240,scrollbars=yes'); return false" href="browse_foreigners.php?
EOT;
            $html_output .= '' . PMA_URL_getCommon($this->_db, $this->_table) . '&amp;field=' . urlencode($column_name) . '&amp;fieldkey=' . $column_index . '&amp;fromsearch=1"';
            if ($in_zoom_search_edit) {
                $html_output .= ' class="browse_foreign"';
            }
            $html_output .= '>' . str_replace("'", "\\'", $titles['Browse']) . '</a>';
        }
        return $html_output;
    }
开发者ID:minggLu,项目名称:openemr,代码行数:35,代码来源:TableSearch.class.php

示例3: PMA_getHtmlForRelationalColumnDropdown

/**
 * Get the HTML for relational column dropdown
 * During grid edit, if we have a relational field, returns the html for the
 * dropdown
 *
 * @param string $db         current database
 * @param string $table      current table
 * @param string $column     current column
 * @param string $curr_value current selected value
 *
 * @return string $dropdown html for the dropdown
 */
function PMA_getHtmlForRelationalColumnDropdown($db, $table, $column, $curr_value)
{
    $foreigners = PMA_getForeigners($db, $table, $column);
    $foreignData = PMA_getForeignData($foreigners, $column, false, '', '');
    if ($foreignData['disp_row'] == null) {
        //Handle the case when number of values
        //is more than $cfg['ForeignKeyMaxLimit']
        $_url_params = array('db' => $db, 'table' => $table, 'field' => $column);
        $dropdown = '<span class="curr_value">' . htmlspecialchars($_REQUEST['curr_value']) . '</span>' . '<a href="browse_foreigners.php' . PMA_URL_getCommon($_url_params) . '"' . 'class="ajax browse_foreign" ' . '>' . __('Browse foreign values') . '</a>';
    } else {
        $dropdown = PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], $curr_value, $GLOBALS['cfg']['ForeignKeyMaxLimit']);
        $dropdown = '<select>' . $dropdown . '</select>';
    }
    return $dropdown;
}
开发者ID:harryboulderdash,项目名称:PlayGFC,代码行数:27,代码来源:sql.lib.php

示例4: PMA_dispRowForeignData

/**
 * Get HTML to display foreign data
 *
 * @param string  $backup_field         hidden input field
 * @param string  $column_name_appendix the name attribute
 * @param string  $onChangeClause       onchange clause for fields
 * @param integer $tabindex             tab index
 * @param integer $tabindex_for_value   offset for the values tabindex
 * @param integer $idindex              id index
 * @param string  $data                 data to edit
 * @param array   $foreignData          data about the foreign keys
 *
 * @return string                       an html snippet
 */
function PMA_dispRowForeignData($backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data, $foreignData)
{
    $html_output = '';
    $html_output .= $backup_field . "\n";
    $html_output .= '<input type="hidden"' . ' name="fields_type' . $column_name_appendix . '"' . ' value="foreign" />';
    $html_output .= '<select name="fields' . $column_name_appendix . '"' . ' ' . $onChangeClause . ' class="textfield"' . ' tabindex="' . ($tabindex + $tabindex_for_value) . '"' . ' id="field_' . $idindex . '_3">';
    $html_output .= PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], $data, $GLOBALS['cfg']['ForeignKeyMaxLimit']);
    $html_output .= '</select>';
    return $html_output;
}
开发者ID:hewenhao2008,项目名称:phpmyadmin,代码行数:24,代码来源:insert_edit.lib.php

示例5: PMA_getForeignFields_Values

/**
 * Creates the HTML content for:
 * 1) Browsing foreign data for a field.
 * 2) Creating elements for search criteria input on fields.
 *
 * @param array  $foreigners      Array of foreign keys
 * @param array  $foreignData     Foreign keys data
 * @param string $field           Column name
 * @param string $tbl_fields_type Column type
 * @param int    $i               Column index
 * @param string $db              Selected database
 * @param string $table           Selected table
 * @param array  $titles          Selected title
 * @param int    $foreignMaxLimit Max limit of displaying foreign elements
 * @param array  $fields          Array of search criteria inputs
 * @param bool   $in_fbs          Whether we are in 'function based search'
 * @param bool   $in_zoom_search_edit  Whether we are in zoom search edit 
 *
 * @return string HTML content for viewing foreing data and elements
 * for search criteria input.
 */
function PMA_getForeignFields_Values($foreigners, $foreignData, $field, $tbl_fields_type, $i, $db, $table, $titles, $foreignMaxLimit, $fields, $in_fbs = false, $in_zoom_search_edit = false)
{
    $str = '';
    if ($foreigners && isset($foreigners[$field]) && is_array($foreignData['disp_row'])) {
        // f o r e i g n    k e y s
        $str .= '<select name="fields[' . $i . ']" id="fieldID_' . $i . '">' . "\n";
        // go back to first row
        // here, the 4th parameter is empty because there is no current
        // value of data for the dropdown (the search page initial values
        // are displayed empty)
        $str .= PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], '', $foreignMaxLimit);
        $str .= '</select>' . "\n";
    } elseif ($foreignData['foreign_link'] == true) {
        if (isset($fields[$i]) && is_string($fields[$i])) {
            $str .= '<input type="text" id="fieldID_' . $i . '" name="fields[' . $i . ']" value="' . $fields[$i] . '" id="field_' . md5($field) . '[' . $i . ']" class="textfield" />';
        } else {
            $str .= '<input type="text" id="fieldID_' . $i . '" name="fields[' . $i . ']" id="field_' . md5($field) . '[' . $i . ']" class="textfield" />';
        }
        $str .= <<<EOT
<a target="_blank" onclick="window.open(this.href, 'foreigners', 'width=640,height=240,scrollbars=yes'); return false" href="browse_foreigners.php?
EOT;
        $str .= '' . PMA_generate_common_url($db, $table) . '&amp;field=' . urlencode($field) . '&amp;fieldkey=' . $i . '"';
        if ($in_zoom_search_edit) {
            $str .= ' class="browse_foreign"';
        }
        $str .= '>' . str_replace("'", "\\'", $titles['Browse']) . '</a>';
    } elseif (in_array($tbl_fields_type[$i], PMA_getGISDatatypes())) {
        // g e o m e t r y
        $str .= '<input type="text" name="fields[' . $i . ']"' . ' size="40" class="textfield" id="field_' . $i . '" />' . "\n";
        if ($in_fbs) {
            $edit_url = 'gis_data_editor.php?' . PMA_generate_common_url();
            $edit_str = PMA_getIcon('b_edit.png', __('Edit/Insert'));
            $str .= '<span class="open_search_gis_editor">';
            $str .= PMA_linkOrButton($edit_url, $edit_str, array(), false, false, '_blank');
            $str .= '</span>';
        }
    } elseif (strncasecmp($tbl_fields_type[$i], 'enum', 4) == 0 || strncasecmp($tbl_fields_type[$i], 'set', 3) == 0 && $in_zoom_search_edit) {
        // e n u m s   a n d   s e t s
        // Enum in edit mode   --> dropdown
        // Enum in search mode --> multiselect
        // Set in edit mode    --> multiselect
        // Set in search mode  --> input (skipped here, so the 'else'
        //                                 section would handle it)
        $value = explode(', ', str_replace("'", '', substr($tbl_fields_type[$i], 5, -1)));
        $cnt_value = count($value);
        if (strncasecmp($tbl_fields_type[$i], 'enum', 4) && !$in_zoom_search_edit || strncasecmp($tbl_fields_type[$i], 'set', 3) && $in_zoom_search_edit) {
            $str .= '<select name="fields[' . $i . '][]" id="fieldID_' . $i . '">' . "\n";
        } else {
            $str .= '<select name="fields[' . $i . '][]" id="fieldID_' . $i . '"' . ' multiple="multiple" size="' . min(3, $cnt_value) . '">' . "\n";
        }
        for ($j = 0; $j < $cnt_value; $j++) {
            if (isset($fields[$i]) && is_array($fields[$i]) && in_array($value[$j], $fields[$i])) {
                $str .= '<option value="' . $value[$j] . '" Selected>' . $value[$j] . '</option>';
            } else {
                $str .= '<option value="' . $value[$j] . '">' . $value[$j] . '</option>';
            }
        }
        // end for
        $str .= '</select>' . "\n";
    } else {
        // o t h e r   c a s e s
        $the_class = 'textfield';
        $type = $tbl_fields_type[$i];
        if ($type == 'date') {
            $the_class .= ' datefield';
        } elseif ($type == 'datetime' || substr($type, 0, 9) == 'timestamp') {
            $the_class .= ' datetimefield';
        } elseif (substr($type, 0, 3) == 'bit') {
            $the_class .= ' bit';
        }
        if (isset($fields[$i]) && is_string($fields[$i])) {
            $str .= '<input type="text" name="fields[' . $i . ']"' . ' size="40" class="' . $the_class . '" id="fieldID_' . $i . '" value = "' . $fields[$i] . '"/>' . "\n";
        } else {
            $str .= '<input type="text" name="fields[' . $i . ']"' . ' size="40" class="' . $the_class . '" id="fieldID_' . $i . '" />' . "\n";
        }
    }
    return $str;
}
开发者ID:tolsasha,项目名称:Forum_PO,代码行数:99,代码来源:tbl_select.lib.php

示例6: PMA_dispRowForeignData

/**
 * Get HTML to display foreign data
 *
 * @param string  $backup_field         hidden input field
 * @param string  $column_name_appendix the name attribute
 * @param string  $onChangeClause       onchange clause for fields
 * @param integer $tabindex             tab index
 * @param integer $tabindex_for_value   offset for the values tabindex
 * @param integer $idindex              id index
 * @param string  $data                 data to edit
 * @param array   $foreignData          data about the foreign keys
 * @param boolean $readOnly             is display read only or not
 *
 * @return string                       an html snippet
 */
function PMA_dispRowForeignData($backup_field, $column_name_appendix, $onChangeClause, $tabindex, $tabindex_for_value, $idindex, $data, $foreignData, $readOnly)
{
    $html_output = '';
    $html_output .= $backup_field . "\n";
    $html_output .= '<input type="hidden"' . ' name="fields_type' . $column_name_appendix . '"' . ' value="foreign" />';
    $html_output .= '<select name="fields' . $column_name_appendix . '"' . ' ' . $onChangeClause . ' class="textfield"' . ($readOnly ? ' disabled' : '') . ' tabindex="' . ($tabindex + $tabindex_for_value) . '"' . ' id="field_' . $idindex . '_3">';
    $html_output .= PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], $data, $GLOBALS['cfg']['ForeignKeyMaxLimit']);
    $html_output .= '</select>';
    //Add hidden input, as disabled <select> input does not included in POST.
    if ($readOnly) {
        $html_output .= '<input name="fields' . $column_name_appendix . '"' . ' type="hidden" value="' . htmlspecialchars($data) . '">';
    }
    return $html_output;
}
开发者ID:wp-cloud,项目名称:phpmyadmin,代码行数:29,代码来源:insert_edit.lib.php

示例7: unNullify

                ?>
="return unNullify('<?php 
                echo urlencode($field);
                ?>
', '<?php 
                echo $jsvkey;
                ?>
')" tabindex="<?php 
                echo $tabindex + $tabindex_for_value;
                ?>
" id="field_<?php 
                echo $idindex;
                ?>
_3">
                <?php 
                echo PMA_foreignDropdown($disp_row, $foreign_field, $foreign_display, $data, 100);
                ?>
            </select>
            </td>
            <?php 
                unset($disp_row);
            } else {
                if ($cfg['LongtextDoubleTextarea'] && strstr($type, 'longtext')) {
                    ?>
            <td bgcolor="<?php 
                    echo $bgcolor;
                    ?>
">&nbsp;</td>
        </tr>
        <tr>
            <td colspan="4" align="right" bgcolor="<?php 
开发者ID:Apxe,项目名称:Rubin_final,代码行数:31,代码来源:tbl_change.php

示例8: PMA_getForeignData

                </select>
            </td>
            <td>
        <?php 
        // <markus@noga.de>
        $field = $fields_list[$i];
        $foreignData = PMA_getForeignData($foreigners, $field, false, '', '');
        if ($foreigners && isset($foreigners[$field]) && is_array($foreignData['disp_row'])) {
            // f o r e i g n    k e y s
            echo '            <select name="fields[' . $i . ']">' . "\n";
            // go back to first row
            // here, the 4th parameter is empty because there is no current
            // value of data for the dropdown (the search page initial values
            // are displayed empty)
            echo PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], '', $GLOBALS['cfg']['ForeignKeyMaxLimit']);
            echo '            </select>' . "\n";
        } elseif ($foreignData['foreign_link'] == true) {
            ?>
            <input type="text" name="fields[<?php 
            echo $i;
            ?>
]"
                id="field_<?php 
            echo md5($field);
            ?>
[<?php 
            echo $i;
            ?>
]"
                class="textfield" />
开发者ID:huangs0928,项目名称:zzlangshi,代码行数:30,代码来源:tbl_select.php

示例9: PMA_foreignDropdown

            <td>
        <?php 
        // <markus@noga.de>
        $field = $fields_list[$i];
        // do not use require_once here
        require './libraries/get_foreign.lib.php';
        // we got a bug report: in some cases, even if $disp is true,
        // there are no rows, so we add a fetch_array
        if ($foreigners && isset($foreigners[$field]) && isset($disp_row) && is_array($disp_row)) {
            // f o r e i g n    k e y s
            echo '            <select name="fields[' . $i . ']">' . "\n";
            // go back to first row
            // here, the 4th parameter is empty because there is no current
            // value of data for the dropdown (the search page initial values
            // are displayed empty)
            echo PMA_foreignDropdown($disp_row, $foreign_field, $foreign_display, '', $GLOBALS['cfg']['ForeignKeyMaxLimit']);
            echo '            </select>' . "\n";
        } elseif (isset($foreign_link) && $foreign_link == true) {
            ?>
            <input type="text" name="fields[<?php 
            echo $i;
            ?>
]"
                id="field_<?php 
            echo md5($field);
            ?>
[<?php 
            echo $i;
            ?>
]"
                class="textfield" />
开发者ID:BGCX261,项目名称:zhss-svn-to-git,代码行数:31,代码来源:tbl_select.php

示例10: unNullify

                ?>
="return unNullify('<?php 
                echo urlencode($field);
                ?>
', '<?php 
                echo $jsvkey;
                ?>
')" tabindex="<?php 
                echo $tabindex + $tabindex_for_value;
                ?>
" id="field_<?php 
                echo $idindex;
                ?>
_3">
                <?php 
                echo PMA_foreignDropdown($disp_row, $foreign_field, $foreign_display, $data, $cfg['ForeignKeyMaxLimit']);
                ?>
            </select>
            </td>
            <?php 
                unset($disp_row);
            } else {
                if ($cfg['LongtextDoubleTextarea'] && strstr($type, 'longtext')) {
                    ?>
            <td bgcolor="<?php 
                    echo $bgcolor;
                    ?>
">&nbsp;</td>
        </tr>
        <tr>
            <td colspan="4" align="right" bgcolor="<?php 
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:31,代码来源:tbl_change.php

示例11: _getForeignKeyInputBox

 /**
  * Provides html elements for search criteria inputbox
  * in case the column is a Foreign Key
  *
  * @param array  $foreignData     Foreign keys data
  * @param string $column_name     Column name
  * @param int    $column_index    Column index
  * @param array  $titles          Selected title
  * @param int    $foreignMaxLimit Max limit of displaying foreign elements
  * @param array  $criteriaValues  Array of search criteria inputs
  * @param string $column_id       Column's inputbox's id
  *
  * @return string HTML elements.
  */
 private function _getForeignKeyInputBox($foreignData, $column_name, $column_index, $titles, $foreignMaxLimit, $criteriaValues, $column_id)
 {
     $html_output = '';
     if (is_array($foreignData['disp_row'])) {
         $html_output .= '<select name="criteriaValues[' . $column_index . ']"' . ' id="' . $column_id . $column_index . '">';
         $html_output .= PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'], $foreignData['foreign_display'], '', $foreignMaxLimit);
         $html_output .= '</select>';
     } elseif ($foreignData['foreign_link'] == true) {
         $html_output .= '<input type="text" id="' . $column_id . $column_index . '"' . ' name="criteriaValues[' . $column_index . ']" id="field_' . md5($column_name) . '[' . $column_index . ']" class="textfield"' . (isset($criteriaValues[$column_index]) && is_string($criteriaValues[$column_index]) ? ' value="' . $criteriaValues[$column_index] . '"' : '') . ' />';
         $html_output .= '<a class="ajax browse_foreign" href="' . 'browse_foreigners.php' . PMA_URL_getCommon(array('db' => $this->_db, 'table' => $this->_table)) . '&amp;field=' . urlencode($column_name) . '&amp;fieldkey=' . $column_index . '&amp;fromsearch=1"';
         $html_output .= '>' . str_replace("'", "\\'", $titles['Browse']) . '</a>';
     }
     return $html_output;
 }
开发者ID:mercysmart,项目名称:naikelas,代码行数:28,代码来源:TableSearch.class.php


注:本文中的PMA_foreignDropdown函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。