-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 15, 2025 at 06:51 AM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 7.3.33

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: `test`
--

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

--
-- Table structure for table `antrian`
--

CREATE TABLE `antrian` (
  `id` int(11) NOT NULL,
  `nama_pasien` varchar(100) DEFAULT NULL,
  `nomor_antrian` int(11) DEFAULT NULL,
  `status` enum('Menunggu','Dalam Ruangan','Selesai') DEFAULT 'Menunggu',
  `tanggal` date DEFAULT curdate()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `antrian`
--

INSERT INTO `antrian` (`id`, `nama_pasien`, `nomor_antrian`, `status`, `tanggal`) VALUES
(1, 'fikri', 1, 'Selesai', '2025-10-14'),
(2, 'elia', 2, 'Selesai', '2025-10-14'),
(3, 'fikri', 3, 'Selesai', '2025-10-14'),
(4, 'fikri', 4, 'Selesai', '2025-10-14'),
(5, 'akakakak', 5, 'Dalam Ruangan', '2025-10-14'),
(6, 'cyio', 6, 'Selesai', '2025-10-14'),
(7, 'oktap', 7, 'Menunggu', '2025-10-14'),
(8, 'jesslyn', 8, 'Menunggu', '2025-10-14'),
(9, 'lery', 1, 'Selesai', '2025-10-15'),
(10, 'fikri', 2, 'Selesai', '2025-10-15'),
(11, 'jesslyn oktaviani', 3, 'Dalam Ruangan', '2025-10-15'),
(12, 'oktap', 4, 'Menunggu', '2025-10-15');

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

--
-- Table structure for table `appointments`
--

CREATE TABLE `appointments` (
  `id` int(11) NOT NULL,
  `nama_pasien` varchar(100) NOT NULL,
  `tanggal` date NOT NULL,
  `jam` time NOT NULL,
  `keluhan` text NOT NULL,
  `status` enum('Menunggu','Dikonfirmasi','Ditolak') DEFAULT 'Menunggu',
  `waktu_input` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `appointments`
--

INSERT INTO `appointments` (`id`, `nama_pasien`, `tanggal`, `jam`, `keluhan`, `status`, `waktu_input`) VALUES
(1, 'lery', '2025-09-30', '19:48:00', 'sakit gigi', 'Dikonfirmasi', '2025-10-13 11:47:14'),
(2, 'fikri', '2025-10-03', '20:50:00', 'gigi lubang', 'Dikonfirmasi', '2025-10-13 11:49:13'),
(3, 'elia', '2025-10-15', '20:59:00', 'sakit panas ', 'Ditolak', '2025-10-13 11:57:23'),
(4, 'isa', '2025-10-14', '13:30:00', 'gigi berlubang', 'Dikonfirmasi', '2025-10-14 04:25:06'),
(5, 'oktap', '2025-10-16', '06:49:00', 'pemasangan behel', 'Menunggu', '2025-10-14 20:47:45'),
(6, 'oktap', '2025-10-20', '13:10:00', 'gigi saya mau dipasangin behel', 'Dikonfirmasi', '2025-10-14 21:09:57'),
(7, 'luna', '2025-10-22', '06:15:00', 'saya sakit demam', 'Ditolak', '2025-10-14 21:13:31');

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

--
-- Table structure for table `diagnosa`
--

CREATE TABLE `diagnosa` (
  `id` int(11) NOT NULL,
  `appointment_id` int(11) NOT NULL,
  `diagnosa` text DEFAULT NULL,
  `obat` text DEFAULT NULL,
  `aturan` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `diagnosa`
--

INSERT INTO `diagnosa` (`id`, `appointment_id`, `diagnosa`, `obat`, `aturan`) VALUES
(1, 1, 'sakit gigi parah', 'paracetamol ', '2x3'),
(2, 1, 'kamu gigi berlubang', 'antalgin', '5x2'),
(3, 4, 'sikat gigi', 'antalgin', '3x1'),
(4, 1, 'dia gigi berlubang', 'antalgin', '3x1 sehari');

--
-- Indexes for dumped tables
--

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

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

--
-- Indexes for table `diagnosa`
--
ALTER TABLE `diagnosa`
  ADD PRIMARY KEY (`id`),
  ADD KEY `appointment_id` (`appointment_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `diagnosa`
--
ALTER TABLE `diagnosa`
  ADD CONSTRAINT `diagnosa_ibfk_1` FOREIGN KEY (`appointment_id`) REFERENCES `appointments` (`id`) ON DELETE 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 */;
