-- http://www.phpmyadmin.net
--




--
-- Database: `gaji_pegawaidb`
--

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

--
-- Table structure for table `absensi`
--

CREATE TABLE IF NOT EXISTS `absensi` (
  `id` int(6) NOT NULL AUTO_INCREMENT,
  `kd_pegawai` char(5) NOT NULL,
  `tanggal` date NOT NULL,
  `jam_masuk` time NOT NULL,
  `jam_keluar` time NOT NULL,
  `status_kehadiran` enum('0','1','2','3') NOT NULL,
  `jenis_kerja` enum('Wajib','Lembur') NOT NULL DEFAULT 'Wajib',
  `keterangan` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;

--
-- Dumping data for table `absensi`
--

INSERT INTO `absensi` (`id`, `kd_pegawai`, `tanggal`, `jam_masuk`, `jam_keluar`, `status_kehadiran`, `jenis_kerja`, `keterangan`) VALUES
(1, 'P0005', '2013-05-01', '08:00:00', '16:00:00', '1', 'Wajib', 'masuk'),
(2, 'P0002', '2013-05-01', '08:00:00', '16:00:00', '1', 'Wajib', ''),
(3, 'P0003', '2013-05-01', '08:00:00', '16:00:00', '1', 'Wajib', ''),
(4, 'P0004', '2013-05-01', '08:00:00', '16:00:00', '1', 'Wajib', ''),
(5, 'P0001', '2013-05-02', '08:00:00', '16:00:00', '1', 'Wajib', ''),
(6, 'P0002', '2013-05-02', '08:00:00', '10:00:00', '2', 'Wajib', 'Sakit'),
(7, 'P0003', '2013-05-02', '08:00:00', '16:00:00', '1', 'Wajib', ''),
(8, 'P0004', '2013-05-02', '08:00:00', '16:00:00', '1', 'Wajib', ''),
(9, 'P0001', '2013-05-03', '08:10:00', '16:00:00', '1', 'Wajib', ''),
(10, 'P0002', '2013-05-03', '08:15:00', '16:00:00', '1', 'Wajib', ''),
(11, 'P0003', '2013-05-03', '08:00:00', '14:00:00', '1', 'Wajib', ''),
(12, 'P0004', '2013-05-03', '08:00:00', '14:00:00', '1', 'Wajib', 'masuk'),
(13, 'P0001', '2013-05-01', '10:23:00', '04:00:00', '1', 'Wajib', 'telat'),
(14, 'P0001', '2013-08-28', '20:31:00', '16:00:00', '2', 'Wajib', 'Masuk izin'),
(15, 'P0001', '2013-09-30', '06:39:00', '16:00:00', '1', 'Wajib', 'masuk');

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

--
-- Table structure for table `bagian`
--

CREATE TABLE IF NOT EXISTS `bagian` (
  `kd_bagian` char(4) NOT NULL,
  `nm_bagian` varchar(100) NOT NULL,
  `gaji_pokok` int(10) NOT NULL,
  `uang_transport` int(10) NOT NULL,
  `uang_makan` int(10) NOT NULL,
  `uang_lembur` int(10) NOT NULL,
  PRIMARY KEY (`kd_bagian`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `bagian`
--

INSERT INTO `bagian` (`kd_bagian`, `nm_bagian`, `gaji_pokok`, `uang_transport`, `uang_makan`, `uang_lembur`) VALUES
('B001', 'SERVIS', 850000, 20000, 100000, 50000),
('B002', 'PENJUALAN', 800000, 20000, 100000, 30000),
('B003', 'KURIR', 700000, 150000, 100000, 40000);

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

--
-- Table structure for table `lembur`
--

CREATE TABLE IF NOT EXISTS `lembur` (
  `id` int(4) NOT NULL AUTO_INCREMENT,
  `kd_pegawai` char(5) NOT NULL,
  `tanggal` date NOT NULL,
  `keterangan` varchar(100) NOT NULL,
  `kd_user` char(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

--
-- Dumping data for table `lembur`
--

INSERT INTO `lembur` (`id`, `kd_pegawai`, `tanggal`, `keterangan`, `kd_user`) VALUES
(1, 'P0001', '2013-08-01', 'Pameran', 'U001'),
(2, 'P0003', '2013-08-03', 'Pameran komputer', 'U001'),
(3, 'P0001', '2013-08-05', 'Lembur', 'U001'),
(4, 'P0003', '2013-08-05', 'lembur', 'U001'),
(5, 'P0002', '2013-08-11', 'lembur', 'U001'),
(6, 'P0004', '2013-08-07', 'lembur', 'U001'),
(7, 'P0005', '2013-08-08', 'lembur', 'U001'),
(8, 'P0004', '2013-08-08', 'lembur', 'U001'),
(9, 'P0005', '2013-08-09', 'lembur', 'U001'),
(10, 'P0001', '2013-09-30', 'okesss', 'U001');

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

--
-- Table structure for table `pegawai`
--

CREATE TABLE IF NOT EXISTS `pegawai` (
  `kd_pegawai` char(5) NOT NULL,
  `nip` varchar(20) NOT NULL,
  `nm_pegawai` varchar(100) NOT NULL,
  `kd_bagian` char(4) NOT NULL,
  `kelamin` varchar(10) NOT NULL,
  `gol_darah` enum('','A','B','AB','O') NOT NULL,
  `agama` varchar(20) NOT NULL,
  `alamat_tinggal` varchar(100) NOT NULL,
  `no_telepon` varchar(20) NOT NULL,
  `tempat_lahir` varchar(40) NOT NULL,
  `tanggal_lahir` date NOT NULL,
  `status_kawin` enum('Kawin','Belum Kawin') NOT NULL,
  `tanggal_masuk` date NOT NULL,
  PRIMARY KEY (`kd_pegawai`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `pegawai`
--

INSERT INTO `pegawai` (`kd_pegawai`, `nip`, `nm_pegawai`, `kd_bagian`, `kelamin`, `gol_darah`, `agama`, `alamat_tinggal`, `no_telepon`, `tempat_lahir`, `tanggal_lahir`, `status_kawin`, `tanggal_masuk`) VALUES
('P0001', '2010.00001', 'Bunafit Nugroho', 'B001', 'Laki-laki', 'O', 'Islam', 'Jl. Janti, Karang Jambe, Yogyakarta', '081922222222', 'Way Jepara', '1982-05-10', 'Kawin', '2013-06-06'),
('P0002', '2010.00002', 'Indah Indriyanna', 'B001', 'Perempuan', 'AB', 'Islam', 'Jl. Janti, Karang Jambe, Yogyakarta', '081922222222', 'Way Jepara', '1980-05-11', 'Kawin', '2013-06-06'),
('P0003', '2010.00003', 'Fitria Prasetiawati', 'B001', 'Perempuan', 'O', 'Islam', 'Jl. Parang Tritis, Bantul, Yogyakarta', '', 'Raman Aji, Lampung Timur', '1990-10-11', 'Belum Kawin', '0000-00-00'),
('P0004', '2010.00004', 'Kiki Zakiah', 'B001', 'Perempuan', 'AB', 'Islam', 'Jl. Janti, Karang Jambe, Yogyakarta', '081911111111', 'Bandung', '1990-01-01', 'Belum Kawin', '2013-08-22'),
('P0005', '2010.00005', 'Hernanto Nanung', 'B002', 'Laki-laki', 'A', 'Islam', 'Yogyakarta', '081922222222', 'Yogyakarta', '2013-02-05', 'Kawin', '2013-02-25'),
('P0006', '2010.00006', 'Sardi Sudrajat', 'B003', 'Laki-laki', 'B', 'Islam', 'Jl. Janti, Yogyakarta', '081911111111', 'Way Jepara, Lampung', '1986-08-17', 'Kawin', '2013-02-21');

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

--
-- Table structure for table `penggajian`
--

CREATE TABLE IF NOT EXISTS `penggajian` (
  `no_penggajian` char(5) NOT NULL,
  `periode_gaji` char(7) NOT NULL,
  `tanggal` date NOT NULL,
  `kd_pegawai` char(5) NOT NULL,
  `gaji_pokok` int(10) NOT NULL,
  `tunj_transport` int(10) NOT NULL,
  `tunj_makan` int(10) NOT NULL,
  `total_lembur` int(10) NOT NULL,
  `total_bonus` int(10) NOT NULL,
  `total_pinjaman` int(10) NOT NULL,
  `kd_user` char(4) NOT NULL,
  PRIMARY KEY (`no_penggajian`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `penggajian`
--

INSERT INTO `penggajian` (`no_penggajian`, `periode_gaji`, `tanggal`, `kd_pegawai`, `gaji_pokok`, `tunj_transport`, `tunj_makan`, `total_lembur`, `total_bonus`, `total_pinjaman`, `kd_user`) VALUES
('PG001', '07-2013', '2013-08-28', 'P0004', 850000, 20000, 110000, 0, 0, 0, 'U001'),
('PG002', '07-2013', '2013-08-28', 'P0001', 850000, 20000, 100000, 0, 100000, 0, 'U001'),
('PG003', '07-2013', '2013-08-28', 'P0003', 850000, 20000, 100000, 0, 50000, 0, 'U001'),
('PG004', '07-2013', '2013-08-28', 'P0002', 850000, 20000, 100000, 0, 0, 0, 'U001'),
('PG005', '07-2013', '2013-08-28', 'P0005', 800000, 20000, 100000, 0, 0, 0, 'U001'),
('PG006', '08-2013', '2013-09-30', 'P0001', 850000, 20000, 100000, 100000, 0, 0, 'U001'),
('PG007', '08-2013', '2013-09-30', 'P0002', 850000, 20000, 100000, 50000, 0, 0, 'U001'),
('PG008', '08-2013', '2013-09-30', 'P0003', 850000, 20000, 100000, 100000, 0, 0, 'U001'),
('PG009', '08-2013', '2013-09-30', 'P0004', 850000, 20000, 100000, 100000, 0, 0, 'U001'),
('PG010', '08-2013', '2013-09-30', 'P0005', 800000, 20000, 100000, 60000, 0, 0, 'U001'),
('PG011', '08-2013', '2013-09-30', 'P0006', 700000, 150000, 100000, 0, 0, 0, 'U001');

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

--
-- Table structure for table `pinjaman`
--

CREATE TABLE IF NOT EXISTS `pinjaman` (
  `no_pinjaman` char(7) NOT NULL,
  `kd_pegawai` char(5) NOT NULL,
  `tanggal` date NOT NULL,
  `besar_pinjaman` int(12) NOT NULL,
  `keterangan` varchar(100) NOT NULL,
  `status_lunas` enum('Hutang','Lunas') NOT NULL DEFAULT 'Hutang',
  `kd_user` char(4) NOT NULL,
  PRIMARY KEY (`no_pinjaman`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `pinjaman`
--

INSERT INTO `pinjaman` (`no_pinjaman`, `kd_pegawai`, `tanggal`, `besar_pinjaman`, `keterangan`, `status_lunas`, `kd_user`) VALUES
('PJ00001', 'P0003', '2013-08-02', 100000, 'Bayar sekolah anak', 'Lunas', 'U001'),
('PJ00002', 'P0001', '2013-08-10', 50000, 'Sekolah anak', 'Lunas', 'U001'),
('PJ00003', 'P0001', '2013-08-15', 100000, 'hutang', 'Lunas', 'U001'),
('PJ00004', 'P0006', '2013-08-25', 500000, 'usaha batu bata', 'Lunas', 'U001'),
('PJ00005', 'P0002', '2013-08-26', 100000, 'pinjam', 'Lunas', 'U001'),
('PJ00006', 'P0004', '2013-08-26', 150000, 'pinjam', 'Lunas', 'U001'),
('PJ00007', 'P0005', '2013-08-26', 50000, 'pinjam', 'Lunas', 'U001'),
('PJ00008', 'P0003', '2013-08-26', 100000, 'pinjam', 'Lunas', 'U001'),
('PJ00009', 'P0005', '2013-08-28', 50000, 'beli sepatu2ss', 'Lunas', 'U001');

