Merge branch 'main' of https://git.probindo.com/Probindo/database-pertani-web
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
<?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('akses_pasar', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table -> string ('uid')->nullable()->unique();
|
||||
|
||||
$table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('cascade');
|
||||
|
||||
$table->tinyInteger('skor_pengalaman')->nullable()->comment('Skala 1-5');
|
||||
$table->json('saluran_terdahulu')->nullable()->comment('Menyimpan opsi Many (Koperasi, BUMDes, dll)');
|
||||
$table->string('saluran_terdahulu_lainnya')->nullable();
|
||||
|
||||
$table->string('alasan_berhenti')->nullable();
|
||||
|
||||
$table->string('praktik_fermentasi')->nullable();
|
||||
$table->text('proses_fermentasi')->nullable();
|
||||
$table->string('model_fermentasi_memungkinkan')->nullable();
|
||||
|
||||
$table->tinyInteger('skor_kesadaran_premium')->nullable()->comment('Skala 1-5');
|
||||
$table->string('sumber_info_premium')->nullable();
|
||||
|
||||
$table->time('waktu_mulai_wawancara')->nullable();
|
||||
$table->time('waktu_selesai_wawancara')->nullable();
|
||||
|
||||
$table->tinyInteger('skor_kepercayaan_responden')->nullable()->comment('Skala 1-5');
|
||||
$table->string('kehadiran_orang_lain')->nullable()->comment('Nama/siapa yang hadir mendampingi');
|
||||
$table->tinyInteger('skor_pengaruh_orang_lain')->nullable()->comment('Skala 1-5');
|
||||
|
||||
$table ->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table ->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table ->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
|
||||
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::create('harga_jual_panen', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table -> string ('uid')->nullable()->unique();
|
||||
|
||||
$table->foreignId('petani_id')->constrained('petani')->onDelete('cascade');
|
||||
|
||||
$table->string('bentuk_produk');
|
||||
|
||||
$table->integer('harga_panen_terakhir')->nullable();
|
||||
$table->integer('harga_tahun_lalu')->nullable();
|
||||
$table->integer('harga_dua_tahun_lalu')->nullable();
|
||||
|
||||
$table ->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table ->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table ->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('akses_pasar');
|
||||
Schema::dropIfExists('harga_jual_panen');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,104 @@
|
||||
<?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('sosial_ekonomi', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uid')->nullable()->unique();
|
||||
|
||||
$table->foreignId('petani_id')->nullable()->constrained('petani')->onDelete('cascade');
|
||||
|
||||
$table->integer('jumlah_tanggungan')->nullable();
|
||||
$table->integer('anak_masih_sekolah')->nullable();
|
||||
$table->integer('yang_ikut_bekerja')->nullable();
|
||||
|
||||
$table->tinyInteger('skor_periode_paceklik')->nullable()
|
||||
->comment('Skala 1-5: 1=>4 bulan, 2=3-4 bulan, 3=1-2 bulan, 4=sebentar/tidak menentu, 5=tidak ada/stabil');
|
||||
$table->string('bulan_paceklik')->nullable();
|
||||
$table->text('sumber_penghasilan_paceklik')->nullable();
|
||||
|
||||
$table->unsignedBigInteger('total_estimasi_biaya_kebun_per_musim')->nullable();
|
||||
|
||||
$table->tinyInteger('skor_kemampuan_menabung')->nullable()
|
||||
->comment('Skala 1-5');
|
||||
$table->unsignedBigInteger('estimasi_tabungan_per_bulan')->nullable();
|
||||
|
||||
$table->tinyInteger('skor_kecukupan_penghasilan')->nullable()
|
||||
->comment('Skala 1-5');
|
||||
$table->text('alasan_kecukupan_penghasilan')->nullable();
|
||||
|
||||
$table->string('status_kepemilikan_lahan')->nullable();
|
||||
$table->tinyInteger('skor_kejelasan_status_lahan')->nullable()
|
||||
->comment('Skala 1-5');
|
||||
$table->boolean('ada_sertifikat_dokumen')->nullable();
|
||||
$table->boolean('ada_sengketa')->nullable();
|
||||
$table->text('keterangan_sengketa')->nullable();
|
||||
$table->string('pihak_membantu_konflik')->nullable()
|
||||
->comment('Tidak ada-selesaikan sendiri / Ada');
|
||||
$table->string('pihak_membantu_konflik_nama')->nullable();
|
||||
$table->year('tahun_bantuan_konflik')->nullable();
|
||||
$table->string('status_konflik')->nullable()
|
||||
->comment('Sudah selesai / Belum, masih berlanjut');
|
||||
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::create('pendapatan_komoditas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uid')->nullable()->unique();
|
||||
|
||||
$table->foreignId('sosial_ekonomi_id')->constrained('sosial_ekonomi')->onDelete('cascade');
|
||||
|
||||
$table->string('kategori')->comment('utama / lainnya');
|
||||
$table->string('komoditas')->nullable();
|
||||
$table->unsignedBigInteger('pendapatan')->nullable();
|
||||
$table->string('periode')->nullable()->comment('musim / tahun');
|
||||
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('pendapatan_luar_pertanian', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uid')->nullable()->unique();
|
||||
|
||||
$table->foreignId('sosial_ekonomi_id')->constrained('sosial_ekonomi')->onDelete('cascade');
|
||||
|
||||
$table->string('jenis_pekerjaan')->nullable();
|
||||
$table->unsignedBigInteger('estimasi_per_bulan')->nullable();
|
||||
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('pendapatan_luar_pertanian');
|
||||
Schema::dropIfExists('pendapatan_komoditas');
|
||||
Schema::dropIfExists('sosial_ekonomi');
|
||||
}
|
||||
};
|
||||
@@ -32,16 +32,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4 mx-n4" />
|
||||
|
||||
<h6 class="mb-3">Informasi Kolom-Kolom</h6>
|
||||
|
||||
<hr class="my-4 mx-n4" />
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-auto d-flex gap-2">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-bs-toggle="offcanvas" data-bs-target="#offcanvasAddKolom" >
|
||||
<i class="ti tabler-plus me-1"></i> Tambah
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-12 mb-4 form-control-validation">
|
||||
|
||||
@@ -56,6 +51,7 @@
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@forelse($tabel->kolom as $index => $kolom)
|
||||
<tr>
|
||||
@@ -94,17 +90,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h6 class="mb-3">Informasi Ringkasan Tabel</h6>
|
||||
|
||||
<hr class="my-4 mx-n4" />
|
||||
<div class="row mb-4">
|
||||
<div class="row mb-12">
|
||||
<div class="col-md-auto d-flex gap-2">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-bs-toggle="offcanvas" data-bs-target="#offcanvasAddRingkasan" >
|
||||
<button type="button" class="btn btn-sm btn-primary" data-bs-toggle="offcanvas" data-bs-target="#offcanvasAddKolom" >
|
||||
<i class="ti tabler-plus me-1"></i> Tambah
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4 mx-n4" />
|
||||
|
||||
<h6 class="mb-3">Informasi Ringkasan Tabel</h6>
|
||||
|
||||
<hr class="my-4 mx-n4" />
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-12 mb-4 form-control-validation">
|
||||
|
||||
@@ -159,16 +158,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-12">
|
||||
<div class="col-md-auto d-flex gap-2">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-bs-toggle="offcanvas" data-bs-target="#offcanvasAddRingkasan" >
|
||||
<i class="ti tabler-plus me-1"></i> Tambah
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h6 class="mb-3">Informasi Formulir Tabel</h6>
|
||||
|
||||
<hr class="my-4 mx-n4" />
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-auto d-flex gap-2">
|
||||
<a href="{{ route('tabel.formulir.index', ['tabel' => $tabel->id]) }}" class="btn btn-sm btn-primary" >
|
||||
<i class="ti tabler-edit me-1"></i> Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-12">
|
||||
@@ -177,6 +178,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-auto d-flex gap-2">
|
||||
<a href="{{ route('tabel.formulir.index', ['tabel' => $tabel->id]) }}" class="btn btn-sm btn-primary" >
|
||||
<i class="ti tabler-edit me-1"></i> Edit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-end">
|
||||
<a href="{{ route('tabel.index') }}" class="btn btn-label-secondary me-2">Kembali</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user