-- phpMyAdmin SQL Dump
-- version 4.0.10deb1ubuntu0.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tempo de Geração: 27/04/2019 às 23:58
-- Versão do servidor: 5.5.62-0ubuntu0.14.04.1
-- Versão do PHP: 5.5.9-1ubuntu4.29

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;

--
-- Banco de dados: `painel`
--

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

--
-- Estrutura para tabela `cmum_admins`
--

CREATE TABLE IF NOT EXISTS `cmum_admins` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` text CHARACTER SET latin1 NOT NULL,
  `password` text CHARACTER SET latin1 NOT NULL,
  `realname` text CHARACTER SET latin1,
  `indt_rev` varchar(5) CHARACTER SET latin1 NOT NULL,
  `email` varchar(255) CHARACTER SET latin1 NOT NULL,
  `enabled` text CHARACTER SET latin1,
  `level` int(11) DEFAULT NULL,
  `hierarquia` text NOT NULL,
  `addedby` int(11) NOT NULL,
  `added` datetime NOT NULL,
  `expiredate` datetime NOT NULL,
  `profiles_pm` text CHARACTER SET latin1 NOT NULL,
  `opcoes_rev` text CHARACTER SET latin1 NOT NULL,
  `opcoes_log` text CHARACTER SET latin1 NOT NULL,
  `email_ps` varchar(255) CHARACTER SET latin1 NOT NULL,
  `token_ps` varchar(255) CHARACTER SET latin1 NOT NULL,
  `email_bf` varchar(255) CHARACTER SET latin1 NOT NULL,
  `token_bf` varchar(255) CHARACTER SET latin1 NOT NULL,
  `info_conta_dep` text CHARACTER SET latin1 NOT NULL,
  `id_modelo_padrao` int(11) NOT NULL,
  `id_rev_mudou_status` int(11) NOT NULL,
  `qtd_logins` int(5) NOT NULL,
  `rev_pre` text NOT NULL,
  `valor_cobrado_global` decimal(10,2) NOT NULL,
  `valor_cob_login` decimal(10,2) NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ;

--
-- Fazendo dump de dados para tabela `cmum_admins`
--

INSERT INTO `cmum_admins` (`id`, `username`, `password`, `realname`, `indt_rev`, `email`, `enabled`, `level`, `hierarquia`, `addedby`, `added`, `expiredate`, `profiles_pm`, `opcoes_rev`, `opcoes_log`, `email_ps`, `token_ps`, `email_bf`, `token_bf`, `info_conta_dep`, `id_modelo_padrao`, `id_rev_mudou_status`, `qtd_logins`, `rev_pre`, `valor_cobrado_global`, `valor_cob_login`) VALUES
(1, 'admin', 'JU4DDAOqu5uK8kfo6QbwkWQbKwx2C1kqQKo5jO+LGGs=', 'Administrador', '', 'adm@yahoo.com.br', 'true', 0, '0', 0, '2014-06-06 00:00:00', '2023-01-31 23:59:59', '', '', '', 'joaogfdaq@gmail.com', 'ss', 'joao@gma', '  ', '', 1, 0, 10000, '0', 30.00, 30.00),
(27, 'test', 'VKJwQ32j+bY1IqaseEDOl/uQj5bxzJfIhR5LoHL7vzA=', 'test', '', 'zx@Hks.com', 'true', 1, '1', 1, '2019-04-11 00:00:00', '2019-05-10 23:59:59', 'a:2:{i:0;s:2:"33";i:1;s:2:"34";}', 'a:11:{i:0;s:1:"1";i:1;s:1:"2";i:2;s:1:"3";i:3;s:1:"4";i:4;s:1:"5";i:5;s:1:"6";i:6;s:1:"7";i:7;s:1:"8";i:8;s:1:"9";i:9;s:2:"10";i:10;s:2:"11";}', 'a:9:{i:0;s:1:"1";i:1;s:1:"2";i:2;s:1:"3";i:3;s:1:"4";i:4;s:1:"5";i:5;s:1:"6";i:6;s:1:"7";i:7;s:1:"8";i:8;s:1:"9";}', '', '', '', '', '', 0, 1, 0, '1', 0.00, 0.00);

--
-- Gatilhos `cmum_admins`
--
DROP TRIGGER IF EXISTS `tg_onDeleteAdmin`;
DELIMITER //
CREATE TRIGGER `tg_onDeleteAdmin` BEFORE DELETE ON `cmum_admins`
 FOR EACH ROW BEGIN
  IF OLD.id = 1 THEN -- Abort when trying to remove this record
    CALL cannot_delete_error; -- raise an error to prevent deleting from the table
  END IF;
END
//
DELIMITER ;

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

--
-- Estrutura stand-in para view `cmum_admins_pais_filhos`
--
CREATE TABLE IF NOT EXISTS `cmum_admins_pais_filhos` (
`id` int(11)
,`username` text
,`enabled` text
,`expiredate` datetime
,`hierarquia` text
,`id_pai` int(11)
,`pai_login` text
);
-- --------------------------------------------------------

--
-- Estrutura para tabela `cmum_cota_pre_paga`
--

CREATE TABLE IF NOT EXISTS `cmum_cota_pre_paga` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_revenda` int(11) NOT NULL,
  `qtd_atual` int(11) NOT NULL,
  `data_atualizacao` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;

--
-- Fazendo dump de dados para tabela `cmum_cota_pre_paga`
--

