-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 18, 2026 at 04:50 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

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

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

--
-- Table structure for table `admins`
--

CREATE TABLE `admins` (
  `id` int(11) NOT NULL,
  `username` varchar(100) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `admins`
--

INSERT INTO `admins` (`id`, `username`, `password_hash`, `created_at`) VALUES
(1, 'admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', '2026-05-18 00:44:42');

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

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `slug` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `image_url` varchar(500) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name`, `slug`, `description`, `image_url`, `created_at`) VALUES
(1, 'Starters', 'starters', 'Elegant appetizers', NULL, '2026-05-18 00:44:42'),
(2, 'Mains', 'mains', 'Signature main courses', NULL, '2026-05-18 00:44:42'),
(3, 'Seafood', 'seafood', 'Fresh from the sea', NULL, '2026-05-18 00:44:42'),
(4, 'Pasta', 'pasta', 'Artisan pasta & risotto', NULL, '2026-05-18 00:44:42'),
(5, 'Desserts', 'desserts', 'Sweet finales', NULL, '2026-05-18 00:44:42'),
(6, 'Beverages', 'beverages', 'Curated drinks & cocktails', NULL, '2026-05-18 00:44:42'),
(7, 'Menu', 'menu', NULL, NULL, '2026-05-18 01:22:33');

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

--
-- Table structure for table `menu_items`
--

CREATE TABLE `menu_items` (
  `id` int(11) NOT NULL,
  `name` varchar(200) NOT NULL,
  `description` text NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `image_url` varchar(500) DEFAULT NULL,
  `category_id` int(11) NOT NULL,
  `is_featured` tinyint(1) NOT NULL DEFAULT 0,
  `is_popular` tinyint(1) NOT NULL DEFAULT 0,
  `is_available` tinyint(1) NOT NULL DEFAULT 1,
  `calories` int(11) DEFAULT NULL,
  `prep_time_mins` int(11) DEFAULT NULL,
  `tags` varchar(500) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `menu_items`
--

INSERT INTO `menu_items` (`id`, `name`, `description`, `price`, `image_url`, `category_id`, `is_featured`, `is_popular`, `is_available`, `calories`, `prep_time_mins`, `tags`, `created_at`) VALUES
(19, 'Wagyu Beef Steak', '', 7.00, 'uploads/1779070727_3327.png', 6, 0, 0, 1, NULL, NULL, NULL, '2026-05-18 02:18:47'),
(20, 'Grilled Salmon Deluxe', '', 8.00, 'uploads/1779070779_8140.png', 6, 0, 0, 1, NULL, NULL, NULL, '2026-05-18 02:19:39'),
(21, 'Chicken Alfredo Pasta', '', 5.00, 'uploads/1779070806_2200.png', 6, 0, 0, 1, NULL, NULL, NULL, '2026-05-18 02:20:06'),
(22, 'Seafood Mix Grill', '', 12.00, 'uploads/1779070907_1902.png', 6, 0, 0, 1, NULL, NULL, NULL, '2026-05-18 02:21:47'),
(23, 'Truffle Mushroom Burger', '', 10.00, 'uploads/1779070991_1734.png', 6, 0, 0, 1, NULL, NULL, NULL, '2026-05-18 02:23:11'),
(24, 'BBQ Beef Ribs', '', 23.00, 'uploads/1779071042_1563.png', 6, 0, 0, 1, NULL, NULL, NULL, '2026-05-18 02:24:02'),
(25, 'Dynamite Shrimp Bowl', '', 16.00, 'uploads/1779071145_5416.png', 6, 0, 0, 1, NULL, NULL, NULL, '2026-05-18 02:25:45'),
(26, 'Margherita Pizza', '', 13.00, 'uploads/1779071228_3416.png', 6, 0, 0, 1, NULL, NULL, NULL, '2026-05-18 02:27:08');

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

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int(11) NOT NULL,
  `customer_name` varchar(200) NOT NULL,
  `customer_phone` varchar(50) NOT NULL,
  `customer_email` varchar(200) DEFAULT NULL,
  `order_type` enum('dine-in','delivery','pickup') NOT NULL DEFAULT 'dine-in',
  `delivery_address` text DEFAULT NULL,
  `delivery_fee` decimal(10,2) NOT NULL DEFAULT 0.00,
  `total` decimal(10,2) NOT NULL,
  `status` varchar(50) NOT NULL DEFAULT 'pending',
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`id`, `customer_name`, `customer_phone`, `customer_email`, `order_type`, `delivery_address`, `delivery_fee`, `total`, `status`, `notes`, `created_at`) VALUES
(4, 'بببببببب', '111111', NULL, 'delivery', 'مممم', 5.00, 27.00, 'completed', 'تتتتتت', '2026-05-18 02:07:09'),
(5, 'بببببببب', '111111', NULL, 'delivery', 'نننننن', 5.00, 70.20, 'completed', 'تتتتت', '2026-05-18 02:08:13'),
(6, 'بببببببب', '111111', NULL, 'delivery', '22222', 5.00, 27.00, 'completed', '444', '2026-05-18 02:14:06'),
(7, 'ppp', '555555', NULL, 'delivery', 'sdafafd', 0.00, 88.56, 'completed', '', '2026-05-18 02:47:56');

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

--
-- Table structure for table `order_items`
--

CREATE TABLE `order_items` (
  `id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `menu_item_id` int(11) NOT NULL,
  `menu_item_name` varchar(200) NOT NULL,
  `quantity` int(11) NOT NULL,
  `unit_price` decimal(10,2) NOT NULL,
  `subtotal` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `order_items`
--

INSERT INTO `order_items` (`id`, `order_id`, `menu_item_id`, `menu_item_name`, `quantity`, `unit_price`, `subtotal`) VALUES
(3, 4, 18, 'كسمك', 1, 20.00, 20.00),
(4, 5, 18, 'كسمك', 3, 20.00, 60.00),
(5, 6, 18, 'كسمك', 1, 20.00, 20.00),
(6, 7, 26, 'Margherita Pizza', 1, 13.00, 13.00),
(7, 7, 24, 'BBQ Beef Ribs', 3, 23.00, 69.00);

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

--
-- Table structure for table `reservations`
--

CREATE TABLE `reservations` (
  `id` int(11) NOT NULL,
  `customer_name` varchar(200) NOT NULL,
  `customer_phone` varchar(50) NOT NULL,
  `customer_email` varchar(200) DEFAULT NULL,
  `party_size` int(11) NOT NULL,
  `date` date NOT NULL,
  `time` time NOT NULL,
  `notes` text DEFAULT NULL,
  `status` enum('pending','confirmed','cancelled') NOT NULL DEFAULT 'pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reservations`
--

INSERT INTO `reservations` (`id`, `customer_name`, `customer_phone`, `customer_email`, `party_size`, `date`, `time`, `notes`, `status`, `created_at`) VALUES
(1, 'llll', '111111', 'lolpp@aviator2025-eg.com', 4, '2026-06-18', '16:30:00', '4444444', 'pending', '2026-05-18 02:10:37');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `admins`
--
ALTER TABLE `admins`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`);

--
-- Indexes for table `menu_items`
--
ALTER TABLE `menu_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `category_id` (`category_id`);

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

--
-- Indexes for table `order_items`
--
ALTER TABLE `order_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_id` (`order_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `menu_items`
--
ALTER TABLE `menu_items`
  ADD CONSTRAINT `menu_items_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `order_items`
--
ALTER TABLE `order_items`
  ADD CONSTRAINT `order_items_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`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 */;
