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

START TRANSACTION;



--
-- Database: `absensi`
--

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

--
-- Table structure for table `announcements`
--

CREATE TABLE `announcements` (
  `id` int(11) NOT NULL,
  `judul` varchar(200) DEFAULT NULL,
  `isi` text DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `announcements`
--

INSERT INTO `announcements` (`id`, `judul`, `isi`, `updated_at`) VALUES
(1, 'Pengumuman Selamat hari raya', 'Minal aidzin walfaizin, mohon maaf lahir dan batin. 🙏\r\n\r\nDi hari yang suci ini, saya dengan tulus memohon maaf apabila selama ini terdapat perkataan, sikap, maupun perbuatan saya yang kurang berkenan di hati.\r\n\r\nSemoga di Hari Raya Idul Fitri 1 Syawal 1447 Hijriah ini, kita semua diberikan keberkahan, kesehatan, dan kebahagiaan.\r\n\r\nSelamat Hari Raya Idul Fitri 🌙✨', '2026-03-22 18:57:31');

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

--
-- Table structure for table `attendances`
--

CREATE TABLE `attendances` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `type` enum('masuk','pulang') NOT NULL,
  `timestamp` datetime DEFAULT current_timestamp(),
  `latitude` decimal(10,7) DEFAULT NULL,
  `longitude` decimal(10,7) DEFAULT NULL,
  `distance_m` int(11) DEFAULT NULL,
  `status` enum('hadir','terlambat','invalid') DEFAULT 'hadir',
  `foto_path` varchar(255) DEFAULT NULL,
  `denda_applied` int(11) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `attendances`
--

INSERT INTO `attendances` (`id`, `user_id`, `type`, `timestamp`, `latitude`, `longitude`, `distance_m`, `status`, `foto_path`, `denda_applied`, `created_at`) VALUES
(34, 5, 'masuk', '2026-03-20 19:56:38', -6.9365007, 106.9339790, 24, 'terlambat', 'att_543d5fd938.jpeg', 0, '2026-03-20 12:56:38'),
(35, 14, 'masuk', '2026-03-20 19:58:21', -6.9365007, 106.9339790, 24, 'hadir', 'att_4a14d92583.jpeg', 0, '2026-03-20 12:58:21'),
(36, 13, 'masuk', '2026-03-20 20:12:43', -6.9365007, 106.9339790, 24, 'hadir', 'att_7faec633ab.jpeg', 0, '2026-03-20 13:12:43'),
(37, 9, 'masuk', '2026-03-20 20:13:33', -6.9365007, 106.9339790, 24, 'terlambat', 'att_f29f9c7027.jpeg', 0, '2026-03-20 13:13:33'),
(39, 10, 'masuk', '2026-03-20 21:59:21', -6.9364941, 106.9339782, 23, 'terlambat', 'att_42b410fa41.jpeg', 0, '2026-03-20 14:59:21'),
(40, 8, 'masuk', '2026-03-20 22:03:23', -6.9365007, 106.9339790, 24, 'hadir', 'att_ece25fdb8c.jpeg', 0, '2026-03-20 15:03:23'),
(41, 5, 'masuk', '2026-03-22 01:05:30', -6.9364941, 106.9339782, 23, 'hadir', 'att_ab29c49300.jpeg', 0, '2026-03-21 18:05:30'),
(42, 13, 'masuk', '2026-03-22 01:07:16', -6.9365673, 106.9339470, 31, 'hadir', 'att_67a2301b42.jpeg', 0, '2026-03-21 18:07:16'),
(43, 5, 'masuk', '2026-04-05 02:51:47', -6.9364630, 106.9340210, 22, 'hadir', 'att_a4370c31b4.jpeg', 0, '2026-04-04 19:51:47'),
(44, 8, 'masuk', '2026-04-11 23:27:19', -6.9364890, 106.9340024, 23, 'terlambat', 'att_014897d1e1.jpeg', 0, '2026-04-11 16:27:19'),
(45, 12, 'masuk', '2026-04-11 23:29:17', -6.9364910, 106.9340001, 23, 'terlambat', 'att_3c43f61f34.jpeg', 0, '2026-04-11 16:29:17');

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

--
-- Table structure for table `divisi`
--

CREATE TABLE `divisi` (
  `id` int(11) NOT NULL,
  `nama_divisi` varchar(100) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `gaji_harian` int(11) DEFAULT 0,
  `gaji_terlambat` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `divisi`
--

INSERT INTO `divisi` (`id`, `nama_divisi`, `created_at`, `gaji_harian`, `gaji_terlambat`) VALUES
(1, 'Kordinator Pencucian', '2025-12-02 03:39:16', 145000, 120000),
(2, 'Kordinator Persiapan', '2025-12-02 03:39:16', 145000, 0),
(3, 'Kordinator Polmak', '2025-12-02 03:39:16', 145000, 0),
(4, 'Kordinator Pemorsian', '2025-12-02 03:39:16', 145000, 120000),
(5, 'Kordinator Distribusi', '2025-12-02 03:39:16', 145000, 120000),
(6, 'Pencucian', '2025-12-02 03:39:16', 0, 0),
(7, 'Persiapan', '2025-12-02 03:39:16', 0, 0),
(8, 'Polmak', '2025-12-02 03:39:16', 0, 0),
(9, 'Pemorsian', '2025-12-02 03:39:16', 0, 0),
(10, 'Gudang', '2025-12-02 03:39:16', 145000, 120000),
(11, 'Security', '2025-12-02 03:39:16', 0, 0),
(12, 'OB', '2025-12-02 03:39:16', 0, 0);

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

--
-- Table structure for table `divisions`
--

CREATE TABLE `divisions` (
  `id` int(11) NOT NULL,
  `nama_divisi` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `foodtray_items`
--

CREATE TABLE `foodtray_items` (
  `id` int(11) NOT NULL,
  `menu_id` int(11) NOT NULL,
  `nama_item` varchar(255) NOT NULL,
  `top_percent` float DEFAULT 0,
  `left_percent` float DEFAULT 0,
  `font_size` int(11) DEFAULT 14,
  `rotate` float DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `foodtray_items`
--

INSERT INTO `foodtray_items` (`id`, `menu_id`, `nama_item`, `top_percent`, `left_percent`, `font_size`, `rotate`) VALUES
(27, 16, 'BUAH LENGKENG', 16.5628, 23.107, 10, 0),
(28, 16, 'NASI PUTIH', 63.8852, 28.2419, 10, 0),
(29, 16, 'TIMUN POTONG', 16.5628, 61.6188, 10, 0),
(30, 16, 'AYAM POTONG', 63.8852, 53.9164, 10, 0),
(31, 16, 'TAHU KUNING', 26.0273, 43.6466, 10, 0);

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

--
-- Table structure for table `foodtray_menus`
--

CREATE TABLE `foodtray_menus` (
  `id` int(11) NOT NULL,
  `nama_menu` varchar(255) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `foodtray_menus`
--

INSERT INTO `foodtray_menus` (`id`, `nama_menu`, `created_at`) VALUES
(16, 'NASI PUTIH AYAM GORENG', '2026-04-13 04:56:17');

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

--
-- Table structure for table `foodtray_menu_sent`
--

CREATE TABLE `foodtray_menu_sent` (
  `id` int(11) NOT NULL,
  `menu_id` int(11) NOT NULL,
  `sent_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `foodtray_menu_sent`
--

INSERT INTO `foodtray_menu_sent` (`id`, `menu_id`, `sent_date`) VALUES
(9, 16, '2026-04-13');

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

--
-- Table structure for table `geofences`
--

CREATE TABLE `geofences` (
  `id` int(11) NOT NULL,
  `nama` varchar(150) DEFAULT NULL,
  `latitude` decimal(10,7) NOT NULL,
  `longitude` decimal(10,7) NOT NULL,
  `radius_m` int(11) NOT NULL DEFAULT 50,
  `aktif` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `geofences`
--

INSERT INTO `geofences` (`id`, `nama`, `latitude`, `longitude`, `radius_m`, `aktif`, `created_at`) VALUES
(19, 'Bale Barudak', -6.9362931, 106.9339268, 50, 1, '2026-03-20 12:47:12');

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

--
-- Table structure for table `invoice`
--

CREATE TABLE `invoice` (
  `id` int(11) NOT NULL,
  `tanggal` date NOT NULL DEFAULT curdate(),
  `supplier_id` int(11) NOT NULL,
  `status` enum('pending','disetujui','diproses','selesai') DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `is_sent` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `invoice`
--

INSERT INTO `invoice` (`id`, `tanggal`, `supplier_id`, `status`, `created_at`, `updated_at`, `is_sent`) VALUES
(5, '2026-04-01', 6, 'selesai', '2026-04-01 10:16:26', '2026-04-08 06:50:53', 1),
(6, '2026-04-01', 6, 'selesai', '2026-04-01 17:47:55', '2026-04-04 15:50:36', 0),
(7, '2026-04-01', 6, 'selesai', '2026-04-01 18:13:54', '2026-04-08 06:51:40', 1),
(8, '2026-04-03', 6, 'selesai', '2026-04-03 17:47:43', '2026-04-08 06:56:12', 1),
(9, '2026-04-04', 6, 'selesai', '2026-04-04 05:28:10', '2026-04-04 15:30:45', 0),
(10, '2026-04-04', 6, 'selesai', '2026-04-04 15:41:27', '2026-04-08 06:57:16', 1),
(11, '2026-04-04', 6, 'selesai', '2026-04-04 15:42:24', '2026-04-08 07:00:31', 1),
(12, '2026-04-04', 6, 'selesai', '2026-04-04 15:42:34', '2026-04-08 07:02:05', 1),
(13, '2026-04-04', 6, 'selesai', '2026-04-04 15:42:50', '2026-04-08 07:03:59', 1),
(14, '2026-04-04', 6, 'selesai', '2026-04-04 15:43:43', '2026-04-08 07:09:37', 1),
(15, '2026-04-04', 6, 'selesai', '2026-04-04 15:43:55', '2026-04-08 07:49:46', 1),
(16, '2026-04-04', 6, 'selesai', '2026-04-04 17:29:17', '2026-04-08 07:50:29', 1),
(17, '2026-04-04', 6, 'selesai', '2026-04-04 17:40:36', '2026-04-04 17:43:23', 0),
(18, '2026-04-04', 6, 'selesai', '2026-04-04 17:43:58', '2026-04-04 17:45:50', 0),
(19, '2026-04-04', 6, 'selesai', '2026-04-04 17:46:29', '2026-04-04 17:58:06', 0),
(20, '2026-04-04', 6, 'selesai', '2026-04-04 18:00:24', '2026-04-04 18:01:02', 0),
(21, '2026-04-04', 6, 'selesai', '2026-04-04 19:19:06', '2026-04-04 19:19:38', 0),
(22, '2026-04-04', 6, 'selesai', '2026-04-04 19:23:45', '2026-04-08 06:47:48', 1),
(23, '2026-04-04', 6, 'selesai', '2026-04-04 19:32:23', '2026-04-08 07:56:44', 1),
(24, '2026-04-04', 6, 'disetujui', '2026-04-04 19:39:53', '2026-04-08 06:43:14', 0),
(25, '2026-04-05', 6, 'diproses', '2026-04-05 04:30:52', '2026-04-08 06:24:17', 0),
(26, '2026-04-05', 6, 'pending', '2026-04-05 04:40:48', '2026-04-05 04:40:48', 0);

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

--
-- Table structure for table `invoice_item`
--

CREATE TABLE `invoice_item` (
  `id` int(11) NOT NULL,
  `invoice_id` int(11) NOT NULL,
  `produk_id` int(11) NOT NULL,
  `nama_item` varchar(255) NOT NULL,
  `qty` decimal(12,2) NOT NULL,
  `satuan` varchar(50) DEFAULT NULL,
  `harga_satuan` decimal(12,2) NOT NULL,
  `total_harga` decimal(12,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `invoice_item`
--

INSERT INTO `invoice_item` (`id`, `invoice_id`, `produk_id`, `nama_item`, `qty`, `satuan`, `harga_satuan`, `total_harga`) VALUES
(11, 5, 2, 'BAWANG PUTIH', 60.00, 'kg', 49000.00, 2940000.00),
(12, 6, 2, 'BAWANG PUTIH', 15.00, 'kg', 60000.00, 900000.00),
(13, 7, 3, 'AYAM POTONG', 200.00, 'kg', 40000.00, 8000000.00),
(14, 8, 3, 'AYAM POTONG', 190.00, 'kg', 40000.00, 7600000.00),
(15, 8, 2, 'BAWANG PUTIH', 5.00, 'kg', 60000.00, 300000.00),
(17, 9, 2, 'BAWANG PUTIH', 10.00, 'kg', 60000.00, 600000.00),
(18, 10, 29, 'MINYAK BIMOLI 5 L', 5.00, 'jerigen', 107000.00, 535000.00),
(19, 10, 24, 'SPAGHETTI SEDANA 1 KG', 10.00, 'kg', 225000.00, 2250000.00),
(20, 11, 25, 'DELMONTE KETCHUP SAUS TOMAT DRG 5.7kg', 2.00, 'jerigen', 102000.00, 204000.00),
(21, 11, 3, 'AYAM POTONG', 350.00, 'kg', 40000.00, 14000000.00),
(22, 11, 2, 'BAWANG PUTIH', 0.50, 'kg', 60000.00, 30000.00),
(23, 12, 25, 'DELMONTE KETCHUP SAUS TOMAT DRG 5.7kg', 2.00, 'jerigen', 102000.00, 204000.00),
(24, 13, 24, 'SPAGHETTI SEDANA 1 KG', 7.00, 'kg', 225000.00, 1575000.00),
(25, 14, 2, 'BAWANG PUTIH', 50.00, 'kg', 60000.00, 3000000.00),
(26, 15, 29, 'MINYAK BIMOLI 5 L', 10.00, 'jerigen', 107000.00, 1070000.00),
(27, 16, 3, 'AYAM POTONG', 50.00, 'kg', 40000.00, 2000000.00),
(28, 17, 29, 'MINYAK BIMOLI 5 L', 5.00, 'jerigen', 107000.00, 535000.00),
(29, 18, 3, 'AYAM POTONG', 100.00, 'kg', 40000.00, 4000000.00),
(30, 19, 26, 'PROCHIZ KEJU GOLD CHEDDAR BOX 2KG', 2.00, 'karton', 916000.00, 1832000.00),
(31, 20, 30, 'TELUR AYAM', 50.00, 'kg', 28500.00, 1425000.00),
(32, 21, 3, 'AYAM POTONG', 200.00, 'kg', 40000.00, 8000000.00),
(33, 22, 3, 'AYAM POTONG', 10.00, 'kg', 40000.00, 400000.00),
(34, 23, 3, 'AYAM POTONG', 40.00, 'kg', 40000.00, 1600000.00),
(35, 24, 17, 'TAHU KUNING', 50.00, 'pack', 5500.00, 275000.00),
(36, 25, 30, 'TELUR AYAM', 200.00, 'kg', 28500.00, 5700000.00),
(39, 26, 22, 'SUSU UHT INDOMILK', 65.00, 'karton', 123000.00, 7995000.00),
(40, 26, 3, 'AYAM POTONG', 50.00, 'kg', 40000.00, 2000000.00);

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

--
-- Table structure for table `leave_requests`
--

CREATE TABLE `leave_requests` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `jenis` enum('izin','sakit') NOT NULL,
  `tanggal_mulai` date DEFAULT NULL,
  `tanggal_akhir` date DEFAULT NULL,
  `keterangan` text DEFAULT NULL,
  `foto_bukti` varchar(255) DEFAULT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `log_barang`
--

CREATE TABLE `log_barang` (
  `id` int(11) NOT NULL,
  `barang_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `jumlah` decimal(10,2) NOT NULL,
  `tipe` enum('masuk','keluar') NOT NULL,
  `nama_barang` varchar(255) NOT NULL,
  `satuan` varchar(50) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `nama_barang_backup` varchar(255) DEFAULT NULL,
  `satuan_backup` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `log_barang`
--

INSERT INTO `log_barang` (`id`, `barang_id`, `user_id`, `jumlah`, `tipe`, `nama_barang`, `satuan`, `created_at`, `nama_barang_backup`, `satuan_backup`) VALUES
(7, 6, 22, 200.00, 'masuk', 'AYAM POTONG', 'KG', '2026-04-05 17:36:17', NULL, NULL),
(9, 7, 22, 6.00, 'masuk', 'BERAS', 'KARUNG', '2026-04-05 17:50:10', NULL, NULL),
(10, 8, 22, 57.00, 'masuk', 'SUSU INDOMILK UHT 115 ML', 'KARTON', '2026-04-05 17:50:38', NULL, NULL),
(11, 6, 22, 120.00, 'keluar', '', '', '2026-04-05 17:51:08', 'AYAM POTONG', 'KG'),
(12, 9, 22, 5.00, 'masuk', 'BAWA GORENG', 'KG', '2026-04-05 17:51:20', NULL, NULL),
(13, 7, 22, 3.00, 'keluar', '', '', '2026-04-05 17:51:28', 'BERAS', 'KARUNG'),
(14, 9, 22, 0.50, 'keluar', '', '', '2026-04-05 17:51:38', 'BAWA GORENG', 'KG'),
(15, 10, 22, 100.00, 'masuk', 'TELUR', 'KG', '2026-04-05 18:19:22', NULL, NULL),
(16, 11, 22, 100.00, 'masuk', 'AYAM GILING', 'KG', '2026-04-05 18:19:38', NULL, NULL),
(17, 11, 22, 50.00, 'keluar', '', '', '2026-04-05 18:19:53', 'AYAM GILING', 'KG'),
(18, 10, 22, 70.00, 'keluar', '', '', '2026-04-05 18:19:59', 'TELUR', 'KG'),
(19, 12, 22, 500.00, 'masuk', 'TAHU KULIT COKLAT', 'PCS', '2026-04-06 07:03:00', NULL, NULL),
(20, 13, 22, 2.00, 'masuk', 'NUGGET SO ECO', 'KG', '2026-04-06 07:03:16', NULL, NULL),
(21, 14, 22, 5.00, 'masuk', 'ROMA BISCUIT KELAPA KLG 345g', 'KARTON', '2026-04-06 07:13:07', NULL, NULL),
(22, 15, 22, 5.00, 'masuk', 'BUAH APEL FUJI UK 88', 'KARTON', '2026-04-06 07:13:19', NULL, NULL),
(23, 16, 22, 6.00, 'masuk', 'BUAH APEL FUJI UK 100', 'KARTON', '2026-04-06 07:14:01', NULL, NULL),
(24, 11, 22, 50.00, 'masuk', 'AYAM GILING', 'KG', '2026-04-06 17:03:59', NULL, NULL),
(25, 11, 22, 50.00, 'masuk', 'AYAM GILING', 'KG', '2026-04-06 19:47:09', NULL, NULL),
(26, 17, 22, 100.00, 'masuk', 'TEMPE', 'PAPAN', '2026-04-06 19:47:27', NULL, NULL),
(27, 9, 22, 5.00, 'masuk', 'BAWA GORENG', 'KG', '2026-04-06 19:50:50', NULL, NULL),
(28, 18, 22, 80.00, 'masuk', 'MELON', 'KG', '2026-04-06 19:51:21', NULL, NULL),
(29, 19, 22, 200.00, 'masuk', 'PISANG AMBON', 'KG', '2026-04-06 19:51:49', NULL, NULL),
(30, 20, 22, 5.00, 'masuk', 'ANGGUR', 'KRAT', '2026-04-06 19:52:10', NULL, NULL),
(31, 13, 22, 4.00, 'masuk', 'NUGGET SO ECO', 'KG', '2026-04-06 19:52:36', NULL, NULL),
(32, 21, 22, 24.00, 'masuk', 'SUSU UHT 1 LITER', 'PCS', '2026-04-06 19:53:10', NULL, NULL),
(34, 22, 22, 100.00, 'masuk', 'JAMBU KRISTA', 'KG', '2026-04-06 20:04:42', NULL, NULL),
(35, 23, 22, 23.00, 'masuk', 'UBI', 'KG', '2026-04-06 20:09:44', NULL, NULL),
(36, 24, 22, 50.00, 'masuk', 'SALADA', 'KG', '2026-04-07 02:00:50', NULL, NULL),
(38, 6, 22, 20.00, 'keluar', '', '', '2026-04-07 06:07:32', 'AYAM POTONG', 'KG'),
(39, 20, 22, 3.00, 'keluar', '', '', '2026-04-07 08:00:49', 'ANGGUR', 'KRAT'),
(40, 13, 22, 3.00, 'keluar', '', '', '2026-04-07 08:06:52', 'NUGGET SO ECO', 'KG'),
(41, 19, 22, 100.00, 'keluar', '', '', '2026-04-07 08:06:59', 'PISANG AMBON', 'KG'),
(42, 17, 22, 50.00, 'keluar', '', '', '2026-04-07 08:07:05', 'TEMPE', 'PAPAN'),
(43, 15, 22, 2.00, 'keluar', '', '', '2026-04-07 08:07:10', 'BUAH APEL FUJI UK 88', 'KARTON'),
(44, 7, 22, 1.00, 'keluar', '', '', '2026-04-07 08:07:19', 'BERAS', 'KARUNG'),
(45, 22, 22, 70.00, 'keluar', '', '', '2026-04-07 08:07:27', 'JAMBU KRISTA', 'KG'),
(46, 9, 22, 5.00, 'keluar', '', '', '2026-04-07 08:07:39', 'BAWA GORENG', 'KG'),
(47, 14, 22, 2.00, 'keluar', '', '', '2026-04-07 08:07:46', 'ROMA BISCUIT KELAPA KLG 345g', 'KARTON'),
(48, 8, 22, 3.00, 'keluar', '', '', '2026-04-07 08:08:17', 'SUSU INDOMILK UHT 115 ML', 'KARTON'),
(49, 19, 22, 20.00, 'keluar', '', '', '2026-04-07 08:08:25', 'PISANG AMBON', 'KG'),
(50, 7, 22, 1.00, 'keluar', '', '', '2026-04-07 08:25:07', 'BERAS', 'KARUNG'),
(51, 20, 22, 1.00, 'keluar', '', '', '2026-04-07 19:06:33', 'ANGGUR', 'KRAT'),
(52, 24, 22, 10.00, 'keluar', '', '', '2026-04-07 19:37:45', 'SALADA', 'KG'),
(56, 26, 22, 12.00, 'masuk', 'LADA HITAM', 'KG', '2026-04-07 20:25:36', NULL, NULL),
(57, 25, 22, 15.00, 'masuk', 'KETANG', 'KG', '2026-04-07 20:25:40', NULL, NULL),
(58, 28, 22, 5.00, 'masuk', 'KECAP INGGRIS', 'BOTOL', '2026-04-07 20:25:57', NULL, NULL);

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

--
-- Table structure for table `pengadaan`
--

CREATE TABLE `pengadaan` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `judul` varchar(255) NOT NULL,
  `subjek` enum('Pengadaan Barang','Perbaikan','Lainnya') NOT NULL,
  `pesan` text NOT NULL,
  `foto` varchar(255) DEFAULT NULL,
  `status` enum('pending','onprocess','disetujui','selesai') DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pengadaan`
--

INSERT INTO `pengadaan` (`id`, `user_id`, `judul`, `subjek`, `pesan`, `foto`, `status`, `created_at`, `updated_at`) VALUES
(9, 5, 'elap ompreng abis', 'Pengadaan Barang', 'mohon beli 3 pack saja', 'pengadaan_1774376121.jpg', 'disetujui', '2026-03-24 18:15:21', '2026-03-24 19:09:34'),
(17, 13, 'Cadong kosong', 'Pengadaan Barang', 'beli lagi', 'pengadaan_1774410571.jpg', 'pending', '2026-03-25 03:49:31', '2026-03-25 03:49:31'),
(19, 13, 'pisau rusak', 'Pengadaan Barang', 'cukup2 pcs saja', 'pengadaan_1774410632.jpg', 'pending', '2026-03-25 03:50:32', '2026-03-25 03:50:32'),
(20, 13, 'baskom rusak ', 'Pengadaan Barang', 'adakan 5 pcs saja', 'pengadaan_1774410667.jpg', 'pending', '2026-03-25 03:51:07', '2026-03-25 03:51:07'),
(25, 13, 'jam dingiding kurang', 'Pengadaan Barang', 'jam dingin kurang 5 pcs', 'pengadaan_1774411074.jpg', 'selesai', '2026-03-25 03:57:54', '2026-04-04 17:07:26'),
(36, 5, 'Panci 2', 'Pengadaan Barang', 'sudah rusak 2 pcs', 'pengadaan_1775360500.jpg', 'pending', '2026-04-05 03:41:40', '2026-04-05 03:41:40');

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

--
-- Table structure for table `produk_supplier`
--

CREATE TABLE `produk_supplier` (
  `id` int(11) NOT NULL,
  `supplier_id` int(11) NOT NULL,
  `nama_produk` varchar(255) NOT NULL,
  `harga_satuan` decimal(12,2) NOT NULL,
  `satuan` varchar(50) DEFAULT 'pcs',
  `kategori` varchar(100) DEFAULT NULL,
  `status_stok` enum('tersedia','habis') DEFAULT 'tersedia',
  `stok_manual` decimal(12,2) NOT NULL DEFAULT 0.00,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `produk_supplier`
--

INSERT INTO `produk_supplier` (`id`, `supplier_id`, `nama_produk`, `harga_satuan`, `satuan`, `kategori`, `status_stok`, `stok_manual`, `created_at`) VALUES
(1, 6, 'KECAP ASIN', 65000.00, 'pcs', NULL, 'tersedia', 0.00, '2026-03-29 05:28:12'),
(2, 6, 'BAWANG PUTIH', 60000.00, 'kg', NULL, 'tersedia', 0.00, '2026-03-29 19:40:51'),
(3, 6, 'AYAM POTONG', 40000.00, 'kg', NULL, 'tersedia', 440.00, '2026-04-01 18:13:41'),
(17, 6, 'TAHU KUNING', 5500.00, 'pack', NULL, 'tersedia', 10.00, '2026-04-04 09:46:32'),
(22, 6, 'SUSU UHT INDOMILK', 123000.00, 'karton', NULL, 'tersedia', 0.00, '2026-04-04 10:44:53'),
(24, 6, 'SPAGHETTI SEDANA 1 KG', 225000.00, 'kg', NULL, 'tersedia', 0.00, '2026-04-04 12:32:00'),
(25, 6, 'DELMONTE KETCHUP SAUS TOMAT DRG 5.7kg', 102000.00, 'jerigen', NULL, 'tersedia', 0.00, '2026-04-04 12:32:30'),
(26, 6, 'PROCHIZ KEJU GOLD CHEDDAR BOX 2KG', 916000.00, 'karton', NULL, 'tersedia', 0.00, '2026-04-04 12:32:50'),
(27, 6, 'GULA PASIR', 180000.00, 'kg', NULL, 'tersedia', 0.00, '2026-04-04 12:33:08'),
(28, 6, 'BUAH SEMANGKA', 14000.00, 'kg', NULL, 'tersedia', 0.00, '2026-04-04 12:33:22'),
(29, 6, 'MINYAK BIMOLI 5 L', 107000.00, 'jerigen', NULL, 'tersedia', 0.00, '2026-04-04 12:33:42'),
(30, 6, 'TELUR AYAM', 28500.00, 'kg', NULL, 'tersedia', 0.00, '2026-04-04 18:00:01');

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

--
-- Table structure for table `reviews`
--

CREATE TABLE `reviews` (
  `id` int(11) NOT NULL,
  `nama` varchar(200) DEFAULT NULL,
  `sekolah` varchar(200) DEFAULT NULL,
  `ulasan` text DEFAULT NULL,
  `rating` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `reviews`
--

INSERT INTO `reviews` (`id`, `nama`, `sekolah`, `ulasan`, `rating`, `created_at`) VALUES
(1, 'Nida Al Haq', 'SMK 1 SUKABUMI', 'MANTAP', 5, '2026-03-06 21:16:18'),
(2, 'SMK 1 KOTA SUKABUMI', 'MAMAN', 'KEREN MENU NYA', 5, '2026-03-06 21:26:18'),
(3, 'Bale Barudak', 'SMKN 1', 'MANTAP', 5, '2026-03-07 14:50:25'),
(4, 'FIRMAN', 'SMK 1 KOTA SUKABUMI', 'KEREN MENU NYAA ADMIN BESOK MAU LAGI YA', 5, '2026-03-18 20:00:21'),
(5, 'Raditya Pamungkas', 'SMK 1 KOTA SUKABUMI', 'AKU MINTA MIN ', 5, '2026-03-18 20:00:42'),
(6, 'Esa Ayu Dwi Cahya', 'SMK 1 KOTA SUKABUMI', 'gua suka sama menu kayta gini', 5, '2026-03-18 20:01:01'),
(7, 'Ahmad Sanusi', 'SMKN 1 KOTA Sukabumi', 'Mbg hari ini sangat enak kak terimakasih banyak ', 5, '2026-04-13 06:09:32');

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

--
-- Table structure for table `shifts`
--

CREATE TABLE `shifts` (
  `id` int(11) NOT NULL,
  `divisi_id` int(11) NOT NULL,
  `jam_masuk` time NOT NULL,
  `jam_pulang` time NOT NULL,
  `toleransi_menit` int(11) DEFAULT 0,
  `aktif` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `shifts`
--

INSERT INTO `shifts` (`id`, `divisi_id`, `jam_masuk`, `jam_pulang`, `toleransi_menit`, `aktif`, `created_at`) VALUES
(6, 10, '12:54:00', '00:00:00', 0, 1, '2026-02-28 17:55:16'),
(7, 5, '11:45:00', '23:20:00', 5, 1, '2026-03-01 17:18:33'),
(8, 12, '07:00:00', '17:06:00', 5, 1, '2026-03-17 20:23:32'),
(18, 11, '19:57:00', '06:00:00', 5, 1, '2026-03-20 12:57:56'),
(20, 4, '20:12:00', '03:00:00', 5, 1, '2026-03-20 13:12:11'),
(21, 1, '23:05:00', '03:00:00', 5, 1, '2026-03-20 15:02:02');

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

--
-- Table structure for table `site_settings`
--

CREATE TABLE `site_settings` (
  `id` int(11) NOT NULL,
  `site_title` varchar(255) NOT NULL,
  `site_description` text NOT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `absen_aktif` tinyint(1) DEFAULT 1,
  `site_url` varchar(255) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `site_settings`
--

INSERT INTO `site_settings` (`id`, `site_title`, `site_description`, `updated_at`, `absen_aktif`, `site_url`) VALUES
(1, 'SPPG Warnasari 2 Office Support System', 'Satuan Pelayana Pemenuhan Gizi', '2026-04-11 17:29:06', 1, 'https://sppgwarnasari.com/');

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

--
-- Table structure for table `stok_gudang`
--

CREATE TABLE `stok_gudang` (
  `id` int(11) NOT NULL,
  `nama_barang` varchar(255) NOT NULL,
  `satuan` varchar(50) NOT NULL,
  `stok` decimal(10,2) NOT NULL DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `stok_gudang`
--

INSERT INTO `stok_gudang` (`id`, `nama_barang`, `satuan`, `stok`) VALUES
(6, 'AYAM POTONG', 'KG', 60.00),
(7, 'BERAS', 'KARUNG', 1.00),
(8, 'SUSU INDOMILK UHT 115 ML', 'KARTON', 54.00),
(9, 'BAWA GORENG', 'KG', 4.50),
(10, 'TELUR', 'KG', 30.00),
(11, 'AYAM GILING', 'KG', 150.00),
(12, 'TAHU KULIT COKLAT', 'PCS', 500.00),
(13, 'NUGGET SO ECO', 'KG', 3.00),
(14, 'ROMA BISCUIT KELAPA KLG 345g', 'KARTON', 3.00),
(15, 'BUAH APEL FUJI UK 88', 'KARTON', 3.00),
(16, 'BUAH APEL FUJI UK 100', 'KARTON', 6.00),
(17, 'TEMPE', 'PAPAN', 50.00),
(18, 'MELON', 'KG', 80.00),
(19, 'PISANG AMBON', 'KG', 80.00),
(20, 'ANGGUR', 'KRAT', 1.00),
(21, 'SUSU UHT 1 LITER', 'PCS', 24.00),
(22, 'JAMBU KRISTA', 'KG', 30.00),
(23, 'UBI', 'KG', 23.00),
(24, 'SALADA', 'KG', 40.00),
(25, 'KETANG', 'KG', 15.00),
(26, 'LADA HITAM', 'KG', 12.00),
(28, 'KECAP INGGRIS', 'BOTOL', 5.00);

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

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `jenis` enum('debit','kredit') DEFAULT NULL,
  `amount` int(11) DEFAULT NULL,
  `keterangan` varchar(255) DEFAULT NULL,
  `related_attendance_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `transactions`
--

INSERT INTO `transactions` (`id`, `user_id`, `jenis`, `amount`, `keterangan`, `related_attendance_id`, `created_at`) VALUES
(1, 5, 'debit', 1081000, 'Denda terlambat 1081 menit', NULL, '2026-02-27 19:51:52'),
(2, 5, 'debit', 1091000, 'Denda terlambat 1091 menit', NULL, '2026-02-27 20:01:39');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `attendances`
--
ALTER TABLE `attendances`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_attendance_user` (`user_id`);

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

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

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

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

--
-- Indexes for table `foodtray_menu_sent`
--
ALTER TABLE `foodtray_menu_sent`
  ADD PRIMARY KEY (`id`),
  ADD KEY `menu_id` (`menu_id`);

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

--
-- Indexes for table `invoice`
--
ALTER TABLE `invoice`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_id` (`supplier_id`);

--
-- Indexes for table `invoice_item`
--
ALTER TABLE `invoice_item`
  ADD PRIMARY KEY (`id`),
  ADD KEY `invoice_id` (`invoice_id`),
  ADD KEY `produk_id` (`produk_id`);

--
-- Indexes for table `leave_requests`
--
ALTER TABLE `leave_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_leave_user` (`user_id`);

--
-- Indexes for table `log_barang`
--
ALTER TABLE `log_barang`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `pengadaan`
--
ALTER TABLE `pengadaan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `produk_supplier`
--
ALTER TABLE `produk_supplier`
  ADD PRIMARY KEY (`id`),
  ADD KEY `supplier_id` (`supplier_id`);

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

--
-- Indexes for table `shifts`
--
ALTER TABLE `shifts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_shifts_divisi` (`divisi_id`);

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

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

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_trans_user` (`user_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

--
-- AUTO_INCREMENT for table `attendances`
--
ALTER TABLE `attendances`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;

--
-- AUTO_INCREMENT for table `divisi`
--
ALTER TABLE `divisi`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `divisions`
--
ALTER TABLE `divisions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `foodtray_items`
--
ALTER TABLE `foodtray_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT for table `foodtray_menus`
--
ALTER TABLE `foodtray_menus`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `foodtray_menu_sent`
--
ALTER TABLE `foodtray_menu_sent`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `geofences`
--
ALTER TABLE `geofences`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `invoice`
--
ALTER TABLE `invoice`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;

--
-- AUTO_INCREMENT for table `invoice_item`
--
ALTER TABLE `invoice_item`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;

--
-- AUTO_INCREMENT for table `leave_requests`
--
ALTER TABLE `leave_requests`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `log_barang`
--
ALTER TABLE `log_barang`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=59;

--
-- AUTO_INCREMENT for table `pengadaan`
--
ALTER TABLE `pengadaan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;

--
-- AUTO_INCREMENT for table `produk_supplier`
--
ALTER TABLE `produk_supplier`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `reviews`
--
ALTER TABLE `reviews`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `shifts`
--
ALTER TABLE `shifts`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

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

--
-- AUTO_INCREMENT for table `stok_gudang`
--
ALTER TABLE `stok_gudang`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `attendances`
--
ALTER TABLE `attendances`
  ADD CONSTRAINT `fk_attendance_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `foodtray_menu_sent`
--
ALTER TABLE `foodtray_menu_sent`
  ADD CONSTRAINT `foodtray_menu_sent_ibfk_1` FOREIGN KEY (`menu_id`) REFERENCES `foodtray_menus` (`id`);

--
-- Constraints for table `invoice`
--
ALTER TABLE `invoice`
  ADD CONSTRAINT `invoice_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `partners` (`id`);

--
-- Constraints for table `invoice_item`
--
ALTER TABLE `invoice_item`
  ADD CONSTRAINT `invoice_item_ibfk_1` FOREIGN KEY (`invoice_id`) REFERENCES `invoice` (`id`),
  ADD CONSTRAINT `invoice_item_ibfk_2` FOREIGN KEY (`produk_id`) REFERENCES `produk_supplier` (`id`);

--
-- Constraints for table `leave_requests`
--
ALTER TABLE `leave_requests`
  ADD CONSTRAINT `fk_leave_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `log_barang`
--
ALTER TABLE `log_barang`
  ADD CONSTRAINT `log_barang_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `pengadaan`
--
ALTER TABLE `pengadaan`
  ADD CONSTRAINT `fk_pengadaan_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `produk_supplier`
--
ALTER TABLE `produk_supplier`
  ADD CONSTRAINT `produk_supplier_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `partners` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `shifts`
--
ALTER TABLE `shifts`
  ADD CONSTRAINT `fk_shifts_divisi` FOREIGN KEY (`divisi_id`) REFERENCES `divisi` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `transactions`
--
ALTER TABLE `transactions`
  ADD CONSTRAINT `fk_trans_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