INSERT INTO `cmum_cota_pre_paga` (`id`, `id_revenda`, `qtd_atual`, `data_atualizacao`) VALUES
(1, 2, 0, '0000-00-00'),
(2, 3, 0, '0000-00-00'),
(3, 4, 0, '0000-00-00'),
(4, 5, 0, '0000-00-00'),
(5, 6, 0, '0000-00-00'),
(6, 7, 0, '0000-00-00'),
(7, 8, 0, '0000-00-00'),
(8, 9, 0, '0000-00-00'),
(9, 10, 0, '0000-00-00'),
(10, 11, 0, '0000-00-00'),
(11, 12, 0, '0000-00-00'),
(12, 13, 0, '0000-00-00'),
(13, 14, 0, '0000-00-00'),
(14, 15, 0, '0000-00-00'),
(15, 16, 0, '0000-00-00'),
(16, 17, 0, '0000-00-00'),
(17, 18, 0, '0000-00-00'),
(18, 19, 0, '0000-00-00'),
(19, 20, 0, '0000-00-00'),
(20, 21, 0, '0000-00-00'),
(21, 0, 0, '0000-00-00'),
(22, 0, 0, '0000-00-00'),
(23, 0, 0, '0000-00-00'),
(24, 0, 0, '0000-00-00'),
(25, 0, 0, '0000-00-00'),
(26, 22, 0, '0000-00-00'),
(27, 23, 0, '0000-00-00'),
(28, 24, 0, '0000-00-00'),
(29, 25, 0, '0000-00-00'),
(30, 26, 0, '0000-00-00'),
(31, 27, 0, '0000-00-00');

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

--
-- Estrutura para tabela `cmum_csp_config`
--

CREATE TABLE IF NOT EXISTS `cmum_csp_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ip_serv` varchar(50) NOT NULL,
  `porta_serv` varchar(50) NOT NULL,
  `user_serv` varchar(50) NOT NULL,
  `senha_serv` varchar(50) NOT NULL,
  `protocol_serv` varchar(50) NOT NULL,
  `desc_serv` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

--
-- Fazendo dump de dados para tabela `cmum_csp_config`
--

INSERT INTO `cmum_csp_config` (`id`, `ip_serv`, `porta_serv`, `user_serv`, `senha_serv`, `protocol_serv`, `desc_serv`) VALUES
(1, '137.74.41.65', '8500', 'root', 'root', 'http', 'csp_linux');

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

--
-- Estrutura stand-in para view `cmum_detalhes_saldo_pre`
--
CREATE TABLE IF NOT EXISTS `cmum_detalhes_saldo_pre` (
`id` int(11)
,`username` text
,`qtd_atual` int(11)
,`qtd_bloq_log` decimal(32,0)
,`qtd_bloq_rev` decimal(32,0)
);
-- --------------------------------------------------------

--
-- Estrutura para tabela `cmum_failedlogins`
--

CREATE TABLE IF NOT EXISTS `cmum_failedlogins` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `date` tinytext,
  `time` tinytext,
  `ip` tinytext,
  `hostname` text,
  `username` tinytext,
  `password` tinytext,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=140 ;

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

--
-- Estrutura para tabela `cmum_limite_logins_profiles`
--

CREATE TABLE IF NOT EXISTS `cmum_limite_logins_profiles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_revenda` int(11) NOT NULL,
  `id_profiles` int(11) NOT NULL,
  `quantidade` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

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

--
-- Estrutura stand-in para view `cmum_logins_ativos_por_rev`
--
CREATE TABLE IF NOT EXISTS `cmum_logins_ativos_por_rev` (
`id` int(11)
,`name` tinytext
,`enabled` tinytext
,`maxconnections` tinytext
,`expiredate` datetime
,`profiles` text
,`id_profile` text
,`id_rev` int(11)
,`username` text
);
-- --------------------------------------------------------

--
-- Estrutura stand-in para view `cmum_logins_com_perfis_limpos`
--
CREATE TABLE IF NOT EXISTS `cmum_logins_com_perfis_limpos` (
`id` int(11)
,`name` tinytext
,`profiles` text
,`perfil_lp` text
,`enabled` tinytext
,`expiredate` datetime
,`addedby` tinytext
);
-- --------------------------------------------------------

--
-- Estrutura stand-in para view `cmum_logins_desativados_por_rev`
--
CREATE TABLE IF NOT EXISTS `cmum_logins_desativados_por_rev` (
`id` int(11)
,`name` tinytext
,`enabled` tinytext
,`maxconnections` tinytext
,`expiredate` datetime
,`profiles` text
,`id_profile` text
,`id_rev` int(11)
,`username` text
);
-- --------------------------------------------------------

--
-- Estrutura stand-in para view `cmum_logins_testes_por_rev`
--
CREATE TABLE IF NOT EXISTS `cmum_logins_testes_por_rev` (
`id` int(11)
,`name` tinytext
,`enabled` tinytext
,`maxconnections` tinytext
,`expiredate` datetime
,`profiles` text
,`id_profile` text
,`id_rev` int(11)
,`username` text
);
-- --------------------------------------------------------

--
-- Estrutura stand-in para view `cmum_logins_vencidos_por_rev`
--
CREATE TABLE IF NOT EXISTS `cmum_logins_vencidos_por_rev` (
`id` int(11)
,`name` tinytext
,`enabled` tinytext
,`maxconnections` tinytext
,`expiredate` datetime
,`profiles` text
,`id_profile` text
,`id_rev` int(11)
,`username` text
);
-- --------------------------------------------------------

--
-- Estrutura para tabela `cmum_mail_models`
--

CREATE TABLE IF NOT EXISTS `cmum_mail_models` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `assunto` varchar(255) NOT NULL,
  `corpo` text NOT NULL,
  `tipomodel` int(1) NOT NULL,
  `data_att` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Estrutura para tabela `cmum_mail_settings`
--

