fixed simplexls

This commit is contained in:
2023-11-17 17:06:00 +07:00
parent e7d78f3251
commit f66f6cdf1e
+4 -8
View File
@@ -17,14 +17,12 @@ declare(strict_types=1);
namespace siaupheng\fonia3\Data;
final class SimpleXLS {
private $__tnamafile = null;
private $__wbook = null;
private $__atabel = [];
private $__aheader = [];
private $__avalue = [];
public function __construct($tnama_file="", $oprop=[]) {
$this->__tnamafile = $tnama_file;
public function __construct($oprop=[]) {
$this->__wbook = new \Shuchkin\SimpleXLSXGen();
$this->__wbook
->setAuthor($_SESSION['__WEB_APP']['APP_NAME']." v".$_SESSION['__WEB_APP']['APP_VER'])
@@ -47,7 +45,7 @@ final class SimpleXLS {
public function add_empty_row($nrow=1) {
$_jkolom = count($this->__atabel);
for ($i=0; $i<$nrow; $i++) {
$this->__avalue[] = array_values(array_fill(0,$_jkolom,""));
$this->__avalue[] = array_fill(0,$_jkolom,"");
}
}
@@ -62,7 +60,7 @@ final class SimpleXLS {
$_jkolom = count($this->__atabel);
if ($_jkolom>0) $_jkolom--;
foreach ($this->__aheader as $_key => $_val) {
$this->__avalue[] = array_values(array_merge(["<b>".$_val."</b>"],array_fill(1,$_jkolom,null)));
$this->__avalue[] = array_merge(["<b>".$_val."</b>"],array_fill(1,$_jkolom,null));
}
if ($bw_header==true) $this->show_headers();
}
@@ -84,9 +82,7 @@ final class SimpleXLS {
}
public function add_stamp($ctk_ke=1, $bnama=false) {
$_jkolom = count($this->__atabel);
if ($_jkolom>0) $_jkolom--;
$this->__avalue[] = array_values(array_merge(["<i>".$_SESSION['__WEB_APP']['APP_NAME']."v".$_SESSION['__WEB_APP']['APP_VER'].date("\@ymd.His")."-".user_id(3).(($bnama==true)?"/".strtoupper(user_user()):"").(($ctk_ke>0)?"#".isi_nol($ctk_ke,2):"")."</i>"],array_fill(1,$_jkolom,null)));
$this->__avalue[] = ["<i>".$_SESSION['__WEB_APP']['APP_NAME']."v".$_SESSION['__WEB_APP']['APP_VER'].date("\@ymd.His")."-".user_id(3).(($bnama==true)?"/".strtoupper(user_user()):"").(($ctk_ke>0)?"#".isi_nol($ctk_ke,2):"")."</i>"];
}
public function get_stamp($ctk_ke=1, $bnama=false) {