feat: init all migration, controller & models. create manage data for insurances
This commit is contained in:
parent
d0af4d87bf
commit
d307027c74
@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Models\DocumentType;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class DocumentTypeController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Display a listing of the resource.
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
$documentTypes = DocumentType::all();
|
|
||||||
return view('doc-types-management.index', compact('documentTypes'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$request->validate([
|
|
||||||
'name' => 'required|string|max:255',
|
|
||||||
]);
|
|
||||||
|
|
||||||
DocumentType::create($request->all());
|
|
||||||
|
|
||||||
return redirect()->route('doc-types-management.index')
|
|
||||||
->with('success', 'Jenis surat berhasil ditambahkan.');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*/
|
|
||||||
public function update(Request $request, $id)
|
|
||||||
{
|
|
||||||
$request->validate([
|
|
||||||
'name' => 'required|string|max:255',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$documentType = DocumentType::findOrFail($id);
|
|
||||||
$documentType->update($request->all());
|
|
||||||
|
|
||||||
return redirect()->route('doc-types-management.index')
|
|
||||||
->with('success', 'Jenis surat berhasil diperbarui.');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*/
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
$documentType = DocumentType::findOrFail($id);
|
|
||||||
$documentType->delete();
|
|
||||||
|
|
||||||
return redirect()->route('doc-types-management.index')
|
|
||||||
->with('success', 'Jenis surat berhasil dihapus.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
61
app/Http/Controllers/InsuranceController.php
Normal file
61
app/Http/Controllers/InsuranceController.php
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\Insurance;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class InsuranceController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$insurances = Insurance::all();
|
||||||
|
return view('insurance.index', compact('insurances'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'name' => 'required|string|max:255',
|
||||||
|
]);
|
||||||
|
|
||||||
|
Insurance::create($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('insurance.index')
|
||||||
|
->with('success', 'Jenis Asuransi berhasil ditambahkan.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'name' => 'required|string|max:255',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$insurance = insurance::findOrFail($id);
|
||||||
|
$insurance->update($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('insurance.index')
|
||||||
|
->with('success', 'Jenis Asuransi berhasil diperbarui.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
$insurance = insurance::findOrFail($id);
|
||||||
|
$insurance->delete();
|
||||||
|
|
||||||
|
return redirect()->route('insurance.index')
|
||||||
|
->with('success', 'Jenis Asuransi berhasil dihapus.');
|
||||||
|
}
|
||||||
|
}
|
||||||
10
app/Http/Controllers/PatienRegistrationController.php
Normal file
10
app/Http/Controllers/PatienRegistrationController.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class PatienRegistrationController extends Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
10
app/Http/Controllers/PatientController.php
Normal file
10
app/Http/Controllers/PatientController.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class PatientController extends Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
10
app/Http/Controllers/ServiceRoomController.php
Normal file
10
app/Http/Controllers/ServiceRoomController.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ServiceRoomController extends Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
10
app/Http/Controllers/TransactionController.php
Normal file
10
app/Http/Controllers/TransactionController.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class TransactionController extends Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
10
app/Http/Controllers/TreatmentController.php
Normal file
10
app/Http/Controllers/TreatmentController.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class TreatmentController extends Controller
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
@ -6,16 +6,10 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
class DocumentType extends Model
|
class Insurance extends Model
|
||||||
{
|
{
|
||||||
use HasFactory, SoftDeletes;
|
use HasFactory, SoftDeletes;
|
||||||
|
|
||||||
/**
|
protected $table = "insurances";
|
||||||
* The attributes that are mass assignable.
|
|
||||||
*
|
|
||||||
* @var array<int, string>
|
|
||||||
*/
|
|
||||||
|
|
||||||
protected $table = "document_types";
|
|
||||||
protected $guarded = ["id"];
|
protected $guarded = ["id"];
|
||||||
}
|
}
|
||||||
12
app/Models/PatienRegistration.php
Normal file
12
app/Models/PatienRegistration.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
class PatienRegistration extends Model
|
||||||
|
{
|
||||||
|
use HasFactory, SoftDeletes;
|
||||||
|
}
|
||||||
12
app/Models/Patient.php
Normal file
12
app/Models/Patient.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
class Patient extends Model
|
||||||
|
{
|
||||||
|
use HasFactory, SoftDeletes;
|
||||||
|
}
|
||||||
12
app/Models/ServiceRoom.php
Normal file
12
app/Models/ServiceRoom.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
class ServiceRoom extends Model
|
||||||
|
{
|
||||||
|
use HasFactory, SoftDeletes;
|
||||||
|
}
|
||||||
12
app/Models/Transaction.php
Normal file
12
app/Models/Transaction.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
class Transaction extends Model
|
||||||
|
{
|
||||||
|
use HasFactory, SoftDeletes;
|
||||||
|
}
|
||||||
12
app/Models/Treatment.php
Normal file
12
app/Models/Treatment.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
class Treatment extends Model
|
||||||
|
{
|
||||||
|
use HasFactory, SoftDeletes;
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
<?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('patients', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
|
||||||
|
// Personal Information
|
||||||
|
$table->string('identity_number', 16)->unique(); // (NIK)
|
||||||
|
$table->string('medical_record_number', 16)->unique(); // (No. Rekam Medis)
|
||||||
|
$table->string('first_name');
|
||||||
|
$table->string('last_name');
|
||||||
|
$table->date('birth_date');
|
||||||
|
$table->enum('gender', ['P', 'L']); // (Laki-laki, Perempuan)
|
||||||
|
$table->string('phone_number', 15);
|
||||||
|
$table->string('email');
|
||||||
|
$table->string('address');
|
||||||
|
|
||||||
|
// Medical Information
|
||||||
|
$table->string('blood_type', 10); // (Golongan Darah)
|
||||||
|
$table->string('allergies');
|
||||||
|
$table->string('current_medicines');
|
||||||
|
$table->text('medical_history');
|
||||||
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('patients');
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -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('insurances', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name', 100); // (BPJS, Asuransi Swasta, dll)
|
||||||
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('insurances');
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -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('service_rooms', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name', 100)->unique(); // (Laboratorium, Radiologi, Ruang Operasi, Ruang Rawat Inap, UGD, IGD)
|
||||||
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('service_rooms');
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
<?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('patien_registrations', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->date('registration_date');
|
||||||
|
$table->string('insurance_number', 20)->unique(); // (No. Asuransi)
|
||||||
|
$table->string('responsible_person_name');
|
||||||
|
$table->string('responsible_person_phone', 15);
|
||||||
|
$table->string('responsible_email');
|
||||||
|
$table->string('responsible_person_relationship'); // (Hubungan dengan Pasien)
|
||||||
|
$table->string('responsible_person_address');
|
||||||
|
|
||||||
|
// Foreign keys
|
||||||
|
$table->foreignId('patient_id')->constrained('patients')->onDelete('cascade');
|
||||||
|
$table->foreignId('insurance_id')->constrained('insurances')->onDelete('cascade');
|
||||||
|
$table->foreignId('service_room_id')->constrained('service_rooms')->onDelete('cascade');
|
||||||
|
$table->foreignId('user_id')->constrained('users')->onDelete('cascade');
|
||||||
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('patien_registrations');
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -11,11 +11,12 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('document_types', function (Blueprint $table) {
|
Schema::create('treatments', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->softDeletes();
|
$table->integer('fee')->default(0);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,6 +25,6 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('document_types');
|
Schema::dropIfExists('treatments');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
<?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('transactions', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->integer('amount')->default(0);
|
||||||
|
$table->foreignId('treatment_id')->constrained('treatments')->onDelete('cascade');
|
||||||
|
$table->foreignId('patien_registration_id')->constrained('patien_registrations')->onDelete('cascade');
|
||||||
|
$table->foreignId('user_id')->constrained('users')->onDelete('cascade');
|
||||||
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('transactions');
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -14,7 +14,6 @@ class DatabaseSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
$this->call([
|
$this->call([
|
||||||
AdminSeeder::class,
|
AdminSeeder::class,
|
||||||
DocumentTypeSeeder::class,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,27 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Database\Seeders;
|
|
||||||
|
|
||||||
use App\Models\DocumentType;
|
|
||||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
|
|
||||||
class DocumentTypeSeeder extends Seeder
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the database seeds.
|
|
||||||
*/
|
|
||||||
public function run(): void
|
|
||||||
{
|
|
||||||
$documentTypes = [
|
|
||||||
['name' => 'Surat Biasa'],
|
|
||||||
['name' => 'Surat Rahasia'],
|
|
||||||
['name' => 'Surat Izin'],
|
|
||||||
['name' => 'Surat Keputusan'],
|
|
||||||
];
|
|
||||||
|
|
||||||
foreach ($documentTypes as $documentType) {
|
|
||||||
DocumentType::create($documentType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -12,12 +12,12 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h1 class="m-0">Manajemen Data Jenis Surat</h1>
|
<h1 class="m-0">Manajemen Data Asuransi</h1>
|
||||||
</div><!-- /.col -->
|
</div><!-- /.col -->
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<ol class="breadcrumb float-sm-right">
|
<ol class="breadcrumb float-sm-right">
|
||||||
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
||||||
<li class="breadcrumb-item active">Jenis Surat</li>
|
<li class="breadcrumb-item active">Jenis Asuransi</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div><!-- /.col -->
|
</div><!-- /.col -->
|
||||||
</div><!-- /.row -->
|
</div><!-- /.row -->
|
||||||
@ -28,9 +28,9 @@
|
|||||||
@section('main-content')
|
@section('main-content')
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<button class="btn btn-info" data-toggle="modal" data-target="#addDocumentTypeModal">
|
<button class="btn btn-info" data-toggle="modal" data-target="#addInsuranceModal">
|
||||||
<i class="fas fa-plus"></i>
|
<i class="fas fa-plus"></i>
|
||||||
Tambah Jenis Surat
|
Tambah Jenis Asuransi
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@ -38,25 +38,25 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>No</th>
|
<th>No</th>
|
||||||
<th>Jenis Surat</th>
|
<th>Jenis Asuransi</th>
|
||||||
<th>Aksi</th>
|
<th>Aksi</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($documentTypes as $index => $doc)
|
@foreach ($insurances as $index => $data)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $index + 1 }}</td>
|
<td>{{ $index + 1 }}</td>
|
||||||
<td>{{ $doc->name }}</td>
|
<td>{{ $data->name }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="#" class="btn btn-sm btn-warning edit-btn"
|
<a href="#" class="btn btn-sm btn-warning edit-btn"
|
||||||
data-url="{{ route('doc-types-management.update', $doc->id) }}"
|
data-url="{{ route('insurance.update', $data->id) }}"
|
||||||
data-name="{{ $doc->name }}" data-toggle="modal"
|
data-name="{{ $data->name }}" data-toggle="modal"
|
||||||
data-target="#editDocumentTypeModal">
|
data-target="#editInsuranceModal">
|
||||||
<i class="fas fa-pencil-alt"></i> Edit
|
<i class="fas fa-pencil-alt"></i> Edit
|
||||||
</a>
|
</a>
|
||||||
<button type="button" class="btn btn-sm btn-danger delete-btn"
|
<button type="button" class="btn btn-sm btn-danger delete-btn"
|
||||||
data-url="{{ route('doc-types-management.destroy', $doc->id) }}" data-toggle="modal"
|
data-url="{{ route('insurance.destroy', $data->id) }}" data-toggle="modal"
|
||||||
data-target="#deleteDocumentTypeModal">
|
data-target="#deleteInsuranceModal">
|
||||||
<i class="fas fa-trash"></i> Hapus
|
<i class="fas fa-trash"></i> Hapus
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
@ -68,22 +68,22 @@
|
|||||||
<!-- /.card-body -->
|
<!-- /.card-body -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Modal Tambah Jenis Surat -->
|
<!-- Modal Tambah Jenis Asuransi -->
|
||||||
<div class="modal fade" id="addDocumentTypeModal" tabindex="-1" aria-labelledby="addDocumentTypeModalLabel"
|
<div class="modal fade" id="addInsuranceModal" tabindex="-1" aria-labelledby="addInsuranceModalLabel"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<form id="addDocumentTypeForm" method="POST" action="{{ route('doc-types-management.store') }}">
|
<form id="addDocumentTypeForm" method="POST" action="{{ route('insurance.store') }}">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="addDocumentTypeModalLabel">Tambah Jenis Surat</h5>
|
<h5 class="modal-title" id="addInsuranceModalLabel">Tambah Jenis Asuransi</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="documentTypeName" class="form-label">Nama Jenis Surat</label>
|
<label for="documentTypeName" class="form-label">Nama Jenis Asuransi</label>
|
||||||
<input type="text" class="form-control" id="documentTypeName" name="name" required>
|
<input type="text" class="form-control" id="documentTypeName" name="name" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -96,8 +96,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Modal Edit Jenis Surat -->
|
<!-- Modal Edit Jenis Asuransi -->
|
||||||
<div class="modal fade" id="editDocumentTypeModal" tabindex="-1" aria-labelledby="editDocumentTypeModalLabel"
|
<div class="modal fade" id="editInsuranceModal" tabindex="-1" aria-labelledby="editInsuranceModalLabel"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<form id="editDocumentTypeForm" method="POST">
|
<form id="editDocumentTypeForm" method="POST">
|
||||||
@ -105,14 +105,14 @@
|
|||||||
@method('PUT')
|
@method('PUT')
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="editDocumentTypeModalLabel">Edit Jenis Surat</h5>
|
<h5 class="modal-title" id="editInsuranceModalLabel">Edit Jenis Asuransi</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="editDocumentTypeName" class="form-label">Nama Jenis Surat</label>
|
<label for="editDocumentTypeName" class="form-label">Nama Jenis Asuransi</label>
|
||||||
<input type="text" class="form-control" id="editDocumentTypeName" name="name" required>
|
<input type="text" class="form-control" id="editDocumentTypeName" name="name" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -126,18 +126,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Modal Konfirmasi Hapus -->
|
<!-- Modal Konfirmasi Hapus -->
|
||||||
<div class="modal fade" id="deleteDocumentTypeModal" tabindex="-1" aria-labelledby="deleteDocumentTypeModalLabel"
|
<div class="modal fade" id="deleteInsuranceModal" tabindex="-1" aria-labelledby="deleteInsuranceModalLabel"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="deleteDocumentTypeModalLabel">Hapus Jenis Surat</h5>
|
<h5 class="modal-title" id="deleteInsuranceModalLabel">Hapus Jenis Asuransi</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
Apakah Anda yakin ingin menghapus jenis surat ini?
|
Apakah Anda yakin ingin menghapus jenis asuransi ini?
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
|
||||||
@ -193,7 +193,7 @@
|
|||||||
|
|
||||||
// Edit Document Type
|
// Edit Document Type
|
||||||
const editButtons = document.querySelectorAll('.edit-btn');
|
const editButtons = document.querySelectorAll('.edit-btn');
|
||||||
const editModal = document.getElementById('editDocumentTypeModal');
|
const editModal = document.getElementById('editInsuranceModal');
|
||||||
const editForm = document.getElementById('editDocumentTypeForm');
|
const editForm = document.getElementById('editDocumentTypeForm');
|
||||||
|
|
||||||
editButtons.forEach(button => {
|
editButtons.forEach(button => {
|
||||||
@ -210,7 +210,7 @@
|
|||||||
|
|
||||||
// Delete Document Type
|
// Delete Document Type
|
||||||
const deleteButtons = document.querySelectorAll('.delete-btn');
|
const deleteButtons = document.querySelectorAll('.delete-btn');
|
||||||
const deleteModal = document.getElementById('deleteDocumentTypeModal');
|
const deleteModal = document.getElementById('deleteInsuranceModal');
|
||||||
const deleteForm = document.getElementById('deleteForm');
|
const deleteForm = document.getElementById('deleteForm');
|
||||||
|
|
||||||
deleteButtons.forEach(button => {
|
deleteButtons.forEach(button => {
|
||||||
@ -34,16 +34,17 @@
|
|||||||
],
|
],
|
||||||
(object) [
|
(object) [
|
||||||
'icon' => 'fas fa-list',
|
'icon' => 'fas fa-list',
|
||||||
'name' => 'Jenis Surat',
|
'name' => 'Jenis Asuransi',
|
||||||
'link' => '/jenis-surat',
|
'link' => '/asuransi',
|
||||||
'childs' => [],
|
'childs' => [],
|
||||||
|
'is_admin' => true, // Menambahkan field ini untuk mengontrol akses
|
||||||
],
|
],
|
||||||
(object) [
|
(object) [
|
||||||
'icon' => 'fas fa-user',
|
'icon' => 'fas fa-user',
|
||||||
'name' => 'Pegawai',
|
'name' => 'Manajemen Pegawai',
|
||||||
'link' => '/manajemen-akun',
|
'link' => '/manajemen-akun',
|
||||||
'childs' => [],
|
'childs' => [],
|
||||||
'is_superuser' => true, // Menambahkan field ini untuk mengontrol akses
|
'is_admin' => true, // Menambahkan field ini untuk mengontrol akses
|
||||||
],
|
],
|
||||||
(object) [
|
(object) [
|
||||||
'title' => 'DROPDOWN EXAMPLE',
|
'title' => 'DROPDOWN EXAMPLE',
|
||||||
@ -82,7 +83,7 @@
|
|||||||
@continue
|
@continue
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if (isset($menu->is_superuser) && $menu->is_superuser && !Auth::user()->role === 'admin')
|
@if (isset($menu->is_admin) && $menu->is_admin && !Auth::user()->role === 'admin')
|
||||||
@continue {{-- Menghentikan iterasi jika bukan superuser --}}
|
@continue {{-- Menghentikan iterasi jika bukan superuser --}}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ use App\Http\Controllers\DashboardController;
|
|||||||
use App\Http\Controllers\ManageUserController;
|
use App\Http\Controllers\ManageUserController;
|
||||||
use App\Http\Controllers\ProfileController;
|
use App\Http\Controllers\ProfileController;
|
||||||
use App\Http\Controllers\DocumentTypeController;
|
use App\Http\Controllers\DocumentTypeController;
|
||||||
|
use App\Http\Controllers\InsuranceController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -45,13 +46,13 @@ Route::middleware('auth')->group(function () {
|
|||||||
Route::put('/manajemen-akun/{id}', [ManageUserController::class, 'update'])->name('users-management.update');
|
Route::put('/manajemen-akun/{id}', [ManageUserController::class, 'update'])->name('users-management.update');
|
||||||
Route::delete('/manajemen-akun/{id}', [ManageUserController::class, 'destroy'])->name('users-management.destroy');
|
Route::delete('/manajemen-akun/{id}', [ManageUserController::class, 'destroy'])->name('users-management.destroy');
|
||||||
Route::post('/manajemen-akun/{id}/disable', [ManageUserController::class, 'disable'])->name('users-management.disable');
|
Route::post('/manajemen-akun/{id}/disable', [ManageUserController::class, 'disable'])->name('users-management.disable');
|
||||||
});
|
|
||||||
|
|
||||||
# Manage Jenis Surat
|
# Manage Jenis Asuransi
|
||||||
Route::get('/jenis-surat', [DocumentTypeController::class, 'index'])->name('doc-types-management.index');
|
Route::get('/asuransi', [InsuranceController::class, 'index'])->name('insurance.index');
|
||||||
Route::post('/jenis-surat', [DocumentTypeController::class, 'store'])->name('doc-types-management.store');
|
Route::post('/asuransi', [InsuranceController::class, 'store'])->name('insurance.store');
|
||||||
Route::put('/jenis-surat/{id}', [DocumentTypeController::class, 'update'])->name('doc-types-management.update');
|
Route::put('/asuransi/{id}', [InsuranceController::class, 'update'])->name('insurance.update');
|
||||||
Route::delete('/jenis-surat/{id}', [DocumentTypeController::class, 'destroy'])->name('doc-types-management.destroy');
|
Route::delete('/asuransi/{id}', [InsuranceController::class, 'destroy'])->name('insurance.destroy');
|
||||||
|
});
|
||||||
|
|
||||||
// Profile Page
|
// Profile Page
|
||||||
Route::get('/profil-akun', [ProfileController::class, 'edit'])->name('profile.edit');
|
Route::get('/profil-akun', [ProfileController::class, 'edit'])->name('profile.edit');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user