Skip to content

Commit

Permalink
update revision
Browse files Browse the repository at this point in the history
  • Loading branch information
punkestu committed Nov 6, 2024
1 parent 7764110 commit 76b0dac
Show file tree
Hide file tree
Showing 15 changed files with 245 additions and 38 deletions.
32 changes: 32 additions & 0 deletions app/Http/Controllers/PersonelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Http\Controllers;

use App\Models\Cabang;
use App\Models\Konsep;
use App\Models\Personel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
Expand Down Expand Up @@ -306,4 +307,35 @@ public function togglePensiun($id)
]);
return redirect()->route('personel.index', ['id' => $personel->cabang_id])->with('success', 'Status pensiun personel berhasil diubah');
}

public function konsep()
{
$konseps = Konsep::all();
return view('personel.konsep', ["konseps" => $konseps]);
}

public function uploadKonsep(Request $request)
{
$request->validate([
"name" => "required",
]);

if ($request->hasFile("berkas")) {
$file = $request->file('berkas');
$fileName = time() . '_' . $file->getClientOriginalName();
$berkas = "/storage/" . $file->storeAs('files', $fileName, 'public');
} else {
$request->validate([
"url" => "required"
]);
$berkas = $request->url;
}

Konsep::create([
"name" => $request->name,
"berkas" => $berkas
]);

return redirect()->route("konsep");
}
}
8 changes: 4 additions & 4 deletions app/Http/Controllers/Rotasi/SelektifAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ public function selektif($id, Request $request)
if ($pengajuan->posisi_tujuan == "ACO") {
$pengajuan->lokasiTujuan->jumlah_personel_aco += 1;
} else if ($pengajuan->posisi_tujuan == "AIS") {
$pengajuan->lokasiTujuan->jumlah_personel_ais -= 1;
$pengajuan->lokasiTujuan->jumlah_personel_ais += 1;
} else if ($pengajuan->posisi_tujuan == "ATFM") {
$pengajuan->lokasiTujuan->jumlah_personel_atfm -= 1;
$pengajuan->lokasiTujuan->jumlah_personel_atfm += 1;
} else if ($pengajuan->posisi_tujuan == "TAPOR") {
$pengajuan->lokasiTujuan->jumlah_personel_tapor -= 1;
$pengajuan->lokasiTujuan->jumlah_personel_tapor += 1;
} else if ($pengajuan->posisi_tujuan == "ATSSystem") {
$pengajuan->lokasiTujuan->jumlah_personel_ats_system -= 1;
$pengajuan->lokasiTujuan->jumlah_personel_ats_system += 1;
} else {
$pengajuan->lokasiTujuan->jumlah_personel += 1;
}
Expand Down
28 changes: 14 additions & 14 deletions app/Models/Cabang.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,109 +144,109 @@ public function outDiterima()
public function inAll()
{
return $this->hasMany(Pengajuan::class, 'lokasi_tujuan_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1));
}
public function outAll()
{
return $this->hasMany(Pengajuan::class, 'lokasi_awal_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
;
}

public function in()
{
return $this->hasMany(Pengajuan::class, 'lokasi_tujuan_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->whereNotIn('posisi_tujuan', ['ACO', 'ATFM', 'AIS', 'TAPOR', 'ATSSystem']);
}

public function out()
{
return $this->hasMany(Pengajuan::class, 'lokasi_awal_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->whereNotIn('posisi_sekarang', ['ACO', 'ATFM', 'AIS', 'TAPOR', 'ATSSystem']);
}

public function inACO()
{
return $this->hasMany(Pengajuan::class, 'lokasi_tujuan_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_tujuan', '=', 'ACO');
}

public function outACO()
{
return $this->hasMany(Pengajuan::class, 'lokasi_awal_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_sekarang', '=', 'ACO');
}

public function inAIS()
{
return $this->hasMany(Pengajuan::class, 'lokasi_tujuan_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_tujuan', '=', 'AIS');
}

public function outAIS()
{
return $this->hasMany(Pengajuan::class, 'lokasi_awal_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_sekarang', '=', 'AIS');
}

public function inATFM()
{
return $this->hasMany(Pengajuan::class, 'lokasi_tujuan_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_tujuan', '=', 'ATFM');
}

public function outATFM()
{
return $this->hasMany(Pengajuan::class, 'lokasi_awal_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_sekarang', '=', 'ATFM');
}

public function inTAPOR()
{
return $this->hasMany(Pengajuan::class, 'lokasi_tujuan_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_tujuan', '=', 'TAPOR');
}

public function outTAPOR()
{
return $this->hasMany(Pengajuan::class, 'lokasi_awal_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_sekarang', '=', 'TAPOR');
}

public function inATSSystem()
{
return $this->hasMany(Pengajuan::class, 'lokasi_tujuan_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_tujuan', '=', 'ATSSystem');
}

public function outATSSystem()
{
return $this->hasMany(Pengajuan::class, 'lokasi_awal_id')
->whereIn('status', ['dapat', 'diterima'])
->whereIn('status', ['diterima'])
->where('updated_at', '>=', now()->subYears(1))
->where('posisi_sekarang', '=', 'ATSSystem');
}
Expand Down
15 changes: 15 additions & 0 deletions app/Models/Konsep.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Konsep extends Model
{
use HasFactory;
protected $fillable = [
"name",
"berkas"
];
}
29 changes: 29 additions & 0 deletions database/migrations/2024_11_06_213136_create_konseps_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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('konseps', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('berkas');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('konseps');
}
};
4 changes: 2 additions & 2 deletions resources/views/components/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class="max-h-0 duration-300 absolute flex flex-col gap-1 bg-white mt-4 text-gray
auth()->user()->profile->cabang->notreadnotifications->count() > 0;
@endphp
<a href="/rotasi/notification"
class="flex aspect-square border-2 rounded-full p-1 {{ $hasNotification ? 'border-blue-500' : 'border-gray-800' }}">
<svg class="w-6 h-6 {{ $hasNotification ? 'text-blue-500' : 'text-gray-800' }}" aria-hidden="true"
class="flex aspect-square border-2 rounded-full p-1 {{ $hasNotification ? 'border-red-500' : 'border-gray-800' }}">
<svg class="w-6 h-6 {{ $hasNotification ? 'text-red-500' : 'text-gray-800' }}" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
viewBox="0 0 24 24">
<path
Expand Down
29 changes: 16 additions & 13 deletions resources/views/personel/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50
<div class="relative p-4 w-full max-w-2xl max-h-full">
<!-- Modal content -->
<form method="POST" action="/personel/import" enctype="multipart/form-data"
class="relative bg-white rounded-lg shadow dark:bg-gray-700">
class="relative bg-white rounded-lg shadow ">
@csrf
<!-- Modal header -->
<div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
<h3 class="text-xl font-semibold text-gray-900 dark:text-white">
<div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t ">
<h3 class="text-xl font-semibold text-gray-900 ">
Import Data Personel
</h3>
<button type="button"
class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center"
data-modal-hide="import-modal">
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 14 14">
Expand All @@ -38,18 +38,21 @@ class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounde
<input type="file" name="sheet" id="sheet" required>
</div>
<!-- Modal footer -->
<div class="flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600">
<div class="flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b">
<button data-modal-hide="import-modal" type="submit"
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Kirim</button>
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center">Kirim</button>
<button data-modal-hide="import-modal" type="button"
class="py-2.5 px-5 ms-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700">Batal</button>
class="py-2.5 px-5 ms-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100">Batal</button>
</div>
</form>
</div>
</div>
<main class="min-h-screen">
<div class="flex justify-between items-center px-4 py-2 bg-gray-100 dark:bg-gray-800">
<h1 class="text-xl font-semibold text-gray-800 dark:text-white">Personel</h1>
<div class="text-xl font-semibold text-gray-800 px-4 py-2 bg-gray-100 flex gap-4">
<a href="/personel" class="underline">Personel</a>
<a href="/personel/konsep">Konsep</a>
</div>
<div class="flex justify-between items-center px-4 py-2 bg-gray-100">
<form action="" class="gap-2 flex">
<input type="search" name="nik" id="nik-search"
class="min-w-40 px-2 py-1 border-2 border-slate-400 rounded-md" placeholder="NIK"
Expand Down Expand Up @@ -97,9 +100,9 @@ class="flex items-center justify-center px-4 py-2 text-white text-sm bg-blue-500
</div>
</div>
<div class="relative overflow-x-auto max-h-[70vh] overflow-y-auto block">
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
<table class="w-full text-sm text-left rtl:text-right text-gray-500 ">
<thead
class="sticky top-0 text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
class="sticky top-0 text-xs text-gray-700 uppercase bg-gray-50 ">
<tr>
<th scope="col" class="px-6 py-3">
No.
Expand Down Expand Up @@ -186,9 +189,9 @@ class="sticky top-0 text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700
</thead>
<tbody>
@foreach ($personels as $personel)
<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
<tr class="bg-white border-b ">
<th scope="row"
class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap ">
{{ $loop->iteration }}
</th>
<td class="px-6 py-4">
Expand Down
Loading

0 comments on commit 76b0dac

Please sign in to comment.