__css = $style; } public function add_field($tnama="", $nlebar=0, $talign="L", $ffunc="", $nkol=1) {//up 2012-03-07 $this->__atabel[] = [$tnama, $nlebar, $ffunc, $talign, $nkol]; } public function show_fields() {//todo: deleted } public function clear() { $this->__avalue = []; } public function add_value() { $tmp_arr = func_get_args(); if (is_array($tmp_arr[0])) $tmp_arr = $tmp_arr[0]; //up 2009-09-27 $tmp_out = ""; for ($i=0; $i__atabel); $i++) { $tmp_val = $tmp_arr[$i]; if (is_array($this->__atabel[$i][2]) && trim("".$tmp_val)<>"") { //up 2010-05-28 $tmp_val = $this->__atabel[$i][2][$tmp_val]; } else if (function_exists($this->__atabel[$i][2]) && trim("".$tmp_val)<>"") { $tmp_val = call_user_func($this->__atabel[$i][2], $tmp_val); } $tmp_val = $this->set_align($tmp_val, $this->__atabel[$i][1], $this->__atabel[$i][3]); $tmp_out .= $tmp_val; } $tmp_out .= ""; $this->__avalue[] = $tmp_out; } public function add_span() { $tmp_arr = func_get_args(); $tmp_out = ""; for ($i=0; $i"") { $tmp_val[0] = call_user_func($tmp_val[3], $tmp_val[0]); } } $tmp_val = $this->set_align($tmp_val[0], 0, $tmp_val[2], false, false, $tmp_val[1], $tmp_val[4]); $tmp_out .= $tmp_val; } $tmp_out .= ""; $this->__avalue[] = $tmp_out; } public function add_stamp($ctk_ke=1, $bnama=false) {//up 2023-10-13 $this->__tstamp = $this->get_stamp($ctk_ke, $bnama); } public function get_stamp($ctk_ke=1, $bnama=false) {//up 2012-10-11 return $_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):""); } public function show($jumlah_ctk=1) {//up 2012-10-11 $out = "__css."\">"; // header out $tmp_out = ""; for ($i=0; $i__atabel); $i++) { if ($this->__atabel[$i][4]==0) continue; $tmp_out .= $this->set_align($this->__atabel[$i][0], $this->__atabel[$i][1], "C", false, true, $this->__atabel[$i][4]); } $tmp_out .= ""; $out = "".$tmp_out.""; // content out for ($i=0; $i__avalue); $i++) { $tmp_str = $this->__avalue[$i]; if (strpos($tmp_str, "_LINE")>0) $tmp_str = "
"; $out .= $tmp_str; } $out .= "
"; $out .= $this->__tstamp; for ($i=1; $i<=$jumlah_ctk; $i++) echo $out; } public function set_align($ttext, $nlen, $tdir="L", $bline=false, $bhead=false, $ncol=1, $textra="") {//up 2011-04-14 $tstyle = $this->create_style($tdir); if ($bline===true) { return "__atabel)."\" class=\"".$tstyle." ".$textra."\">".$ttext.""; } else { return (($bhead===true)?"1)?" colspan=\"".$ncol."\"":"")." class=\"".$tstyle." ".$textra."\" ".(($bhead===true)?"width=\"".$nlen."\"":"").">".$ttext.(($bhead===true)?"":""); } } private function create_style($tstyle="L") { //up 2014-10-12 // style = Left Right Center No-Border No-Left No-Right Bold Italic $apad = ["L"=>"l", "R"=>"r", "C"=>"c", "NB"=>"nb", "NL"=>"noleft", "NR"=>"noright", "B"=>"b", "I"=>"i"]; $_astyle = explode(",", $tstyle); $thasil = ""; foreach ($_astyle as $_key => $_val) { $thasil .= " ".$apad[$_val]; } return substr($thasil,1); } public function add_pagebreak() {}//delete: not used anymore } ?>