first commit

This commit is contained in:
2026-10-29 13:34:31 +07:00
commit 45e4595c57
255 changed files with 35457 additions and 0 deletions
@@ -0,0 +1,83 @@
<?php
/*******************************************************************
PHP Class : /Controller/Table/Gel/GajiController
Description : Master Standar Gaji
Created By : Siau Pheng ([email protected]).
Created Date : September 17th, 2014.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
declare(strict_types=1);
namespace App\Controller\Table\Gel;
use flight\Engine;
use flight\database\SimplePdo;
use flight\Session;
use Webapp\DB\SQL;
use Webapp\Web\Form;
use Webapp\Web\Param;
class GajiController {
private string $mode_detail;
private int $id_reg;
protected Engine $app;
protected SimplePdo $db;
public function __construct(Engine $app, SimplePdo $db, Session $session) {
$this->app = $app;
$this->db = $db;
$this->mode_detail = Param::Get("mode_detail", "");
$this->id_reg = Param::Int("REG_ID", $session->get('WEB_APP')['REG_ID']);
}
public function form_gaji() {
if ( $this->mode_detail == "save" ) {
$sql = new SQL($this->app);
$sql->set_table("gel_config");
$sql->add_param("LEMBUR");
$sql->add_param("BONUS1");
$sql->add_param("BONUS2");
$sql->add_where("REG_ID");
$sql->UpdateDB();
$this->mode_detail = "view";
}
$atabel = [ 'REG_ID'=>0, 'LEMBUR'=>0, 'BONUS1'=>0, 'BONUS2'=>0 ];
if ($this->id_reg > 0) {
$atabel = $this->db->fetchRow("SELECT * FROM gel_config WHERE REG_ID=?", [$this->id_reg]);
}
$benable = ($this->mode_detail === "update") ? true : false;
$form = new Form($this->app);
$tlembur = $form->textbox("_", "LEMBUR", $atabel['LEMBUR'], $benable, false, "double", "nilai lembur harian");
$tbonus1 = $form->textbox("_", "BONUS1", $atabel['BONUS1'], $benable, false, "double", "nilai bonus mingguan");
$tbonus2 = $form->textbox("_", "BONUS2", $atabel['BONUS2'], $benable, false, "double", "nilai bonus bulanan");
$ajson['html'] = '
<div class="row mb-1">
<label class="col-sm-6 col-lg-5 col-form-label" for="LEMBUR">Lembur Harian</label>
<div class="col">'.$tlembur.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-6 col-lg-5 col-form-label" for="BONUS1">Bonus Mingguan</label>
<div class="col">'.$tbonus1.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-6 col-lg-5 col-form-label" for="BONUS2">Bonus Bulanan</label>
<div class="col">'.$tbonus2.'</div>
</div>
<input type="hidden" id="REG_ID" value="'.$atabel['REG_ID'].'" >
<input type="hidden" id="mode_detail" value="'.$this->mode_detail.'" >';
$this->app->json($ajson);
}
public function index() {
$this->app->json(['html' => '<div id="divMaster">&nbsp;</div>' ]);
}
}
+105
View File
@@ -0,0 +1,105 @@
<?php
/*******************************************************************
// PHP Class : /Controller/Table/Gel/GrupController
Description : Master Grup Rekening
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
declare(strict_types=1);
namespace App\Controller\Table\Gel;
use flight\Engine;
use flight\database\SimplePdo;
use Webapp\DB\SQL;
use Webapp\Web\Form;
use Webapp\Web\Param;
use Webapp\Web\Table;
class GrupController {
private string $mode_detail;
private int $id_grup;
protected Engine $app;
protected SimplePdo $db;
public function __construct(Engine $app, SimplePdo $db) {
$this->app = $app;
$this->db = $db;
$this->mode_detail = Param::Get("mode_detail", "");
$this->id_grup = Param::Int("Grup_RekID", 0);
}
public function table_detail() {
if (in_array($this->mode_detail, ["insert","update","delete"])) {
$sql = new SQL($this->app);
$sql->set_table("gel_acc_grup");
$sql->add_param("Nama_Grup");
$sql->add_param("Aktif");
$sql->add_param_userid();
$sql->add_where("Grup_RekID");
if ($this->mode_detail === "insert") {
$sql->InsertDB();
} else if ($this->mode_detail === "update") {
$sql->UpdateDB();
} else if ($this->mode_detail === "delete") {
$sql->DeleteDB();
}
}
$tcari = Param::Get("Cari_Rek");
$tsql = ''; $asql = [];
if (!empty($tcari)) {
$tsql = 'Nama_Grup LIKE ?';
$asql[] = '%'. $tcari .'%';
}
$obj = new Table($this->app);
$obj->set_table("gel_acc_grup", "*", $tsql, $asql);
$obj->add_field("Grup_RekID", "ID", "hid");
$obj->add_field("Nama_Grup", "Nama Grup Rekening", "awr");
$obj->add_field("Aktif", "Aktif", "c", "checkbox");
$obj->set_field_order("Nama_Grup", "A");
$obj->add_row_btn("clipboard", "Ubah", "RekGrupJS.detail_ubah");
$obj->add_row_btn("trash", "Hapus", "RekGrupJS.detail_hapus");
$obj->set_func_btn("RekGrupJS.detail_tambah", "+ Grup Rekening");
$this->app->json([ $obj->json_table("divDetail") ]);
}
public function form_grup() {
$atabel = [ 'Grup_RekID'=>0, 'Nama_Grup'=>"", 'Aktif'=>1 ];
if ($this->id_grup > 0) {
$atabel = $this->db->fetchRow("SELECT * FROM gel_acc_Grup WHERE Grup_RekID=?", [$this->id_grup]);
}
$form = new Form($this->app);
$tnama = $form->textbox("_", "Nama_Grup", $atabel['Nama_Grup'], true, true, "text", "nama grup rekening");
$taktif = $form->radio("_", "Aktif", $atabel['Aktif'], true, false, [1=>"Aktif",0=>"Tidak"]);
$ajson['html'] = '
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Nama_Grup">Nama Grup</label>
<div class="col">'.$tnama.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Aktif">Status Aktif ?</label>
<div class="col d-flex gap-2">'.$taktif.'</div>
</div>
<input type="hidden" id="Grup_RekID" value="'.$atabel['Grup_RekID'].'" >
<input type="hidden" id="mode_detail" value="'.$this->mode_detail.'" >';
$this->app->json($ajson);
}
public function index() {
$this->app->json(['html' => '
<div class="fade-in"><div class="card"><div class="card-header custom-style">Daftar Grup Rekening</div><div class="card-body"><div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Rek" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divDetail">&nbsp;</div></div></div></div>'
]);
}
}
@@ -0,0 +1,126 @@
<?php
/*******************************************************************
PHP Class : /Controller/Table/Gel/KaryawanController
Description : Master Standar Gaji
Created By : Siau Pheng ([email protected]).
Created Date : September 17th, 2014.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
declare(strict_types=1);
namespace App\Controller\Table\Gel;
use flight\Engine;
use flight\database\SimplePdo;
use Webapp\DB\SQL;
use Webapp\Web\Form;
use Webapp\Web\Param;
use Webapp\Web\Table;
class KaryawanController {
private string $mode_detail;
private int $id_karya;
protected Engine $app;
protected SimplePdo $db;
public function __construct(Engine $app, SimplePdo $db) {
$this->app = $app;
$this->db = $db;
$this->mode_detail = Param::Get("mode_detail", "");
$this->id_karya = Param::Int("KaryaID", 0);
}
public function table_detail() {
if (in_array($this->mode_detail, ["insert","update","delete"])) {
$sql = new SQL($this->app);
$sql->set_table("para_karyawan");
$sql->add_param("Nama_Karya");
$sql->add_param("Gaji_Harian");
$sql->add_param_date("Tgl_Masuk");
$sql->add_param_date("Tgl_Keluar");
$sql->add_param("Aktif");
$sql->add_param_userid();
$sql->add_where("KaryaID");
if ($this->mode_detail === "insert") {
$sql->InsertDB();
} else if ($this->mode_detail === "update") {
$sql->UpdateDB();
} else if ($this->mode_detail === "delete") {
$sql->DeleteDB();
}
}
$tcari = Param::Get("Cari_Karya");
$tsql = ''; $asql = [];
if (!empty($tcari)) {
$tsql = 'Nama_Karya LIKE ?';
$asql[] = '%'. $tcari .'%';
}
$obj = new Table($this->app);
$obj->set_table("para_karyawan", "*", $tsql, $asql);
$obj->add_field("KaryaID", "ID", "hid");
$obj->add_field("Nama_Karya", "Nama Karyawan", "awr");
$obj->add_field("Gaji_Harian", "Gaji Harian", "r", "rupiah");
$obj->add_field("Tgl_Masuk", "Tgl. Masuk", "c", "sqltgl");
$obj->add_field("Tgl_Keluar", "Tgl. Keluar", "c", "sqltgl");
$obj->add_field("Aktif", "Aktif", "c", "checkbox");
$obj->set_field_order("Nama_Karya", "A");
$obj->add_row_btn("clipboard", "Ubah", "KaryawanJS.detail_ubah");
$obj->add_row_btn("trash", "Hapus", "KaryawanJS.detail_hapus");
$obj->set_func_btn("KaryawanJS.detail_tambah", "+ Karyawan");
$this->app->json([ $obj->json_table("divDetail") ]);
}
public function form_karya() {
$atabel = [ 'KaryaID'=>0, 'Nama_Karya'=>"", 'Gaji_Harian'=>0, 'Tgl_Masuk'=>tgl_ymd(), 'Tgl_Keluar'=>'0000-00-00', 'Aktif'=>1 ];
if ($this->id_karya > 0) {
$atabel = $this->db->fetchRow("SELECT * FROM para_karyawan WHERE KaryaID=?", [$this->id_karya]);
}
$form = new Form($this->app);
$tnama = $form->textbox("_", "Nama_Karya", $atabel['Nama_Karya'], true, true, "text", "nama karyawan");
$tgaji = $form->textbox("_", "Gaji_Harian", $atabel['Gaji_Harian'], true, true, "double", "gaji harian");
$tmasuk = $form->datebox("_", "Tgl_Masuk", $atabel['Tgl_Masuk'], true, false);
$tkeluar = $form->datebox("_", "Tgl_Keluar", $atabel['Tgl_Keluar'], true, false);
$taktif = $form->radio("_", "Aktif", $atabel['Aktif'], true, true, ['1'=>"Aktif",'0'=>"Tidak"]);
$ajson['html'] = '
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Nama_Karya">Nama Karyawan</label>
<div class="col">'.$tnama.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Gaji_Harian">Gaji Harian</label>
<div class="col-sm-6 col-lg-5">'.$tgaji.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Tgl_Masuk">Tanggal Masuk</label>
<div class="col-sm-6 col-lg-5">'.$tmasuk.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Tgl_Keluar">Tanggal Keluar</label>
<div class="col-sm-6 col-lg-5">'.$tkeluar.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Aktif">Status Aktif ?</label>
<div class="col d-flex gap-2">'.$taktif.'</div>
</div>
<input type="hidden" id="KaryaID" value="'.$atabel['KaryaID'].'" >
<input type="hidden" id="mode_detail" value="'.$this->mode_detail.'" >';
$this->app->json($ajson);
}
public function index() {
$this->app->json(['html' => '
<div class="fade-in"><div class="card"><div class="card-header custom-style">Daftar Karyawan</div><div class="card-body"><div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Karya" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divDetail">&nbsp;</div></div></div></div>'
]);
}
}
+210
View File
@@ -0,0 +1,210 @@
<?php
/*******************************************************************
PHP Class : /Controller/Table/Gel/RekController
Description : Master Rekening
Created By : Siau Pheng ([email protected]).
Created Date : December 7th, 2010.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
declare(strict_types=1);
namespace App\Controller\Table\Gel;
use App\Utils\Invesa;
use flight\Engine;
use flight\database\SimplePdo;
use flight\Session;
use Webapp\DB\SQL;
use Webapp\Printer\PrintHTML;
use Webapp\Web\Form;
use Webapp\Web\Param;
use Webapp\Web\Table;
class RekController {
private string $reg_name;
private int $max_level;
private string $mode_detail;
private string $kode_rek;
protected Engine $app;
protected SimplePdo $db;
public function __construct(Engine $app, SimplePdo $db, Session $session) {
$this->app = $app;
$this->db = $db;
$this->reg_name = (string) $session->get('WEB_APP')['REG_NAME'];
$this->max_level = (int) $session->get('APP_GEL')['MAX_LEVEL'] ?? 5;
$this->mode_detail = Param::Get("mode_detail", "");
$this->kode_rek = Param::Get("Kode_Rek", "");
}
public function table_detail() {
if (in_array($this->mode_detail, ["insert","update","delete"])) {
$sql = new SQL($this->app);
$sql->set_table("gel_acc");
$sql->add_param("Kode_Induk");
$sql->add_param("Nama_Rek");
$sql->add_param("Grup_RekID");
$sql->add_param("Level");
$sql->add_param("Mode");
$sql->add_param("Kas_Rek");
$sql->add_param("Aktif");
$sql->add_param_userid();
$sql->add_where("Kode_Rek");
if ($this->mode_detail === "insert") {
$sql->add_param("Kode_Rek");
$sql->InsertDB();
} else if ($this->mode_detail === "update") {
$sql->UpdateDB();
} else if ($this->mode_detail === "delete") {
$sql->DeleteDB();
}
}
$tcari = Param::Get("Cari_Rek");
$tsql = ''; $asql = [];
if (!empty($tcari)) {
$tsql = 'CONCAT(A.Kode_Rek,A.Nama_Rek) LIKE ?';
$asql[] = '%'. $tcari .'%';
}
$obj = new Table($this->app);
$obj->set_table("gel_acc A LEFT JOIN gel_acc_grup G ON (A.Grup_RekID=G.Grup_RekID)", "A.*,G.Nama_Grup", $tsql, $asql);
$obj->add_field("Kode_Rek", "Kode", "c");
$obj->add_field("Nama_Rek", "Nama Rekening", "awr");
$obj->add_field("Nama_Grup", "Grup", "l");
$obj->add_field("Level", "Level", "c");
$obj->add_field("Mode", "Mode", "c");
$obj->add_field("Aktif", "Aktif", "c", "checkbox");
$obj->set_row_color("Mode", "G", "rblue");
$obj->set_field_order("Kode_Rek", "A");
$obj->add_row_btn("clipboard", "Ubah", "RekJS.detail_ubah");
$obj->add_row_btn("trash", "Hapus", "RekJS.detail_hapus");
$obj->set_func_btn("RekJS.detail_tambah", "+ Rekening");
$this->app->json([ $obj->json_table("divDetail") ]);
}
public function form_rek() {
$atabel = [ 'Kode_Rek'=>0, 'Nama_Rek'=>"", 'Kode_Induk'=>0, 'Grup_RekID'=>0, 'Level'=>1, 'Mode'=>"D", 'Kas_Rek'=>0, 'Aktif'=>1 ];
if (!empty($this->kode_rek)) {
$atabel = $this->db->fetchRow("SELECT * FROM gel_acc WHERE Kode_Rek=?", [$this->kode_rek]);
}
$form = new Form($this->app);
$tgrup = $form->option_db("_", "Grup_RekID", $atabel['Grup_RekID'], true, false, "gel_acc_grup", ["Grup_RekID","Nama_Grup"], "Aktif=1 ORDER BY Grup_RekID");
$tinduk = $form->option_db("_", "Kode_Induk", $atabel['Kode_Induk'], true, false, "gel_acc", ["Kode_Rek","Nama_Rek"], "Mode='G' AND Aktif=1 ORDER BY Kode_Rek", [0,"TOP LEVEL"]);
$tkode = $form->textbox("_", "Kode_Rek", $atabel['Kode_Rek'], true, false, "text", "kode rekening");
$tnama = $form->textbox("_", "Nama_Rek", $atabel['Nama_Rek'], true, true, "text", "nama rekening");
$tlevel = $form->option("_", "Level", $atabel['Level'], true, false, $this->Level_Array());
$tmode = $form->radio("_", "Mode", $atabel['Mode'], true, true, ['G'=>"Grup",'D'=>"Detail"]);
$tkas_rek = $form->radio("_", "Kas_Rek", $atabel['Kas_Rek'], true, true, ['1'=>"Ya",'0'=>"Tidak"]);
$taktif = $form->radio("_", "Aktif", $atabel['Aktif'], true, true, ['1'=>"Aktif",'0'=>"Tidak"]);
$ajson['html'] = '
<div class="row mb-1">
<label class="col-sm-5 col-lg-2 col-form-label" for="Grup_RekID">Grup Rekening</label>
<div class="col-sm-7 col-lg-4">'.$tgrup.'</div>
<label class="col-sm-5 col-lg-2 col-form-label" for="Aktif">Status Aktif ?</label>
<div class="col d-flex gap-2">'.$taktif.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-5 col-lg-2 col-form-label" for="Kode_Rek">Kode Rekening</label>
<div class="col-sm-7 col-lg-4">'.$tkode.'</div>
<label class="col-sm-5 col-lg-2 col-form-label" for="Kas_Rek">Rekening Kas ?</label>
<div class="col d-flex gap-2">'.$tkas_rek.Invesa::Form_Info("Rekening untuk Transaksi Penerimaan / Pembayaran.").'</div>
</div>
<div class="row mb-1">
<label class="col-sm-5 col-lg-2 col-form-label" for="Kode_Induk">Rekening Induk</label>
<div class="col-sm-7 col-lg-10">'.$tinduk.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-5 col-lg-2 col-form-label" for="Nama_Rek">Nama Rekening</label>
<div class="col-sm-7 col-lg-10">'.$tnama.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-5 col-lg-2 col-form-label" for="Level">Level Rekening</label>
<div class="col-sm-7 col-lg-4">'.$tlevel.'</div>
<label class="col-sm-5 col-lg-2 col-form-label" for="Mode">Mode Rekening</label>
<div class="col d-flex gap-2">'.$tmode.'</div>
</div>
<input type="hidden" id="mode_detail" value="'.$this->mode_detail.'" />';
$this->app->json($ajson);
}
public function detail_print() {
$form = new Form($this->app);
$tgrup = $form->option_db("_", "Grup_RekID", 0, true, false, "gel_acc_grup", ["Grup_RekID","Nama_Grup"], "Aktif=1 ORDER BY Grup_RekID", [0, "SEMUA GRUP"]);
$tlevel = $form->option("_", "Level", $this->max_level, true, false, $this->Level_Array());
$ttgl = $form->datebox("_", "Tgl_Cetak", tgl_ymd(), true, false);
$ajson['html'] = '
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Grup_RekID">Grup Rekening</label>
<div class="col">'.$tgrup.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Level">Level Rekening</label>
<div class="col col-form-label">'.$tlevel.'</div>
</div>
<div class="row mb-1">
<label class="col-sm-4 col-lg-3 col-form-label" for="Tgl_Cetak">Tanggal Cetak</label>
<div class="col-sm-4 col-lg-4">'.$ttgl.'</div>
</div>';
$this->app->json($ajson);
}
public function print_rek() {
$id_grup = Param::Get("Grup_RekID", 0);
$level = Param::Get("Level", 0);
$nama_grup = "";
if ($id_grup > 0) $nama_grup = $this->db->fetchField("SELECT Nama_Grup FROM gel_acc_grup WHERE Grup_RekID=?", [$id_grup]);
// generate report header
$tglheader = "Tanggal Cetak : ".Param::Get("Tgl_Cetak");
$tsql = ''; $asql = [];
if ($id_grup > 0) { $tsql .= " AND Grup_RekID=?"; $asql[] = $id_grup; }
if ($level > 0) { $tsql .= " AND Level<=?"; $asql[] = $level; }
$tsql = (strlen($tsql) > 0) ? ' WHERE '.substr($tsql, 4) : '';
// query data laporan
$stat = $this->db->runQuery("SELECT A.*,G.Nama_Grup FROM (SELECT * FROM gel_acc".$tsql.") A LEFT JOIN gel_acc_grup G ON (A.Grup_RekID=G.Grup_RekID) ORDER BY A.Kode_Rek ASC", $asql);
$pre = new PrintHTML($this->app);
$pre->add_title([strtoupper($this->reg_name), "Laporan Daftar Rekening", $tglheader]);
$pre->add_field("No",10,"C");
$pre->add_field("Kode",20, "C");
$pre->add_field("Nama Rekening",80, "L");
$pre->add_field("Grup",50, "L");
$pre->add_field("Level",20, "C");
$pre->add_field("Mode",20, "C");
if ($id_grup > 0) $pre->add_sub_title("Grup Rekening : ".$nama_grup);
$pre->show_titles();
$pre->show_headers();
$nomor = 1; $strpad = "&nbsp;&nbsp;&nbsp;";
while ($row = $stat->fetch(SimplePdo::FETCH_ASSOC)) {
$pre->add_row([ $nomor++, $row['Kode_Rek'], str_repeat($strpad, (int) $row['Level']-1).$row['Nama_Rek'], $row['Nama_Grup'], $row['Level'], $row['Mode'] ]);
}
$pre->add_stamp(0, true);
$pre->show();
}
private function Level_Array($item = -1) {
$_alevel = []; for ($i=1; $i<=$this->max_level; $i++) $_alevel[$i] = "Level ".$i;
return ($item == -1) ? $_alevel : $_alevel[$item];
}
public function index() {
$this->app->json(['html' => '
<div class="fade-in"><div class="card"><div class="card-header custom-style">Daftar Rekening</div><div class="card-body"><div class="row mb-1"><div class="col-10"><div class="input-group"><input class="form-control" id="Cari_Rek" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div><div class="col-2 btn-group"><button class="btn btn-info shadow-none" type="button" id="butPrint"><i class="bi-printer me-2"></i>Cetak</button></div></div><div id="divDetail">&nbsp;</div></div></div></div>'
]);
}
}