-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 20, 2020 at 11:01 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `db_pendaftaran`
--

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

--
-- Table structure for table `carabayar`
--

CREATE TABLE `carabayar` (
  `kodecarabayar` varchar(2) NOT NULL,
  `nama` varchar(8) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `carabayar`
--

INSERT INTO `carabayar` (`kodecarabayar`, `nama`) VALUES
('A1', 'ASURANSI'),
('B1', 'BPJS'),
('U1', 'UMUM');

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

--
-- Table structure for table `dokter`
--

CREATE TABLE `dokter` (
  `kodedokter` varchar(5) NOT NULL,
  `namadokter` varchar(100) NOT NULL,
  `kodepoli` varchar(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dokter`
--

INSERT INTO `dokter` (`kodedokter`, `namadokter`, `kodepoli`) VALUES
('D01', 'Prof. Dr. Zubairi Djoerban, Sp. PD- KHOM', '01'),
('D02', 'Dr. Sugiono Somoastro, Sp.PD-KHOM', '01'),
('D03', 'Dr. Noto Dwimartutie, Sp.PD-Kger', '01'),
('D04', 'Dr. Ihsanil Husna, Sp. PD', '01'),
('D05', 'Dr. Raden Fidiaji Hiltono Santoso, Sp.PD', '01'),
('D06', 'Dr. Muhammad Alkaff, Sp.PD', '01'),
('D07', 'Dr. Mohammad Syahrir Azizi, Sp. PD,KKV', '01'),
('D08', 'Dr. Ramlan Sitompul, Sp. THT -KL', '02'),
('D09', 'Dr. Hendarmin Syafei, Sp. JP', '03'),
('D10', 'Dr. Gardjito Hardjosukarso, Sp. JP', '03'),
('D11', 'Dr. Ratna Andriani, Sp. P', '04'),
('D12', 'Dr. Flora Eka Sari, Sp. P', '04'),
('D13', 'Dr. Roy Budiarto Halim, Sp. B', '05'),
('D14', 'Dr. Vonty Elfrida, Sp. B', '05'),
('D15', 'Dr. Evert D.C Poetiray, Sp. B. Onk (K)', '06'),
('D16', 'Dr. Dewa Gede Subawa, Sp.B.Onk ', '06'),
('D17', 'Dr. Sri Suwando, Sp. B, Sp. OT', '07'),
('D18', 'Prof. DR. Dr. Achmad Fauzi Kamal, Sp. OT (K)', '07'),
('D19', 'Dr. Hendar Nugrahadi Priambodo, Sp.OT', '07');

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

--
-- Table structure for table `jadwal`
--

CREATE TABLE `jadwal` (
  `kodejadwal` varchar(5) NOT NULL,
  `hari` varchar(7) NOT NULL,
  `waktumulai` time NOT NULL,
  `waktuberakhir` time NOT NULL,
  `kodedokter` varchar(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `jadwal`
--

INSERT INTO `jadwal` (`kodejadwal`, `hari`, `waktumulai`, `waktuberakhir`, `kodedokter`) VALUES
('k001', 'Kamis', '08:00:00', '10:00:00', 'D01'),
('r001', 'Rabu', '15:30:00', '00:00:00', 'D02'),
('s001', 'Senin', '08:00:00', '10:00:00', 'D01'),
('s002', 'Senin', '16:00:00', '00:00:00', 'D01'),
('s003', 'Senin', '16:00:00', '00:00:00', 'D02');

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

--
-- Table structure for table `pendaftaran`
--

CREATE TABLE `pendaftaran` (
  `nopendaftaran` varchar(10) NOT NULL,
  `kodepoli` varchar(5) NOT NULL,
  `kodedokter` varchar(5) NOT NULL,
  `nomr` int(5) NOT NULL,
  `namapasien` varchar(100) NOT NULL,
  `nohp` varchar(13) NOT NULL,
  `noktp` varchar(15) NOT NULL,
  `tanggal_lahir` varchar(10) NOT NULL,
  `alamat` varchar(500) NOT NULL,
  `waktu_pelayanan` date NOT NULL,
  `kodecarabayar` varchar(8) NOT NULL,
  `tanggalinput` date NOT NULL,
  `waktuinput` time NOT NULL,
  `jpasien` varchar(5) NOT NULL,
  `namaasuransi` varchar(100) NOT NULL,
  `noasuransi` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `pendaftaran`
--

INSERT INTO `pendaftaran` (`nopendaftaran`, `kodepoli`, `kodedokter`, `nomr`, `namapasien`, `nohp`, `noktp`, `tanggal_lahir`, `alamat`, `waktu_pelayanan`, `kodecarabayar`, `tanggalinput`, `waktuinput`, `jpasien`, `namaasuransi`, `noasuransi`) VALUES
('B01D01-001', '01', 'D01', 0, '', '', '', '', '', '2020-07-20', 'B1', '2020-07-21', '00:00:00', 'Baru', '', '');

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

--
-- Table structure for table `poliklinik`
--

CREATE TABLE `poliklinik` (
  `kodepoli` varchar(5) NOT NULL,
  `namapoli` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `poliklinik`
--

INSERT INTO `poliklinik` (`kodepoli`, `namapoli`) VALUES
('01', 'SPESIALIS PENYAKIT DALAM'),
('02', 'SPESIALIS THT'),
('03', 'SPESIALIS JANTUNG'),
('04', 'SPESIALIS PARU'),
('05', 'SPESIALIS BEDAH'),
('06', 'SPESIALIS BEDAH TUMOR (ONKOLOGI)'),
('07', 'SPESIALIS BEDAH TULANG (ORTHOPEDI)'),
('08', 'SPESIALIS BEDAH GINJAL & SALURAN KEMIH (UROLOGI)'),
('09', 'SPESIALIS BEDAH SALURAN PENCERNAAN (DIGESTIV)'),
('10', 'SPESIALIS KULIT & KELAMIN'),
('11', 'SPESIALIS BEDAH PLASTIK'),
('12', 'SPESIALIS KESEHATAN FISIK & REHABILITAS'),
('13', 'SPESIALIS RADIOLOGI & USG'),
('14', 'SPESIALIS SYARAF (NEUROLOGI)'),
('15', 'SPESIALIS KEBIDANAN & KANDUNGAN'),
('16', 'SPESIALIS KESEHATAN ANAK'),
('17', 'SPESIALIS ONKOLOGI ANAK'),
('18', 'KESEHATAN GIGI & MULUT'),
('19', 'SPESIALIS MATA'),
('20', 'SPESIALIS KESEHATAN JIWA (PSIKIATRI)'),
('21', 'FISIOTERAPI');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `carabayar`
--
ALTER TABLE `carabayar`
  ADD PRIMARY KEY (`kodecarabayar`);

--
-- Indexes for table `dokter`
--
ALTER TABLE `dokter`
  ADD PRIMARY KEY (`kodedokter`),
  ADD KEY `kodepoli` (`kodepoli`);

--
-- Indexes for table `jadwal`
--
ALTER TABLE `jadwal`
  ADD PRIMARY KEY (`kodejadwal`),
  ADD KEY `kodedokter` (`kodedokter`);

--
-- Indexes for table `pendaftaran`
--
ALTER TABLE `pendaftaran`
  ADD PRIMARY KEY (`nopendaftaran`),
  ADD KEY `kodepoliklinik` (`kodepoli`),
  ADD KEY `nomr` (`nomr`),
  ADD KEY `kodedokter` (`kodedokter`),
  ADD KEY `kodejpasien` (`kodecarabayar`);

--
-- Indexes for table `poliklinik`
--
ALTER TABLE `poliklinik`
  ADD PRIMARY KEY (`kodepoli`);

--
-- Constraints for dumped tables
--

--
-- Constraints for table `dokter`
--
ALTER TABLE `dokter`
  ADD CONSTRAINT `dokter_ibfk_1` FOREIGN KEY (`kodepoli`) REFERENCES `poliklinik` (`kodepoli`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `jadwal`
--
ALTER TABLE `jadwal`
  ADD CONSTRAINT `jadwal_ibfk_1` FOREIGN KEY (`kodedokter`) REFERENCES `dokter` (`kodedokter`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pendaftaran`
--
ALTER TABLE `pendaftaran`
  ADD CONSTRAINT `pendaftaran_ibfk_1` FOREIGN KEY (`kodepoli`) REFERENCES `poliklinik` (`kodepoli`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pendaftaran_ibfk_3` FOREIGN KEY (`kodedokter`) REFERENCES `dokter` (`kodedokter`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `pendaftaran_ibfk_4` FOREIGN KEY (`kodecarabayar`) REFERENCES `carabayar` (`kodecarabayar`) ON DELETE CASCADE 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 */;
