62 lines
2.4 KiB
PHP
62 lines
2.4 KiB
PHP
<?php
|
|
|
|
/*******************************************************************
|
|
|
|
PHP Class : /Controller/System/SuperController
|
|
Description : Supervisi Operator
|
|
Created By : Siau Pheng ([email protected]).
|
|
Created Date : September 11st, 2012.
|
|
Last Modified : August 29th, 2026.
|
|
|
|
(c) 3FONIA Software; WWW.3FONIA.COM.
|
|
|
|
*******************************************************************/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\System;
|
|
|
|
use flight\Engine;
|
|
use flight\Session;
|
|
use flight\database\SimplePdo;
|
|
use Webapp\Web\Param;
|
|
use Webapp\Web\Table;
|
|
|
|
class SuperController {
|
|
|
|
protected Engine $app;
|
|
protected SimplePdo $db;
|
|
|
|
public function __construct(Engine $app, SimplePdo $db) {
|
|
$this->app = $app;
|
|
$this->db = $db;
|
|
}
|
|
|
|
public function approve() {
|
|
$this->db->runQuery('UPDATE app_auth SET Auth=1,SuperID=? WHERE AuthID=?', [$this->app->user()->id(), Param::Get("AuthID",0)]);
|
|
}
|
|
|
|
public function table_detail() {
|
|
$obj = new Table($this->app);
|
|
$obj->set_table('(SELECT AuthID,UserID,Kode,DATE_FORMAT(Tanggal,"%d-%m-%Y %H:%i:%s") Tanggal,REQ,Catatan FROM app_auth WHERE Auth=0) A LEFT JOIN app_operator O ON (A.UserID=O.UserID) LEFT JOIN app_menu M ON (A.Kode=M.Kode)', 'A.*,O.Nama Nama_User,M.Judul');
|
|
$obj->add_field("AuthID", "ID", "hid");
|
|
$obj->add_field("Nama_User", "User ID", "l");
|
|
$obj->add_field("Tanggal", "Tanggal", "c");
|
|
$obj->add_field("Judul", "Menu Aplikasi", "l");
|
|
$obj->add_field("Catatan", "Informasi Transaksi", "awr");
|
|
$obj->add_field("REQ", "Kode Request", "l");
|
|
$obj->add_row_btn("unlock2", "Proses", "SuperJS.detail_select");
|
|
$ajson[] = $obj->json_table("divSuper");
|
|
$this->app->json($ajson);
|
|
}
|
|
|
|
public function index() {
|
|
$this->app->json([
|
|
'html' => '
|
|
<div class="fade-in">
|
|
<div class="card"><div class="card-header custom-style">Supervisi Hak Akses</div><div class="card-body"><div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Super" 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="divSuper"> </div></div></div>
|
|
</div>'
|
|
]);
|
|
}
|
|
}
|