-- mysqldump-php https://github.com/ifsnop/mysqldump-php
--
-- Host: localhost	Database: dmacherprojetos_agenda
-- ------------------------------------------------------
-- Date: Sat, 18 Apr 2026 08:23:30 -0300


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

CREATE TABLE `appointments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `date_sched` datetime NOT NULL,
  `contact` varchar(40) NOT NULL,
  `email` varchar(170) NOT NULL,
  `address` varchar(100) NOT NULL,
  `details` text,
  `send_notify` tinyint(1) NOT NULL DEFAULT '1',
  `notified` tinyint(1) NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

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

SET autocommit=0;
INSERT INTO `appointments` VALUES (1,0,'0000-00-00 00:00:00','','','',NULL,1,0,0,'2025-05-21 11:55:46'),(3,2,'2025-05-29 10:20:00','','bah_franca@hotmail.com','Rua Pedro Moreira de Sousa, 323, Jardim Park Real, Indaiatuba, SP','',1,0,0,'2025-05-28 10:16:27'),(4,3,'2025-05-29 11:21:00','19992701474','contato@primehousesolutions.com.br','Rua Tapuia, 587, Vila Maria Helena, Indaiatuba , SP','',1,0,0,'2025-05-28 10:16:46');
COMMIT;

-- Dumped table `appointments` with 3 row(s)
--

--
-- Table structure for table `clients`
--

CREATE TABLE `clients` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `nome_razao_social` varchar(250) DEFAULT NULL,
  `cpf_cnpj` varchar(30) DEFAULT NULL,
  `rg_ie` varchar(30) DEFAULT NULL,
  `email` varchar(200) DEFAULT NULL,
  `telefone_residencial` varchar(20) DEFAULT NULL,
  `telefone_trabalho` varchar(20) DEFAULT NULL,
  `whatsapp` varchar(20) DEFAULT NULL,
  `estado_civil` enum('Solteiro(a)','Casado(a)','Divorciado(a)','Viúvo(a)','Separado(a)','União Estável') DEFAULT NULL,
  `cep` varchar(10) DEFAULT NULL,
  `logradouro` varchar(250) DEFAULT NULL,
  `numero` varchar(10) DEFAULT NULL,
  `bairro` varchar(100) DEFAULT NULL,
  `complemento` varchar(100) DEFAULT NULL,
  `municipio` varchar(100) DEFAULT NULL,
  `uf` char(2) DEFAULT NULL,
  `data_nascimento` date DEFAULT NULL,
  `sexo` enum('Masculino','Feminino','Não definido') DEFAULT NULL,
  `obs` text,
  `advertencia` text,
  `categoria` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `clients`
--

SET autocommit=0;
INSERT INTO `clients` VALUES (1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,1,'BÃRBARA FRANÇA','41857069870',NULL,'bah_franca@hotmail.com',NULL,NULL,'19971545012',NULL,'13348731','Rua Pedro Moreira de Sousa','323','Jardim Park Real','Quadra 3 Lote 7','Indaiatuba','SP',NULL,NULL,NULL,NULL,NULL),(3,1,'Cris',NULL,NULL,'contato@primehousesolutions.com.br',NULL,'19992701474',NULL,NULL,NULL,'Rua Tapuia','587','Vila Maria Helena',NULL,'Indaiatuba ','SP',NULL,NULL,NULL,NULL,NULL),(4,1,'Mateus ',NULL,NULL,'contato@kikutividros.com.br',NULL,'19999566477','19999566477',NULL,'13332656','Rua Senador Romeu Tuma','320','Mato Dentro ','Pisa - Bloco 33 Apartamento 102','Indaiatuba ','SP',NULL,NULL,NULL,NULL,NULL);
COMMIT;

-- Dumped table `clients` with 4 row(s)
--

--
-- Table structure for table `email_logs`
--

CREATE TABLE `email_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `appointment_id` int(11) NOT NULL,
  `client_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sent_by` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `sent_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `status` enum('success','error') COLLATE utf8mb4_unicode_ci NOT NULL,
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `client_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sent_by` (`sent_by`(250))
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `email_logs`
--

SET autocommit=0;
INSERT INTO `email_logs` VALUES (1,0,0,'','','','','','2025-05-21 14:57:28','success',NULL,''),(2,1,2,'2','Adminstrator Admin','bah_franca@hotmail.com','Reunião Agendada','Olá BÃRBARA FRANÇA,\n\nVocê tem uma reunião marcada para: 21-05-2025 08:00.\n\nAtenciosamente,\nDmacher Projetos.','2025-05-21 19:08:40','success','Email enviado com sucesso.','BÃRBARA FRANÇA'),(3,1,3,'2','Adminstrator Admin','bah_franca@hotmail.com','Reunião Agendada','Olá BÃRBARA FRANÇA,\n\nVocê tem uma reunião marcada para: 29-05-2025 10:20.\n\nAtenciosamente,\nDmacher Projetos.','2025-05-28 13:16:27','success','Email enviado com sucesso.','BÃRBARA FRANÇA'),(4,1,4,'3','Adminstrator Admin','contato@primehousesolutions.com.br','Reunião Agendada','Olá Cris,\n\nVocê tem uma reunião marcada para: 29-05-2025 11:21.\n\nAtenciosamente,\nDmacher Projetos.','2025-05-28 13:16:46','success','Email enviado com sucesso.','Cris'),(5,1,5,'6','Adminstrator Admin','x@x.com','Reunião Agendada','Olá <script> alert(\'message\'); </script>,\n\nVocê tem uma reunião marcada para: 27-10-2025 16:54.\n\nAtenciosamente,\nDmacher Projetos.','2025-11-29 17:52:23','success','Email enviado com sucesso.','<script> Alert(\'message\'); </script>');
COMMIT;

-- Dumped table `email_logs` with 5 row(s)
--

--
-- Table structure for table `location`
--

CREATE TABLE `location` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `location` text,
  `description` text,
  `max_a_day` int(11) NOT NULL,
  `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `location`
