
CREATE DATABASE business_order;
USE business_order;

CREATE TABLE orders (
 id INT AUTO_INCREMENT PRIMARY KEY,
 nama VARCHAR(100),
 whatsapp VARCHAR(20),
 telp VARCHAR(20),
 pickup TEXT,
 dropoff TEXT,
 kursi VARCHAR(50),
 penumpang INT,
 harga DECIMAL(10,2),
 status ENUM('Pending','Paid','Done','Cancelled') DEFAULT 'Pending',
 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE admin (
 id INT AUTO_INCREMENT PRIMARY KEY,
 username VARCHAR(50),
 password VARCHAR(255),
 role ENUM('superadmin','staff') DEFAULT 'staff'
);

INSERT INTO admin (username,password,role)
VALUES ('admin', SHA2('admin123',256), 'superadmin');
