-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `db_sarpras`
--

-- --------------------------------------------------------

--
-- Table structure for table `bangunan`
--

CREATE TABLE `bangunan` (
  `id` int(11) UNSIGNED NOT NULL,
  `nama_bangunan` varchar(150) NOT NULL,
  `luas_bangunan` double NOT NULL DEFAULT 0,
  `jumlah_ruang` int(11) NOT NULL DEFAULT 0,
  `tahun_dibangun` year(4) DEFAULT NULL,
  `nilai_perolehan` double NOT NULL DEFAULT 0,
  `penyusutan_per_tahun` double NOT NULL DEFAULT 0,
  `nilai_sekarang` double NOT NULL DEFAULT 0,
  `kondisi` enum('Baik','Rusak Ringan','Rusak Berat') NOT NULL DEFAULT 'Baik',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `bangunan`
--

INSERT INTO `bangunan` (`id`, `nama_bangunan`, `luas_bangunan`, `jumlah_ruang`, `tahun_dibangun`, `nilai_perolehan`, `penyusutan_per_tahun`, `nilai_sekarang`, `kondisi`, `created_at`, `updated_at`) VALUES
(1, 'Gedung Timur', 20, 15, '2023', 5000000000, 1000000, 4997000000, 'Baik', '2026-05-18 09:31:14', '2026-05-18 10:17:38');

-- --------------------------------------------------------

--
-- Table structure for table `barang`
--

CREATE TABLE `barang` (
  `id` int(11) UNSIGNED NOT NULL,
  `kode_barang` varchar(50) NOT NULL,
  `nama_barang` varchar(150) NOT NULL,
  `id_jenis` int(11) UNSIGNED DEFAULT NULL,
  `merk` varchar(100) DEFAULT NULL,
  `spesifikasi` text DEFAULT NULL,
  `jumlah` int(11) NOT NULL DEFAULT 0,
  `harga_satuan` double NOT NULL DEFAULT 0,
  `harga_total` double NOT NULL DEFAULT 0,
  `id_sumber_dana` int(11) UNSIGNED DEFAULT NULL,
  `id_ruangan` int(11) UNSIGNED DEFAULT NULL,
  `foto` varchar(255) DEFAULT NULL,
  `tahun_perolehan` year(4) DEFAULT NULL,
  `umur_ekonomis` int(11) DEFAULT NULL,
  `penyusutan_per_tahun` double NOT NULL DEFAULT 0,
  `kondisi` enum('Baik','Rusak Ringan','Rusak Berat') NOT NULL DEFAULT 'Baik',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `barang`
--

INSERT INTO `barang` (`id`, `kode_barang`, `nama_barang`, `id_jenis`, `merk`, `spesifikasi`, `jumlah`, `harga_satuan`, `harga_total`, `id_sumber_dana`, `id_ruangan`, `foto`, `tahun_perolehan`, `umur_ekonomis`, `penyusutan_per_tahun`, `kondisi`, `created_at`, `updated_at`) VALUES
(1, 'KIB1', 'Komputer', 1, 'HP', 'intel core i3', 2, 2000000, 4000000, 1, 3, '1779095878_156929847a059df7a7cc.jpg', '2024', 5, 400000, 'Baik', '2026-05-18 09:17:58', '2026-05-18 10:12:20'),
(3, 'KIB1', 'Proyektor', 1, 'Epson', '', 2, 4000000, 8000000, 3, 2, '1779099386_82ed2b376d97fa51e057.png', '2022', 6, 666666.66666667, 'Baik', '2026-05-18 10:16:26', '2026-05-18 10:16:53');

-- --------------------------------------------------------

--
-- Table structure for table `buku`
--

CREATE TABLE `buku` (
  `id` int(11) UNSIGNED NOT NULL,
  `tgl_pengadaan` date DEFAULT NULL,
  `id_sumber_dana` int(11) UNSIGNED DEFAULT NULL,
  `judul` varchar(200) NOT NULL,
  `pengarang` varchar(150) DEFAULT NULL,
  `penerbit` varchar(150) DEFAULT NULL,
  `tahun_terbit` year(4) DEFAULT NULL,
  `harga_satuan` double NOT NULL DEFAULT 0,
  `jumlah` int(11) NOT NULL DEFAULT 0,
  `total_harga` double NOT NULL DEFAULT 0,
  `foto` varchar(255) DEFAULT NULL,
  `id_ruangan` int(11) UNSIGNED DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `buku`
--

INSERT INTO `buku` (`id`, `tgl_pengadaan`, `id_sumber_dana`, `judul`, `pengarang`, `penerbit`, `tahun_terbit`, `harga_satuan`, `jumlah`, `total_harga`, `foto`, `id_ruangan`, `created_at`, `updated_at`) VALUES
(1, '2026-05-18', 3, 'Komik', 'Joko', 'Erlangga', '2023', 10000000, 5, 50000000, '1779096814_faf238a19a8a4c45c796.jpg', 4, '2026-05-18 09:33:34', '2026-05-18 10:18:07');

-- --------------------------------------------------------

--
-- Table structure for table `jenis_barang`
--

CREATE TABLE `jenis_barang` (
  `id` int(11) UNSIGNED NOT NULL,
  `nama_jenis` varchar(100) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `jenis_barang`
--

INSERT INTO `jenis_barang` (`id`, `nama_jenis`, `created_at`, `updated_at`) VALUES
(1, 'Elektronik', NULL, NULL),
(3, 'Alat Olahraga', NULL, NULL),
(4, 'Media Pembelajaran', '2026-05-18 12:48:06', '2026-05-18 12:48:06'),
(5, 'KOMPUTER', '2026-05-18 12:48:23', '2026-05-18 12:48:38');

-- --------------------------------------------------------

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `version` varchar(255) NOT NULL,
  `class` varchar(255) NOT NULL,
  `group` varchar(255) NOT NULL,
  `namespace` varchar(255) NOT NULL,
  `time` int(11) NOT NULL,
  `batch` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `version`, `class`, `group`, `namespace`, `time`, `batch`) VALUES
(1, '2026-05-18-000001', 'App\\Database\\Migrations\\CreateSarprasTables', 'default', 'App', 1779088713, 1);

-- --------------------------------------------------------

--
-- Table structure for table `peminjaman`
--

CREATE TABLE `peminjaman` (
  `id` int(11) UNSIGNED NOT NULL,
  `id_barang` int(11) UNSIGNED DEFAULT NULL,
  `id_ruangan` int(11) UNSIGNED DEFAULT NULL,
  `tgl_peminjaman` date DEFAULT NULL,
  `tgl_pengembalian` date DEFAULT NULL,
  `biaya` double NOT NULL DEFAULT 0,
  `foto` varchar(255) DEFAULT NULL,
  `keterangan` text DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `peminjaman`
--

INSERT INTO `peminjaman` (`id`, `id_barang`, `id_ruangan`, `tgl_peminjaman`, `tgl_pengembalian`, `biaya`, `foto`, `keterangan`, `created_at`, `updated_at`) VALUES
(1, 1, 3, '2026-05-18', '2026-05-18', 500000, '1779097458_01c4dccd5d675147df45.jpg', '', '2026-05-18 09:44:18', '2026-05-18 09:44:18');

-- --------------------------------------------------------

--
-- Table structure for table `pengajuan`
--

CREATE TABLE `pengajuan` (
  `id` int(11) UNSIGNED NOT NULL,
  `tgl_pengajuan` date DEFAULT NULL,
  `tgl_persetujuan` date DEFAULT NULL,
  `nama_barang` varchar(150) NOT NULL,
  `id_ruangan` int(11) UNSIGNED DEFAULT NULL,
  `biaya` double NOT NULL DEFAULT 0,
  `foto` varchar(255) DEFAULT NULL,
  `keterangan` text DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pengajuan`
--

INSERT INTO `pengajuan` (`id`, `tgl_pengajuan`, `tgl_persetujuan`, `nama_barang`, `id_ruangan`, `biaya`, `foto`, `keterangan`, `created_at`, `updated_at`) VALUES
(1, '2026-05-18', '2026-05-18', 'Komputer', 3, 500000, '1779097577_a72da6fe79819e2e6cf4.webp', 'kebutuhan pembelajaran', '2026-05-18 09:46:17', '2026-05-18 09:46:17');

-- --------------------------------------------------------

--
-- Table structure for table `penghapusan`
--

CREATE TABLE `penghapusan` (
  `id` int(11) UNSIGNED NOT NULL,
  `tgl_kerusakan` date DEFAULT NULL,
  `tgl_persetujuan` date DEFAULT NULL,
  `id_barang` int(11) UNSIGNED DEFAULT NULL,
  `id_ruangan` int(11) UNSIGNED DEFAULT NULL,
  `foto` varchar(255) DEFAULT NULL,
  `keterangan` text DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `penghapusan`
--

INSERT INTO `penghapusan` (`id`, `tgl_kerusakan`, `tgl_persetujuan`, `id_barang`, `id_ruangan`, `foto`, `keterangan`, `created_at`, `updated_at`) VALUES
(1, '2026-05-18', '2026-05-18', 1, 2, '1779097639_6e258b62d032ec487364.png', 'rusak', '2026-05-18 09:47:19', '2026-05-18 09:47:19');

-- --------------------------------------------------------

--
-- Table structure for table `perbaikan`
--

CREATE TABLE `perbaikan` (
  `id` int(11) UNSIGNED NOT NULL,
  `id_barang` int(11) UNSIGNED DEFAULT NULL,
  `id_ruangan` int(11) UNSIGNED DEFAULT NULL,
  `jenis_perbaikan` varchar(150) NOT NULL,
  `tgl_kerusakan` date DEFAULT NULL,
  `tgl_perbaikan` date DEFAULT NULL,
  `biaya` double NOT NULL DEFAULT 0,
  `foto` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `perbaikan`
--

INSERT INTO `perbaikan` (`id`, `id_barang`, `id_ruangan`, `jenis_perbaikan`, `tgl_kerusakan`, `tgl_perbaikan`, `biaya`, `foto`, `created_at`, `updated_at`) VALUES
(1, 1, 3, 'Ganti PSU', '2026-05-18', '2026-05-23', 50000, '1779097520_44d29316948b4ad72849.jpg', '2026-05-18 09:45:20', '2026-05-18 09:45:20');

-- --------------------------------------------------------

--
-- Table structure for table `ruangan`
--

CREATE TABLE `ruangan` (
  `id` int(11) UNSIGNED NOT NULL,
  `nama_ruangan` varchar(100) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `ruangan`
--

INSERT INTO `ruangan` (`id`, `nama_ruangan`, `created_at`, `updated_at`) VALUES
(1, 'Ruang Kepala Madrasah', NULL, '2026-05-18 12:47:02'),
(2, 'Ruang Guru', NULL, NULL),
(3, 'Lab Komputer', NULL, NULL),
(4, 'Perpustakaan', NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `sumber_dana`
--

CREATE TABLE `sumber_dana` (
  `id` int(11) UNSIGNED NOT NULL,
  `nama_sumber` varchar(100) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sumber_dana`
--

INSERT INTO `sumber_dana` (`id`, `nama_sumber`, `created_at`, `updated_at`) VALUES
(1, 'BOS Pusat', NULL, NULL),
(2, 'BOPDA', NULL, '2026-05-18 12:47:23'),
(3, 'Komite Sekolah', NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `tanah`
--

CREATE TABLE `tanah` (
  `id` int(11) UNSIGNED NOT NULL,
  `nama_tanah` varchar(150) NOT NULL,
  `status_kepemilikan` varchar(100) NOT NULL,
  `luas` double NOT NULL DEFAULT 0,
  `lokasi` text NOT NULL,
  `tahun_perolehan` year(4) DEFAULT NULL,
  `nilai_perolehan` double NOT NULL DEFAULT 0,
  `kenaikan_per_tahun` double NOT NULL DEFAULT 0,
  `nilai_sekarang` double NOT NULL DEFAULT 0,
  `kondisi` varchar(100) NOT NULL,
  `keterangan` text DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tanah`
--

INSERT INTO `tanah` (`id`, `nama_tanah`, `status_kepemilikan`, `luas`, `lokasi`, `tahun_perolehan`, `nilai_perolehan`, `kenaikan_per_tahun`, `nilai_sekarang`, `kondisi`, `keterangan`, `created_at`, `updated_at`) VALUES
(1, 'Gedung Utama', 'Persyarikatan', 25000, 'Wojorejo Indah Timur No. 26', '2024', 10000000000, 1000000, 10002000000, 'Baik', '', '2026-05-18 09:26:51', '2026-05-18 10:17:12');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `bangunan`
--
ALTER TABLE `bangunan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `barang`
--
ALTER TABLE `barang`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `buku`
--
ALTER TABLE `buku`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `jenis_barang`
--
ALTER TABLE `jenis_barang`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `peminjaman`
--
ALTER TABLE `peminjaman`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `pengajuan`
--
ALTER TABLE `pengajuan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `penghapusan`
--
ALTER TABLE `penghapusan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `perbaikan`
--
ALTER TABLE `perbaikan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `ruangan`
--
ALTER TABLE `ruangan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sumber_dana`
--
ALTER TABLE `sumber_dana`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tanah`
--
ALTER TABLE `tanah`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `bangunan`
--
ALTER TABLE `bangunan`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `barang`
--
ALTER TABLE `barang`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `buku`
--
ALTER TABLE `buku`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `jenis_barang`
--
ALTER TABLE `jenis_barang`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `peminjaman`
--
ALTER TABLE `peminjaman`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `pengajuan`
--
ALTER TABLE `pengajuan`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `penghapusan`
--
ALTER TABLE `penghapusan`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `perbaikan`
--
ALTER TABLE `perbaikan`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `ruangan`
--
ALTER TABLE `ruangan`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `sumber_dana`
--
ALTER TABLE `sumber_dana`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `tanah`
--
ALTER TABLE `tanah`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
COMMIT;

