udpate
|
|
@ -4,6 +4,7 @@ use Illuminate\Support\Str;
|
||||||
use App\Models\Master\Menu;
|
use App\Models\Master\Menu;
|
||||||
use App\Models\Master\AccessMenu;
|
use App\Models\Master\AccessMenu;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Models\UnitKonversi;
|
||||||
use App\Models\GWP;
|
use App\Models\GWP;
|
||||||
|
|
||||||
if (!function_exists('taskLabel')) {
|
if (!function_exists('taskLabel')) {
|
||||||
|
|
@ -402,3 +403,16 @@ if (!function_exists('activityYearRange')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('valueUnitKonversion')) {
|
||||||
|
function valueUnitKonversion($kategori,$from,$to)
|
||||||
|
{
|
||||||
|
$value = UnitKonversi::where('kategori_id',$kategori)
|
||||||
|
->where('from_id',$from)
|
||||||
|
->where('to_id',$to)
|
||||||
|
->first();
|
||||||
|
|
||||||
|
return $value->value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class FrontController extends Controller
|
||||||
{
|
{
|
||||||
function index() {
|
function index() {
|
||||||
$data['title'] = 'Beranda';
|
$data['title'] = 'Beranda';
|
||||||
return redirect('login');
|
// return redirect('login');
|
||||||
// return view('index',$data);
|
return view('index',$data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,94 @@ namespace App\Http\Controllers\Pengaturan;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use DB;
|
||||||
|
use App\Models\Unit;
|
||||||
|
use App\Models\UnitKonversi;
|
||||||
|
use App\Models\Kategori;
|
||||||
|
|
||||||
class UnitKonversiController extends Controller
|
class UnitKonversiController extends Controller
|
||||||
{
|
{
|
||||||
|
protected $title = 'Unit Konversi';
|
||||||
|
protected $template = 'modules.pengaturan.unit-conversion';
|
||||||
|
protected $route = 'modules.pengaturan.unit-conversion';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
//
|
permission('is_read', $this->route, 'module',true);
|
||||||
|
|
||||||
|
$data['breadcrumbs'] = [
|
||||||
|
['name' => 'Dashboard'],
|
||||||
|
['name' => 'Pengaturan'],
|
||||||
|
['name' => 'Unit Konversi','active' => true],
|
||||||
|
];
|
||||||
|
$data['title'] = $this->title;
|
||||||
|
$data['route'] = $this->route;
|
||||||
|
$data['kategori'] = Kategori::all();
|
||||||
|
$data['unit'] = Unit::where('kategori_id',decode_id(@request()->kategori_id))->get();
|
||||||
|
return view($this->template.'.index',$data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function valueKonversion($kategori,$from,$to) {
|
||||||
|
$value = valueUnitKonversion(decode_id($kategori),decode_id($from),decode_id($to));
|
||||||
|
// return ;
|
||||||
|
|
||||||
|
return response()->json(['value' => $value]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function grid(Request $request)
|
||||||
|
{
|
||||||
|
if(@$request->kategori_id){
|
||||||
|
$data = Unit::where('kategori_id',decode_id($request->kategori_id))->orderBy('UnitId','ASC')->get();
|
||||||
|
}else{
|
||||||
|
$data = [];
|
||||||
|
}
|
||||||
|
$_data = [];
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($data as $key => $row) {
|
||||||
|
|
||||||
|
|
||||||
|
$action = '';
|
||||||
|
$status = '';
|
||||||
|
if($row->status == 0){
|
||||||
|
$status = '<span class="btn btn-sm btn-block btn-danger"> Tidak Aktif </span>';
|
||||||
|
}else{
|
||||||
|
$status = '<span class="btn btn-sm btn-block btn-success"> Aktif </span>';
|
||||||
|
}
|
||||||
|
$unit = Unit::where('kode',$row->kode)->first();
|
||||||
|
|
||||||
|
$input = '<div class="append"></div>';
|
||||||
|
|
||||||
|
$action .= '<div class="d-flex gap-1">';
|
||||||
|
if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){
|
||||||
|
$action .= '<a data-id="'.encode_id($row->UnitId).'" href="'.url('pengaturan/unit/update/'.encode_id($row->UnitId)).'" data-toggle="tooltip" title="Simpan Perubahan Data" class="btn btn-sm btn-block btn-primary"><i class="mdi mdi-content-save-outline text-white"></i></a>';
|
||||||
|
// $action .= '<a data-id="'.encode_id($row->UnitId).'" href="'.url('pengaturan/unit/update/'.encode_id($row->UnitId)).'" data-toggle="tooltip" title="Edit Data" class="btn btn-sm btn-block btn-primary"><i class="mdi mdi-pencil text-white"></i></a>';
|
||||||
|
if(session('group_id') == 1){
|
||||||
|
// $action .= '<a href="#" data-href="'.url('pengaturan/unit/delete/'.encode_id($row->UnitId)).'" data-toggle="tooltip" title="Edit Data" class="remove_data btn btn-sm btn-block btn-danger"><i class="mdi mdi-delete text-white"></i></a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$action .= '</div>';
|
||||||
|
|
||||||
|
$_data[] = [
|
||||||
|
'no' => $key+1,
|
||||||
|
'id' => encode_id($row->UnitId),
|
||||||
|
'kategori' => @$row->kategori->nama,
|
||||||
|
'nama' => @$row->nama,
|
||||||
|
'kategoriID' => encode_id(@$row->kategori->KategoriId),
|
||||||
|
'UnitId' => encode_id($unit->UnitId),
|
||||||
|
'status' => @$status,
|
||||||
|
'input' => @$input,
|
||||||
|
'action' => @$action,
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// return response()->json($_data); // Return the data as a JSON response
|
||||||
|
return response()->json($_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -28,7 +107,39 @@ class UnitKonversiController extends Controller
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
//
|
$kategoriId = decode_id($request->kategori_id);
|
||||||
|
$toRaw = array_values($request->input('to'));
|
||||||
|
$codes = array_values(array_filter($toRaw, fn($v) => !is_numeric($v)));
|
||||||
|
$codeToId = !empty($codes) ? Unit::whereIn('kode', $codes)->pluck('UnitId','kode')->toArray() : [];
|
||||||
|
$toIds = array_map(fn($v) => is_numeric($v) ? (int)$v : ($codeToId[$v] ?? null), $toRaw);
|
||||||
|
|
||||||
|
DB::transaction(function() use ($request, $kategoriId, $toIds) {
|
||||||
|
foreach ($request->all() as $key => $vals) {
|
||||||
|
if (!str_starts_with($key, 'val_')) continue;
|
||||||
|
|
||||||
|
$fromId = (int) substr($key, 4);
|
||||||
|
if (!$fromId || !is_array($vals)) continue;
|
||||||
|
|
||||||
|
foreach ($toIds as $col => $toId) {
|
||||||
|
if (!$toId) continue;
|
||||||
|
|
||||||
|
$raw = $vals[$col] ?? null;
|
||||||
|
// skip empty if you want: if ($raw === null || $raw === '') continue;
|
||||||
|
$value = ($raw === null || $raw === '') ? 0 : (float)$raw;
|
||||||
|
|
||||||
|
UnitKonversi::updateOrCreate(
|
||||||
|
['kategori_id' => $kategoriId, 'from_id' => $fromId, 'to_id' => $toId],
|
||||||
|
['value' => $value, 'updated_at' => now()]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return redirect()->back()->with([
|
||||||
|
'message' => 'Berhasil update data',
|
||||||
|
'type' => 'success',
|
||||||
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -50,9 +161,29 @@ class UnitKonversiController extends Controller
|
||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, string $id)
|
public function update($id = null)
|
||||||
{
|
{
|
||||||
//
|
$data['breadcrumbs'] = [
|
||||||
|
['name' => 'Dashboard'],
|
||||||
|
['name' => 'Pengaturan'],
|
||||||
|
['name' => 'Unit Konversi','active' => true],
|
||||||
|
];
|
||||||
|
$keyId = decode_id($id);
|
||||||
|
$data['title'] = $this->title;
|
||||||
|
$data['route'] = $this->route;
|
||||||
|
$data['keyId'] = $id;
|
||||||
|
$data['item'] = UnitKonversi::where('UnitKonversiId',$keyId)->first();
|
||||||
|
$data['kategori'] = Kategori::all();
|
||||||
|
return view($this->template.'.form',$data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete($id)
|
||||||
|
{
|
||||||
|
$keyId = decode_id($id);
|
||||||
|
|
||||||
|
$data = UnitKonversi::where('UnitKonversiId',$keyId)->delete();
|
||||||
|
|
||||||
|
return response()->json(['success' => true,'message' => 'Berhasil update data','type' => 'success']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
class UnitKonversi extends Model
|
||||||
|
{
|
||||||
|
use SoftDeletes;
|
||||||
|
|
||||||
|
protected $table = 'p_unit_konversi';
|
||||||
|
protected $primaryKey = 'UnitKonversiId';
|
||||||
|
protected $guarded = [];
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('p_unit_konversi', function (Blueprint $table) {
|
||||||
|
$table->id('UnitKonversiId');
|
||||||
|
$table->integer('kategori_id');
|
||||||
|
$table->integer('from_id');
|
||||||
|
$table->integer('to_id');
|
||||||
|
$table->float('value');
|
||||||
|
$table->timestampsTz();
|
||||||
|
$table->softdeletesTz();
|
||||||
|
|
||||||
|
$table->foreign('kategori_id')->references('KategoriId')->on('p_kategori')->cascadeOnDelete();
|
||||||
|
$table->foreign('from_id')->references('UnitId')->on('p_unit')->cascadeOnDelete();
|
||||||
|
$table->foreign('to_id')->references('UnitId')->on('p_unit')->cascadeOnDelete();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('p_unit_konversi');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
After Width: | Height: | Size: 140 B |
|
After Width: | Height: | Size: 211 B |
|
After Width: | Height: | Size: 211 B |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 185 KiB |
|
After Width: | Height: | Size: 225 KiB |
|
After Width: | Height: | Size: 311 KiB |
|
After Width: | Height: | Size: 401 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -1,4 +1,59 @@
|
||||||
@extends('layouts.blank')
|
@extends('layouts.front')
|
||||||
@section('content')
|
@section('content')
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ducimus molestiae iusto libero ut dolores deleniti, pariatur laborum provident magnam fugiat dignissimos corporis totam eos neque ex omnis itaque! Laboriosam, necessitatibus!</p>
|
|
||||||
|
<section class="relative continer py-[90px]">
|
||||||
|
<div class="flex flex-col items-center text-center mx-auto py-100 gap-1 w-[80%] md:w-[80%] lg:w-[60%]">
|
||||||
|
<h1 class="mb-0 font-semibold text-[42px] md:text-[52px] lg:text-[72px]">Sistem Informasi</h1>
|
||||||
|
<h1 class="mb-0 font-semibold text-[42px] md:text-[52px] lg:text-[72px]">Gas Rumah Kaca Daerah</h1>
|
||||||
|
<p class="mb-0 text-[#878C91] md:w-[70%]">Platform terintegrasi untuk memantau, melaporkan, dan mengevaluasi status emisi GRK serta kemajuan Rencana Aksi Mitigasi di wilayah Jakarta. Akses data inventarisasi terbaru dan peran serta publik.</p>
|
||||||
|
<div class="flex flex-col md:flex-row gap-10 md:gap-3 mt-20">
|
||||||
|
<div><a href="" class="rounded-full bg-[#2084FF] px-10 py-4 text-white">Lihat Rencana Aksi <i class="bx bx-right-arrow-alt"></i></a></div>
|
||||||
|
<div><a href="" class="rounded-full px-10 py-4 border">Akses Dashboard Terbaru</a></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section class="relative container mx-auto p-10">
|
||||||
|
<div class="flex flex-col md:flex-row gap-4 justify-between items-center">
|
||||||
|
<div class="md:w-[50%]"><h1 class="text-[32px] md:text-[42px] font-semibold">Informasi Gas Rumah Kaca Daerah</h1></div>
|
||||||
|
<div class="md:w-[50%]"><p class="text-[16px] text-[#878C91]">Perhitungan emisi GRK mengikuti standar IPCC terbaru dan divalidasi oleh lembaga lingkungan terkait, serta didukung kerja sama dengan Kementerian LHK untuk memastikan akuntabilitas data.</p></div>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-5 mt-[50px]">
|
||||||
|
<div class="bg-[url({{ asset('assets/images/bg1.png') }})] bg-no-repeat bg-cover flex flex-col items-start gap-3 text-white justify-end p-3 pb-[30px] rounded-[10px] h-[500px] bg-blend-overlay">
|
||||||
|
<h4 class="text-[20px]">Energi</h4>
|
||||||
|
<p class="font-thin text-sm">We're a UK-based Laravel agency. We'll get your project moving so you can focus on what matters most. You'll have peac.</p>
|
||||||
|
</div>
|
||||||
|
<div class="bg-[url({{ asset('assets/images/bg2.png') }})] bg-no-repeat bg-cover flex flex-col items-start gap-3 text-white justify-end p-3 pb-[30px] rounded-[10px] h-[500px] bg-blend-overlay">
|
||||||
|
<h4 class="text-[20px]">Industrial Processes and Product Use</h4>
|
||||||
|
<p class="font-thin text-sm">As the largest on-shore Laravel development company in the United States, Active Logic is headquartered in.</p>
|
||||||
|
</div>
|
||||||
|
<div class="bg-[url({{ asset('assets/images/bg3.png') }})] bg-no-repeat bg-cover flex flex-col items-start gap-3 text-white justify-end p-3 pb-[30px] rounded-[10px] h-[500px] bg-blend-overlay">
|
||||||
|
<h4 class="text-[20px]">Pertanian & Lahan</h4>
|
||||||
|
<p class="font-thin text-sm">We’re the Laravel agency you couldn’t afford locally. But we’re based in Georgia, the country. So, you can.</p>
|
||||||
|
</div>
|
||||||
|
<div class="bg-[url({{ asset('assets/images/bg4.png') }})] bg-no-repeat bg-cover flex flex-col items-start gap-3 text-white justify-end p-3 pb-[30px] rounded-[10px] h-[500px] bg-blend-overlay">
|
||||||
|
<h4 class="text-[20px]">Limbah</h4>
|
||||||
|
<p class="font-thin text-sm">We're the experts in all things Laravel. If you need an app built or rescued, or you need your team built or leveled up, we'v</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col md:flex-row gap-4 justify-center items-center mt-[45px]">
|
||||||
|
<div><a href="" class="rounded-full bg-[#2084FF] px-10 py-4 text-white">Lihat Rencana Aksi <i class="bx bx-right-arrow-alt"></i></a></div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="relative mx-auto container p-5">
|
||||||
|
<div class="bg-[#2084FF] rounded-[10px] pt-20">
|
||||||
|
<div class="flex flex-row gap-4 justify-center text-center items-center text-white">
|
||||||
|
<div class="md:w-[70%]"><h1 class="text-[32px] md:text-[42px] font-semibold">Semua yang Anda Butuhkan, Lengkap dan Terverifikasi.</h1></div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col lg:flex-row justify-center items-center gap-4 mt-[35px] px-20 lg:w-[80%] mx-auto">
|
||||||
|
<div class="rounded-full w-full border px-6 py-3 text-white"><a href="">Investasi Sektor</a></div>
|
||||||
|
<div class="rounded-full w-full border px-6 py-3 text-[#2084FF] bg-white"><a href="">Tren Tahun ke Tahun</a></div>
|
||||||
|
<div class="rounded-full w-full border px-6 py-3 text-white"><a href="">RAD GRK Interaktif</a></div>
|
||||||
|
<div class="rounded-full w-full border px-6 py-3 text-white"><a href="">Peta Geografis Aksi</a></div>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-center -mt-[50px]">
|
||||||
|
<img src="{{ asset('assets/images/dashboard.png') }}" alt="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en" data-layout="vertical" data-topbar="light" data-sidebar="dark" data-sidebar-size="lg" data-sidebar-image="none" data-preloader="disable">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>@yield('title',@$title) | SIGD</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta content="SIDG" name="description" />
|
||||||
|
<meta content="ilhamwara" name="author" />
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="{{ asset('assets/logo-dinas.ico') }}">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="{{ asset('assets/logo-dinas.ico') }}">
|
||||||
|
<link rel="mask-icon" href="{{ asset('assets/logo-dinas.ico') }}" color="#5bbad5">
|
||||||
|
<!-- App favicon -->
|
||||||
|
<link rel="shortcut icon" href="{{asset('assets/images/favicon.ico')}}">
|
||||||
|
<!-- Bootstrap Css -->
|
||||||
|
{{-- <link href="{{asset('assets/css/bootstrap.min.css')}}" id="bootstrap-style" rel="stylesheet" type="text/css" /> --}}
|
||||||
|
<!-- Icons Css -->
|
||||||
|
<link href="{{asset('assets/css/icons.min.css')}}" rel="stylesheet" type="text/css" />
|
||||||
|
<!-- App Css-->
|
||||||
|
<link href="{{asset('assets/css/app.min.css')}}" id="app-style" rel="stylesheet" type="text/css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="{{asset('assets/css/bootstrap-table.min.css')}}">
|
||||||
|
<link href="{{ asset('assets/libs/sweetalert2/sweetalert2.min.css') }}" rel="stylesheet" type="text/css" />
|
||||||
|
<!-- alertifyjs Css -->
|
||||||
|
<link href="{{ asset('assets/libs/alertifyjs/build/css/alertify.min.css') }}" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="{{ asset('assets/libs/choices.js/public/assets/styles/choices.min.css') }}" rel="stylesheet" type="text/css" />
|
||||||
|
|
||||||
|
<!-- alertifyjs default themes Css -->
|
||||||
|
<link href="{{ asset('assets/libs/alertifyjs/build/css/themes/default.min.css') }}" rel="stylesheet" type="text/css" />
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
@yield('css')
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<section class="absolute">
|
||||||
|
<img src="{{ asset('assets/images/bg-front.png') }}" alt="">
|
||||||
|
</section>
|
||||||
|
<section class="navbar px-5 py-8 relative container mx-auto hidden md:block">
|
||||||
|
<div class="flex justify-between items-center">
|
||||||
|
<div class="flex gap-[50px] items-center">
|
||||||
|
<div><a href=""><img src="{{ asset('assets/images/logo.png') }}" alt=""></a></div>
|
||||||
|
<div class="flex gap-4">
|
||||||
|
<a href="">Edukasi & Regulasi</a>
|
||||||
|
<a href="">Dokumentasi</a>
|
||||||
|
<a href="">Inventarisasi</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div><a href="{{ url('login') }}" class="rounded-full px-6 py-3 border">Login</a></div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section class="navbar px-5 pt-8 relative container mx-auto md:hidden">
|
||||||
|
<div><a href="#" class="px-4 py-3 text-[20px]"><i class="bx bx-menu"></i></a></div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
@yield('content')
|
||||||
|
{{-- <script src="{{asset('assets/libs/bootstrap/js/bootstrap.bundle.min.js')}}"></script> --}}
|
||||||
|
<script src="{{asset('assets/libs/metismenujs/metismenujs.min.js')}}"></script>
|
||||||
|
<script src="{{asset('assets/libs/simplebar/simplebar.min.js')}}"></script>
|
||||||
|
<script src="{{asset('assets/libs/eva-icons/eva.min.js')}}"></script>
|
||||||
|
|
||||||
|
<script src="{{ asset('assets/js/app.js') }}"></script>
|
||||||
|
<script src="{{asset('assets/js/bootstrap-table.min.js')}}"></script>
|
||||||
|
<script src="{{ asset('assets/libs/sweetalert2/sweetalert2.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('assets/libs/alertifyjs/build/alertify.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('assets/libs/choices.js/public/assets/scripts/choices.min.js') }}"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
new Choices('.choices', {
|
||||||
|
shouldSort: false,
|
||||||
|
});
|
||||||
|
@if (Session::get('type')=='invalid')
|
||||||
|
alertify.error("{{ Session::get('message') }}");
|
||||||
|
@endif
|
||||||
|
@if (Session::get('type')=='success')
|
||||||
|
alertify.success("{{ Session::get('message') }}");
|
||||||
|
@endif
|
||||||
|
@if (Session::get('type')=='warning')
|
||||||
|
alertify.warning("{{ Session::get('message') }}");
|
||||||
|
@endif
|
||||||
|
</script>
|
||||||
|
@yield('js')
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
data-page-size="10"
|
data-page-size="10"
|
||||||
data-id-field="id"
|
data-id-field="id"
|
||||||
id="grid-data">
|
id="grid-data">
|
||||||
<thead class="table-primary text-primary">
|
<thead class="table-secondary text-primary">
|
||||||
<tr>
|
<tr>
|
||||||
<th data-width="15%" class="text-center" data-field="action">#</th>
|
<th data-width="15%" class="text-center" data-field="action">#</th>
|
||||||
<th data-field="kode">Kode</th>
|
<th data-field="kode">Kode</th>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
data-page-size="10"
|
data-page-size="10"
|
||||||
data-id-field="id"
|
data-id-field="id"
|
||||||
id="grid-data">
|
id="grid-data">
|
||||||
<thead class="table-primary text-primary">
|
<thead class="table-secondary text-primary">
|
||||||
<tr>
|
<tr>
|
||||||
<th data-width="15%" class="text-center" data-field="action">#</th>
|
<th data-width="15%" class="text-center" data-field="action">#</th>
|
||||||
<th data-field="kode">Kode</th>
|
<th data-field="kode">Kode</th>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
data-page-size="10"
|
data-page-size="10"
|
||||||
data-id-field="id"
|
data-id-field="id"
|
||||||
id="grid-data">
|
id="grid-data">
|
||||||
<thead class="table-primary text-primary">
|
<thead class="table-secondary text-primary">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-center" colspan="2">Greenhouse gas</th>
|
<th class="text-center" colspan="2">Greenhouse gas</th>
|
||||||
<th class="text-center" colspan="{{ count(@$ar) }}">IPCC Assessment Report</th>
|
<th class="text-center" colspan="{{ count(@$ar) }}">IPCC Assessment Report</th>
|
||||||
|
|
@ -43,7 +43,6 @@
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 text-right">
|
<div class="col-md-12 text-right">
|
||||||
<a href="{{route($route.'.index')}}" class="btn btn-danger"><i class="mdi mdi-cancel"></i> Batal</a>
|
|
||||||
<button type="submit" class="btn btn-success"><i class="mdi mdi-content-save-outline"></i> Simpan</button>
|
<button type="submit" class="btn btn-success"><i class="mdi mdi-content-save-outline"></i> Simpan</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
data-page-size="10"
|
data-page-size="10"
|
||||||
data-id-field="id"
|
data-id-field="id"
|
||||||
id="grid-data">
|
id="grid-data">
|
||||||
<thead class="table-primary text-primary">
|
<thead class="table-secondary text-primary">
|
||||||
<tr>
|
<tr>
|
||||||
<th data-width="15%" class="text-center" data-field="action">#</th>
|
<th data-width="15%" class="text-center" data-field="action">#</th>
|
||||||
<th data-field="kode">Kode</th>
|
<th data-field="kode">Kode</th>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
data-page-size="10"
|
data-page-size="10"
|
||||||
data-id-field="id"
|
data-id-field="id"
|
||||||
id="grid-data">
|
id="grid-data">
|
||||||
<thead class="table-primary text-primary">
|
<thead class="table-secondary text-primary">
|
||||||
<tr>
|
<tr>
|
||||||
<th data-width="15%" class="text-center" data-field="action">#</th>
|
<th data-width="15%" class="text-center" data-field="action">#</th>
|
||||||
<th data-field="alias">Alias</th>
|
<th data-field="alias">Alias</th>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
@extends('layouts.master')
|
||||||
|
@section('content')
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<i class="mdi mdi-account"></i> {{$title}}
|
||||||
|
</div>
|
||||||
|
<form action="{{route($route.'.store')}}" method="POST" class="">
|
||||||
|
{{csrf_field()}}
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<input type="hidden" name="secure_id" value="{{@$keyId}}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12 mb-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-xl-12 form-label">Kategori</label>
|
||||||
|
<div class="col-12 ">
|
||||||
|
<select name="kategori_id" class="form-control choices @error('kategori_id') is-invalid @enderror select2" id="" required>
|
||||||
|
<option value="">-- PILIH KATEGORI --</option>
|
||||||
|
@foreach ( $kategori as $dataKat)
|
||||||
|
<option {{ $dataKat->KategoriId == @$item->kategori_id ? 'selected' : '' }} value="{{ encode_id($dataKat->KategoriId)}}">{{ $dataKat->nama }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
@error('kategori_id')
|
||||||
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6 mb-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-xl-12 form-label">Kode</label>
|
||||||
|
<div class="col-12 ">
|
||||||
|
<input type="text" value="{{@$item->kode ? @$item->kode : old('kode')}}" name="kode" class="form-control @error('kode') is-invalid @enderror" placeholder="Masukan Kode" required>
|
||||||
|
@error('kode')
|
||||||
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6 mb-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-xl-12 form-label">Nama</label>
|
||||||
|
<div class="col-12 ">
|
||||||
|
<input type="text" value="{{@$item->nama ? @$item->nama : old('nama')}}" name="nama" class="form-control @error('nama') is-invalid @enderror" placeholder="Masukan Nama" required>
|
||||||
|
@error('nama')
|
||||||
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6 mb-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-xl-12 form-label">Nomor Baris</label>
|
||||||
|
<div class="col-12 ">
|
||||||
|
<input type="text" value="{{@$item->nomor_baris ? @$item->nomor_baris : old('nomor_baris')}}" name="nomor_baris" class="form-control @error('nomor_baris') is-invalid @enderror" placeholder="Masukan Nomor Baris" required>
|
||||||
|
@error('nomor_baris')
|
||||||
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6 mb-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-xl-12 form-label">Status</label>
|
||||||
|
<div class="col-12 ">
|
||||||
|
<select name="status" class="form-control @error('status') is-invalid @enderror" id="" required>
|
||||||
|
<option {{ @$item->status == '0' ? 'selected' : ''}} value="0">Tidak Aktif</option>
|
||||||
|
<option selected {{ @$item->status == '1' ? 'selected' : ''}} value="1">Aktif</option>
|
||||||
|
</select>
|
||||||
|
@error('status')
|
||||||
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12 mb-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-xl-12 form-label">Deskripsi</label>
|
||||||
|
<div class="col-12 ">
|
||||||
|
<textarea name="deskripsi" class="form-control @error('deskripsi') is-invalid @enderror" id="" cols="30" rows="10">{{@$item->deskripsi ? @$item->deskripsi : old('deskripsi')}}</textarea>
|
||||||
|
@error('deskripsi')
|
||||||
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 text-right">
|
||||||
|
<a href="{{route($route.'.index')}}" class="btn btn-danger"><i class="mdi mdi-cancel"></i> Batal</a>
|
||||||
|
<button type="submit" class="btn btn-success"><i class="mdi mdi-content-save-outline"></i> Simpan</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
@section('js')
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.numberInput').on('input', function() {
|
||||||
|
this.value = this.value.replace(/[^0-9]/g, ''); // Hanya angka 0-9
|
||||||
|
});
|
||||||
|
$('#togglePassword').on('click', function() {
|
||||||
|
let passwordField = $('#password');
|
||||||
|
let icon = $(this).find('i');
|
||||||
|
|
||||||
|
// Cek apakah input saat ini bertipe password
|
||||||
|
if (passwordField.attr('type') === 'password') {
|
||||||
|
passwordField.attr('type', 'text'); // Ubah ke teks
|
||||||
|
icon.removeClass('mdi-eye').addClass('mdi-eye-off'); // Ganti ikon
|
||||||
|
} else {
|
||||||
|
passwordField.attr('type', 'password'); // Ubah ke password
|
||||||
|
icon.removeClass('mdi-eye-off').addClass('mdi-eye'); // Kembalikan ikon
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
||||||
|
|
@ -0,0 +1,159 @@
|
||||||
|
@extends('layouts.master')
|
||||||
|
|
||||||
|
@section('css')
|
||||||
|
@endsection
|
||||||
|
@section('content')
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="card">
|
||||||
|
<form action="{{route($route.'.store')}}" method="POST" class="">
|
||||||
|
{{csrf_field()}}
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="col-lg-3" id="pencarian">
|
||||||
|
<select name="kategori_id" class="form-control choices kategori_id @error('kategori_id') is-invalid @enderror select2" id="" required>
|
||||||
|
<option value="">- PILIH KATEGORI -</option>
|
||||||
|
@foreach ( $kategori as $dataKat)
|
||||||
|
<option {{ $dataKat->KategoriId == decode_id(@request()->kategori_id) ? 'selected' : '' }} value="{{ encode_id($dataKat->KategoriId)}}">{{ $dataKat->nama }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div id="toolbar">
|
||||||
|
<div class="d-flex flex-row d-none">
|
||||||
|
<div class="col-12">
|
||||||
|
<a href="{{route($route.'.update')}}" id="btn-add" class="btn d-flex justify-content-center align-items-center w-100 h-100 btn-primary">
|
||||||
|
<i class="mdi mdi-plus"></i> Tambah Data
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="table w-100"
|
||||||
|
data-search="true"
|
||||||
|
data-toggle="table"
|
||||||
|
data-pagination="false"
|
||||||
|
data-toolbar="#toolbar"
|
||||||
|
data-show-refresh="false"
|
||||||
|
data-url="{{route($route.'.grid',['kategori_id' => @request()->kategori_id])}}"
|
||||||
|
data-ajax-options='{"xhrFields": {"withCredentials": true}}'
|
||||||
|
data-sort-name="ids"
|
||||||
|
data-sort-order="desc"
|
||||||
|
data-page-size="10"
|
||||||
|
data-id-field="id"
|
||||||
|
id="grid-data">
|
||||||
|
<thead class="table-secondary text-primary">
|
||||||
|
<tr>
|
||||||
|
{{-- <th data-width="15%" class="text-center" data-field="action">#</th> --}}
|
||||||
|
<th data-field="nama">Nama</th>
|
||||||
|
@foreach ($unit as $dataUnit)
|
||||||
|
<th class="commandInput" data-field="input" data-key="{{ encode_id($dataUnit->UnitId) }}" data-formatter="commandInput">
|
||||||
|
{{ $dataUnit->kode }}
|
||||||
|
<input type="hidden" id="to" data-key="{{ encode_id($dataUnit->UnitId) }}" value="{{ $dataUnit->kode }}" name="to[]">
|
||||||
|
</th>
|
||||||
|
@endforeach
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 text-right">
|
||||||
|
<button type="submit" class="btn btn-success"><i class="mdi mdi-content-save-outline"></i> Simpan</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
@section('js')
|
||||||
|
<script type="text/javascript">
|
||||||
|
var $table = $('#grid-data')
|
||||||
|
var $ok = $('#ok')
|
||||||
|
$(function() {
|
||||||
|
$('.kategori_id').on('change',function(){
|
||||||
|
var kategori = $(this).val();
|
||||||
|
window.location.href="{{ url('pengaturan/unit-conversion?kategori_id=') }}"+kategori;
|
||||||
|
// $table.bootstrapTable('refresh');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
function queryParams(params) {
|
||||||
|
$('#pencarian').find('input[name], select').each(function() {
|
||||||
|
params[$(this).attr('name')] = $(this).val()
|
||||||
|
})
|
||||||
|
|
||||||
|
return params
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajaxRequest(params) {
|
||||||
|
var url = "{{ route($route.'.grid') }}";
|
||||||
|
$.get(url + '?' + $.param(params.data)).then(function (res) {
|
||||||
|
params.success(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function commandInput(value, row) {
|
||||||
|
var kategoriID = row['kategoriID'];
|
||||||
|
var unitID = row['UnitId'];
|
||||||
|
var to = $('.commandInput').attr('data-key');
|
||||||
|
var key = "{{ url('pengaturan/unit-conversion/value') }}/"+kategoriID + '/' + unitID + '/' + to;
|
||||||
|
var input = '';
|
||||||
|
var val = 0;
|
||||||
|
|
||||||
|
$.get(key, function(res){
|
||||||
|
val = res.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
input += '<input type="text" value="'+val+'" name="val_'+row['UnitId']+'[]" class="form-control">';
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#grid-data").on("click", ".remove_data", function() {
|
||||||
|
var base_url = $(this).attr('data-href');
|
||||||
|
var id = $(this).attr('data-id');
|
||||||
|
Swal.fire({
|
||||||
|
title: "Hapus Data!",
|
||||||
|
text: "Apa anda yakin ingin menghapus data ini ?",
|
||||||
|
icon: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#DD6B55",
|
||||||
|
confirmButtonText: "Ya Hapus Sekarang",
|
||||||
|
cancelButtonText: "Tidak"
|
||||||
|
}).then((result) => {
|
||||||
|
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
|
||||||
|
request = $.ajax({
|
||||||
|
url: base_url,
|
||||||
|
xhrFields: {
|
||||||
|
withCredentials: true
|
||||||
|
},
|
||||||
|
type: "GET",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Callback handler that will be called on success
|
||||||
|
request.done(function(response, textStatus, jqXHR){
|
||||||
|
console.log(response);
|
||||||
|
alertify.success("Berhasil Menhapus Data");
|
||||||
|
$('#grid-data').bootstrapTable('refresh');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Callback handler that will be called on failure
|
||||||
|
request.fail(function (jqXHR, textStatus, errorThrown){
|
||||||
|
alertify.error("Gagal " + textStatus, errorThrown);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
data-page-size="10"
|
data-page-size="10"
|
||||||
data-id-field="id"
|
data-id-field="id"
|
||||||
id="grid-data">
|
id="grid-data">
|
||||||
<thead class="table-primary text-primary">
|
<thead class="table-secondary text-primary">
|
||||||
<tr>
|
<tr>
|
||||||
<th data-width="15%" class="text-center" data-field="action">#</th>
|
<th data-width="15%" class="text-center" data-field="action">#</th>
|
||||||
<th data-field="kategori">Kategori</th>
|
<th data-field="kategori">Kategori</th>
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,20 @@ use App\Http\Controllers\Pengaturan\GHGController;
|
||||||
use App\Http\Controllers\Pengaturan\GWPController;
|
use App\Http\Controllers\Pengaturan\GWPController;
|
||||||
use App\Http\Controllers\Pengaturan\KategoriController;
|
use App\Http\Controllers\Pengaturan\KategoriController;
|
||||||
use App\Http\Controllers\Pengaturan\UnitController;
|
use App\Http\Controllers\Pengaturan\UnitController;
|
||||||
|
use App\Http\Controllers\Pengaturan\UnitKonversiController;
|
||||||
|
|
||||||
Route::get('dashboard',[HomeController::class,'index'])->name('index');
|
Route::get('dashboard',[HomeController::class,'index'])->name('index');
|
||||||
|
|
||||||
Route::name('pengaturan.')->prefix('pengaturan')->group(function () {
|
Route::name('pengaturan.')->prefix('pengaturan')->group(function () {
|
||||||
|
|
||||||
|
Route::name('unit-conversion.')->prefix('unit-conversion')->group(function () {
|
||||||
|
Route::resource('/',UnitKonversiController::class);
|
||||||
|
Route::get('grid',[UnitKonversiController::class,'grid'])->name('grid');
|
||||||
|
Route::get('value/{kategori}/{from}/{to}',[UnitKonversiController::class,'valueKonversion'])->name('valueKonversion');
|
||||||
|
Route::get('update/{id?}',[UnitKonversiController::class,'update'])->name('update');
|
||||||
|
Route::get('delete/{id?}',[UnitKonversiController::class,'delete'])->name('delete');
|
||||||
|
});
|
||||||
|
|
||||||
Route::name('unit.')->prefix('unit')->group(function () {
|
Route::name('unit.')->prefix('unit')->group(function () {
|
||||||
Route::resource('/',UnitController::class);
|
Route::resource('/',UnitController::class);
|
||||||
Route::get('grid',[UnitController::class,'grid'])->name('grid');
|
Route::get('grid',[UnitController::class,'grid'])->name('grid');
|
||||||
|
|
|
||||||