--

SET autocommit=0;
COMMIT;

-- Dumped table `location` with 0 row(s)
--

--
-- Table structure for table `patient_list`
--

CREATE TABLE `patient_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `type` set('0','1','','') NOT NULL,
  `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `patient_list`
--

SET autocommit=0;
INSERT INTO `patient_list` VALUES (43,'teste','','2025-04-05 10:20:27');
COMMIT;

-- Dumped table `patient_list` with 1 row(s)
--

--
-- Table structure for table `patient_meta`
--

CREATE TABLE `patient_meta` (
  `patient_id` int(11) NOT NULL,
  `meta_field` text,
  `meta_value` text,
  `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  KEY `patient_id` (`patient_id`),
  CONSTRAINT `patient_meta_ibfk_1` FOREIGN KEY (`patient_id`) REFERENCES `patient_list` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `patient_meta`
--

SET autocommit=0;
INSERT INTO `patient_meta` VALUES (43,'name','teste','2025-04-05 10:20:27'),(43,'email','teste@teste.com.br','2025-04-05 10:20:27'),(43,'contact','19555555555','2025-04-05 10:20:27'),(43,'address','Rua 1\r\n2','2025-04-05 10:20:27');
COMMIT;

-- Dumped table `patient_meta` with 4 row(s)
--

--
-- Table structure for table `postits`
--

CREATE TABLE `postits` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT 'Novo Post-it',
  `content` text,
  `color` varchar(50) NOT NULL DEFAULT 'yellow',
  `width` int(11) NOT NULL DEFAULT '250',
  `height` int(11) NOT NULL DEFAULT '250',
  `position_x` int(11) NOT NULL,
  `position_y` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `postits`
--

SET autocommit=0;
INSERT INTO `postits` VALUES (4,'Novo Post-it','','yellow',250,250,20,20,'2025-04-15 22:09:22','2025-04-15 22:09:22');
COMMIT;

-- Dumped table `postits` with 1 row(s)
--

--
-- Table structure for table `schedule_settings`
--

CREATE TABLE `schedule_settings` (
  `meta_field` text NOT NULL,
  `meta_value` text NOT NULL,
  `date_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `schedule_settings`
--

SET autocommit=0;
INSERT INTO `schedule_settings` VALUES ('day_schedule','Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday','2025-11-29 14:45:47'),('morning_schedule','07:30,12:00','2025-11-29 14:45:47'),('afternoon_schedule','13:00,18:30','2025-11-29 14:45:47'),('notification_time','30','2025-11-29 14:45:47');
COMMIT;

-- Dumped table `schedule_settings` with 4 row(s)
--

--
-- Table structure for table `smtp_settings`
--

CREATE TABLE `smtp_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `host` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `port` int(11) NOT NULL,
  `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `encryption` enum('ssl','tls','none') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `smtp_settings`
--

SET autocommit=0;
INSERT INTO `smtp_settings` VALUES (4,1,'mail.primehousesolutions.com.br',587,'noreply@primehousesolutions.com.br','W883aC9pYXTAp2qTRFxy','tls','2025-04-05 12:23:05','2025-05-21 14:56:51');
COMMIT;

-- Dumped table `smtp_settings` with 1 row(s)
--

--
-- Table structure for table `system_info`
--

CREATE TABLE `system_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `meta_field` text NOT NULL,
  `meta_value` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `system_info`
--

SET autocommit=0;
INSERT INTO `system_info` VALUES (1,'name','Agenda'),(6,'short_name','Agenda'),(11,'logo','uploads/favicon.png'),(13,'user_avatar','uploads/user_avatar.jpg'),(14,'cover','uploads/1630631400_clinic-cover.jpg');
COMMIT;

-- Dumped table `system_info` with 5 row(s)
--

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `firstname` varchar(250) NOT NULL,
  `lastname` varchar(250) NOT NULL,
  `username` text NOT NULL,
  `password` text NOT NULL,
  `avatar` text,
  `last_login` datetime DEFAULT NULL,
  `type` tinyint(1) NOT NULL DEFAULT '0',
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `users`
--

SET autocommit=0;
INSERT INTO `users` VALUES (1,'Adminstrator','Admin','admin','21232f297a57a5a743894a0e4a801fc3','uploads/1744749360_Screenshot from 2025-04-14 20-23-48.png',NULL,1,'2021-01-20 14:02:37','2025-04-15 17:36:56');
COMMIT;

-- Dumped table `users` with 1 row(s)
--


