-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 29, 2022 at 04:49 AM
-- Server version: 10.4.25-MariaDB
-- PHP Version: 7.4.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `absensi_karyawan`
--

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

--
-- Table structure for table `tb_absensi_karyawan`
--

CREATE TABLE `tb_absensi_karyawan` (
  `no` int(5) NOT NULL,
  `nik` varchar(18) DEFAULT NULL,
  `id_dinas` int(3) DEFAULT NULL,
  `tanggal` date NOT NULL,
  `jam_masuk` time DEFAULT NULL,
  `jam_istirehat` time DEFAULT NULL,
  `jam_masuk_kembali` time DEFAULT NULL,
  `jam_pulang` time DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_absensi_karyawan`
--

INSERT INTO `tb_absensi_karyawan` (`no`, `nik`, `id_dinas`, `tanggal`, `jam_masuk`, `jam_istirehat`, `jam_masuk_kembali`, `jam_pulang`) VALUES
(8, '1234567890123456', 1, '2022-09-21', '06:57:50', NULL, NULL, NULL),
(9, '1234567890123455', 1, '2022-09-21', '09:34:03', '09:46:52', NULL, NULL),
(10, '1234567890123456', 1, '2022-09-28', '09:15:04', '09:58:07', '09:58:45', '09:58:52');

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

--
-- Table structure for table `tb_admin`
--

CREATE TABLE `tb_admin` (
  `no` int(4) NOT NULL,
  `nik_kd` varchar(18) DEFAULT NULL,
  `nik` varchar(18) DEFAULT NULL,
  `nama` varchar(100) NOT NULL,
  `level` varchar(20) NOT NULL,
  `id_dinas` int(3) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_admin`
--

INSERT INTO `tb_admin` (`no`, `nik_kd`, `nik`, `nama`, `level`, `id_dinas`) VALUES
(1, NULL, '1234567890123456', 'Admin', 'Admin', 1),
(2, '1234567890123456', NULL, 'Kepala Dinas', 'Kepala Dinas', 1);

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

--
-- Table structure for table `tb_dinas`
--

CREATE TABLE `tb_dinas` (
  `id_dinas` int(3) NOT NULL,
  `dinas` varchar(100) NOT NULL,
  `lat` varchar(100) NOT NULL,
  `lng` varchar(100) NOT NULL,
  `radius` int(2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_dinas`
--

INSERT INTO `tb_dinas` (`id_dinas`, `dinas`, `lat`, `lng`, `radius`) VALUES
(1, 'Dinas Pariwisata Kepemudaan dan Olahraga Kabupaten Mamuju Tengah', '-3.9887240011073284', '119.65215215', 100);

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

--
-- Table structure for table `tb_informasi_libur`
--

CREATE TABLE `tb_informasi_libur` (
  `id_informasi_libur` int(5) NOT NULL,
  `id_libur` int(5) NOT NULL,
  `nik` varchar(18) DEFAULT NULL,
  `tanggal` date NOT NULL,
  `ket` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `tb_informasi_perjalanan_dinas`
--

CREATE TABLE `tb_informasi_perjalanan_dinas` (
  `id_informasi_perjalanan_dinas` int(5) NOT NULL,
  `id_perjalanan_dinas` int(5) NOT NULL,
  `nik` varchar(18) DEFAULT NULL,
  `tanggal` date NOT NULL,
  `ket` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `tb_karyawan`
--

CREATE TABLE `tb_karyawan` (
  `nik` varchar(18) NOT NULL,
  `nama` varchar(100) NOT NULL,
  `no_telpon` varchar(14) DEFAULT NULL,
  `jabatan` varchar(100) NOT NULL,
  `pangkat` varchar(15) DEFAULT NULL,
  `status` text DEFAULT NULL,
  `alamat` text DEFAULT NULL,
  `tanggal_lahir` date DEFAULT NULL,
  `id_dinas` int(3) NOT NULL,
  `device_id` varchar(100) DEFAULT NULL,
  `image` varchar(150) NOT NULL,
  `keanggotaan` varchar(50) NOT NULL,
  `jenis_kelamin` varchar(10) NOT NULL,
  `tempat_lahir` varchar(100) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_karyawan`
--

INSERT INTO `tb_karyawan` (`nik`, `nama`, `no_telpon`, `jabatan`, `pangkat`, `status`, `alamat`, `tanggal_lahir`, `id_dinas`, `device_id`, `image`, `keanggotaan`, `jenis_kelamin`, `tempat_lahir`, `created_at`, `updated_at`) VALUES
('123143534543534534', 'daasd', '08151651165161', 'Kasubag Kepegawaian', 'II C', 'Kontrak', 'asdasd', '1954-08-12', 1, NULL, 'assets/images/foto_karyawan/123143534543534534/1.jpg', 'Ekonomi Kreatif', 'Perempuan', 'asdsa', '2022-11-25 01:30:12', '2022-11-25 01:30:12'),
('1234567890123444', 'bobo', '0865465465466', 'Sekretaris', 'IV D', 'PNS', 'sadsad', '1992-08-30', 1, NULL, 'assets/images/foto_karyawan/1234567890123444/1-brjYnVlXwM3j_SWXImT0Rg.png', 'Sekretariat', 'Laki-laki', 'Tawau', '2022-09-19 00:09:54', '2022-11-19 23:22:46'),
('1234567890123454', 'Ilham', '082293246583', 'Kepala Bidang', 'Tiada', 'Kontrak', 'asdasd', '1889-09-13', 1, NULL, 'assets/images/foto_karyawan/1234567890123454/1111..jpg', 'Sekretariat', 'Laki-laki', 'Tawau', '2022-09-15 04:09:10', '2022-09-15 04:09:10'),
('1234567890123455', 'Karan', '0895806674850', 'Kepala Dinas', 'Tiada', 'PNS', 'Jln Apas, Tawau, Sabah', '1889-09-13', 1, NULL, 'assets/images/foto_karyawan/1234567890123455/11073968_844405842264361_5190470711960847490_n.jpg', 'Sekretariat', 'Laki-laki', 'Tawau', '2022-09-09 02:42:26', '2022-09-09 02:54:41'),
('1234567890123456', 'Aran', '082293246583', 'Analisis Kebijakan', 'Tiada', 'Kontrak', 'Jln Industri Kecil, Soreang, Parepare', '1889-09-13', 1, '156afc024de8a022', 'assets/images/foto_karyawan/1234567890123456/6564e6d48892e6ba325bda1ec27189c9b4b3b473_hq.jpg', 'Sekretariat', 'Laki-laki', 'Tawau', '2022-09-07 02:47:55', '2022-11-24 22:26:00'),
('456456543645645645', '5dsfsdfdsf', '08151651165161', 'Staf', 'IV A', 'PNS', 'sdfsdf', '1987-02-15', 1, NULL, 'assets/images/foto_karyawan/456456543645645645/1.jpg', 'Olahraga', 'Perempuan', 'sdfsdf', '2022-11-25 01:30:36', '2022-11-25 01:30:36'),
('567675756756756756', 'daasd', '08151651165161', 'Staf', 'IV A', 'Kontrak', 'sdfsdf', '1987-01-05', 1, NULL, 'assets/images/foto_karyawan/567675756756756756/1.jpg', 'Olahraga', 'Laki-laki', 'sdfsdf', '2022-11-25 01:31:02', '2022-11-25 01:31:02');

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

--
-- Table structure for table `tb_kordinat_karyawan`
--

CREATE TABLE `tb_kordinat_karyawan` (
  `nik` varchar(18) NOT NULL,
  `lat` varchar(20) NOT NULL,
  `lng` varchar(20) NOT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_kordinat_karyawan`
--

INSERT INTO `tb_kordinat_karyawan` (`nik`, `lat`, `lng`, `updated_at`) VALUES
('1234567890123455', '-3.9889786', '119.6518278', '2022-09-21 09:34:43'),
('1234567890123456', '-3.9889742', '119.6518331', '2022-09-27 09:53:48');

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

--
-- Table structure for table `tb_laporan_karyawan`
--

CREATE TABLE `tb_laporan_karyawan` (
  `no_laporan` int(4) NOT NULL,
  `nik` varchar(18) NOT NULL,
  `image` varchar(150) DEFAULT NULL,
  `nama_laporan` varchar(100) NOT NULL,
  `ket_laporan` text NOT NULL,
  `created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_laporan_karyawan`
--

INSERT INTO `tb_laporan_karyawan` (`no_laporan`, `nik`, `image`, `nama_laporan`, `ket_laporan`, `created_at`) VALUES
(247, '1234567890123456', 'assets/images/karyawan/247/d2dbec5b-f1f3-4413-b0a9-c08f41f704cb8738234311332518571.jpg', 'wedas', 'sghgf', '2022-11-24 22:11:23'),
(248, '1234567890123456', NULL, 'sadasd', 'asdasd', '2022-11-25 00:03:51');

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

--
-- Table structure for table `tb_libur`
--

CREATE TABLE `tb_libur` (
  `id_libur` int(5) NOT NULL,
  `id_dinas` int(3) NOT NULL,
  `list_karyawan` mediumtext NOT NULL,
  `range_tanggal` mediumtext NOT NULL,
  `file` varchar(200) NOT NULL,
  `ket` text NOT NULL,
  `created_at` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `tb_login_admin`
--

CREATE TABLE `tb_login_admin` (
  `no` int(4) NOT NULL,
  `username` varchar(200) NOT NULL,
  `password` varchar(200) NOT NULL,
  `nik` varchar(18) DEFAULT NULL,
  `nik_kd` varchar(18) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_login_admin`
--

INSERT INTO `tb_login_admin` (`no`, `username`, `password`, `nik`, `nik_kd`) VALUES
(1, 'admin', '25d55ad283aa400af464c76d713c07ad', '1234567890123456', NULL),
(2, 'kepaladinaspariwisata', '25d55ad283aa400af464c76d713c07ad', NULL, '1234567890123456');

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

--
-- Table structure for table `tb_login_user`
--

CREATE TABLE `tb_login_user` (
  `no` int(3) NOT NULL,
  `username` varchar(100) NOT NULL,
  `password` varchar(100) NOT NULL,
  `nik` varchar(18) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_login_user`
--

INSERT INTO `tb_login_user` (`no`, `username`, `password`, `nik`) VALUES
(3, '1234567890123456', 'd1b2cc725d846f0460ff290c60925070', '1234567890123456'),
(4, '1234567890123455', '25d55ad283aa400af464c76d713c07ad', '1234567890123455'),
(5, '1234567890123454', '25d55ad283aa400af464c76d713c07ad', '1234567890123454'),
(9, '1234567890123444', '25d55ad283aa400af464c76d713c07ad', '1234567890123444'),
(12, '123143534543534534', '25d55ad283aa400af464c76d713c07ad', '123143534543534534'),
(13, '456456543645645645', '25d55ad283aa400af464c76d713c07ad', '456456543645645645'),
(14, '567675756756756756', '25d55ad283aa400af464c76d713c07ad', '567675756756756756');

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

--
-- Table structure for table `tb_pengaturan_jam_kerja_harian`
--

CREATE TABLE `tb_pengaturan_jam_kerja_harian` (
  `no` int(2) NOT NULL,
  `id_dinas` int(11) DEFAULT NULL,
  `hari` varchar(10) NOT NULL,
  `jam_masuk` time DEFAULT NULL,
  `jam_istirehat` time DEFAULT NULL,
  `jam_masuk_kembali` time DEFAULT NULL,
  `jam_pulang` time DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_pengaturan_jam_kerja_harian`
--

INSERT INTO `tb_pengaturan_jam_kerja_harian` (`no`, `id_dinas`, `hari`, `jam_masuk`, `jam_istirehat`, `jam_masuk_kembali`, `jam_pulang`) VALUES
(1, 1, 'senin', '07:10:00', '12:00:00', '13:00:00', '16:00:00'),
(2, 1, 'selasa', '08:00:00', '12:00:00', '13:00:00', '16:00:00'),
(3, 1, 'rabu', '08:00:00', '12:00:00', '13:00:00', '16:00:00'),
(4, 1, 'jumat', '08:00:00', '11:00:00', '12:00:00', '19:00:00'),
(5, 1, 'kamis', '08:00:00', '12:00:00', '13:00:00', '16:00:00');

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

--
-- Table structure for table `tb_perjalanan_dinas`
--

CREATE TABLE `tb_perjalanan_dinas` (
  `id_perjalanan_dinas` int(5) NOT NULL,
  `id_dinas` int(3) NOT NULL,
  `list_karyawan` mediumtext NOT NULL,
  `range_tanggal` mediumtext NOT NULL,
  `ket` text NOT NULL,
  `sppd` varchar(200) NOT NULL,
  `created_at` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `tb_surat_masuk`
--

CREATE TABLE `tb_surat_masuk` (
  `id_surat_masuk` int(11) NOT NULL,
  `id_dinas` int(2) DEFAULT NULL,
  `no_surat` varchar(20) NOT NULL,
  `asal_surat` varchar(100) NOT NULL,
  `tanggal_pengiriman` date NOT NULL,
  `tanggal_diterima` date NOT NULL,
  `no_agenda` varchar(5) NOT NULL,
  `sifat` varchar(15) DEFAULT NULL,
  `perihal` text NOT NULL,
  `diteruskan_kepada` varchar(30) DEFAULT NULL,
  `respon` varchar(30) DEFAULT NULL,
  `fail` varchar(200) NOT NULL,
  `catatan` text DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `tb_surat_masuk`
--

INSERT INTO `tb_surat_masuk` (`id_surat_masuk`, `id_dinas`, `no_surat`, `asal_surat`, `tanggal_pengiriman`, `tanggal_diterima`, `no_agenda`, `sifat`, `perihal`, `diteruskan_kepada`, `respon`, `fail`, `catatan`, `created_at`, `updated_at`) VALUES
(3, 1, '001/4545/2152/645/as', 'Aran', '2022-10-12', '2022-11-20', '001', 'Tiada', 'asdasd', 'Tiada', 'Tiada', 'assets/surat_masuk/1/3/CV-id.pdf', 'sadsa asdas', '2022-11-21 00:26:52', '2022-11-28 01:57:20');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `tb_absensi_karyawan`
--
ALTER TABLE `tb_absensi_karyawan`
  ADD PRIMARY KEY (`no`),
  ADD KEY `id_dinas` (`id_dinas`),
  ADD KEY `nik` (`nik`);

--
-- Indexes for table `tb_admin`
--
ALTER TABLE `tb_admin`
  ADD PRIMARY KEY (`no`),
  ADD KEY `id_dinas` (`id_dinas`),
  ADD KEY `nik_kd` (`nik_kd`),
  ADD KEY `nik` (`nik`);

--
-- Indexes for table `tb_dinas`
--
ALTER TABLE `tb_dinas`
  ADD PRIMARY KEY (`id_dinas`);

--
-- Indexes for table `tb_informasi_libur`
--
ALTER TABLE `tb_informasi_libur`
  ADD PRIMARY KEY (`id_informasi_libur`),
  ADD KEY `id_libur` (`id_libur`),
  ADD KEY `karyawan` (`nik`);

--
-- Indexes for table `tb_informasi_perjalanan_dinas`
--
ALTER TABLE `tb_informasi_perjalanan_dinas`
  ADD PRIMARY KEY (`id_informasi_perjalanan_dinas`),
  ADD KEY `id_libur` (`id_perjalanan_dinas`),
  ADD KEY `karyawan` (`nik`);

--
-- Indexes for table `tb_karyawan`
--
ALTER TABLE `tb_karyawan`
  ADD PRIMARY KEY (`nik`),
  ADD KEY `id_dinas` (`id_dinas`);

--
-- Indexes for table `tb_kordinat_karyawan`
--
ALTER TABLE `tb_kordinat_karyawan`
  ADD PRIMARY KEY (`nik`),
  ADD KEY `nik` (`nik`);

--
-- Indexes for table `tb_laporan_karyawan`
--
ALTER TABLE `tb_laporan_karyawan`
  ADD PRIMARY KEY (`no_laporan`),
  ADD KEY `nik` (`nik`);

--
-- Indexes for table `tb_libur`
--
ALTER TABLE `tb_libur`
  ADD PRIMARY KEY (`id_libur`),
  ADD KEY `id_dinas` (`id_dinas`);

--
-- Indexes for table `tb_login_admin`
--
ALTER TABLE `tb_login_admin`
  ADD PRIMARY KEY (`no`),
  ADD KEY `nik` (`nik`),
  ADD KEY `nik_kd` (`nik_kd`);

--
-- Indexes for table `tb_login_user`
--
ALTER TABLE `tb_login_user`
  ADD PRIMARY KEY (`no`),
  ADD KEY `nik_karyawan` (`nik`);

--
-- Indexes for table `tb_pengaturan_jam_kerja_harian`
--
ALTER TABLE `tb_pengaturan_jam_kerja_harian`
  ADD PRIMARY KEY (`no`),
  ADD KEY `id_dinas` (`id_dinas`);

--
-- Indexes for table `tb_perjalanan_dinas`
--
ALTER TABLE `tb_perjalanan_dinas`
  ADD PRIMARY KEY (`id_perjalanan_dinas`),
  ADD KEY `id_dinas` (`id_dinas`);

--
-- Indexes for table `tb_surat_masuk`
--
ALTER TABLE `tb_surat_masuk`
  ADD PRIMARY KEY (`id_surat_masuk`),
  ADD KEY `id_dinas` (`id_dinas`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `tb_absensi_karyawan`
--
ALTER TABLE `tb_absensi_karyawan`
  MODIFY `no` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `tb_admin`
--
ALTER TABLE `tb_admin`
  MODIFY `no` int(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `tb_dinas`
--
ALTER TABLE `tb_dinas`
  MODIFY `id_dinas` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `tb_informasi_libur`
--
ALTER TABLE `tb_informasi_libur`
  MODIFY `id_informasi_libur` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101;

--
-- AUTO_INCREMENT for table `tb_informasi_perjalanan_dinas`
--
ALTER TABLE `tb_informasi_perjalanan_dinas`
  MODIFY `id_informasi_perjalanan_dinas` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `tb_laporan_karyawan`
--
ALTER TABLE `tb_laporan_karyawan`
  MODIFY `no_laporan` int(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=249;

--
-- AUTO_INCREMENT for table `tb_libur`
--
ALTER TABLE `tb_libur`
  MODIFY `id_libur` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `tb_login_admin`
--
ALTER TABLE `tb_login_admin`
  MODIFY `no` int(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `tb_login_user`
--
ALTER TABLE `tb_login_user`
  MODIFY `no` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `tb_pengaturan_jam_kerja_harian`
--
ALTER TABLE `tb_pengaturan_jam_kerja_harian`
  MODIFY `no` int(2) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `tb_perjalanan_dinas`
--
ALTER TABLE `tb_perjalanan_dinas`
  MODIFY `id_perjalanan_dinas` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `tb_surat_masuk`
--
ALTER TABLE `tb_surat_masuk`
  MODIFY `id_surat_masuk` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `tb_absensi_karyawan`
--
ALTER TABLE `tb_absensi_karyawan`
  ADD CONSTRAINT `tb_absensi_karyawan_ibfk_1` FOREIGN KEY (`nik`) REFERENCES `tb_karyawan` (`nik`) ON DELETE NO ACTION ON UPDATE CASCADE,
  ADD CONSTRAINT `tb_absensi_karyawan_ibfk_2` FOREIGN KEY (`id_dinas`) REFERENCES `tb_dinas` (`id_dinas`) ON DELETE NO ACTION ON UPDATE CASCADE;

--
-- Constraints for table `tb_admin`
--
ALTER TABLE `tb_admin`
  ADD CONSTRAINT `tb_admin_ibfk_1` FOREIGN KEY (`id_dinas`) REFERENCES `tb_dinas` (`id_dinas`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tb_admin_ibfk_2` FOREIGN KEY (`nik_kd`) REFERENCES `tb_karyawan` (`nik`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tb_informasi_libur`
--
ALTER TABLE `tb_informasi_libur`
  ADD CONSTRAINT `tb_informasi_libur_ibfk_1` FOREIGN KEY (`id_libur`) REFERENCES `tb_libur` (`id_libur`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tb_informasi_libur_ibfk_2` FOREIGN KEY (`nik`) REFERENCES `tb_karyawan` (`nik`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tb_informasi_perjalanan_dinas`
--
ALTER TABLE `tb_informasi_perjalanan_dinas`
  ADD CONSTRAINT `tb_informasi_perjalanan_dinas_ibfk_1` FOREIGN KEY (`id_perjalanan_dinas`) REFERENCES `tb_perjalanan_dinas` (`id_perjalanan_dinas`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tb_informasi_perjalanan_dinas_ibfk_2` FOREIGN KEY (`nik`) REFERENCES `tb_karyawan` (`nik`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tb_karyawan`
--
ALTER TABLE `tb_karyawan`
  ADD CONSTRAINT `tb_karyawan_ibfk_1` FOREIGN KEY (`id_dinas`) REFERENCES `tb_dinas` (`id_dinas`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tb_kordinat_karyawan`
--
ALTER TABLE `tb_kordinat_karyawan`
  ADD CONSTRAINT `tb_kordinat_karyawan_ibfk_1` FOREIGN KEY (`nik`) REFERENCES `tb_karyawan` (`nik`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tb_laporan_karyawan`
--
ALTER TABLE `tb_laporan_karyawan`
  ADD CONSTRAINT `tb_laporan_karyawan_ibfk_1` FOREIGN KEY (`nik`) REFERENCES `tb_karyawan` (`nik`) ON DELETE NO ACTION ON UPDATE CASCADE;

--
-- Constraints for table `tb_login_admin`
--
ALTER TABLE `tb_login_admin`
  ADD CONSTRAINT `tb_login_admin_ibfk_1` FOREIGN KEY (`nik`) REFERENCES `tb_admin` (`nik`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `tb_login_admin_ibfk_2` FOREIGN KEY (`nik_kd`) REFERENCES `tb_admin` (`nik_kd`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tb_login_user`
--
ALTER TABLE `tb_login_user`
  ADD CONSTRAINT `tb_login_user_ibfk_1` FOREIGN KEY (`nik`) REFERENCES `tb_karyawan` (`nik`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tb_pengaturan_jam_kerja_harian`
--
ALTER TABLE `tb_pengaturan_jam_kerja_harian`
  ADD CONSTRAINT `tb_pengaturan_jam_kerja_harian_ibfk_1` FOREIGN KEY (`id_dinas`) REFERENCES `tb_dinas` (`id_dinas`) ON DELETE CASCADE ON UPDATE NO ACTION;

--
-- Constraints for table `tb_surat_masuk`
--
ALTER TABLE `tb_surat_masuk`
  ADD CONSTRAINT `tb_surat_masuk_ibfk_1` FOREIGN KEY (`id_dinas`) REFERENCES `tb_dinas` (`id_dinas`) ON DELETE SET NULL ON UPDATE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
