Browse Source

Обновление файла.

master
Repellent 8 years ago
parent
commit
ccf6c925c9
  1. 11
      import/excel_reader.php

11
import/excel_reader.php

@ -584,7 +584,7 @@ class Spreadsheet_Excel_Reader {
// DUMP AN HTML TABLE OF THE ENTIRE XLS DATA // DUMP AN HTML TABLE OF THE ENTIRE XLS DATA
// ========================================= // =========================================
function dump($row_numbers=false,$col_letters=false,$sheet=0,$table_class='excel') { function dump($row_numbers=false,$col_letters=false,$sheet=0,$table_class='excel',$styles=true) {
$out = "<table class=\"$table_class\" cellspacing=0>"; $out = "<table class=\"$table_class\" cellspacing=0>";
if ($col_letters) { if ($col_letters) {
$out .= "<thead>\n\t<tr>"; $out .= "<thead>\n\t<tr>";
@ -596,7 +596,7 @@ class Spreadsheet_Excel_Reader {
if ($this->colhidden($i,$sheet)) { if ($this->colhidden($i,$sheet)) {
$style .= "display:none;"; $style .= "display:none;";
} }
$out .= "\n\t\t<th style=\"$style\">" . strtoupper($this->colindexes[$i]) . "</th>"; $out .= "\n\t\t<th".($styles ? " style=\"$style\"":"").">" . strtoupper($this->colindexes[$i]) . "</th>";
} }
$out .= "</tr></thead>\n"; $out .= "</tr></thead>\n";
} }
@ -608,7 +608,7 @@ class Spreadsheet_Excel_Reader {
if ($this->rowhidden($row,$sheet)) { if ($this->rowhidden($row,$sheet)) {
$style .= "display:none;"; $style .= "display:none;";
} }
$out .= "\n\t<tr style=\"$style\">"; $out .= "\n\t<tr".($styles ? " style=\"$style\"":"").">";
if ($row_numbers) { if ($row_numbers) {
$out .= "\n\t\t<th>$row</th>"; $out .= "\n\t\t<th>$row</th>";
} }
@ -628,11 +628,12 @@ class Spreadsheet_Excel_Reader {
if ($this->colhidden($col,$sheet)) { if ($this->colhidden($col,$sheet)) {
$style .= "display:none;"; $style .= "display:none;";
} }
$out .= "\n\t\t<td style=\"$style\"" . ($colspan > 1?" colspan=$colspan":"") . ($rowspan > 1?" rowspan=$rowspan":"") . ">"; $out .= "\n\t\t<td".($styles ? " style=\"$style\"":""). ($colspan > 1?" colspan=$colspan":"") . ($rowspan > 1?" rowspan=$rowspan":"") . ">";
$val = $this->val($row,$col,$sheet); $val = $this->val($row,$col,$sheet);
$val = ($val===floatval(0) ? '0' : $val);
if ($val=='') { $val="&nbsp;"; } if ($val=='') { $val="&nbsp;"; }
else { else {
$val = htmlentities($val); $val = htmlentities($val,ENT_QUOTES,$this->_defaultEncoding);
$link = $this->hyperlink($row,$col,$sheet); $link = $this->hyperlink($row,$col,$sheet);
if ($link!='') { if ($link!='') {
$val = "<a href=\"$link\">$val</a>"; $val = "<a href=\"$link\">$val</a>";

Loading…
Cancel
Save