CREATE TABLE IF NOT EXISTS `cmum_mail_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `email` varchar(50) NOT NULL,
  `nome_exibir` varchar(25) NOT NULL,
  `senha` varchar(50) NOT NULL,
  `serv_mail` varchar(25) NOT NULL,
  `data_cad` datetime NOT NULL,
  `data_atu` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

--
-- Fazendo dump de dados para tabela `cmum_mail_settings`
--

INSERT INTO `cmum_mail_settings` (`id`, `uid`, `email`, `nome_exibir`, `senha`, `serv_mail`, `data_cad`, `data_atu`) VALUES
(1, 1, 'perfilx3cs@gmail.com', 'Servidor DELTA_SYSTEM', 'CEQQ+p0d0fNIDrTZEB4R+dnBIOloQ86D4zCBL4frAAA=', 'gmail', '2015-06-12 20:51:57', '2015-07-19 08:58:39');

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

--
-- Estrutura para tabela `cmum_modelos_email`
--

CREATE TABLE IF NOT EXISTS `cmum_modelos_email` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `aid` int(11) NOT NULL,
  `nome_modelo` varchar(255) COLLATE utf8_bin NOT NULL,
  `assunto` varchar(255) COLLATE utf8_bin NOT NULL,
  `corpo` text COLLATE utf8_bin NOT NULL,
  `tipo_modelo` set('1','2') COLLATE utf8_bin NOT NULL,
  `data_atual` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `permite_acesso` tinyint(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ;

--
-- Fazendo dump de dados para tabela `cmum_modelos_email`
--

INSERT INTO `cmum_modelos_email` (`id`, `aid`, `nome_modelo`, `assunto`, `corpo`, `tipo_modelo`, `data_atual`, `permite_acesso`) VALUES
(1, 1, 'DELTA SYSTEM', 'DELTA SYSTEM DADOS SERVIDOR', '&lt;p&gt;&lt;strong&gt;[NMVENDEDOR]&lt;/strong&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;strong&gt;TEMOS PAINEL REVENDA (&lt;span style=&quot;color:rgb(0, 0, 255)&quot;&gt;SKY&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:rgb(255, 0, 0)&quot;&gt;CLAROTV&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:rgb(255, 215, 0)&quot;&gt;OITV&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 128, 0)&quot;&gt;NETHD&lt;/span&gt;)&amp;nbsp;CONHE&amp;Ccedil;A NOSSO SISTEMA:&amp;nbsp;&lt;em&gt;&lt;span style=&quot;color:#FFA07A&quot;&gt;http://deltasystem.noip.us/sistema&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;strong&gt;Visite Nossa Loja&amp;nbsp;&lt;em&gt;&lt;span style=&quot;color:rgb(218, 165, 32)&quot;&gt;http://foxnet.loja2.com.br/&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(0, 0, 205)&quot;&gt;&lt;strong&gt;Watssapp &amp;nbsp;(4888349167)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(0, 0, 205)&quot;&gt;&lt;strong&gt;skype &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(x3cs_hd)&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;font-size:18px&quot;&gt;&lt;strong&gt;&lt;em&gt;Bem Vindo&lt;/em&gt;&amp;nbsp;&lt;span style=&quot;color:rgb(64, 224, 208)&quot;&gt;[NMCLIENTE]&lt;/span&gt;&lt;span style=&quot;font-family:helvetica neue,helvetica,arial,sans-serif&quot;&gt;&amp;nbsp; Em Nosso Sistema&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&amp;nbsp;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(0, 0, 255)&quot;&gt;&lt;strong&gt;&lt;em&gt;SEGUE DADOS PARA CONEXAO DE SEU TESTE&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;br /&gt;\n&lt;strong&gt;&lt;span style=&quot;color:rgb(0, 128, 128)&quot;&gt;&lt;em&gt;LOGIN:&lt;/em&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:rgb(0, 128, 0)&quot;&gt;&lt;em&gt;&amp;nbsp;[LGCLIENTE]&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;color:rgb(0, 128, 0)&quot;&gt;&lt;em&gt;&lt;span style=&quot;font-family:helvetica neue,helvetica,arial,sans-serif; font-size:10.6666669845581px&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;\n&lt;strong&gt;&lt;span style=&quot;color:rgb(0, 128, 128)&quot;&gt;&lt;em&gt;SENHA:&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;span style=&quot;color:rgb(165, 42, 42)&quot;&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 128, 0)&quot;&gt;&amp;nbsp;[SNCLIENTE]&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;color:rgb(0, 128, 0)&quot;&gt;&lt;span style=&quot;font-family:helvetica neue,helvetica,arial,sans-serif; font-size:10.6666669845581px&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;\n&lt;strong&gt;&lt;span style=&quot;color:rgb(0, 128, 128)&quot;&gt;&lt;em&gt;VALIDADE:&lt;/em&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color:rgb(0, 128, 0)&quot;&gt;[VCCLIENTE]&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;\n&lt;span style=&quot;color:rgb(255, 0, 0)&quot;&gt;&lt;strong&gt;[DDSERVIDOR]&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(0, 128, 128)&quot;&gt;&lt;em&gt;&lt;strong&gt;Deskey 0102030405060708091011121314&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(0, 0, 205)&quot;&gt;&lt;strong&gt;&lt;em&gt;ESPERAMOS QUE TENHA GOSTADO&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(0, 0, 205)&quot;&gt;&lt;strong&gt;&lt;em&gt;SE DESEJAR CONTINUAR ESCOLHA UMA DAS OP&amp;Ccedil;OES ABAIXO PARA EFETUAR O PAGAMENTO&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 0, 205)&quot;&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(0, 128, 0)&quot;&gt;&lt;strong&gt;Conta Caixa &amp;nbsp;Economica&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(255, 0, 0)&quot;&gt;&lt;strong&gt;Agencia:&amp;nbsp;1084&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(255, 0, 0)&quot;&gt;&lt;strong&gt;Operacao: 001&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(255, 0, 0)&quot;&gt;&lt;strong&gt;Conta Corrente: 0760-8&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;font-size:16px&quot;&gt;&lt;span style=&quot;color:rgb(255, 0, 0)&quot;&gt;&lt;em&gt;&lt;strong&gt;Titular Augusto Ize Neto&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:rgb(105, 105, 105)&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-size:14px&quot;&gt;PARA SUA COMODIDADE TAMBEM PODE ESTAR EFETUANDO O PAGAMENTO EM NOSSA CENTRAL DO CLIENTE Clique No Link ABAIXO&lt;/span&gt;&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&lt;span style=&quot;color:rgb(105, 105, 105)&quot;&gt;&lt;strong&gt;&lt;em&gt;ENTRE&amp;nbsp;COM SEU LOGIN&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;color:rgb(64, 224, 208)&quot;&gt;&lt;strong&gt;&lt;em&gt;[LGCLIENTE]&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&lt;span style=&quot;font-family:helvetica neue,helvetica,arial,sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style=&quot;color:rgb(105, 105, 105)&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-family:helvetica neue,helvetica,arial,sans-serif&quot;&gt;&amp;nbsp;E SUA SENHA&amp;nbsp;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;color:rgb(64, 224, 208)&quot;&gt;&lt;strong&gt;[SNCLIENTE]&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;color:rgb(0, 128, 0)&quot;&gt;&lt;span style=&quot;font-family:helvetica neue,helvetica,arial,sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;\n\n&lt;p&gt;&lt;span style=&quot;color:#0000CD&quot;&gt;&lt;strong&gt;http://deltasystem.noip.us/linhas/cliente/index.php/login/entrar&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;\n', '', '2015-07-19 09:28:20', 1);

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

--
-- Estrutura para tabela `cmum_modelos_email_rev`
--

CREATE TABLE IF NOT EXISTS `cmum_modelos_email_rev` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `aid` int(11) NOT NULL,
  `nome_modelo` varchar(255) COLLATE utf8_bin NOT NULL,
  `assunto` varchar(255) COLLATE utf8_bin NOT NULL,
  `corpo` text COLLATE utf8_bin NOT NULL,
  `data_atual` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

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

--
-- Estrutura para tabela `cmum_notificacoes_interna`
--

CREATE TABLE IF NOT EXISTS `cmum_notificacoes_interna` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(255) COLLATE utf8_bin NOT NULL,
  `mensagem` text COLLATE utf8_bin NOT NULL,
  `tipo` tinyint(4) NOT NULL,
  `id_cad_adm` int(11) NOT NULL,
  `id_para_rev` int(11) NOT NULL,
  `propagar_subrev` tinyint(4) NOT NULL,
  `data_cad` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

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

--
-- Estrutura para tabela `cmum_notif_int_lidas`
--

CREATE TABLE IF NOT EXISTS `cmum_notif_int_lidas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_revenda` int(11) NOT NULL,
  `id_notificacao` int(11) NOT NULL,
  `data_leitura` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

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

--
-- Estrutura para tabela `cmum_opc_log`
--

CREATE TABLE IF NOT EXISTS `cmum_opc_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nome_opc` varchar(255) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=10 ;

--
-- Fazendo dump de dados para tabela `cmum_opc_log`
--

INSERT INTO `cmum_opc_log` (`id`, `nome_opc`) VALUES
(1, 'Pode alterar login'),
(2, 'Pode alterar senha'),
(3, 'Pode alterar email'),
(4, 'Pode alterar vencimento'),
(5, 'Pode alterar status'),
(6, 'Pode exlcuir logins'),
(7, 'Pode alterar nome'),
(8, 'Pode alterar o numero de conexoes'),
(9, 'Pode alterar telefone');

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

--
-- Estrutura para tabela `cmum_opc_rev`
--

CREATE TABLE IF NOT EXISTS `cmum_opc_rev` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nome_opc` varchar(255) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=12 ;

