-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `dvrhexcb_warranty`
--

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

--
-- Table structure for table `customers`
--

CREATE TABLE `customers` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `customers`
--

INSERT INTO `customers` (`id`, `name`, `phone`, `created_at`) VALUES
(1, 'محمد رافت', '01021270039', '2025-07-09 05:56:48'),
(2, 'زياد سامح', '01008020403', '2025-07-09 06:00:30'),
(3, 'زياد سامح', '01008020403', '2025-07-09 06:03:55'),
(4, 'محمد رضا', '01007505580', '2025-07-09 21:35:45'),
(5, 'محمد رضا', '01007505580', '2025-07-09 21:36:00'),
(6, 'محمد رضا', '01007505580', '2025-07-09 21:36:08'),
(7, 'احمد رمضان', '01090001755', '2025-07-09 22:50:51'),
(8, 'محمد رضا', '01007505580', '2025-07-10 10:51:13'),
(9, 'احمد السيد موسي', '01006523477', '2025-07-10 14:57:10'),
(10, 'عبدالجواد السيد ندي', '01003482288', '2025-07-10 16:54:42'),
(11, 'احمد اكرامي طلعت', '01010208447', '2025-07-10 19:14:38'),
(12, 'محمود عبدالقوي المنشاوي', '01068943434', '2025-07-12 13:10:54'),
(13, 'منه طلحه مرزوق', '01093164352', '2025-07-12 18:55:25'),
(14, 'علي الزعفران', '01095666500', '2025-07-14 13:28:11'),
(15, 'محمد راشد السيد', NULL, '2025-07-14 17:10:28'),
(16, 'علاء عبدالعال عبد الجواد', '01098680965', '2025-07-15 10:07:19'),
(17, 'احمد حماده خضر', '01026264378', '2025-07-15 18:35:04'),
(18, 'احمد سامح صديق', '01014611498', '2025-07-16 18:36:46'),
(19, 'هاله انور جوده', '01007678390', '2025-07-19 17:08:20'),
(20, 'الحج محمد ميره', '01090060795', '2025-07-20 12:56:34'),
(21, 'احمد رمضان', '01090001755', '2025-07-20 23:05:49'),
(22, 'احمد رمضان', '4444', '2025-07-20 23:30:26'),
(23, 'محمد رافت', '010900017555', '2025-07-21 07:42:31'),
(24, 'عبدالرحمن محمد خميس', '01017422182', '2025-07-22 17:22:29');

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

--
-- Table structure for table `invoices`
--

