add hide header to xlsx and printhtml
This commit is contained in:
+3
-3
@@ -5,7 +5,7 @@
|
|||||||
PHP Class : /Data/Xlsx.php
|
PHP Class : /Data/Xlsx.php
|
||||||
Created By : Siau Pheng ([email protected]).
|
Created By : Siau Pheng ([email protected]).
|
||||||
Created Date : November 18th, 2012.
|
Created Date : November 18th, 2012.
|
||||||
Last Modified : October 1st, 2026.
|
Last Modified : October 24th, 2026.
|
||||||
|
|
||||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||||
|
|
||||||
@@ -130,8 +130,8 @@ final class Xlsx {
|
|||||||
$this->sheet->writeTo('A'.(string) $this->baris, '');
|
$this->sheet->writeTo('A'.(string) $this->baris, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show_headers(): void {
|
public function show_headers(bool $is_hide=false): void {
|
||||||
$this->sheet->writeHeader(array_column($this->atabel, 'n'))
|
if (!$is_hide) $this->sheet->writeHeader(array_column($this->atabel, 'n'))
|
||||||
->applyFontStyleBold()
|
->applyFontStyleBold()
|
||||||
->applyTextCenter()
|
->applyTextCenter()
|
||||||
->applyBorder(Style::BORDER_STYLE_THIN);
|
->applyBorder(Style::BORDER_STYLE_THIN);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
Module : /Printer/PrintHTML.php
|
Module : /Printer/PrintHTML.php
|
||||||
Created By : Siau Pheng ([email protected]).
|
Created By : Siau Pheng ([email protected]).
|
||||||
Created Date : June 15th, 2008.
|
Created Date : June 15th, 2008.
|
||||||
Last Modified : October 2nd, 2026.
|
Last Modified : October 24th, 2026.
|
||||||
|
|
||||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||||
|
|
||||||
@@ -119,16 +119,16 @@ final class PrintHTML {
|
|||||||
echo '<br />';
|
echo '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show_headers(): void {
|
public function show_headers(bool $is_hide=false): void {
|
||||||
vprintf('<table class="%s"><thead>', [$this->css]);
|
vprintf('<table class="%s"><thead>', [$this->css]);
|
||||||
// 0-n, 1=l, 2-f, 3-a, 4-k
|
// 0-n, 1=l, 2-f, 3-a, 4-k
|
||||||
$head_out = "<tr>";
|
$head_out = "<tr>";
|
||||||
foreach ($this->atabel as $tabel) {
|
foreach ($this->atabel as $tabel) {
|
||||||
if ($tabel['k'] === 0) continue;
|
if ($tabel['k'] === 0) continue;
|
||||||
$head_out .= $this->set_align($tabel['n'], $tabel['l'], "C", false, true, $tabel['k']);
|
$head_out .= $this->set_align($tabel['n'], $tabel['l'], "C", false, true, $tabel['k'], ($is_hide?'d-none':''));
|
||||||
}
|
}
|
||||||
$head_out .= "</tr>";
|
$head_out .= "</tr>";
|
||||||
echo "</thead>".$head_out."<tbody>";
|
echo $head_out."</thead><tbody>";
|
||||||
// start content row
|
// start content row
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ final class PrintHTML {
|
|||||||
if ($line===true) {
|
if ($line===true) {
|
||||||
return "<tr><td colspan=\"".count($this->atabel)."\" class=\"".$tstyle." ".$extra."\">".$text."</td></tr>";
|
return "<tr><td colspan=\"".count($this->atabel)."\" class=\"".$tstyle." ".$extra."\">".$text."</td></tr>";
|
||||||
} else {
|
} else {
|
||||||
return (($head===true)?"<th":"<td").(($col>1)?" colspan=\"".(string)$col."\"":"")." class=\"".$tstyle." ".$extra."\" ".(($head===true)?"width=\"".(string)$width."\"":"").">".$text.(($head===true)?"</th>":"</td>");
|
return (($head===true)?"<th":"<td").(($col>1)?" colspan=\"".(string) $col."\"":"")." class=\"".$tstyle." ".$extra."\" ".(($head===true)?"width=\"".(string) $width."\"":"").">".$text.(($head===true)?"</th>":"</td>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user