
CREATE TABLE `books` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `antes_imagem` varchar(250) NOT NULL,
  `depois_imagem` varchar(250) NOT NULL,
  `servico_id` int(11) NOT NULL,
  `inicio` datetime NOT NULL,
  `fim` datetime NOT NULL,
  `observacoes` longtext NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
INSERT INTO `books` VALUES ('6', '1703185742-1.png', '1703185742-2.png', '0', '2023-12-21 17:32:06', '2023-12-21 17:40:01', '');
INSERT INTO `books` VALUES ('7', '1703185742-3.png', '1703185742-4.png', '0', '2023-12-21 17:52:55', '2023-12-21 17:53:03', '');
INSERT INTO `books` VALUES ('8', '1703600881-1.png', '1703600881-2.png', '0', '2023-12-26 14:20:33', '2023-12-26 14:21:05', '');
CREATE TABLE `configuracoes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(50) NOT NULL,
  `link` varchar(300) NOT NULL,
  `logo` varchar(30) NOT NULL,
  `distancia` float(12,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
INSERT INTO `configuracoes` VALUES ('1', 'CAS Dashboard', 'https://caspromocoes.app.br/', '/arquivos/logo.png', '300.00');
CREATE TABLE `contratos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `estabelecimento` int(11) NOT NULL,
  `promotor_responsavel` int(11) NOT NULL,
  `cliente_id` int(11) NOT NULL,
  `titulo` varchar(240) NOT NULL,
  `descricao` varchar(500) NOT NULL,
  `data_inicial` date NOT NULL,
  `data_final` date NOT NULL,
  `horario` time NOT NULL,
  `dia_semana` int(1) NOT NULL,
  `valor` float(12,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
INSERT INTO `contratos` VALUES ('2', '2', '8', '1', 'Max Atacadista', '', '2024-08-01', '2024-08-30', '17:30:00', '2', '200.00');
INSERT INTO `contratos` VALUES ('3', '1', '8', '1', 'Fort Atacadista', '', '2024-08-21', '2024-08-30', '11:00:00', '3', '200.00');
INSERT INTO `contratos` VALUES ('4', '1', '8', '1', 'Fort Atacadista', '', '2024-08-21', '2024-08-30', '11:00:00', '4', '200.00');
CREATE TABLE `estabelecimentos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nome` varchar(240) NOT NULL,
  `endereco` varchar(240) NOT NULL,
  `latitude` varchar(30) NOT NULL,
  `longitude` varchar(30) NOT NULL,
  `logo` varchar(240) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
INSERT INTO `estabelecimentos` VALUES ('1', 'Fort Atacadista', 'Rua Jorge Zipperer, 151 - Centro, São Bento do Sul - SC, 89280-490', '-25.508786249916398', '-49.29075711226028', 'estabelecimento_1.png');
INSERT INTO `estabelecimentos` VALUES ('2', 'Max Atacadista (centro)', 'Av. Winston Churchill, 1527 - sala 08 - Capão Raso, Curitiba - PR, 81130-000', '-25.509667397949052', '-49.29414742451326', '1703019286.png');
CREATE TABLE `modalidades` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(240) NOT NULL,
  `status` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
INSERT INTO `modalidades` VALUES ('1', 'Gerente Ausente', '1');
INSERT INTO `modalidades` VALUES ('2', 'Estabelecimento Fechado', '1');
CREATE TABLE `ocorrencias` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `data` date NOT NULL,
  `horario` time NOT NULL,
  `titulo` varchar(240) NOT NULL,
  `imagem` varchar(240) NOT NULL,
  `descricao` varchar(240) NOT NULL,
  `modalidade` int(11) NOT NULL,
  `servico_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `produtos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `codigo_barra` varchar(100) NOT NULL,
  `preco` float NOT NULL,
  `servico_id` int(11) NOT NULL,
  `data` date NOT NULL,
  `id_estabelecimento` int(11) NOT NULL,
  `id_cliente` int(11) NOT NULL,
  `promocao` varchar(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `servicos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `baixado` int(1) NOT NULL,
  `titulo` varchar(240) NOT NULL,
  `descricao` varchar(500) NOT NULL,
  `data` date NOT NULL,
  `dia_semana` int(1) NOT NULL,
  `horario` time NOT NULL,
  `promotor_responsavel` int(11) NOT NULL,
  `cliente_id` int(11) NOT NULL,
  `estabelecimento` int(11) NOT NULL,
  `valor` float(12,2) NOT NULL,
  `id_status` int(1) NOT NULL,
  `checkin` datetime NOT NULL,
  `checkout` datetime NOT NULL,
  `observacoes` longtext NOT NULL,
  `checkin_latitude` varchar(30) NOT NULL,
  `checkin_longitude` varchar(30) NOT NULL,
  `checkout_latitude` varchar(30) NOT NULL,
  `checkout_longitude` varchar(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;
INSERT INTO `servicos` VALUES ('3', '1', 'Max Atacadista', '', '2024-06-20', '0', '22:53:00', '8', '1', '2', '0.00', '0', '2023-12-26 14:31:36', '2023-12-26 14:34:08', '', '-25.509565', '-49.2954636', '-25.509565', '-49.2954636');
INSERT INTO `servicos` VALUES ('11', '1', 'Preparar prateleira do Nescau', 'Preparar prateleira do NescauPreparar prateleira do NescauPreparar prateleira do Nescau', '2024-06-20', '0', '19:38:00', '8', '1', '1', '0.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('12', '1', 'Max Atacadista', '', '2024-06-20', '0', '22:53:00', '8', '1', '2', '0.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('13', '1', 'Preparar prateleira do Nescau', 'Preparar prateleira do NescauPreparar prateleira do NescauPreparar prateleira do Nescau', '2024-06-20', '0', '19:38:00', '8', '1', '1', '0.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('14', '0', 'Max Atacadista', '', '2024-05-24', '0', '22:53:00', '8', '1', '2', '50.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('15', '1', 'Preparar prateleira do Nescau', 'Preparar prateleira do NescauPreparar prateleira do NescauPreparar prateleira do Nescau', '2024-05-24', '0', '19:38:00', '8', '1', '1', '0.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('16', '0', 'Max Atacadista', '', '2024-05-24', '0', '22:53:00', '8', '1', '2', '0.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('17', '0', 'Preparar prateleira do Nescau', 'Preparar prateleira do NescauPreparar prateleira do NescauPreparar prateleira do Nescau', '2024-05-24', '0', '19:38:00', '8', '1', '1', '0.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('18', '0', 'Max Atacadista', '', '2024-08-20', '2', '17:30:00', '8', '1', '2', '0.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('19', '0', 'Fort Atacadista', '', '2024-08-21', '3', '11:00:00', '8', '1', '1', '200.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('20', '0', 'Fort Atacadista', '', '2024-08-22', '4', '11:00:00', '8', '1', '1', '200.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('21', '0', 'Max Atacadista', '', '2024-08-27', '2', '17:30:00', '8', '1', '2', '0.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('22', '0', 'Fort Atacadista', '', '2024-08-28', '3', '11:00:00', '8', '1', '1', '200.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
INSERT INTO `servicos` VALUES ('23', '0', 'Fort Atacadista', '', '2024-08-29', '4', '11:00:00', '8', '1', '1', '200.00', '0', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '', '', '');