--
-- Fazendo dump de dados para tabela `cmum_opc_rev`
--

INSERT INTO `cmum_opc_rev` (`id`, `nome_opc`) VALUES
(1, 'Pode alterar login'),
(2, 'Pode alterar senha'),
(3, 'Pode alterar nome'),
(4, 'Pode alterar email'),
(5, 'Pode alterar vencimento'),
(6, 'Pode alterar status'),
(7, 'Pode adicionar revendas'),
(8, 'Pode excluir revendas'),
(9, 'Pode alterar qtd de logins'),
(10, 'Pode criar planos pre pagos'),
(11, '<i>Revenda pode ter pagina para pedidos de testes</i>');

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

--
-- Estrutura para tabela `cmum_painel_ativacao`
--

CREATE TABLE IF NOT EXISTS `cmum_painel_ativacao` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `chave1` tinytext COLLATE utf8_bin NOT NULL,
  `chave2` tinytext COLLATE utf8_bin NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

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

--
-- Estrutura para tabela `cmum_planos_pre`
--

CREATE TABLE IF NOT EXISTS `cmum_planos_pre` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_revenda` int(11) NOT NULL,
  `desc_plano` text NOT NULL,
  `qtd_login` int(11) NOT NULL,
  `valor_cobrado` decimal(10,2) NOT NULL,
  `data_cad` date NOT NULL,
  `status` tinyint(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

--
-- Fazendo dump de dados para tabela `cmum_planos_pre`
--

INSERT INTO `cmum_planos_pre` (`id`, `id_revenda`, `desc_plano`, `qtd_login`, `valor_cobrado`, `data_cad`, `status`) VALUES
(5, 1, 'revenda 01', 10, 50.00, '2015-06-29', 1),
(6, 1, 'teste', 10, 10.00, '2019-04-11', 1);

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

--
-- Estrutura para tabela `cmum_profiles`
--

CREATE TABLE IF NOT EXISTS `cmum_profiles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` tinytext,
  `value` tinytext,
  `url_ip` varchar(255) NOT NULL,
  `porta` varchar(12) NOT NULL,
  `obs` tinytext NOT NULL,
  `bloqueado` tinyint(2) NOT NULL DEFAULT '0',
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=35 ;

--
-- Fazendo dump de dados para tabela `cmum_profiles`
--

INSERT INTO `cmum_profiles` (`id`, `name`, `value`, `url_ip`, `porta`, `obs`, `bloqueado`) VALUES
(33, 'SKY', 'ceu', 'csgp.ddns.me', '31005', '', 0),
(34, 'CLARO', 'clarotv', 'csgp.ddns.me', '32005', '', 0);

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

--
-- Estrutura para tabela `cmum_ps_notificao`
--

CREATE TABLE IF NOT EXISTS `cmum_ps_notificao` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_login` int(11) NOT NULL,
  `id_revenda` int(11) NOT NULL,
  `nome_produto` varchar(255) COLLATE utf8_bin NOT NULL,
  `valor_un` decimal(10,2) NOT NULL,
  `quantidade` int(5) NOT NULL,
  `status` int(5) NOT NULL,
  `metodo_pag` int(5) NOT NULL,
  `codigo_pag` int(5) NOT NULL,
  `codigo_noticacao` varchar(255) COLLATE utf8_bin NOT NULL,
  `data_cad` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `data_atual` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `url_notificacao` tinytext COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;

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

