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

START TRANSACTION;



--
-- Database: `espacios_parking`
--

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

--
-- Table structure for table `espacios`
--

CREATE TABLE IF NOT EXISTS `espacios` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `lugar` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `estado` enum('Libre','Ocupado','Reservado') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `HoraInicio` datetime NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `espacios`
--

INSERT INTO `espacios` (`ID`, `lugar`, `estado`, `HoraInicio`) VALUES
(1, '1', 'Ocupado', '2026-05-26 09:57:39'),
(2, '2', 'Libre', '0000-00-00 00:00:00'),
(3, '3', 'Reservado', '0000-00-00 00:00:00'),
(4, '4', 'Reservado', '0000-00-00 00:00:00'),
(5, '5', 'Reservado', '0000-00-00 00:00:00'),
(6, '6', 'Ocupado', '2026-05-26 09:59:20'),
(7, '7', 'Libre', '0000-00-00 00:00:00'),
(8, '8', 'Ocupado', '2026-05-26 09:59:22'),
(9, '9', 'Libre', '0000-00-00 00:00:00'),
(10, '10', 'Ocupado', '2026-05-26 09:59:27'),
(11, '11', 'Libre', '0000-00-00 00:00:00'),
(12, '12', 'Ocupado', '2026-05-26 09:59:24'),
(13, '13', 'Libre', '0000-00-00 00:00:00'),
(14, '14', 'Libre', '0000-00-00 00:00:00'),
(15, '15', 'Libre', '0000-00-00 00:00:00'),
(16, '16', 'Ocupado', '2026-05-26 09:59:29'),
(17, '17', 'Libre', '0000-00-00 00:00:00'),
(18, '18', 'Libre', '0000-00-00 00:00:00'),
(19, '19', 'Libre', '0000-00-00 00:00:00'),
(20, '20', 'Libre', '0000-00-00 00:00:00'),
(21, '21', 'Libre', '0000-00-00 00:00:00'),
(22, '22', 'Libre', '0000-00-00 00:00:00'),
(23, '23', 'Libre', '0000-00-00 00:00:00'),
(24, '24', 'Libre', '0000-00-00 00:00:00'),
(25, '25', 'Libre', '0000-00-00 00:00:00'),
(26, '26', 'Libre', '0000-00-00 00:00:00'),
(27, '27', 'Libre', '0000-00-00 00:00:00'),
(28, '28', 'Libre', '0000-00-00 00:00:00'),
(29, '29', 'Libre', '0000-00-00 00:00:00'),
(30, '30', 'Libre', '0000-00-00 00:00:00'),
(31, '31', 'Libre', '0000-00-00 00:00:00'),
(32, '32', 'Libre', '0000-00-00 00:00:00'),
(33, '33', 'Libre', '0000-00-00 00:00:00'),
(34, '34', 'Libre', '0000-00-00 00:00:00'),
(35, '35', 'Libre', '0000-00-00 00:00:00'),
(36, '36', 'Libre', '0000-00-00 00:00:00'),
(37, '37', 'Libre', '0000-00-00 00:00:00'),
(38, '38', 'Libre', '0000-00-00 00:00:00'),
(39, '39', 'Libre', '0000-00-00 00:00:00'),
(40, '40', 'Libre', '0000-00-00 00:00:00'),
(41, '41', 'Libre', '0000-00-00 00:00:00'),
(42, '42', 'Libre', '0000-00-00 00:00:00'),
(43, '43', 'Libre', '0000-00-00 00:00:00'),
(44, '44', 'Libre', '0000-00-00 00:00:00'),
(45, '45', 'Libre', '0000-00-00 00:00:00'),
(46, '46', 'Libre', '0000-00-00 00:00:00'),
(47, '47', 'Libre', '0000-00-00 00:00:00'),
(48, '48', 'Libre', '0000-00-00 00:00:00'),
(49, '49', 'Libre', '0000-00-00 00:00:00'),
(50, '50', 'Libre', '0000-00-00 00:00:00'),
(51, '51', 'Libre', '0000-00-00 00:00:00'),
(52, '52', 'Libre', '0000-00-00 00:00:00'),
(53, '53', 'Libre', '0000-00-00 00:00:00'),
(54, '54', 'Libre', '0000-00-00 00:00:00'),
(55, '55', 'Libre', '0000-00-00 00:00:00'),
(56, '56', 'Libre', '0000-00-00 00:00:00'),
(57, '57', 'Libre', '0000-00-00 00:00:00'),
(58, '58', 'Libre', '0000-00-00 00:00:00'),
(59, '59', 'Libre', '0000-00-00 00:00:00'),
(60, '60', 'Libre', '0000-00-00 00:00:00'),
(61, '61', 'Libre', '0000-00-00 00:00:00'),
(62, '62', 'Libre', '0000-00-00 00:00:00'),
(63, '63', 'Libre', '0000-00-00 00:00:00'),
(64, '64', 'Libre', '0000-00-00 00:00:00');

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

--
-- Table structure for table `recibos`
--

CREATE TABLE IF NOT EXISTS `recibos` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `espacio_id` int NOT NULL,
  `tiempo` int DEFAULT NULL,
  `costo` float DEFAULT NULL,
  `inicio` datetime NOT NULL,
  `fin` datetime DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `espacio_id` (`espacio_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `recibos`
--

INSERT INTO `recibos` (`ID`, `espacio_id`, `tiempo`, `costo`, `inicio`, `fin`) VALUES
(5, 1, 2, 0.3, '2026-05-25 10:53:43', '2026-05-25 10:56:19'),
(6, 1, 0, 0, '2026-05-25 11:35:57', '2026-05-25 11:36:04'),
(7, 8, 0, 0, '2026-05-25 16:11:24', '2026-05-25 16:11:49'),
(8, 11, 0, 0, '2026-05-25 16:15:30', '2026-05-25 16:15:49'),
(9, 1, 0, 0, '2026-05-26 03:30:19', '2026-05-26 03:30:22'),
(10, 1, NULL, NULL, '2026-05-26 09:57:40', NULL),
(11, 2, 0, 0, '2026-05-26 09:57:41', '2026-05-26 09:57:42'),
(12, 6, NULL, NULL, '2026-05-26 09:59:20', NULL),
(13, 8, NULL, NULL, '2026-05-26 09:59:22', NULL),
(14, 12, NULL, NULL, '2026-05-26 09:59:24', NULL),
(15, 10, NULL, NULL, '2026-05-26 09:59:27', NULL),
(16, 16, NULL, NULL, '2026-05-26 09:59:29', NULL),
(17, 9, 0, 0, '2026-05-27 01:48:23', '2026-05-27 01:48:27'),
(18, 9, 0, 0, '2026-05-27 01:49:06', '2026-05-27 01:49:14');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `recibos`
--
ALTER TABLE `recibos`
  ADD CONSTRAINT `recibos_ibfk_1` FOREIGN KEY (`espacio_id`) REFERENCES `espacios` (`ID`);
COMMIT;

