Documentation TYPO3 par Ameos

htmlexcel.php

00001 <?php
00002 /* $Id: htmlexcel.php,v 1.1 2005/03/06 12:52:20 nijel Exp $ */
00003 // vim: expandtab sw=4 ts=4 sts=4:
00004 
00016 function PMA_exportComment($text) {
00017     return TRUE;
00018 }
00019 
00027 function PMA_exportFooter() {
00028     ?>
00029 </table>
00030 </div>
00031 </body>
00032 </html>
00033     <?php
00034     return TRUE;
00035 }
00036 
00044 function PMA_exportHeader() {
00045     global $charset, $charset_of_file;
00046     ?>
00047 <html xmlns:o="urn:schemas-microsoft-com:office:office"
00048 xmlns:x="urn:schemas-microsoft-com:office:excel"
00049 xmlns="http://www.w3.org/TR/REC-html40">
00050 
00051 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00052 <html>
00053 <head>
00054         <meta http-equiv="Content-type" content="text/html;charset=<?php echo isset($charset_of_file) ? $charset_of_file : $charset; ?>" />
00055 <style id="Classeur1_16681_Styles">
00056 </style>
00057 
00058 </head>
00059 <body>
00060 
00061 <div id="Classeur1_16681" align=center x:publishsource="Excel">
00062 
00063 <table x:str border=0 cellpadding=0 cellspacing=0 width=100% style='border-collapse: collapse'>
00064 <?php
00065 
00066     return TRUE;
00067 }
00068 
00078 function PMA_exportDBHeader($db) {
00079     return TRUE;
00080 }
00081 
00091 function PMA_exportDBFooter($db) {
00092     return TRUE;
00093 }
00094 
00104 function PMA_exportDBCreate($db) {
00105     return TRUE;
00106 }
00107 
00121 function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
00122     global $what;
00123 
00124     // Gets the data from the database
00125     $result      = PMA_DBI_query($sql_query, NULL, PMA_DBI_QUERY_UNBUFFERED);
00126     $fields_cnt  = PMA_DBI_num_fields($result);
00127 
00128     // If required, get fields name at the first line
00129     if (isset($GLOBALS[$what . '_shownames']) && $GLOBALS[$what . '_shownames'] == 'yes') {
00130         $schema_insert = '<tr>';
00131         for ($i = 0; $i < $fields_cnt; $i++) {
00132             $schema_insert .= '<td class=xl2216681 nowrap><b>' . htmlspecialchars(stripslashes(PMA_DBI_field_name($result, $i))) . '</b></td>';
00133         } // end for
00134         $schema_insert .= '</tr>';
00135         if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
00136     } // end if
00137 
00138     // Format the data
00139     while ($row = PMA_DBI_fetch_row($result)) {
00140         $schema_insert = '<tr>';
00141         for ($j = 0; $j < $fields_cnt; $j++) {
00142             if (!isset($row[$j]) || is_null($row[$j])) {
00143                 $value = $GLOBALS[$what . '_replace_null'];
00144             } else if ($row[$j] == '0' || $row[$j] != '') {
00145                 $value = $row[$j];
00146             } else {
00147                 $value = '';
00148             }
00149             $schema_insert .= '<td class=xl2216681 nowrap>' . htmlspecialchars($value) . '</td>';
00150         } // end for
00151         $schema_insert .= '</tr>';
00152         if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
00153     } // end while
00154     PMA_DBI_free_result($result);
00155 
00156     return TRUE;
00157 }
00158 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6