--
-- Estrutura stand-in para view `cmum_saldo_bloq_pre_log`
--
CREATE TABLE IF NOT EXISTS `cmum_saldo_bloq_pre_log` (
`id_revenda` int(11)
,`qtd_logins` decimal(32,0)
);
-- --------------------------------------------------------

--
-- Estrutura stand-in para view `cmum_saldo_bloq_pre_rev`
--
CREATE TABLE IF NOT EXISTS `cmum_saldo_bloq_pre_rev` (
`id_pai` int(11)
,`qtd_logins` decimal(32,0)
);
-- --------------------------------------------------------

--
-- Estrutura para tabela `cmum_settings`
--

CREATE TABLE IF NOT EXISTS `cmum_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cmumversion` tinytext,
  `dbversion` tinytext,
  `sessiontimeout` tinytext,
  `hidehelp` int(11) DEFAULT NULL,
  `def_ipmask` tinytext,
  `def_profiles` text,
  `def_maxconnections` tinytext,
  `def_admin` tinytext,
  `def_enabled` tinytext,
  `def_mapexclude` tinytext,
  `def_debug` tinytext,
  `def_customvalues` text,
  `def_ecmrate` tinytext,
  `cleanlogin` int(11) DEFAULT NULL,
  `logfailedlogins` int(11) DEFAULT NULL,
  `servername` tinytext,
  `autoloaddef` int(11) DEFAULT NULL,
  `fetchfromcsp` int(11) DEFAULT NULL,
  `cspsrv_ip` tinytext,
  `cspsrv_port` tinytext,
  `cspsrv_user` tinytext,
  `cspsrv_pass` tinytext,
  `cspsrv_protocol` tinytext,
  `cspconnchk` int(11) DEFAULT NULL,
  `osdlink` tinytext,
  `extracolumn` tinytext,
  `rndpasschr` text,
  `rndpasschrlength` int(11) DEFAULT NULL,
  `orderbyfield` tinytext,
  `orderbyorder` tinytext,
  `genxmlkey` tinytext,
  `ips_perm_acesso_key` tinytext NOT NULL,
  `ips_bloq` text NOT NULL,
  `ips_perm` text NOT NULL,
  `mult_perf` tinyint(2) NOT NULL,
  `id_modelo_padrao` int(11) NOT NULL,
  `tempo_login_teste` varchar(5) NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

--
-- Fazendo dump de dados para tabela `cmum_settings`
--

