⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 display_export.lib.php

📁 一个用PHP编写的
💻 PHP
📖 第 1 页 / 共 3 页
字号:
<?php/* $Id: display_export.lib.php,v 2.47.2.1 2006/06/15 20:22:56 lem9 Exp $ */// vim: expandtab sw=4 ts=4 sts=4:// Get relations & co. statusrequire_once('./libraries/relation.lib.php');$cfgRelation = PMA_getRelationsParam();// Check if we have native MS Excel export using PEAR class Spreadsheet_Excel_Writerif (!empty($GLOBALS['cfg']['TempDir'])) {    @include_once('Spreadsheet/Excel/Writer.php');    if (class_exists('Spreadsheet_Excel_Writer')) {        $xls = TRUE;    } else {        $xls = FALSE;    }} else {    $xls = FALSE;}function PMA_exportCheckboxCheck($str) {    if (isset($GLOBALS['cfg']['Export'][$str]) && $GLOBALS['cfg']['Export'][$str]) {        echo ' checked="checked"';    }}function PMA_exportIsActive($what, $val) {    if (isset($GLOBALS['cfg']['Export'][$what]) &&  $GLOBALS['cfg']['Export'][$what] == $val) {        echo ' checked="checked"';    }}?><form method="post" action="export.php" name="dump"><?php$hide_structure = false;$hide_sql       = false;$hide_xml       = (bool) ! (isset($db) && strlen($db));if ($export_type == 'server') {    echo PMA_generate_common_hidden_inputs('', '', 1);} elseif ($export_type == 'database') {    echo PMA_generate_common_hidden_inputs($db, '', 1);} else {    echo PMA_generate_common_hidden_inputs($db, $table, 1);    if (!isset($single_table)) {        $hide_structure = true;        $hide_sql       = true;    } else {        // just to keep this value for possible next display of this form after saving on server        echo '<input type="hidden" name="single_table" value="TRUE" />' . "\n";    }}echo '<input type="hidden" name="export_type" value="' . $export_type . '" />' . "\n";if (isset($sql_query)) {    echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />' . "\n";}?><script type="text/javascript" language="javascript">//<![CDATA[function hide_them_all() {    document.getElementById("csv_options").style.display = 'none';    document.getElementById("excel_options").style.display = 'none';    document.getElementById("latex_options").style.display = 'none';    document.getElementById("htmlexcel_options").style.display = 'none';    document.getElementById("htmlword_options").style.display = 'none';    document.getElementById("pdf_options").style.display = 'none';<?php if ($xls) { ?>    document.getElementById("xls_options").style.display = 'none';<?php } ?><?php if (!$hide_sql) { ?>    document.getElementById("sql_options").style.display = 'none';<?php } ?>    document.getElementById("none_options").style.display = 'none';}function show_checked_option() {    hide_them_all();    if (document.getElementById('radio_dump_latex').checked) {        document.getElementById('latex_options').style.display = 'block';    } else if (document.getElementById('radio_dump_htmlexcel').checked) {        document.getElementById('htmlexcel_options').style.display = 'block';    } else if (document.getElementById('radio_dump_pdf').checked) {        document.getElementById('pdf_options').style.display = 'block';    } else if (document.getElementById('radio_dump_htmlword').checked) {        document.getElementById('htmlword_options').style.display = 'block';<?php if ($xls) { ?>    } else if (document.getElementById('radio_dump_xls').checked) {        document.getElementById('xls_options').style.display = 'block';<?php } ?><?php if (!$hide_sql) { ?>    } else if (document.getElementById('radio_dump_sql').checked) {        document.getElementById('sql_options').style.display = 'block';<?php } ?><?php if (!$hide_xml) { ?>    } else if (document.getElementById('radio_dump_xml').checked) {        document.getElementById('none_options').style.display = 'block';<?php } ?>    } else if (document.getElementById('radio_dump_csv').checked) {        document.getElementById('csv_options').style.display = 'block';    } else if (document.getElementById('radio_dump_excel').checked) {        document.getElementById('excel_options').style.display = 'block';    } else {        if (document.getElementById('radio_dump_sql')) {            document.getElementById('radio_dump_sql').checked = true;            document.getElementById('sql_options').style.display = 'block';        } else if (document.getElementById('radio_dump_csv')) {            document.getElementById('radio_dump_csv').checked = true;            document.getElementById('csv_options').style.display = 'block';        } else {            document.getElementById('none_options').style.display = 'block';        }    }}//]]></script><fieldset id="fieldsetexport"><legend><?php echo $export_page_title; ?></legend><?php/*  * this table is needed to fix rendering in Opera <= 9 and Safari <= 2 * normaly just the two fieldset would have float: left */?><table><tr><td><div id="div_container_exportoptions"><fieldset id="exportoptions"><legend><?php echo $strExport; ?></legend>    <?php if ( ! empty( $multi_values ) ) { ?>    <div class="formelementrow">        <?php echo $multi_values; ?>    </div>    <?php } ?><?php if ( ! $hide_sql ) { /* SQL */ ?>    <div class="formelementrow">        <input type="radio" name="what" value="sql" id="radio_dump_sql"            onclick="                if (this.checked) {                    hide_them_all();                    document.getElementById('sql_options').style.display = 'block';                }; return true"            <?php PMA_exportIsActive('format', 'sql'); ?> />            <label for="radio_dump_sql"><?php echo $strSQL; ?></label>    </div><?php } /* LaTeX table */ ?>    <div class="formelementrow">        <input type="radio" name="what" value="latex" id="radio_dump_latex"            onclick="                if (this.checked) {                    hide_them_all();                    document.getElementById('latex_options').style.display = 'block';                }; return true"            <?php PMA_exportIsActive('format', 'latex'); ?> />        <label for="radio_dump_latex"><?php echo $strLaTeX; ?></label>    </div><?php /* PDF  */ ?>    <div class="formelementrow">        <input type="radio" name="what" value="pdf" id="radio_dump_pdf"            onclick="                if (this.checked) {                    hide_them_all();                    document.getElementById('pdf_options').style.display = 'block';                }; return true"            <?php PMA_exportIsActive('format', 'pdf'); ?> />        <label for="radio_dump_pdf"><?php echo $strPDF; ?></label>    </div><?php /* HTML Excel */ ?>    <div class="formelementrow">        <input type="radio" name="what" value="htmlexcel" id="radio_dump_htmlexcel"            onclick="                if (this.checked) {                    hide_them_all();                    document.getElementById('htmlexcel_options').style.display = 'block';                    document.getElementById('checkbox_dump_asfile').checked = true;                };  return true"            <?php PMA_exportIsActive('format', 'htmlexcel'); ?> />        <label for="radio_dump_htmlexcel"><?php echo $strHTMLExcel; ?></label>    </div><?php /* HTML Word */ ?>    <div class="formelementrow">        <input type="radio" name="what" value="htmlword" id="radio_dump_htmlword"            onclick="                if (this.checked) {                    hide_them_all();                    document.getElementById('htmlword_options').style.display = 'block';                    document.getElementById('checkbox_dump_asfile').checked = true;                };  return true"            <?php PMA_exportIsActive('format', 'htmlword'); ?> />        <label for="radio_dump_htmlword"><?php echo $strHTMLWord; ?></label>    </div><?php if ($xls) { /*  Native Excel */ ?>    <div class="formelementrow">        <input type="radio" name="what" value="xls" id="radio_dump_xls"            onclick="                if (this.checked) {                    hide_them_all();                    document.getElementById('xls_options').style.display = 'block';                    document.getElementById('checkbox_dump_asfile').checked = true;                };  return true"            <?php PMA_exportIsActive('format', 'xls'); ?> />        <label for="radio_dump_xls"><?php echo $strStrucNativeExcel; ?></label>    </div><?php } /* Excel CSV */ ?>    <div class="formelementrow">        <input type="radio" name="what" value="excel" id="radio_dump_excel"            onclick="                if (this.checked) {                    hide_them_all();                    document.getElementById('excel_options').style.display = 'block';                }; return true"            <?php PMA_exportIsActive('format', 'excel'); ?> />        <label for="radio_dump_excel"><?php echo $strStrucExcelCSV; ?></label>    </div><?php /* General CSV */ ?>    <div class="formelementrow">        <input type="radio" name="what" value="csv" id="radio_dump_csv"            onclick="if                (this.checked) {                    hide_them_all();                    document.getElementById('csv_options').style.display = 'block';                 }; return true"             <?php PMA_exportIsActive('format', 'csv'); ?> />        <label for="radio_dump_csv"><?php echo $strStrucCSV;?></label>    </div><?php if (!$hide_xml) { /* XML */ ?>    <div class="formelementrow">        <input type="radio" name="what" value="xml" id="radio_dump_xml"            onclick="                if (this.checked) {                    hide_them_all();                    document.getElementById('none_options').style.display = 'block';                }; return true"            <?php PMA_exportIsActive('format', 'xml'); ?> />        <label for="radio_dump_xml"><?php echo $strXML; ?></label>    </div><?php } ?></fieldset></div></td><td><div id="div_container_sub_exportoptions"><?php if ( ! $hide_sql ) { /* SQL options */ ?><fieldset id="sql_options">    <legend>    <?php    echo $strSQLOptions;    $goto_documentation = '<a href="./Documentation.html#faqexport" target="documentation">';    echo ( $cfg['ReplaceHelpImg'] ? '' : '(' )       . $goto_documentation       . ( $cfg['ReplaceHelpImg'] ?             '<img class="icon" src="' . $pmaThemeImage . 'b_help.png" alt="'             .$strDocu . '" width="11" height="11" />'           : $strDocu )       . '</a>' . ($cfg['ReplaceHelpImg'] ? '' : ')');    ?>    </legend>    <div class="formelementrow">        <?php echo $strAddHeaderComment; ?>:<br />        <input type="text" name="header_comment" size="30"            value="<?php echo $cfg['Export']['sql_header_comment']; ?>" />    </div>    <div class="formelementrow">        <input type="checkbox" name="use_transaction" value="yes"            id="checkbox_use_transaction"            <?php PMA_exportCheckboxCheck('sql_use_transaction'); ?> />        <label for="checkbox_use_transaction">            <?php echo $strEncloseInTransaction; ?></label>    </div>    <div class="formelementrow">        <input type="checkbox" name="disable_fk" value="yes"            id="checkbox_disable_fk"            <?php PMA_exportCheckboxCheck('sql_disable_fk'); ?> />        <label for="checkbox_disable_fk">            <?php echo $strDisableForeignChecks; ?></label>    </div><?php if (PMA_MYSQL_INT_VERSION >= 40100) { ?>    <label for="select_sql_compat">        <?php echo $strSQLExportCompatibility; ?>:</label>    <select name="sql_compat" id="select_sql_compat">        <?php        $compats = array('NONE');        if (PMA_MYSQL_INT_VERSION >= 40101) {            $compats[] = 'ANSI';            $compats[] = 'DB2';            $compats[] = 'MAXDB';            $compats[] = 'MYSQL323';            $compats[] = 'MYSQL40';            $compats[] = 'MSSQL';            $compats[] = 'ORACLE';            $compats[] = 'POSTGRESQL';            if (PMA_MYSQL_INT_VERSION >= 50001) {                $compats[] = 'TRADITIONAL';            }        }        foreach ($compats as $x) {            echo '<option value="' . $x . '"'                . ($cfg['Export']['sql_compat'] == $x ? ' selected="selected"' : '' )                . '>' . $x . '</option>' . "\n";        }        ?>    </select>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -