49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Session;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class PengaturanController extends Controller
|
|
{
|
|
public function __construct(){
|
|
$this->siteTitle = "Pengaturan";
|
|
parent::__construct();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$this->setIconTitle("fa fa-cog");
|
|
return view('admin.pengaturan.index');
|
|
}
|
|
|
|
public function rekonAnggaran()
|
|
{
|
|
try{
|
|
DB::beginTransaction();
|
|
DB::raw(
|
|
"UPDATE BELANJA_REALISASI t1
|
|
SET t1.JUMLAH_ANGGARAN = (
|
|
SELECT V_ANGG_TAPD FROM VW_DPA_RSK t2
|
|
WHERE t1.KODE_RSK = t2.I_ID
|
|
) WHERE t1.TAHUN_ANGGARAN = ".getTA()
|
|
);
|
|
DB::commit();
|
|
return response()->json([
|
|
"success" => true,
|
|
"message" => "Data anggaran berhasil disesuaikan!"
|
|
]);
|
|
|
|
}catch(Throwable $e){
|
|
|
|
DB::rollBack();
|
|
return response()->json([
|
|
"success" => false,
|
|
"message" => "Data anggaran gagal disesuaikan!"
|
|
]);
|
|
}
|
|
}
|
|
}
|