INSERT INTO `cmum_settings` (`id`, `cmumversion`, `dbversion`, `sessiontimeout`, `hidehelp`, `def_ipmask`, `def_profiles`, `def_maxconnections`, `def_admin`, `def_enabled`, `def_mapexclude`, `def_debug`, `def_customvalues`, `def_ecmrate`, `cleanlogin`, `logfailedlogins`, `servername`, `autoloaddef`, `fetchfromcsp`, `cspsrv_ip`, `cspsrv_port`, `cspsrv_user`, `cspsrv_pass`, `cspsrv_protocol`, `cspconnchk`, `osdlink`, `extracolumn`, `rndpasschr`, `rndpasschrlength`, `orderbyfield`, `orderbyorder`, `genxmlkey`, `ips_perm_acesso_key`, `ips_bloq`, `ips_perm`, `mult_perf`, `id_modelo_padrao`, `tempo_login_teste`) VALUES
(1, '2.3.1', '2.3.1', '2000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2000, 'csp_linux', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, '', NULL, NULL, '', '', 'painel', '137.74.41.65', '192.168.1.2', '137.74.41.65', 1, 1, '24');

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

--
-- Estrutura para tabela `cmum_teste_cs`
--

CREATE TABLE IF NOT EXISTS `cmum_teste_cs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(50) NOT NULL,
  `addedby` int(11) NOT NULL,
  `data_cad` datetime NOT NULL,
  `ip` varchar(50) NOT NULL,
  `url_ref` tinytext NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

--
-- Fazendo dump de dados para tabela `cmum_teste_cs`
--

INSERT INTO `cmum_teste_cs` (`id`, `email`, `addedby`, `data_cad`, `ip`, `url_ref`) VALUES
(1, 'alian.pitta@ig.com.br', 1, '2015-07-19 00:00:00', '187.13.137.115', 'http://deltasystem.noip.us/linhas/formulario_testes.php?r=Mlp2V3R3UkQ0U0x1QjB4Zi9OemZ5NDRySjN4ZEVXVlcvYVgrcHI2alV2WT0'),
(2, 'testex3@hotmail.com', 1, '2015-07-20 00:00:00', '186.214.240.31', 'http://deltasystem.noip.us/linhas/formulario_testes.php?r=Mlp2V3R3UkQ0U0x1QjB4Zi9OemZ5NDRySjN4ZEVXVlcvYVgrcHI2alV2WT0,');

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

--
-- Estrutura stand-in para view `cmum_total_geral_por_perfil`
--
CREATE TABLE IF NOT EXISTS `cmum_total_geral_por_perfil` (
`id` int(11)
,`name` tinytext
,`total` bigint(21)
);
-- --------------------------------------------------------

--
-- Estrutura stand-in para view `cmum_total_logins_ativos`
--
CREATE TABLE IF NOT EXISTS `cmum_total_logins_ativos` (
`id` int(11)
,`username` text
,`revenda_pai` int(11)
,`valor_cob_login` decimal(10,2)
,`total_ativos` bigint(21)
,`total_por_con` double
);
-- --------------------------------------------------------

--
-- Estrutura para tabela `cmum_transacao_arquivo`
--

CREATE TABLE IF NOT EXISTS `cmum_transacao_arquivo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_login` int(11) NOT NULL,
  `id_transacao` int(11) NOT NULL,
  `nome_arquivo_salvo` varchar(255) NOT NULL,
  `nome_arquivo_orig` varchar(255) NOT NULL,
  `caminho_completo_arquivo` tinytext NOT NULL,
  `is_image` tinyint(4) NOT NULL,
  `extensao` varchar(5) NOT NULL,
  `data_cad` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

--
-- Fazendo dump de dados para tabela `cmum_transacao_arquivo`
--

INSERT INTO `cmum_transacao_arquivo` (`id`, `id_login`, `id_transacao`, `nome_arquivo_salvo`, `nome_arquivo_orig`, `caminho_completo_arquivo`, `is_image`, `extensao`, `data_cad`) VALUES
(1, 301, 6, 'e7648d83278cb950409fe187a0f1acdd.png', 'Sem_título.png', '/var/www/linhas/uploads/e7648d83278cb950409fe187a0f1acdd.png', 1, '.png', '0000-00-00 00:00:00'),
(2, 299, 9, 'd2fc4de50a40a004b7614415a825c421.png', 'delta-ambulance-logo.png', '/var/www/linhas/uploads/d2fc4de50a40a004b7614415a825c421.png', 1, '.png', '0000-00-00 00:00:00'),
(3, 299, 8, '84cfd045bf5f6fd025750d2f3519a63a.png', 'delta-ambulance-logo.png', '/var/www/linhas/uploads/84cfd045bf5f6fd025750d2f3519a63a.png', 1, '.png', '0000-00-00 00:00:00');

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

--
-- Estrutura para tabela `cmum_transacoes`
--

CREATE TABLE IF NOT EXISTS `cmum_transacoes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `id_revenda` int(11) NOT NULL,
  `tipo` int(11) NOT NULL,
  `valor_un` decimal(10,2) NOT NULL,
  `qtd_meses` int(11) NOT NULL,
  `valor_total` decimal(10,2) NOT NULL,
  `detalhes` tinytext NOT NULL,
  `data_cad` datetime NOT NULL,
  `data_atualizacao` datetime NOT NULL,
  `status` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;

--
-- Fazendo dump de dados para tabela `cmum_transacoes`
--

INSERT INTO `cmum_transacoes` (`id`, `id_user`, `id_revenda`, `tipo`, `valor_un`, `qtd_meses`, `valor_total`, `detalhes`, `data_cad`, `data_atualizacao`, `status`) VALUES
(1, 302, 1, 3, 80.00, 1, 80.00, '<p><strong>Valor un.:</strong> R$ 80.00<br/><strong>Qtd Meses:</strong> 1<br/><strong>Total:</strong> R$ 80.00</p>', '2015-07-19 10:04:42', '0000-00-00 00:00:00', 1),
(2, 302, 1, 3, 80.00, 1, 80.00, '<p><strong>Valor un.:</strong> R$ 80.00<br/><strong>Qtd Meses:</strong> 1<br/><strong>Total:</strong> R$ 80.00</p>', '2015-07-19 10:05:24', '0000-00-00 00:00:00', 1),
(3, 302, 1, 3, 80.00, 1, 80.00, '<p><strong>Valor un.:</strong> R$ 80.00<br/><strong>Qtd Meses:</strong> 1<br/><strong>Total:</strong> R$ 80.00</p>', '2015-07-19 10:15:20', '0000-00-00 00:00:00', 1),
(4, 302, 1, 3, 80.00, 1, 80.00, '<p><strong>Valor un.:</strong> R$ 80.00<br/><strong>Qtd Meses:</strong> 1<br/><strong>Total:</strong> R$ 80.00</p>', '2015-07-19 10:30:39', '0000-00-00 00:00:00', 1),
(5, 302, 1, 1, 80.00, 1, 80.00, '<p><strong>Valor un.:</strong> R$ 80.00<br/><strong>Qtd Meses:</strong> 1<br/><strong>Total:</strong> R$ 80.00</p>', '2015-07-19 10:31:23', '0000-00-00 00:00:00', 1),
(6, 302, 1, 2, 80.00, 1, 80.00, '<p><strong>Valor un.:</strong> R$ 80.00<br/><strong>Qtd Meses:</strong> 1<br/><strong>Total:</strong> R$ 80.00</p>', '2015-07-19 10:32:45', '0000-00-00 00:00:00', 1),
(7, 311, 1, 3, 30.00, 1, 30.00, '<p><strong>Valor un.:</strong> R$ 30.00<br/><strong>Qtd Meses:</strong> 1<br/><strong>Total:</strong> R$ 30.00</p>', '2015-07-20 20:20:41', '0000-00-00 00:00:00', 1),
(8, 311, 1, 3, 30.00, 1, 30.00, '<p><strong>Valor un.:</strong> R$ 30.00<br/><strong>Qtd Meses:</strong> 1<br/><strong>Total:</strong> R$ 30.00</p>', '2015-07-20 20:22:45', '0000-00-00 00:00:00', 1),
(9, 311, 1, 1, 30.00, 1, 30.00, '<p><strong>Valor un.:</strong> R$ 30.00<br/><strong>Qtd Meses:</strong> 1<br/><strong>Total:</strong> R$ 30.00</p><p>***(Aprovado manualmente pela revenda.)</p>', '2015-07-20 20:23:03', '2019-04-11 04:33:17', 3);

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

--
-- Estrutura para tabela `cmum_transacoes_planos`
--

CREATE TABLE IF NOT EXISTS `cmum_transacoes_planos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_revenda` int(11) NOT NULL,
  `id_pai` int(11) NOT NULL,
  `id_plano` int(11) NOT NULL,
  `tipo` tinyint(4) NOT NULL,
  `valor_pagamento` decimal(10,2) NOT NULL,
  `qtd_logins` int(11) NOT NULL,
  `detalhes` tinytext NOT NULL,
  `data_cad` date NOT NULL,
  `data_atualizacao` date NOT NULL,
  `status` tinyint(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

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

--
-- Estrutura para tabela `cmum_udb`
--

CREATE TABLE IF NOT EXISTS `cmum_udb` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` tinytext CHARACTER SET latin1,
  `password` tinytext CHARACTER SET latin1,
  `displayname` tinytext CHARACTER SET latin1,
  `ipmask` tinytext CHARACTER SET latin1,
  `profiles` text CHARACTER SET latin1,
  `maxconnections` tinytext CHARACTER SET latin1,
  `admin` tinytext CHARACTER SET latin1,
  `enabled` tinytext CHARACTER SET latin1,
  `mapexclude` tinytext CHARACTER SET latin1,
  `debug` tinytext CHARACTER SET latin1,
  `comment` text CHARACTER SET latin1,
  `email` text CHARACTER SET latin1,
  `dd` char(2) CHARACTER SET latin1 NOT NULL,
  `telefone` varchar(10) CHARACTER SET latin1 NOT NULL,
  `dd_cel` char(3) CHARACTER SET latin1 NOT NULL,
  `celular` varchar(10) CHARACTER SET latin1 NOT NULL,
  `usrgroup` tinytext CHARACTER SET latin1,
  `customvalues` text CHARACTER SET latin1,
  `ecmrate` tinytext CHARACTER SET latin1,
  `startdate` date DEFAULT NULL,
  `expiredate` datetime DEFAULT NULL,
  `added` tinytext CHARACTER SET latin1,
  `addedby` tinytext CHARACTER SET latin1,
  `addedbyname` tinytext CHARACTER SET latin1 NOT NULL,
  `changed` tinytext CHARACTER SET latin1,
  `changedby` tinytext CHARACTER SET latin1,
  `obs_user` tinytext CHARACTER SET latin1 NOT NULL,
  `valor_cob` decimal(10,2) NOT NULL,
  `id_rev_mudou_status` int(11) NOT NULL,
  `ip_cad` varchar(255) COLLATE utf8_bin NOT NULL,
  `ip_atualizacao` varchar(255) COLLATE utf8_bin NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ;

--
-- Fazendo dump de dados para tabela `cmum_udb`
--

INSERT INTO `cmum_udb` (`id`, `name`, `password`, `displayname`, `ipmask`, `profiles`, `maxconnections`, `admin`, `enabled`, `mapexclude`, `debug`, `comment`, `email`, `dd`, `telefone`, `dd_cel`, `celular`, `usrgroup`, `customvalues`, `ecmrate`, `startdate`, `expiredate`, `added`, `addedby`, `addedbyname`, `changed`, `changedby`, `obs_user`, `valor_cob`, `id_rev_mudou_status`, `ip_cad`, `ip_atualizacao`) VALUES
(1, 'gpcs', '12345', 'teste gp', '', 'a:1:{i:0;s:2:"34";}', '1', 'false', 'true', '', '0', '', '', '', '', '', '', '#01', '', '', '2019-04-11', '2019-04-30 23:59:59', '2019-04-11 13:32', '1', 'Admin', '', '', '', 0.00, 0, '177.23.240.42', '');

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

--
-- Estrutura para tabela `cmum_urls_rev`
--

CREATE TABLE IF NOT EXISTS `cmum_urls_rev` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_rev` int(11) NOT NULL,
  `id_profiles` int(11) NOT NULL,
  `url` varchar(255) COLLATE utf8_bin NOT NULL,
  `portas` varchar(255) COLLATE utf8_bin NOT NULL,
  `data_cad` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ;

--
-- Fazendo dump de dados para tabela `cmum_urls_rev`
--

INSERT INTO `cmum_urls_rev` (`id`, `id_rev`, `id_profiles`, `url`, `portas`, `data_cad`) VALUES
(1, 21, 1, 'joao.com', '123', '0000-00-00');

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

--
-- Estrutura para view `cmum_admins_pais_filhos`
--
DROP TABLE IF EXISTS `cmum_admins_pais_filhos`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_admins_pais_filhos` AS select `f`.`id` AS `id`,`f`.`username` AS `username`,`f`.`enabled` AS `enabled`,`f`.`expiredate` AS `expiredate`,`f`.`hierarquia` AS `hierarquia`,`p`.`id` AS `id_pai`,`p`.`username` AS `pai_login` from (`cmum_admins` `f` left join `cmum_admins` `p` on((`f`.`addedby` = `p`.`id`)));

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

--
-- Estrutura para view `cmum_detalhes_saldo_pre`
--
DROP TABLE IF EXISTS `cmum_detalhes_saldo_pre`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_detalhes_saldo_pre` AS select `a`.`id` AS `id`,`a`.`username` AS `username`,`cpp`.`qtd_atual` AS `qtd_atual`,ifnull(`saldo_bloq_log`.`qtd_logins`,0) AS `qtd_bloq_log`,ifnull(`saldo_bloq_rev`.`qtd_logins`,0) AS `qtd_bloq_rev` from (((`cmum_admins` `a` left join `cmum_cota_pre_paga` `cpp` on((`a`.`id` = `cpp`.`id_revenda`))) left join `cmum_saldo_bloq_pre_log` `saldo_bloq_log` on((`a`.`id` = `saldo_bloq_log`.`id_revenda`))) left join `cmum_saldo_bloq_pre_rev` `saldo_bloq_rev` on((`a`.`id` = `saldo_bloq_rev`.`id_pai`))) where (`a`.`rev_pre` = '1');

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

--
-- Estrutura para view `cmum_logins_ativos_por_rev`
--
DROP TABLE IF EXISTS `cmum_logins_ativos_por_rev`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_logins_ativos_por_rev` AS select `u`.`id` AS `id`,`u`.`name` AS `name`,`u`.`enabled` AS `enabled`,`u`.`maxconnections` AS `maxconnections`,`u`.`expiredate` AS `expiredate`,`u`.`profiles` AS `profiles`,replace(substring_index(substring_index(`u`.`profiles`,':',-(1)),';',1),'"','') AS `id_profile`,`a`.`id` AS `id_rev`,`a`.`username` AS `username` from (`cmum_udb` `u` left join `cmum_admins` `a` on((`u`.`addedby` = `a`.`id`))) where ((`u`.`enabled` = 'true') and (`u`.`expiredate` >= now()) and ((to_days(`u`.`expiredate`) - to_days(`u`.`added`)) > 2) and (`a`.`rev_pre` = '0'));

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

--
-- Estrutura para view `cmum_logins_com_perfis_limpos`
--
DROP TABLE IF EXISTS `cmum_logins_com_perfis_limpos`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_logins_com_perfis_limpos` AS select `cmum_udb`.`id` AS `id`,`cmum_udb`.`name` AS `name`,`cmum_udb`.`profiles` AS `profiles`,replace(substring_index(substring_index(`cmum_udb`.`profiles`,':',-(1)),';',1),'"','') AS `perfil_lp`,`cmum_udb`.`enabled` AS `enabled`,`cmum_udb`.`expiredate` AS `expiredate`,`cmum_udb`.`addedby` AS `addedby` from `cmum_udb`;

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

--
-- Estrutura para view `cmum_logins_desativados_por_rev`
--
DROP TABLE IF EXISTS `cmum_logins_desativados_por_rev`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_logins_desativados_por_rev` AS select `u`.`id` AS `id`,`u`.`name` AS `name`,`u`.`enabled` AS `enabled`,`u`.`maxconnections` AS `maxconnections`,`u`.`expiredate` AS `expiredate`,`u`.`profiles` AS `profiles`,replace(substring_index(substring_index(`u`.`profiles`,':',-(1)),';',1),'"','') AS `id_profile`,`a`.`id` AS `id_rev`,`a`.`username` AS `username` from (`cmum_udb` `u` left join `cmum_admins` `a` on((`u`.`addedby` = `a`.`id`))) where ((`u`.`enabled` = 'false') and (`a`.`rev_pre` = '0'));

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

--
-- Estrutura para view `cmum_logins_testes_por_rev`
--
DROP TABLE IF EXISTS `cmum_logins_testes_por_rev`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_logins_testes_por_rev` AS select `u`.`id` AS `id`,`u`.`name` AS `name`,`u`.`enabled` AS `enabled`,`u`.`maxconnections` AS `maxconnections`,`u`.`expiredate` AS `expiredate`,`u`.`profiles` AS `profiles`,replace(substring_index(substring_index(`u`.`profiles`,':',-(1)),';',1),'"','') AS `id_profile`,`a`.`id` AS `id_rev`,`a`.`username` AS `username` from (`cmum_udb` `u` left join `cmum_admins` `a` on((`u`.`addedby` = `a`.`id`))) where ((`u`.`enabled` = 'true') and (`u`.`expiredate` >= now()) and ((to_days(`u`.`expiredate`) - to_days(`u`.`added`)) <= 2));

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

--
-- Estrutura para view `cmum_logins_vencidos_por_rev`
--
DROP TABLE IF EXISTS `cmum_logins_vencidos_por_rev`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_logins_vencidos_por_rev` AS select `u`.`id` AS `id`,`u`.`name` AS `name`,`u`.`enabled` AS `enabled`,`u`.`maxconnections` AS `maxconnections`,`u`.`expiredate` AS `expiredate`,`u`.`profiles` AS `profiles`,replace(substring_index(substring_index(`u`.`profiles`,':',-(1)),';',1),'"','') AS `id_profile`,`a`.`id` AS `id_rev`,`a`.`username` AS `username` from (`cmum_udb` `u` left join `cmum_admins` `a` on((`u`.`addedby` = `a`.`id`))) where ((`u`.`enabled` = 'true') and (`u`.`expiredate` <= now()) and (`a`.`rev_pre` = '0'));

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

--
-- Estrutura para view `cmum_saldo_bloq_pre_log`
--
DROP TABLE IF EXISTS `cmum_saldo_bloq_pre_log`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_saldo_bloq_pre_log` AS select `cmum_transacoes`.`id_revenda` AS `id_revenda`,sum(`cmum_transacoes`.`qtd_meses`) AS `qtd_logins` from `cmum_transacoes` where (`cmum_transacoes`.`status` in (1,2)) group by `cmum_transacoes`.`id_revenda`;

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

--
-- Estrutura para view `cmum_saldo_bloq_pre_rev`
--
DROP TABLE IF EXISTS `cmum_saldo_bloq_pre_rev`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_saldo_bloq_pre_rev` AS select `cmum_transacoes_planos`.`id_pai` AS `id_pai`,sum(`cmum_transacoes_planos`.`qtd_logins`) AS `qtd_logins` from `cmum_transacoes_planos` where (`cmum_transacoes_planos`.`status` in (1,2)) group by `cmum_transacoes_planos`.`id_pai`;

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

--
-- Estrutura para view `cmum_total_geral_por_perfil`
--
DROP TABLE IF EXISTS `cmum_total_geral_por_perfil`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_total_geral_por_perfil` AS select `p`.`id` AS `id`,`p`.`name` AS `name`,count(`vw1`.`perfil_lp`) AS `total` from (`cmum_profiles` `p` join `cmum_logins_com_perfis_limpos` `vw1` on((`p`.`id` = `vw1`.`perfil_lp`))) where ((`vw1`.`enabled` = 'true') and (`vw1`.`expiredate` > now())) group by `p`.`name`;

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

--
-- Estrutura para view `cmum_total_logins_ativos`
--
DROP TABLE IF EXISTS `cmum_total_logins_ativos`;

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `cmum_total_logins_ativos` AS select `a`.`id` AS `id`,`a`.`username` AS `username`,`a`.`addedby` AS `revenda_pai`,`a`.`valor_cob_login` AS `valor_cob_login`,(select count(`vw1`.`name`) from `cmum_logins_ativos_por_rev` `vw1` where (`vw1`.`id_rev` = `a`.`id`)) AS `total_ativos`,ifnull((select sum(`vw1`.`maxconnections`) from `cmum_logins_ativos_por_rev` `vw1` where (`vw1`.`id_rev` = `a`.`id`)),0) AS `total_por_con` from `cmum_admins` `a`;

/*!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 */;
