Files
esapipd/apps/php/func/esapipd.php
T

62 lines
2.0 KiB
PHP

<?php
/*******************************************************************
App. Name : SISTEM INFORMASI MONITORING DAN EVALUASI
Module : /apps/php/func/esapipd.php
Desc. : PHP - Fungsi eSAPIPD
Created By : Siau Pheng ([email protected]).
Created Date : May 15th, 2012.
Last Modified : May 1st, 2026.
(c) 2012 - 2026, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
require_once(__DIR__."/../../../../../vendor/autoload.php");
use siaupheng\fonia3\DB\MySQL;
define("SAPI_JENIS_POKIR", 1);
define("SAPI_JENIS_ASMAS", 2);
define("SAPI_JENIS_RENJA", 3);
$fdb = new MySQL();
function tahun_ang($prefix = "") {
global $fdb;
$atahun = [];
$fdb->Query("SELECT Tahun FROM para_periode WHERE Tahun IN (SELECT Tahun FROM sapi_keg) ORDER BY Tahun");
while ($fdb->Next()){
$atahun[$fdb->Row("Tahun")] = $prefix . $fdb->Row("Tahun");
}
return $atahun;
}
function map_tahun_submap($thn_map = 0) {
$amap = [2021 => 2022, 2024 => 2025];
return $amap[$thn_map] ?? $thn_map;
}
function Kolom_Status1($err = 0) {
$stat = '<i class="icon fs-5 text-danger bi-exclamation-circle me-2" title="Cek dan perbaiki informasi kegiatan!"></i><span class="badge rounded-pill text-bg-danger">'.$err.'</span>';
if ($err == 0) $stat = '<i class="icon text-success fs-5 bi-check-circle"></i>';
return $stat;
}
function Kolom_Status2($err = 0) {
$stat = '<i class="icon fs-5 text-danger bi-exclamation-circle me-2" title="Cek dan perbaiki informasi kegiatan!"></i>';
if ($err == 0) $stat = '<i class="icon text-success fs-5 bi-check-circle"></i>';
return $stat;
}
function Kegiatan_Baru($tahun = 0, $kd_jenis = "R") {
global $fdb;
$ino = 0;
$fdb->Query("SELECT MAX(RIGHT(Kode,6)) Nomor FROM sapi_keg WHERE Tahun='".$tahun."' AND Kode LIKE '".$kd_jenis.substr($tahun,-2)."%'");
if ($fdb->Next()) $ino = (int)$fdb->Row("Nomor", 0);
return $kd_jenis.substr($tahun,-2).isi_nol(++$ino, 6);
}
?>