CREATE TABLE `invoices` (
  `id` int(11) NOT NULL,
  `invoice_number` varchar(20) NOT NULL,
  `customer_id` int(11) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `date` date NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `invoices`
--

INSERT INTO `invoices` (`id`, `invoice_number`, `customer_id`, `user_id`, `date`, `total_amount`, `notes`, `created_at`) VALUES
(3, '783470', 3, 1, '2025-07-09', 14800.00, NULL, '2025-07-09 06:03:55'),
(17, '316376', 19, 1, '2025-07-19', 16000.00, NULL, '2025-07-19 17:08:20'),
(6, '515592', 8, 1, '2025-07-10', 15000.00, NULL, '2025-07-10 10:51:13'),
(7, '356223', 9, 1, '2025-07-10', 8700.00, NULL, '2025-07-10 14:57:10'),
(8, '793517', 10, 1, '2025-07-10', 8000.00, NULL, '2025-07-10 16:54:42'),
(9, '901448', 11, 1, '2025-07-10', 18000.00, NULL, '2025-07-10 19:14:38'),
(10, '390156', 12, 1, '2025-07-12', 11000.00, NULL, '2025-07-12 13:10:54'),
(11, '312415', 13, 1, '2025-07-12', 8500.00, NULL, '2025-07-12 18:55:25'),
(12, '894950', 14, 1, '2025-07-14', 8000.00, '', '2025-07-14 13:28:11'),
(13, '606736', 15, 1, '2025-07-14', 16500.00, NULL, '2025-07-14 17:10:28'),
(14, '743730', 16, 1, '2025-07-15', 10800.00, NULL, '2025-07-15 10:07:19'),
(15, '645292', 17, 1, '2025-07-15', 16500.00, NULL, '2025-07-15 18:35:04'),
(16, '220891', 18, 1, '2025-07-16', 18000.00, NULL, '2025-07-16 18:36:46'),
(18, '552783', 20, 1, '2025-07-20', 11500.00, NULL, '2025-07-20 12:56:34'),
(22, '268938', 24, 1, '2025-07-22', 27000.00, NULL, '2025-07-22 17:22:29');

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

--
-- Table structure for table `invoice_items`
--

CREATE TABLE `invoice_items` (
  `id` int(11) NOT NULL,
  `invoice_id` int(11) NOT NULL,
  `product_id` int(11) DEFAULT NULL,
  `product_name` varchar(100) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `quantity` int(11) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `warranty_end` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `invoice_items`
--

INSERT INTO `invoice_items` (`id`, `invoice_id`, `product_id`, `product_name`, `price`, `quantity`, `total`, `warranty_end`) VALUES
(1, 1, NULL, 'ZBOOK G2', 15000.00, 1, 15000.00, '2025-10-07'),
(2, 2, NULL, 'DELL 7520 EXON RAM 16 HARD 512 SSD VGA NVIDIA  +BAG +MOUSE + CHARGER', 14800.00, 1, 14800.00, NULL),
(3, 3, NULL, 'DELL 7520 EXON RAM 16 HARD 512 SSD VGA NVIDIA  +BAG +MOUSE + CHARGER', 14800.00, 1, 14800.00, '2025-10-07'),
(4, 5, NULL, 'zbook g8', 35000.00, 1, 35000.00, '2025-10-07'),
(5, 6, NULL, 'LAP HP ZBOOK G3 I7-6 RAM16SSD256+HDD500 VGA 4 GIGA', 15000.00, 1, 15000.00, '2025-10-08'),
(6, 7, NULL, 'LAP DELL 3300 I5-8/RAM16/SSD256 VGA INTEL SCREEN14.1INCH', 8700.00, 1, 8700.00, '2025-10-08'),
(7, 8, NULL, 'LAP DELL 3300 I5-8/RAM8/SSD256 VGA INTEL SCREEN14.1INCH', 8000.00, 1, 8000.00, '2025-10-08'),
(8, 9, NULL, 'zbook g5 studio ram 16 hard 512 vga 4 giga + bag +mouse wirelress', 18000.00, 1, 18000.00, '2025-10-08'),
(9, 10, NULL, 'LAP HP 745G6 RAM16 SSD256  VGA 2 GIGA', 11000.00, 1, 11000.00, '2025-10-10'),
(10, 11, NULL, 'LAP LENOVO 81W1 RAM 8 HD 1TERA', 8500.00, 1, 8500.00, '2025-10-10'),
(12, 12, NULL, 'LAP DEL 5570 I3-6 RAM8 SSD128- HDD 500INTEL', 8000.00, 1, 8000.00, '2025-10-14'),
(13, 13, NULL, 'LAB DELL XEON 7520 RAM 16 HARD 512SSD HARD 500HDD VGA 4G NVIDA', 16500.00, 1, 16500.00, '2025-10-12'),
(14, 14, NULL, 'LAPP HP 650 G2 /RAM16/SSD256+HDD500+VGA 2GIGA MD', 10800.00, 1, 10800.00, '2025-10-13'),
(15, 15, NULL, 'LAP ZBOOK G3 XEON /RAM 32 SSD256+HDD500/VGA 4GIGA', 16500.00, 1, 16500.00, '2025-10-13'),
(16, 16, NULL, 'LAP ZBOOK G5 STUDIO /XEON/RAM16-SS512 VGA P1000', 18000.00, 1, 18000.00, '2025-10-14'),
(17, 17, NULL, 'LAB DELL XEON 7520 RAM 16 HARD 512SSD HARD 500ssd VGA 4G NVIDA', 16000.00, 1, 16000.00, '2025-10-17'),
(18, 18, NULL, 'HP 745 G6 RAYZEN 5 PRO RAM 16 HARD 512 M.2 VGA AMD 2 G', 11500.00, 1, 11500.00, '2025-10-18'),
(19, 19, NULL, 'zbook g2', 15.00, 1, 15.00, '2025-10-18'),
(20, 20, NULL, '4', 11.00, 1, 11.00, '2025-10-18'),
(21, 21, NULL, 'ZBOOK G2', 11.00, 1, 11.00, NULL),
(22, 22, NULL, 'LAB HP ZBOOK G6 CORE I9-9TH H RAM 32 HARD 512SSD VGA 4G VNIDA 15.6 FHD', 27000.00, 1, 27000.00, '2025-10-20');

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

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `stock` int(11) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`id`, `name`, `price`, `stock`, `created_at`) VALUES
(1, 'منتج 1', 100.00, 50, '2025-07-09 05:56:22'),
(2, 'منتج 2', 150.00, 30, '2025-07-09 05:56:22'),
(3, 'منتج 3', 200.00, 20, '2025-07-09 05:56:22');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `invoices`
--
ALTER TABLE `invoices`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `invoice_number` (`invoice_number`),
  ADD KEY `customer_id` (`customer_id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `invoice_items`
--
ALTER TABLE `invoice_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `invoice_id` (`invoice_id`),
  ADD KEY `product_id` (`product_id`);

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;

