· 9 years ago · Aug 31, 2016, 03:36 AM
1<?php
2
3/**
4 * HTMLs configuration pages
5 * @author Bruno Ribeiro <bruno.espertinho@gmail.com>
6 * @version 1.1
7 * @access public
8 * @package Config
9 * @todo Improve the customization of the configuration file
10 * */
11class SetupConfigHTML {
12
13 /**
14 * file config required for start the website
15 * Note: at the time of verification and creating the configuration file, is always
16 * in the root folder, then the file is in a folder specify as follows: "config/config.inc.php"
17 * @var string
18 */
19 public $file = 'application/config/config.php';
20
21 /**
22 * Name your project
23 * @var str
24 */
25 var $name = 'Sistema Financeiro para salão de beleza';
26
27 /**
28 * Name SQL file
29 * @var String
30 */
31 var $sql = '/Salao.sql';
32
33 /**
34 * link your project
35 * @var str
36 */
37 var $link = 'http://example.com';
38
39 /**
40 * logo your project
41 * @var str
42 */
43 var $logo = 'images/w-logo-blue.png';
44
45 /**
46 * Rules for replacement
47 * @var array
48 */
49 var $Rules = array("<" => "<", ">" => ">", """ => '"', "'" => "'", "&" => "&");
50
51 /**
52 * Metthod Magic
53 * Require language file
54 */
55 public function __construct() {
56 include('Language/pt-br.php');
57 if (!defined('LOGO')) {
58 die('error');
59 }
60 }
61
62 protected function makehtaccess($POST) {
63 $RewriteBase = parse_url($POST['url'], PHP_URL_PATH);
64 return <<<EOF
65# Necessary to prevent problems when using a controller named "index" and having a root index.php
66# more here: http://stackoverflow.com/q/20918746/1114320
67Options -MultiViews
68
69# turn rewriting on
70RewriteEngine On
71
72# When using the script within a sub-folder, put this path here, like /mysubfolder/
73# If your app is in the root of your web folder, then please delete this line or comment it out
74RewriteBase {$RewriteBase}
75
76RewriteCond %{REQUEST_FILENAME} !-d
77RewriteCond %{REQUEST_FILENAME} !-f
78RewriteCond %{REQUEST_FILENAME} !-l
79
80RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
81EOF;
82 }
83
84 protected function MakeSQLFile($POST) {
85 $name = $POST['name'];
86 $now = date("Y-m-d H:i:s", time());
87 $pass = password_hash($_POST['passSystem'], PASSWORD_DEFAULT, array('cost' => "10"));
88 return <<<EOF
89CREATE TABLE IF NOT EXISTS `agenda` (
90 `id` int(11) NOT NULL AUTO_INCREMENT,
91 `id_user` int(11) NOT NULL,
92 `id_cliente` int(11) DEFAULT NULL,
93 `titulo` varchar(250) DEFAULT NULL,
94 `description` mediumtext,
95 `horario` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
96 `horario_end` datetime DEFAULT NULL COMMENT 'TermÃnio',
97 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
98 PRIMARY KEY (`id`)
99) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
100
101-- --------------------------------------------------------
102
103--
104-- Table structure for table `ChangeLog`
105--
106
107CREATE TABLE IF NOT EXISTS `ChangeLog` (
108 `id` int(11) NOT NULL AUTO_INCREMENT,
109 `id_version` int(11) NOT NULL,
110 `id_bug` int(11) DEFAULT NULL,
111 `title` varchar(250) DEFAULT NULL,
112 `descri` varchar(250) DEFAULT NULL,
113 `data_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'no show',
114 PRIMARY KEY (`id`)
115) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=127 ;
116
117--
118-- Dumping data for table `ChangeLog`
119--
120
121INSERT INTO `ChangeLog` (`id`, `id_version`, `id_bug`, `title`, `descri`, `data_created`) VALUES
122(1, 1, NULL, 'added: Comissão de Usuário', NULL, '2014-10-03 01:21:35'),
123(2, 2, NULL, 'added: Filtros para pesquisa', NULL, '2014-10-03 01:22:35'),
124(3, 2, NULL, 'added: Lembretes', NULL, '2014-10-03 01:22:35'),
125(4, 3, NULL, 'fix: API correios', NULL, '2014-10-03 01:24:11'),
126(5, 3, NULL, 'update: Filtros avançados', NULL, '2014-10-03 01:24:11'),
127(6, 3, NULL, 'update: 3 novos Gráficos', NULL, '2014-10-03 01:24:11'),
128(7, 3, NULL, 'added: Chat Global', NULL, '2014-10-03 01:24:11'),
129(8, 3, NULL, 'added: Controle de Serviço', NULL, '2014-10-03 01:24:11'),
130(9, 3, NULL, 'added: Controle de Estoque', NULL, '2014-10-03 01:24:41'),
131(10, 3, NULL, 'added: Comissão de Usuário', NULL, '2014-10-03 01:24:41'),
132(11, 4, NULL, 'fix: Query Security', NULL, '2014-10-03 01:25:12'),
133(12, 4, NULL, 'update: Query Mysqli', NULL, '2014-10-03 01:25:12'),
134(13, 5, NULL, 'added: Aniversário', NULL, '2014-10-03 01:25:50'),
135(14, 5, NULL, 'added: Checkout', NULL, '2014-10-03 01:25:50'),
136(15, 5, NULL, 'added: Carrinho de Compras', NULL, '2014-10-03 01:25:50'),
137(16, 6, NULL, 'fix: Checkout', NULL, '2014-10-03 01:27:39'),
138(17, 6, NULL, 'fix: Vendas', NULL, '2014-10-03 01:27:39'),
139(18, 6, NULL, 'update: Aniversário', NULL, '2014-10-03 01:27:39'),
140(19, 6, NULL, 'update: Alt Clientes', NULL, '2014-10-03 01:27:39'),
141(20, 6, NULL, 'update: Add Clientes', NULL, '2014-10-03 01:27:39'),
142(21, 6, NULL, 'update: Query Clientes', NULL, '2014-10-03 01:27:39'),
143(22, 6, NULL, 'update: Query Contas', NULL, '2014-10-03 01:27:39'),
144(23, 6, NULL, 'added: Query Recibos Itens', NULL, '2014-10-03 01:27:39'),
145(24, 6, NULL, 'added: Query Recibos', NULL, '2014-10-03 01:27:39'),
146(25, 6, NULL, 'added: Tool Recibos', NULL, '2014-10-03 01:27:39'),
147(41, 7, NULL, 'fix: Login', NULL, '2014-10-03 01:30:00'),
148(42, 7, NULL, 'fix: Menu', NULL, '2014-10-03 01:30:00'),
149(43, 7, NULL, 'fix: Principal', NULL, '2014-10-03 01:30:00'),
150(44, 7, NULL, 'fix: Relatório Financeiro', NULL, '2014-10-03 01:30:00'),
151(46, 8, NULL, 'fix: Detalhes Funcionário', NULL, '2014-10-03 01:31:14'),
152(47, 8, NULL, 'fix: Recibos', NULL, '2014-10-03 01:31:14'),
153(48, 8, NULL, 'fix: Finanças Produtos', NULL, '2014-10-03 01:31:29'),
154(49, 8, NULL, 'fix: Relatório Financeiro', NULL, '2014-10-03 01:31:29'),
155(50, 9, NULL, 'update: Layout Responsivo', NULL, '2014-10-03 01:53:57'),
156(51, 9, NULL, 'added: Agendamento de Clientes', NULL, '2014-10-03 01:53:57'),
157(52, 9, NULL, 'added: Calendário', NULL, '2014-10-03 01:53:57'),
158(54, 9, NULL, 'added: Largura de Banda', NULL, '2014-10-03 01:53:57'),
159(55, 9, NULL, 'fix: Comissões', NULL, '2014-10-03 01:53:57'),
160(56, 9, NULL, 'added: Permissões de cargos', NULL, '2014-10-03 01:53:57'),
161(57, 9, NULL, 'added: Suspender', NULL, '2014-10-03 01:53:57'),
162(58, 9, NULL, 'fix: Lembretes', NULL, '2014-10-03 01:53:57'),
163(59, 9, NULL, 'update: database structure', NULL, '2014-10-03 01:53:57'),
164(60, 9, NULL, 'added: Instalação Fácil', NULL, '2014-10-03 01:53:57'),
165(61, 9, NULL, 'added: Gravatar system', NULL, '2014-10-03 01:53:57'),
166(62, 9, NULL, 'added: Configurações Globais', NULL, '2014-10-03 01:53:57'),
167(64, 9, NULL, 'fix: Notas', NULL, '2014-10-04 06:00:00'),
168(65, 9, NULL, 'added: Notificações', NULL, '2014-10-04 06:00:00'),
169(67, 10, NULL, 'Versão Inicial', NULL, '2014-10-03 01:27:39'),
170(68, 9, NULL, 'added: Configurações Menu', NULL, '2014-10-07 22:27:19'),
171(69, 9, NULL, 'added: Configurações Acesso', NULL, '2014-10-07 22:27:35'),
172(70, 9, NULL, 'update: Global Chat', NULL, '2014-10-07 22:30:05'),
173(71, 9, NULL, 'update: Usuários', NULL, '2014-10-07 22:30:46'),
174(72, 9, NULL, 'update: Changerlog', NULL, '2014-10-07 22:31:52'),
175(73, 9, NULL, 'update: Gráficos', NULL, '2014-10-07 22:32:53'),
176(74, 11, NULL, 'fix: Recibos', NULL, '2014-11-10 05:46:07'),
177(75, 11, NULL, 'update: Acessos', NULL, '2014-11-10 05:46:34'),
178(76, 11, NULL, 'fix: Menu', NULL, '2014-11-10 05:47:00'),
179(77, 11, NULL, 'fix: Principal', NULL, '2014-11-10 08:04:22'),
180(78, 11, NULL, 'fix: Auto Instalador', NULL, '2014-11-10 08:29:53'),
181(79, 12, NULL, 'added: Custos Fixos', NULL, '2014-11-24 00:06:21'),
182(80, 12, NULL, 'added: Módulo Relatórios', NULL, '2014-11-24 00:06:50'),
183(81, 12, NULL, 'fix: Adicionar Cliente', NULL, '2014-11-24 00:07:18'),
184(82, 12, NULL, 'update: Movimentar Serviços', NULL, '2014-11-24 00:07:53'),
185(83, 12, NULL, 'update: Movimentar Produtos', NULL, '2014-11-24 00:08:03'),
186(84, 12, NULL, 'update: Configuração Globais', NULL, '2014-11-24 00:08:43'),
187(85, 12, NULL, 'update: Auto Instalador', NULL, '2014-11-24 00:09:37'),
188(86, 12, NULL, 'update: Recibos', NULL, '2014-11-24 00:10:16'),
189(88, 12, NULL, 'update: composer.json', NULL, '2014-11-24 04:52:25'),
190(89, 12, NULL, 'fix: Ferramentas Access', NULL, '2014-11-24 04:53:40'),
191(90, 12, NULL, 'fix: Notificações', NULL, '2014-11-24 04:55:21'),
192(91, 12, NULL, 'fix: Mensagens', NULL, '2014-11-24 04:55:29'),
193(92, 12, NULL, 'update: Gráficos Finanças', NULL, '2014-11-24 05:33:49'),
194(93, 12, NULL, 'added: Fluxo de Caixa', NULL, '2014-11-27 01:01:52'),
195(94, 12, NULL, 'added: Fontes', NULL, '2014-11-27 01:04:06'),
196(95, 12, NULL, 'fix: Recibos', NULL, '2014-12-04 00:44:56'),
197(96, 12, NULL, 'fix: Checkout', NULL, '2014-12-10 20:24:38'),
198(97, 12, NULL, 'added: Galeria', NULL, '2014-12-13 23:26:36'),
199(98, 12, NULL, 'fix: Global', NULL, '2014-12-14 05:35:38'),
200(99, 12, NULL, 'fix: Estoque', NULL, '2014-12-18 23:48:15'),
201(100, 12, NULL, 'fix: Funcionários', NULL, '2014-12-18 23:50:48'),
202(101, 12, NULL, 'fix: Serviços', NULL, '2014-12-18 23:53:08'),
203(102, 12, NULL, 'fix: Usuários', NULL, '2014-12-18 23:56:24'),
204(103, 12, NULL, 'fix: Notificações Barra', NULL, '2014-12-19 00:09:48'),
205(104, 12, NULL, 'added: Configuração Autenticação', NULL, '2014-12-19 00:10:17'),
206(105, 13, NULL, 'update: Tarefas Ajax application', NULL, '2015-07-24 08:22:01'),
207(106, 13, NULL, 'fix: Print Recibos', NULL, '2015-07-24 08:22:19'),
208(107, 13, NULL, 'fix: Menu', NULL, '2015-07-24 08:22:37'),
209(108, 13, NULL, 'fix: Autenticação', NULL, '2015-07-24 20:40:13'),
210(109, 13, NULL, 'fix: Acessos', NULL, '2015-07-24 20:40:27'),
211(110, 13, NULL, 'fix: Globais', NULL, '2015-07-24 20:40:38'),
212(111, 13, NULL, 'fix: Produtos', NULL, '0000-00-00 00:00:00'),
213(112, 13, NULL, 'fix: Serviços', NULL, '0000-00-00 00:00:00'),
214(113, 14, NULL, 'fix: Comissões', NULL, '2015-10-25 23:45:32'),
215(114, 14, NULL, 'fix: Filtro Fluxo de Caixa', NULL, '2014-11-27 01:01:52'),
216(115, 14, NULL, 'fix: Impressão Google Chrome', NULL, '2014-12-14 05:35:38'),
217(116, 15, NULL, 'added: URL redirect', NULL, '2015-10-25 23:48:39'),
218(117, 15, NULL, 'added: Envio Notificações', NULL, '2015-10-25 23:48:57'),
219(118, 15, NULL, 'fix: Recibos', NULL, '2015-10-25 23:50:38'),
220(119, 15, NULL, 'update: Bash', NULL, '2015-10-25 23:53:01'),
221(120, 16, NULL, 'update: acessos', NULL, '2014-10-03 01:21:35'),
222(121, 16, NULL, 'added: assoc empregados', NULL, '2014-10-03 01:21:35'),
223(122, 16, NULL, 'added: assoc clientes', NULL, '2014-10-03 01:21:35'),
224(123, 16, NULL, 'fix: fornecedores', NULL, '2014-10-03 01:21:35'),
225(124, 16, NULL, 'added: assoc fornecedor', NULL, '2014-10-03 01:21:35'),
226(125, 16, NULL, 'update: auto instalador', NULL, '2014-10-03 01:21:35'),
227(126, 16, NULL, 'added: 2 cargos : "Cliente" e "Fornecedor"', NULL, '2014-10-03 01:21:35');
228
229-- --------------------------------------------------------
230
231--
232-- Table structure for table `ChangeLog_Version`
233--
234
235CREATE TABLE IF NOT EXISTS `ChangeLog_Version` (
236 `id` int(11) NOT NULL AUTO_INCREMENT,
237 `version` varchar(10) NOT NULL,
238 `subtitle` varchar(250) DEFAULT NULL,
239 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
240 PRIMARY KEY (`id`)
241) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ;
242
243--
244-- Dumping data for table `ChangeLog_Version`
245--
246
247INSERT INTO `ChangeLog_Version` (`id`, `version`, `subtitle`, `data`) VALUES
248(1, '1.1', 'Beta', '2013-04-26 22:06:21'),
249(2, '2.1', NULL, '2013-05-26 22:06:41'),
250(3, '3.0', 'Release', '2013-05-28 22:07:06'),
251(4, '3.1', NULL, '2014-03-21 22:07:16'),
252(5, '3.2', 'Beta', '2014-03-28 22:07:20'),
253(6, '3.3', 'Beta', '2014-04-16 22:07:24'),
254(7, '3.4', NULL, '2014-08-01 22:07:24'),
255(8, '3.5', NULL, '2014-09-18 22:07:24'),
256(9, '4.0', 'Release', '2014-10-02 22:07:36'),
257(10, '1.0', NULL, '2013-01-03 22:06:21'),
258(11, '4.1', NULL, '2014-11-10 02:45:24'),
259(12, '4.2', 'Release', '2014-11-23 21:05:50'),
260(13, '4.2.1', NULL, '2015-07-24 05:21:36'),
261(14, '4.2.2', NULL, '2015-10-23 05:21:36'),
262(15, '4.2.3', NULL, '2015-10-25 23:45:09'),
263(16, '4.2.4', NULL, '2015-11-04 20:20:59');
264
265-- --------------------------------------------------------
266
267--
268-- Table structure for table `clientes`
269--
270
271CREATE TABLE IF NOT EXISTS `clientes` (
272 `id` int(11) NOT NULL AUTO_INCREMENT,
273 `id_user` int(11) DEFAULT NULL,
274 `assoc` int(11) DEFAULT NULL,
275 `nome` varchar(100) NOT NULL,
276 `agenda` varchar(15) DEFAULT NULL,
277 `agenda_cor` varchar(10) NOT NULL DEFAULT '#000000',
278 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
279 `End` varchar(100) DEFAULT NULL,
280 `Num` varchar(5) DEFAULT NULL,
281 `Bairro` varchar(50) DEFAULT NULL,
282 `Cidade` varchar(50) DEFAULT NULL,
283 `UF` varchar(2) DEFAULT NULL,
284 `Cep` varchar(9) DEFAULT NULL,
285 `Fone` varchar(255) DEFAULT NULL,
286 `Email` varchar(50) DEFAULT NULL,
287 `Rg` varchar(22) DEFAULT NULL,
288 `Cpf` varchar(14) DEFAULT NULL,
289 `Aniversario` timestamp NULL DEFAULT NULL,
290 `Sexo` enum('F','M','T') NOT NULL,
291 `Indicacao` varchar(100) DEFAULT NULL,
292 `Obs` varchar(50) DEFAULT NULL,
293 PRIMARY KEY (`id`),
294 UNIQUE KEY `Nm` (`nome`)
295) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
296
297-- --------------------------------------------------------
298
299--
300-- Table structure for table `Configure`
301--
302
303CREATE TABLE IF NOT EXISTS `Configure` (
304 `id` int(11) NOT NULL AUTO_INCREMENT,
305 `DEBUG` tinyint(1) NOT NULL DEFAULT '0',
306 `url` varchar(250) NOT NULL,
307 `LOGO` varchar(250) NOT NULL,
308 `FAVOICON` varchar(250) NOT NULL,
309 `INTERFACE` varchar(250) NOT NULL DEFAULT 'eth0',
310 `NAME` varchar(100) NOT NULL,
311 `COOKIE_RUNTIME` int(11) NOT NULL,
312 `COOKIE_DOMAIN` varchar(50) NOT NULL DEFAULT 'localhost',
313 `ACCOUNT_TYPE_FOR_SALLER` int(11) NOT NULL,
314 `DAY_CLOSE_COMISSION` int(11) DEFAULT NULL,
315 `STATUS_DAY_CLOSE` tinyint(1) NOT NULL,
316 PRIMARY KEY (`id`)
317) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
318
319--
320-- Dumping data for table `Configure`
321--
322
323INSERT INTO `Configure` (`id`, `DEBUG`, `url`, `LOGO`, `FAVOICON`, `INTERFACE`, `NAME`, `COOKIE_RUNTIME`, `COOKIE_DOMAIN`, `ACCOUNT_TYPE_FOR_SALLER`, `DAY_CLOSE_COMISSION`, `STATUS_DAY_CLOSE`) VALUES
324(1, 0, '{$POST['url']}', 'logo.png', 'favicon.ico', 'eth1', '{$POST['name']}', 1209600, '{$POST['coockie_domain']}', 1, 10, 1);
325
326-- --------------------------------------------------------
327
328--
329-- Table structure for table `ConfigureFonts`
330--
331
332CREATE TABLE IF NOT EXISTS `ConfigureFonts` (
333 `Id` int(11) NOT NULL AUTO_INCREMENT,
334 `titulo` varchar(150) NOT NULL,
335 `banco` enum('Banco Do Brasil','Bradesco','Caixa','Itau','Santander') NOT NULL,
336 `agencia` int(4) NOT NULL,
337 `conta` int(8) NOT NULL,
338 `Convenio` int(11) DEFAULT NULL,
339 `carteira` varchar(20) DEFAULT NULL,
340 `codigoCliente` int(5) DEFAULT NULL,
341 `numeroDocumento` int(7) DEFAULT NULL,
342 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
343 PRIMARY KEY (`Id`)
344) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
345
346-- --------------------------------------------------------
347
348--
349-- Table structure for table `ConfigureInfos`
350--
351
352CREATE TABLE IF NOT EXISTS `ConfigureInfos` (
353 `id` int(11) NOT NULL AUTO_INCREMENT,
354 `logo` varchar(250) DEFAULT NULL,
355 `email` varchar(50) DEFAULT NULL,
356 `Fone` varchar(50) DEFAULT NULL,
357 `End` varchar(100) DEFAULT NULL,
358 `Num` varchar(5) DEFAULT NULL,
359 `Bairro` varchar(50) DEFAULT NULL,
360 `Cidade` varchar(50) DEFAULT NULL,
361 `UF` varchar(2) DEFAULT NULL,
362 `Cep` varchar(9) DEFAULT NULL,
363 `CNPJ` varchar(50) DEFAULT NULL,
364 PRIMARY KEY (`id`)
365) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
366
367--
368-- Dumping data for table `ConfigureInfos`
369--
370
371INSERT INTO `ConfigureInfos` (`id`, `logo`, `email`, `Fone`, `End`, `Num`, `Bairro`, `Cidade`, `UF`, `Cep`, `CNPJ`) VALUES
372(1, 'bucket-logo.png', 'bruno.espertinho@gmail.com', '(82) 3651-2816', 'Rua Doutor Abelardo de Barros', '200', 'Tijuca', 'Rio de Janeiro', 'RJ', '20521030', '48.274.445/7437-55');
373
374-- --------------------------------------------------------
375
376--
377-- Table structure for table `ConfigureMail`
378--
379
380CREATE TABLE IF NOT EXISTS `ConfigureMail` (
381 `id` int(11) NOT NULL AUTO_INCREMENT,
382 `AUTH` tinyint(1) NOT NULL DEFAULT '0',
383 `SMTP` varchar(20) DEFAULT NULL,
384 `SMTP_SECURE` enum('tls','ssl') DEFAULT NULL,
385 `USER` varchar(50) DEFAULT NULL,
386 `PASS` varchar(20) DEFAULT NULL,
387 `PORT` int(4) NOT NULL DEFAULT '587',
388 `CC` varchar(50) DEFAULT NULL,
389 `BCC` varchar(50) DEFAULT NULL,
390 `HTML` tinyint(1) NOT NULL DEFAULT '1',
391 `BUTTON_SIGNATURE` mediumtext,
392 `TOP_SIGNATURE` longtext,
393 PRIMARY KEY (`id`)
394) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
395
396--
397-- Dumping data for table `ConfigureMail`
398--
399
400INSERT INTO `ConfigureMail` (`id`, `AUTH`, `SMTP`, `SMTP_SECURE`, `USER`, `PASS`, `PORT`, `CC`, `BCC`, `HTML`, `BUTTON_SIGNATURE`, `TOP_SIGNATURE`) VALUES
401(1, 0, NULL, 'tls', NULL, NULL, 587, '', '', 1, 'Senado Federal - Praça dos Três Poderes - BrasÃlia DF - CEP 70165-900 - Fone: (61)6666-6666', '<img src="https://ci5.googleusercontent.com/proxy/eHfqKidrRMZJ7DHhentABTu1RKQSLxMrt7HAzR_UArgre9dbqSYUK08W6ZLe0VI4bF8H0OdFe8ihLsZMgtaxSRDbcCFhaw6s4rbfyY_AhYl_bIvkMxfJB-y_XKY=s0-d-e1-ft#http://www12.senado.gov.br/ecidadania/++resource++img/email-header.png" alt="">');
402
403-- --------------------------------------------------------
404
405--
406-- Table structure for table `cron_input`
407--
408
409CREATE TABLE IF NOT EXISTS `cron_input` (
410 `id` int(11) NOT NULL AUTO_INCREMENT,
411 `id_user` int(11) NOT NULL,
412 `metthod` enum('Dinheiro','Cartão de Crédito','Cheque','Débito Automático') NOT NULL,
413 `card_name` enum('American Express','Diners Club','MasterCard','Visa','Maestro','Amex','Outros') DEFAULT NULL,
414 `card_agence` varchar(250) DEFAULT NULL,
415 `card_number` varchar(250) DEFAULT NULL,
416 `cheque_number` varchar(250) DEFAULT NULL,
417 `title` varchar(100) NOT NULL,
418 `descri` mediumtext,
419 `qnt` int(5) DEFAULT NULL,
420 `value` double NOT NULL,
421 `status` tinyint(1) NOT NULL,
422 `cron_time` enum('monthly','weekly','daily') NOT NULL,
423 `monthly_day` int(1) DEFAULT NULL,
424 `weekly_day` int(1) DEFAULT NULL,
425 `daily_hour` int(2) DEFAULT NULL,
426 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
427 PRIMARY KEY (`id`)
428) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
429
430-- --------------------------------------------------------
431
432--
433-- Table structure for table `cron_output`
434--
435
436CREATE TABLE IF NOT EXISTS `cron_output` (
437 `id` int(11) NOT NULL AUTO_INCREMENT,
438 `id_user` int(11) DEFAULT NULL,
439 `metthod` enum('Dinheiro','Cartão de Crédito','Cheque','Débito Automático') NOT NULL,
440 `card_name` enum('American Express','Diners Club','MasterCard','Visa','Maestro','Amex','Outros') DEFAULT NULL,
441 `card_agence` varchar(250) DEFAULT NULL,
442 `card_number` varchar(250) DEFAULT NULL,
443 `cheque_number` varchar(250) DEFAULT NULL,
444 `title` varchar(100) NOT NULL,
445 `descri` mediumtext,
446 `value` double NOT NULL,
447 `status` tinyint(1) NOT NULL,
448 `cron_time` enum('monthly','weekly','daily') NOT NULL,
449 `monthly_day` int(1) DEFAULT NULL,
450 `weekly_day` int(1) DEFAULT NULL,
451 `daily_hour` time DEFAULT NULL,
452 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
453 PRIMARY KEY (`id`)
454) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
455
456-- --------------------------------------------------------
457
458--
459-- Table structure for table `empresa`
460--
461
462CREATE TABLE IF NOT EXISTS `empresa` (
463 `id` int(11) NOT NULL AUTO_INCREMENT,
464 `nome` varchar(250) NOT NULL,
465 `cpf` varchar(250) DEFAULT NULL,
466 `cpnj` varchar(250) DEFAULT NULL,
467 `email` varchar(250) NOT NULL,
468 `fone` varchar(250) NOT NULL,
469 `UF` varchar(2) DEFAULT NULL,
470 `Cep` varchar(9) DEFAULT NULL,
471 `End` varchar(100) DEFAULT NULL,
472 `Num` varchar(5) DEFAULT NULL,
473 `Bairro` varchar(50) DEFAULT NULL,
474 `Cidade` varchar(50) DEFAULT NULL,
475 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
476 PRIMARY KEY (`id`)
477) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
478
479
480-- --------------------------------------------------------
481
482--
483-- Table structure for table `entradas`
484--
485
486CREATE TABLE IF NOT EXISTS `entradas` (
487 `id` int(11) NOT NULL AUTO_INCREMENT,
488 `user` int(11) NOT NULL,
489 `supervisor` int(11) NOT NULL,
490 `loja` int(11) DEFAULT NULL,
491 `type` enum('logged','logout') NOT NULL,
492 `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
493 PRIMARY KEY (`id`)
494) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;
495
496
497-- --------------------------------------------------------
498
499--
500-- Table structure for table `fornecedores`
501--
502
503CREATE TABLE IF NOT EXISTS `fornecedores` (
504 `id` int(11) NOT NULL AUTO_INCREMENT,
505 `assoc` int(11) DEFAULT NULL,
506 `empresa` varchar(250) NOT NULL,
507 `cpf` varchar(250) DEFAULT NULL,
508 `cpnj` varchar(250) DEFAULT NULL,
509 `email` varchar(250) NOT NULL,
510 `fone` varchar(250) NOT NULL,
511 `UF` varchar(2) DEFAULT NULL,
512 `Cep` varchar(9) DEFAULT NULL,
513 `End` varchar(100) DEFAULT NULL,
514 `Num` varchar(5) DEFAULT NULL,
515 `Bairro` varchar(50) DEFAULT NULL,
516 `Cidade` varchar(50) DEFAULT NULL,
517 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
518 PRIMARY KEY (`id`)
519) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
520
521-- --------------------------------------------------------
522
523--
524-- Table structure for table `funcionarios`
525--
526
527CREATE TABLE IF NOT EXISTS `funcionarios` (
528 `id` int(11) NOT NULL AUTO_INCREMENT,
529 `assoc` int(11) DEFAULT NULL,
530 `empresa` int(11) DEFAULT NULL,
531 `loja` int(11) DEFAULT NULL,
532 `nome` varchar(100) NOT NULL,
533 `Salario` double DEFAULT NULL,
534 `Sexo` enum('F','M','T') NOT NULL,
535 `DtNasc` varchar(20) DEFAULT NULL,
536 `CPF` varchar(100) DEFAULT NULL,
537 `RG` varchar(100) DEFAULT NULL,
538 `End` varchar(100) DEFAULT NULL,
539 `Num` varchar(5) DEFAULT NULL,
540 `Bairro` varchar(50) DEFAULT NULL,
541 `Cidade` varchar(50) DEFAULT NULL,
542 `UF` varchar(2) DEFAULT NULL,
543 `Cep` varchar(100) DEFAULT NULL,
544 `Tel` varchar(100) DEFAULT NULL,
545 `Celular` varchar(100) DEFAULT NULL,
546 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
547 PRIMARY KEY (`id`),
548 UNIQUE KEY `Nm` (`nome`)
549) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
550
551
552-- --------------------------------------------------------
553
554--
555-- Table structure for table `gallery_cat`
556--
557
558CREATE TABLE IF NOT EXISTS `gallery_cat` (
559 `id` int(11) NOT NULL AUTO_INCREMENT,
560 `id_user` int(11) NOT NULL,
561 `title` varchar(250) NOT NULL,
562 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
563 PRIMARY KEY (`id`)
564) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
565
566-- --------------------------------------------------------
567
568--
569-- Table structure for table `gallery_pic`
570--
571
572CREATE TABLE IF NOT EXISTS `gallery_pic` (
573 `id` int(11) NOT NULL AUTO_INCREMENT,
574 `id_cat` int(11) NOT NULL,
575 `id_user` int(11) NOT NULL,
576 `pic` varchar(250) NOT NULL,
577 `title` varchar(200) DEFAULT 'Sem tÃtulo',
578 `descri` mediumtext,
579 `type` varchar(5) NOT NULL,
580 `Resolution` varchar(10) NOT NULL,
581 `size` int(20) NOT NULL,
582 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
583 PRIMARY KEY (`id`)
584) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
585
586-- --------------------------------------------------------
587
588--
589-- Table structure for table `global_chat`
590--
591
592CREATE TABLE IF NOT EXISTS `global_chat` (
593 `id` int(11) NOT NULL AUTO_INCREMENT,
594 `id_user` int(11) NOT NULL,
595 `msg` mediumtext NOT NULL,
596 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
597 PRIMARY KEY (`id`)
598) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
599
600
601-- --------------------------------------------------------
602
603--
604-- Table structure for table `guia_solucao`
605--
606
607CREATE TABLE IF NOT EXISTS `guia_solucao` (
608 `id` int(3) NOT NULL AUTO_INCREMENT,
609 `id_poster` int(11) DEFAULT NULL,
610 `status` tinyint(1) NOT NULL DEFAULT '1',
611 `style` enum('primary','success','info','inverse','default','danger') NOT NULL DEFAULT 'primary',
612 `position` enum('left','right','center') NOT NULL,
613 `titulo` varchar(240) NOT NULL,
614 `texto` longtext NOT NULL,
615 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
616 PRIMARY KEY (`id`)
617) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='portal de dúvidas' AUTO_INCREMENT=7 ;
618
619--
620-- Dumping data for table `guia_solucao`
621--
622
623INSERT INTO `guia_solucao` (`id`, `id_poster`, `status`, `style`, `position`, `titulo`, `texto`, `data`) VALUES
624(2, NULL, 1, 'success', 'left', 'Não Consigo Adicionar Usuário ', '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n<p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n<p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>', '2014-09-07 00:56:00'),
625(3, NULL, 1, 'primary', 'left', 'Tem algum erro no meu sistema ', '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>', '2014-09-07 00:56:00'),
626(4, NULL, 1, 'success', 'right', 'Não Consigo Adicionar uma Foto ', '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n<p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>', '2014-09-07 00:56:00'),
627(5, NULL, 1, 'default', 'center', 'Quero relatar minhas sugestões ', '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n<p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n<p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>', '2014-09-07 00:56:00'),
628(6, NULL, 1, 'danger', 'right', 'Quero Formatar minha maquina ', '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n<p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n<p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n<p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur bibendum ornare dolor, quis ullamcorper ligula sodales at. Nulla tellus elit, varius non commodo eget, mattis vel eros. In sed ornare nulla.\n </p>', '2014-09-07 00:56:00');
629
630-- --------------------------------------------------------
631
632--
633-- Table structure for table `input_others`
634--
635
636CREATE TABLE IF NOT EXISTS `input_others` (
637 `id` int(11) NOT NULL AUTO_INCREMENT,
638 `id_user` int(11) NOT NULL,
639 `id_cron` int(11) DEFAULT NULL,
640 `cron` tinyint(1) NOT NULL DEFAULT '0',
641 `metthod` enum('Dinheiro','Cartão de Crédito','Cheque','Débito Automático') NOT NULL,
642 `card_name` enum('American Express','Diners Club','MasterCard','Visa','Maestro','Amex','Outros') DEFAULT NULL,
643 `card_agence` varchar(250) DEFAULT NULL,
644 `card_number` varchar(250) DEFAULT NULL,
645 `cheque_number` varchar(250) DEFAULT NULL,
646 `title` varchar(100) NOT NULL,
647 `descri` mediumtext,
648 `value` double NOT NULL,
649 `status` tinyint(1) NOT NULL,
650 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
651 PRIMARY KEY (`id`)
652) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
653
654-- --------------------------------------------------------
655
656--
657-- Table structure for table `input_product`
658--
659
660CREATE TABLE IF NOT EXISTS `input_product` (
661 `id` int(11) NOT NULL AUTO_INCREMENT,
662 `id_user` int(10) DEFAULT NULL,
663 `id_product` int(10) NOT NULL,
664 `id_client` int(11) DEFAULT NULL,
665 `id_font` int(11) DEFAULT NULL,
666 `id_receipt` int(11) NOT NULL,
667 `name` varchar(250) NOT NULL,
668 `descri` mediumtext,
669 `qnt` int(3) NOT NULL DEFAULT '1',
670 `discount` float DEFAULT NULL,
671 `generate_billet` tinyint(1) NOT NULL DEFAULT '0',
672 `installments` int(2) NOT NULL DEFAULT '1' COMMENT 'Payment installments',
673 `payment_due` int(2) DEFAULT NULL COMMENT 'day of the month due for payment',
674 `value` float DEFAULT NULL COMMENT 'atenção o valor deve está multiplicado',
675 `status` tinyint(1) NOT NULL,
676 `Payment_method` enum('a_vista','parcelado','entrada_e_parcelas','porcentagem_e_Parcelas') NOT NULL DEFAULT 'a_vista',
677 `metthod` enum('Dinheiro','Cartão de Crédito','Cheque','Débito Automático') NOT NULL,
678 `card_name` enum('American Express','Diners Club','MasterCard','Visa','Maestro','Amex','Outros') DEFAULT NULL,
679 `card_agence` varchar(50) DEFAULT NULL,
680 `card_number` varchar(100) DEFAULT NULL,
681 `cheque_number` varchar(250) DEFAULT NULL,
682 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
683 PRIMARY KEY (`id`)
684) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='all products ever made' AUTO_INCREMENT=1 ;
685
686-- --------------------------------------------------------
687
688--
689-- Table structure for table `input_product_plots`
690--
691
692CREATE TABLE IF NOT EXISTS `input_product_plots` (
693 `id` int(11) NOT NULL AUTO_INCREMENT,
694 `id_receipt` int(11) NOT NULL,
695 `status` tinyint(1) NOT NULL DEFAULT '0',
696 `plot` int(2) NOT NULL,
697 `plot_value` float NOT NULL,
698 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
699 PRIMARY KEY (`id`)
700) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
701
702-- --------------------------------------------------------
703
704--
705-- Table structure for table `input_servico`
706--
707
708CREATE TABLE IF NOT EXISTS `input_servico` (
709 `id` int(11) NOT NULL AUTO_INCREMENT,
710 `id_user` int(10) DEFAULT NULL,
711 `id_service` int(10) NOT NULL,
712 `id_client` int(11) DEFAULT NULL,
713 `id_employee` int(10) DEFAULT NULL,
714 `id_font` int(11) DEFAULT NULL,
715 `id_receipt` int(11) NOT NULL,
716 `name` varchar(250) NOT NULL,
717 `descri` mediumtext,
718 `qnt` int(3) NOT NULL DEFAULT '1',
719 `discount` float DEFAULT NULL,
720 `generate_billet` tinyint(1) NOT NULL DEFAULT '0',
721 `installments` int(2) DEFAULT '1' COMMENT 'Payment installments',
722 `payment_due` int(2) DEFAULT NULL COMMENT 'day of the month due for payment',
723 `value` float DEFAULT NULL,
724 `status` tinyint(1) NOT NULL,
725 `Payment_method` enum('a_vista','parcelado','entrada_e_parcelas','porcentagem_e_Parcelas') NOT NULL DEFAULT 'a_vista',
726 `metthod` enum('Dinheiro','Cartão de Crédito','Cheque','Débito Automático') NOT NULL,
727 `card_name` enum('American Express','Diners Club','MasterCard','Visa','Maestro','Amex','Outros') DEFAULT NULL,
728 `card_agence` varchar(50) DEFAULT NULL,
729 `card_number` varchar(100) DEFAULT NULL,
730 `cheque_number` varchar(250) DEFAULT NULL,
731 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
732 PRIMARY KEY (`id`)
733) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='all services ever made' AUTO_INCREMENT=1 ;
734
735-- --------------------------------------------------------
736
737--
738-- Table structure for table `input_servico_plots`
739--
740
741CREATE TABLE IF NOT EXISTS `input_servico_plots` (
742 `id` int(11) NOT NULL AUTO_INCREMENT,
743 `id_receipt` int(11) NOT NULL,
744 `status` tinyint(1) NOT NULL DEFAULT '0',
745 `plot` int(2) NOT NULL,
746 `plot_value` float NOT NULL,
747 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
748 PRIMARY KEY (`id`)
749) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
750
751-- --------------------------------------------------------
752
753--
754-- Table structure for table `loja`
755--
756
757CREATE TABLE IF NOT EXISTS `loja` (
758 `id` int(11) NOT NULL AUTO_INCREMENT,
759 `nome` varchar(250) NOT NULL,
760 `email` varchar(250) NOT NULL,
761 `fone` varchar(250) NOT NULL,
762 `UF` varchar(2) DEFAULT NULL,
763 `Cep` varchar(9) DEFAULT NULL,
764 `End` varchar(100) DEFAULT NULL,
765 `Num` varchar(5) DEFAULT NULL,
766 `Bairro` varchar(50) DEFAULT NULL,
767 `Cidade` varchar(50) DEFAULT NULL,
768 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
769 PRIMARY KEY (`id`)
770) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
771
772
773-- --------------------------------------------------------
774
775--
776-- Table structure for table `marcador`
777--
778
779CREATE TABLE IF NOT EXISTS `marcador` (
780 `id` int(11) NOT NULL AUTO_INCREMENT,
781 `nome` varchar(200) NOT NULL,
782 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
783 PRIMARY KEY (`id`)
784) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
785
786-- --------------------------------------------------------
787
788--
789-- Table structure for table `mensagem`
790--
791
792CREATE TABLE IF NOT EXISTS `mensagem` (
793 `id` int(11) NOT NULL AUTO_INCREMENT,
794 `id_from` int(11) DEFAULT NULL COMMENT 'ID do usuário remetente',
795 `id_to` int(11) NOT NULL COMMENT 'ID do usuário destinário',
796 `star` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 = Não é favorito | 1 = Favorito',
797 `important` tinyint(1) NOT NULL DEFAULT '0',
798 `trash` tinyint(1) DEFAULT '0' COMMENT '0 = não está na lixeira | 1 = lixeira',
799 `spam` tinyint(1) NOT NULL DEFAULT '0',
800 `label` int(11) DEFAULT NULL,
801 `title` varchar(250) NOT NULL,
802 `text` mediumtext NOT NULL,
803 `lida` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 = não lida, 1 = lida',
804 `data` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
805 PRIMARY KEY (`id`)
806) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='mensagens' AUTO_INCREMENT=1 ;
807
808-- --------------------------------------------------------
809
810--
811-- Table structure for table `mensagem_attack`
812--
813
814CREATE TABLE IF NOT EXISTS `mensagem_attack` (
815 `id` int(11) NOT NULL AUTO_INCREMENT,
816 `id_message` int(11) NOT NULL,
817 `size` varchar(11) NOT NULL,
818 `file` varchar(250) NOT NULL,
819 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
820 PRIMARY KEY (`id`)
821) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
822
823-- --------------------------------------------------------
824
825--
826-- Table structure for table `mensagem_reply`
827--
828
829CREATE TABLE IF NOT EXISTS `mensagem_reply` (
830 `id` int(11) NOT NULL AUTO_INCREMENT,
831 `id_user` int(11) NOT NULL,
832 `id_message` int(11) NOT NULL,
833 `text` longtext NOT NULL,
834 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
835 PRIMARY KEY (`id`)
836) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
837
838-- --------------------------------------------------------
839
840--
841-- Table structure for table `menu`
842--
843
844CREATE TABLE IF NOT EXISTS `menu` (
845 `id` int(11) NOT NULL AUTO_INCREMENT,
846 `status` tinyint(1) NOT NULL,
847 `sub` tinyint(1) DEFAULT '0' COMMENT 'id subcategoria ',
848 `name` varchar(50) NOT NULL,
849 `link` varchar(250) NOT NULL DEFAULT '#' COMMENT 'padrão #',
850 `icone` varchar(250) NOT NULL COMMENT 'icone fa class',
851 `position` int(10) NOT NULL,
852 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
853 PRIMARY KEY (`id`)
854) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
855
856--
857-- Dumping data for table `menu`
858--
859
860INSERT INTO `menu` (`id`, `status`, `sub`, `name`, `link`, `icone`, `position`, `data`) VALUES
861(1, 1, 0, 'Principal', 'dashboard/index', 'fa-home', 1, '2014-09-29 00:36:52'),
862(2, 1, 1, 'Gráficos', '#', 'fa-bar-chart-o', 2, '2014-03-05 16:05:52'),
863(3, 1, 1, 'Movimentar', '#', 'fa-external-link', 6, '2014-03-05 16:05:52'),
864(5, 1, 1, 'Notificações', '#', 'fa-envelope', 8, '2014-03-05 16:05:52'),
865(6, 1, 1, 'Ferramentas', '#', 'fa-suitcase', 9, '2014-03-05 16:05:52'),
866(7, 1, 0, 'Guia do Usuário', 'dashboard/Guide/doubts', 'fa-question-circle', 10, '2014-03-05 16:05:52'),
867(8, 0, 1, 'Sistema', '#', 'fa-user', 12, '2014-03-05 16:05:52'),
868(11, 1, 1, 'Gerenciar', '#', 'fa-book', 5, '2014-03-05 16:05:52'),
869(12, 1, 1, 'Configuração', '#', 'fa-gear', 13, '2013-11-05 16:05:52'),
870(13, 1, 1, 'Custos Fixos', '#', 'fa-refresh', 8, '2014-10-03 02:11:58'),
871(14, 1, 1, 'Relatórios', '#', 'fa-tasks', 8, '2014-10-03 02:11:58');
872
873-- --------------------------------------------------------
874
875--
876-- Table structure for table `menu_access`
877--
878
879CREATE TABLE IF NOT EXISTS `menu_access` (
880 `id` int(11) NOT NULL AUTO_INCREMENT,
881 `account_type` int(11) NOT NULL,
882 `id_menu` int(11) NOT NULL,
883 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
884 PRIMARY KEY (`id`),
885 UNIQUE KEY `id` (`id`)
886) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=77 ;
887
888--
889-- Dumping data for table `menu_access`
890--
891
892INSERT INTO `menu_access` (`id`, `account_type`, `id_menu`, `data`) VALUES
893(51, 1, 1, '2016-07-27 01:54:20'),
894(52, 1, 11, '2016-07-27 01:54:20'),
895(53, 1, 5, '2016-07-27 01:54:20'),
896(54, 1, 6, '2016-07-27 01:54:20'),
897(55, 1, 7, '2016-07-27 01:54:20'),
898(56, 1, 8, '2016-07-27 01:54:20'),
899(57, 2, 1, '2016-07-27 01:54:20'),
900(58, 2, 2, '2016-07-27 01:54:20'),
901(59, 2, 5, '2016-07-27 01:54:20'),
902(60, 2, 6, '2016-07-27 01:54:20'),
903(61, 2, 7, '2016-07-27 01:54:20'),
904(62, 2, 8, '2016-07-27 01:54:20'),
905(63, 3, 1, '2016-07-27 01:54:20'),
906(64, 3, 2, '2016-07-27 01:54:20'),
907(65, 3, 3, '2016-07-27 01:54:20'),
908(66, 3, 5, '2016-07-27 01:54:20'),
909(67, 3, 7, '2016-07-27 01:54:20'),
910(68, 3, 8, '2016-07-27 01:54:20'),
911(69, 4, 1, '2016-07-27 01:54:20'),
912(70, 4, 2, '2016-07-27 01:54:20'),
913(71, 4, 11, '2016-07-27 01:54:20'),
914(72, 4, 3, '2016-07-27 01:54:20'),
915(73, 4, 5, '2016-07-27 01:54:20'),
916(74, 4, 6, '2016-07-27 01:54:20'),
917(75, 4, 7, '2016-07-27 01:54:20'),
918(76, 4, 8, '2016-07-27 01:54:20');
919
920-- --------------------------------------------------------
921
922--
923-- Table structure for table `menu_sub`
924--
925
926CREATE TABLE IF NOT EXISTS `menu_sub` (
927 `id` int(11) NOT NULL AUTO_INCREMENT,
928 `status` tinyint(1) NOT NULL COMMENT 'visible ?',
929 `id_menu` int(11) DEFAULT NULL COMMENT 'id do menu',
930 `name` varchar(50) NOT NULL,
931 `link` varchar(250) NOT NULL DEFAULT '#' COMMENT 'padrão #',
932 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'data created',
933 PRIMARY KEY (`id`)
934) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=75 ;
935
936--
937-- Dumping data for table `menu_sub`
938--
939
940INSERT INTO `menu_sub` (`id`, `status`, `id_menu`, `name`, `link`, `data`) VALUES
941(2, 1, 13, 'Despesas', 'dashboard/OverheadCosts/expense', '2014-03-05 16:05:18'),
942(3, 1, 2, 'Comissões', 'dashboard/Charts/comissions', '2014-03-05 16:05:18'),
943(4, 1, 2, 'Finanças', 'dashboard/Charts/finance', '2014-03-05 16:05:18'),
944(6, 1, 3, 'Vendas Serviços', 'dashboard/Mov/services', '2014-03-05 16:05:18'),
945(7, 1, 3, 'Vendas Produtos', 'dashboard/Mov/products', '2014-03-05 16:05:18'),
946(14, 1, 11, 'Usuários', 'dashboard/Manager/users', '2014-03-05 16:05:18'),
947(15, 1, 5, 'Mensagem', 'dashboard/Notifier/inbox', '2014-03-05 16:05:18'),
948(17, 1, 5, 'Notificações', 'dashboard/Notifier/notifier', '2014-03-05 16:05:18'),
949(18, 1, 8, 'Sair', 'login/logout', '2014-03-05 16:05:18'),
950(22, 1, 7, 'Portal de Dúvidas', 'dashboard/Guide/doubts', '2014-03-05 16:05:18'),
951(25, 1, 8, 'Suspender', 'dashboard/System/lock_screen', '2014-03-05 16:05:18'),
952(27, 1, 6, 'Agenda', 'dashboard/Tools/calendar', '2014-03-05 16:05:18'),
953(32, 1, 6, 'Tempo Real Largura de Banda', 'dashboard/Tools/chart_bandwidth', '2014-03-05 16:05:18'),
954(35, 1, 12, 'Globais', 'dashboard/Settings/global', '2014-03-05 16:05:18'),
955(36, 1, 12, 'Menu', 'dashboard/Settings/Menu', '2014-03-05 16:05:18'),
956(47, 1, 11, 'Clientes', 'dashboard/Manager/clients', '2014-09-20 03:00:00'),
957(48, 1, 11, 'Fornecedores', 'dashboard/Manager/fornecedores', '2014-09-20 03:00:00'),
958(49, 1, 11, 'Estoque', 'dashboard/Manager/estoque', '2014-09-20 03:00:00'),
959(50, 1, 11, 'Serviços', 'dashboard/Manager/servicos', '2014-09-20 03:00:00'),
960(51, 1, 14, 'Comissões', 'dashboard/Reports/commission', '2014-09-20 03:00:00'),
961(52, 1, 8, 'Changelog', 'dashboard/System/Changerlog', '2014-03-05 16:05:18'),
962(53, 1, 11, 'Agenda', 'dashboard/Manager/agenda', '2014-09-22 03:00:00'),
963(55, 1, 3, 'Despesas', 'dashboard/Mov/expense', '2014-09-20 03:00:00'),
964(56, 1, 3, 'Receitas', 'dashboard/Mov/income', '2014-09-20 03:00:00'),
965(58, 1, 12, 'Acessos', 'dashboard/Settings/access', '2014-03-05 16:05:18'),
966(59, 1, 13, 'Receitas', 'dashboard/OverheadCosts/income', '2014-03-05 16:05:18'),
967(60, 1, 12, 'Informações Comercial', 'dashboard/Settings/receipts', '2014-10-13 23:32:20'),
968(61, 1, 14, 'Recibos', 'dashboard/Reports/receipt', '2014-10-16 16:57:15'),
969(62, 1, 11, 'Funcionários', 'dashboard/Manager/employee', '2014-10-21 18:56:27'),
970(64, 1, 14, 'Fluxo de Caixa', 'dashboard/Reports/cash_flow', '2014-11-20 00:02:56'),
971(65, 0, 14, 'Serviços', 'dashboard/Settings/access', '2014-11-20 00:02:56'),
972(66, 1, 11, 'Fontes', 'dashboard/Manager/fonts', '2014-11-26 15:51:10'),
973(67, 1, 12, 'Autenticação', 'dashboard/Settings/auth', '2014-12-12 22:01:15'),
974(68, 1, 6, 'Galeria', 'dashboard/Tools/gallery', '2014-12-13 20:24:47'),
975(69, 1, 6, 'Aniversários', 'dashboard/Tools/birth', '2015-10-23 17:15:45'),
976(70, 1, 11, 'Supervisores', 'dashboard/Manager/supervisor', '2014-09-20 03:00:00'),
977(71, 1, 3, 'Entradas e SaÃdas', 'dashboard/Reports/entradas', '2014-10-16 16:57:15'),
978(72, 1, 11, 'Lojas', 'dashboard/Manager/lojas', '2014-09-20 03:00:00'),
979(73, 1, 11, 'Empresas', 'dashboard/Manager/empresas', '2014-09-20 03:00:00'),
980(74, 1, 2, 'Visitas', 'dashboard/Charts/visits', '2014-03-05 16:05:18');
981
982-- --------------------------------------------------------
983
984--
985-- Table structure for table `menu_sub_access`
986--
987
988CREATE TABLE IF NOT EXISTS `menu_sub_access` (
989 `id` int(11) NOT NULL AUTO_INCREMENT,
990 `account_type` int(11) NOT NULL,
991 `id_sub_menu` int(11) NOT NULL,
992 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
993 PRIMARY KEY (`id`)
994) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=58 ;
995
996--
997-- Dumping data for table `menu_sub_access`
998--
999
1000INSERT INTO `menu_sub_access` (`id`, `account_type`, `id_sub_menu`, `data`) VALUES
1001(1, 4, 3, '2016-07-27 01:54:20'),
1002(2, 4, 4, '2016-07-27 01:54:20'),
1003(3, 3, 4, '2016-07-27 01:54:20'),
1004(4, 4, 6, '2016-07-27 01:54:20'),
1005(5, 3, 6, '2016-07-27 01:54:20'),
1006(6, 3, 7, '2016-07-27 01:54:20'),
1007(7, 4, 7, '2016-07-27 01:54:20'),
1008(9, 2, 15, '2016-07-27 01:54:20'),
1009(10, 3, 15, '2016-07-27 01:54:20'),
1010(11, 4, 15, '2016-07-27 01:54:20'),
1011(13, 2, 17, '2016-07-27 01:54:20'),
1012(14, 3, 17, '2016-07-27 01:54:20'),
1013(15, 4, 17, '2016-07-27 01:54:20'),
1014(17, 2, 18, '2016-07-27 01:54:20'),
1015(18, 3, 18, '2016-07-27 01:54:20'),
1016(19, 4, 18, '2016-07-27 01:54:20'),
1017(21, 2, 22, '2016-07-27 01:54:20'),
1018(22, 3, 22, '2016-07-27 01:54:20'),
1019(23, 4, 22, '2016-07-27 01:54:20'),
1020(25, 2, 25, '2016-07-27 01:54:20'),
1021(26, 3, 25, '2016-07-27 01:54:20'),
1022(27, 4, 25, '2016-07-27 01:54:20'),
1023(29, 2, 27, '2016-07-27 01:54:20'),
1024(30, 3, 27, '2016-07-27 01:54:20'),
1025(31, 4, 27, '2016-07-27 01:54:20'),
1026(32, 4, 28, '2016-07-27 01:54:20'),
1027(33, 4, 47, '2016-07-27 01:54:20'),
1028(34, 4, 48, '2016-07-27 01:54:20'),
1029(35, 4, 49, '2016-07-27 01:54:20'),
1030(36, 4, 50, '2016-07-27 01:54:20'),
1031(37, 4, 51, '2016-07-27 01:54:20'),
1032(39, 2, 52, '2016-07-27 01:54:20'),
1033(40, 3, 52, '2016-07-27 01:54:20'),
1034(41, 4, 52, '2016-07-27 01:54:20'),
1035(42, 4, 53, '2016-07-27 01:54:20'),
1036(43, 2, 53, '2016-07-27 01:54:20'),
1037(45, 4, 55, '2016-07-27 01:54:20'),
1038(46, 4, 56, '2016-07-27 01:54:20'),
1039(47, 4, 59, '2016-07-27 01:54:20'),
1040(48, 3, 61, '2016-07-27 01:54:20'),
1041(49, 4, 61, '2016-07-27 01:54:20'),
1042(57, 1, 53, '2016-07-27 01:54:20');
1043
1044-- --------------------------------------------------------
1045
1046--
1047-- Table structure for table `notes`
1048--
1049
1050CREATE TABLE IF NOT EXISTS `notes` (
1051 `id` int(11) NOT NULL AUTO_INCREMENT,
1052 `id_user` int(11) NOT NULL,
1053 `text` mediumtext NOT NULL,
1054 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1055 PRIMARY KEY (`id`)
1056) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1057
1058-- --------------------------------------------------------
1059
1060--
1061-- Table structure for table `notifier`
1062--
1063
1064CREATE TABLE IF NOT EXISTS `notifier` (
1065 `id` int(11) NOT NULL AUTO_INCREMENT,
1066 `id_from` int(11) DEFAULT NULL COMMENT 'ID do usuário remetente',
1067 `id_to` int(11) NOT NULL COMMENT 'ID do usuário destinário',
1068 `title` varchar(250) NOT NULL,
1069 `text` mediumtext NOT NULL,
1070 `lida` int(1) DEFAULT '0' COMMENT '0 = não lida, 1 = lida',
1071 `data` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
1072 PRIMARY KEY (`id`)
1073) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='notificações' AUTO_INCREMENT=2 ;
1074
1075--
1076-- Dumping data for table `notifier`
1077--
1078
1079INSERT INTO `notifier` (`id_from`, `id_to`, `title`, `text`, `lida`, `data`) VALUES
1080(NULL, 6, 'Seja Bem Vindo !', 'Instalação efetuada com sucesso ! seja bem vindo ao {$name}.', 0, '{$now}');
1081
1082-- --------------------------------------------------------
1083
1084--
1085-- Table structure for table `output_others`
1086--
1087
1088CREATE TABLE IF NOT EXISTS `output_others` (
1089 `id` int(11) NOT NULL AUTO_INCREMENT,
1090 `id_user` int(11) NOT NULL,
1091 `id_cron` int(11) DEFAULT NULL,
1092 `cron` tinyint(1) NOT NULL DEFAULT '0',
1093 `metthod` enum('Dinheiro','Cartão de Crédito','Cheque','Débito Automático') NOT NULL,
1094 `card_name` enum('American Express','Diners Club','MasterCard','Visa','Maestro','Amex','Outros') DEFAULT NULL,
1095 `card_agence` varchar(250) DEFAULT NULL,
1096 `card_number` varchar(250) DEFAULT NULL,
1097 `cheque_number` varchar(250) DEFAULT NULL,
1098 `title` varchar(100) NOT NULL,
1099 `descri` mediumtext,
1100 `value` double NOT NULL,
1101 `status` tinyint(1) NOT NULL,
1102 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1103 PRIMARY KEY (`id`)
1104) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1105
1106-- --------------------------------------------------------
1107
1108--
1109-- Table structure for table `output_product`
1110--
1111
1112CREATE TABLE IF NOT EXISTS `output_product` (
1113 `id` int(11) NOT NULL AUTO_INCREMENT,
1114 `id_user` int(11) NOT NULL,
1115 `id_client` int(11) DEFAULT NULL,
1116 `status` tinyint(1) NOT NULL DEFAULT '1',
1117 `id_product` int(10) NOT NULL,
1118 `id_receipt` int(11) NOT NULL,
1119 `discount` tinyint(1) NOT NULL DEFAULT '0',
1120 `name` varchar(250) NOT NULL,
1121 `descri` mediumtext,
1122 `qnt` int(3) DEFAULT '1',
1123 `value` float NOT NULL,
1124 `metthod` enum('Dinheiro','Cartão de Crédito','Cheque','Débito Automático') NOT NULL,
1125 `card_name` enum('American Express','Diners Club','MasterCard','Visa','Maestro','Amex','Outros') DEFAULT NULL,
1126 `card_agence` varchar(50) DEFAULT NULL,
1127 `card_number` varchar(100) DEFAULT NULL,
1128 `cheque_number` varchar(250) DEFAULT NULL,
1129 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1130 PRIMARY KEY (`id`)
1131) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='all products ever made' AUTO_INCREMENT=1 ;
1132
1133-- --------------------------------------------------------
1134
1135--
1136-- Table structure for table `output_servico`
1137--
1138
1139CREATE TABLE IF NOT EXISTS `output_servico` (
1140 `id` int(11) NOT NULL AUTO_INCREMENT,
1141 `id_user` int(10) DEFAULT NULL,
1142 `id_service` int(10) DEFAULT NULL,
1143 `id_client` int(11) DEFAULT NULL,
1144 `id_employee` int(10) DEFAULT NULL,
1145 `id_receipt` int(11) NOT NULL,
1146 `discount` tinyint(1) NOT NULL DEFAULT '0',
1147 `name` varchar(250) NOT NULL,
1148 `descri` mediumtext,
1149 `qnt` int(3) DEFAULT '1',
1150 `value` float NOT NULL,
1151 `status` tinyint(1) NOT NULL,
1152 `metthod` enum('Dinheiro','Cartão de Crédito','Cheque','Débito Automático') NOT NULL,
1153 `card_name` enum('American Express','Diners Club','MasterCard','Visa','Maestro','Amex','Outros') DEFAULT NULL,
1154 `card_agence` varchar(50) DEFAULT NULL,
1155 `card_number` varchar(100) DEFAULT NULL,
1156 `cheque_number` varchar(100) DEFAULT NULL,
1157 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1158 PRIMARY KEY (`id`)
1159) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='all services ever made' AUTO_INCREMENT=1 ;
1160
1161-- --------------------------------------------------------
1162
1163--
1164-- Table structure for table `produtos`
1165--
1166
1167CREATE TABLE IF NOT EXISTS `produtos` (
1168 `id` int(11) NOT NULL AUTO_INCREMENT,
1169 `id_fornecedor` int(11) NOT NULL,
1170 `autoexpense` tinyint(1) NOT NULL DEFAULT '0',
1171 `nome` varchar(250) NOT NULL,
1172 `descri` mediumtext,
1173 `valor_original` varchar(50) NOT NULL,
1174 `valor` varchar(250) NOT NULL,
1175 `marcador` int(11) DEFAULT NULL,
1176 `quantidade` int(11) NOT NULL,
1177 `foto` varchar(250) DEFAULT NULL,
1178 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1179 PRIMARY KEY (`id`)
1180) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1181
1182-- --------------------------------------------------------
1183
1184--
1185-- Table structure for table `ProgrammerBillet`
1186--
1187
1188CREATE TABLE IF NOT EXISTS `ProgrammerBillet` (
1189 `id` int(11) NOT NULL AUTO_INCREMENT,
1190 `id_poster` int(11) NOT NULL,
1191 `status` tinyint(1) NOT NULL DEFAULT '0',
1192 `id_client` int(11) DEFAULT NULL,
1193 `id_funcionario` int(11) DEFAULT NULL,
1194 `id_receipt` int(11) DEFAULT NULL,
1195 `id_font` int(11) NOT NULL,
1196 `plots` int(11) NOT NULL,
1197 `value` float NOT NULL,
1198 `data_send` date NOT NULL,
1199 `data_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1200 PRIMARY KEY (`id`)
1201) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1202
1203-- --------------------------------------------------------
1204
1205--
1206-- Table structure for table `recibos`
1207--
1208
1209CREATE TABLE IF NOT EXISTS `recibos` (
1210 `id` int(11) NOT NULL AUTO_INCREMENT,
1211 `id_cliente` int(11) DEFAULT NULL,
1212 `id_user` int(11) DEFAULT NULL,
1213 `id_employee` int(11) DEFAULT NULL COMMENT 'if type is service, used for commission',
1214 `id_font` int(11) DEFAULT NULL,
1215 `discount` double DEFAULT NULL,
1216 `generate_billet` tinyint(1) NOT NULL DEFAULT '0',
1217 `installments` int(2) NOT NULL DEFAULT '1',
1218 `payment_due` int(2) DEFAULT NULL,
1219 `_interval` int(3) DEFAULT NULL,
1220 `_interval_period` enum('day','week','month','year') DEFAULT NULL,
1221 `Payment_method` enum('a_vista','parcelado','entrada_e_parcelas','porcentagem_e_Parcelas') NOT NULL DEFAULT 'a_vista',
1222 `entry_value` float DEFAULT NULL,
1223 `percent_entry` float DEFAULT NULL,
1224 `status` tinyint(1) NOT NULL DEFAULT '0',
1225 `style` enum('Products','Services') NOT NULL,
1226 `metthod` enum('Dinheiro','Cartão de Crédito','Cheque','Débito Automático') NOT NULL,
1227 `card_name` enum('American Express','Diners Club','MasterCard','Visa','Maestro','Amex','Outros') DEFAULT NULL,
1228 `card_agence` varchar(250) DEFAULT NULL,
1229 `card_number` varchar(250) DEFAULT NULL,
1230 `cheque_number` varchar(250) DEFAULT NULL,
1231 `data` datetime NOT NULL,
1232 `data_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1233 PRIMARY KEY (`id`)
1234) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1235
1236-- --------------------------------------------------------
1237
1238--
1239-- Table structure for table `recibos_itens`
1240--
1241
1242CREATE TABLE IF NOT EXISTS `recibos_itens` (
1243 `id` int(11) NOT NULL AUTO_INCREMENT,
1244 `id_recibo` int(11) NOT NULL,
1245 `id_product` int(11) DEFAULT NULL,
1246 `id_service` int(11) DEFAULT NULL,
1247 `nome` varchar(200) NOT NULL,
1248 `descri` mediumtext,
1249 `valor_original` float DEFAULT NULL,
1250 `valor_despesa` float DEFAULT NULL,
1251 `valor_lucro` float NOT NULL,
1252 `qnt` int(11) NOT NULL DEFAULT '1',
1253 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1254 PRIMARY KEY (`id`)
1255) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1256
1257-- --------------------------------------------------------
1258
1259--
1260-- Table structure for table `servicos`
1261--
1262
1263CREATE TABLE IF NOT EXISTS `servicos` (
1264 `id` int(11) NOT NULL AUTO_INCREMENT,
1265 `titulo` varchar(250) NOT NULL COMMENT 'TÃtulo do serviço',
1266 `descri` mediumtext COMMENT 'uma pequena descrição do serviço',
1267 `valor` double NOT NULL COMMENT 'valor bruto do serviço',
1268 `comissao` double DEFAULT NULL COMMENT 'comissão por funcionario',
1269 `data` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
1270 PRIMARY KEY (`id`)
1271) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
1272
1273-- --------------------------------------------------------
1274
1275--
1276-- Table structure for table `supervisor`
1277--
1278
1279CREATE TABLE IF NOT EXISTS `supervisor` (
1280 `id` int(11) NOT NULL AUTO_INCREMENT,
1281 `assoc` int(11) DEFAULT NULL,
1282 `empresa` int(11) DEFAULT NULL,
1283 `loja` mediumtext COMMENT 'croma ;',
1284 `nome` varchar(250) NOT NULL,
1285 `phone` varchar(250) NOT NULL,
1286 `email` varchar(250) NOT NULL,
1287 `criado` datetime NOT NULL,
1288 `atualizado` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1289 PRIMARY KEY (`id`)
1290) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1291
1292-- --------------------------------------------------------
1293
1294--
1295-- Table structure for table `task`
1296--
1297
1298CREATE TABLE IF NOT EXISTS `task` (
1299 `id` int(11) NOT NULL AUTO_INCREMENT,
1300 `id_user` int(11) NOT NULL,
1301 `status` tinyint(1) NOT NULL DEFAULT '0',
1302 `title` mediumtext NOT NULL,
1303 `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1304 PRIMARY KEY (`id`)
1305) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
1306
1307
1308-- --------------------------------------------------------
1309
1310--
1311-- Table structure for table `users`
1312--
1313
1314CREATE TABLE IF NOT EXISTS `users` (
1315 `user_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'auto incrementing user_id of each user, unique index',
1316 `user_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'user''s name, unique',
1317 `user_first_name` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
1318 `user_last_name` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
1319 `user_password_hash` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'user''s password in salted and hashed format',
1320 `user_email` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'user''s email, unique',
1321 `user_active` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'user''s activation status',
1322 `user_account_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'user''s account type (basic, premium, etc)',
1323 `user_has_avatar` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 if user has a local avatar, 0 if not',
1324 `user_rememberme_token` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'user''s remember-me cookie token',
1325 `user_creation_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of the creation of user''s account',
1326 `user_last_login_timestamp` bigint(20) DEFAULT NULL COMMENT 'timestamp of user''s last login',
1327 `user_failed_logins` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'user''s failed login attempts',
1328 `user_last_failed_login` int(10) DEFAULT NULL COMMENT 'unix timestamp of last failed login attempt',
1329 `user_activation_hash` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'user''s email verification hash string',
1330 `user_registration_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
1331 `user_password_reset_hash` char(40) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'user''s password reset code',
1332 `user_password_reset_timestamp` bigint(20) DEFAULT NULL COMMENT 'timestamp of the password reset request',
1333 `user_provider_type` text COLLATE utf8_unicode_ci,
1334 `user_facebook_uid` bigint(20) unsigned DEFAULT NULL COMMENT 'optional - facebook UID',
1335 PRIMARY KEY (`user_id`),
1336 UNIQUE KEY `user_name` (`user_name`),
1337 UNIQUE KEY `user_email` (`user_email`),
1338 KEY `user_facebook_uid` (`user_facebook_uid`)
1339) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='user data' AUTO_INCREMENT=7 ;
1340
1341--
1342-- Dumping data for table `users`
1343--
1344
1345INSERT INTO `users` (`user_id`, `user_name`, `user_first_name`, `user_last_name`, `user_password_hash`, `user_email`, `user_active`, `user_account_type`,`user_provider_type`) VALUES
1346(6, '{$_POST["userSystem"]}', '{$_POST["userSystem"]}', NULL, '{$pass}', '{$_POST["emailSystem"]}', 1, 0, 'DEFAULT');
1347-- --------------------------------------------------------
1348
1349--
1350-- Table structure for table `visits`
1351--
1352
1353CREATE TABLE IF NOT EXISTS `visits` (
1354 `id` int(11) NOT NULL AUTO_INCREMENT,
1355 `session` varchar(250) NOT NULL,
1356 `page` varchar(250) NOT NULL,
1357 `useagent` varchar(250) NOT NULL,
1358 `ip` varchar(250) NOT NULL,
1359 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1360 PRIMARY KEY (`id`)
1361) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=85 ;
1362
1363EOF;
1364 }
1365
1366 /**
1367 * Here is the main configuration file of your application.
1368 * Note: replace special characters that makes conflict with the EOFPAGE
1369 * if the character in question does not exist, add it to
1370 * the array $ASCI_table_replace the file setup-config.php
1371 * @access protected
1372 * @param array $POST
1373 * @return HTML
1374 */
1375 protected function FileGenerate($POST) {
1376 $year = date('Y');
1377
1378 return <<<EOFPAGE
1379<?php
1380
1381/**
1382 * Configuration File {$this->name}
1383 *
1384 * For more info about constants please @see http://php.net/manual/en/function.define.php
1385 * If you want to know why we use "define" instead of "const" @see http://stackoverflow.com/q/2447791/1114320
1386 * @copyright (c) {$year}, Bruno Ribeiro
1387 */
1388
1389/**
1390 * Configuration for: Database
1391 * This is the place where you define your database credentials, type etc.
1392 *
1393 * database type
1394 * define('DB_TYPE', 'mysql');
1395 * database host, usually it's "127.0.0.1" or "localhost", some servers also need port info, like "127.0.0.1:8080"
1396 * define('DB_HOST', '127.0.0.1');
1397 * name of the database. please note: database and database table are not the same thing!
1398 * define('DB_NAME', 'login');
1399 * user for your database. the user needs to have rights for SELECT, UPDATE, DELETE and INSERT
1400 * By the way, it's bad style to use "root", but for development it will work
1401 * define('DB_USER', 'root');
1402 * The password of the above user
1403 * define('DB_PASS', 'xxx');
1404 * define('DB_PREFIX', 'prefix_'); or NULL
1405 */
1406define('DB_TYPE', 'mysql');
1407define('DB_HOST', '{$POST['dbhost']}');
1408define('DB_NAME', '{$POST['dbname']}');
1409define('DB_USER', '{$POST['uname']}');
1410define('DB_PASS', '{$POST['pwd']}');
1411define('DB_PREFIX', NULL);
1412
1413// get data for dynamic settings
1414function array_table($table, $where, $fetch) {
1415 $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
1416 $mysqli->set_charset('utf8');
1417 if ($where !== false) {
1418 $query = "SELECT $fetch FROM `$table` WHERE $where[0] = '$where[1]' LIMIT 1";
1419 } else {
1420 $query = "SELECT $fetch FROM `$table` LIMIT 1";
1421 }
1422 $q = mysqli_query($mysqli, $query);
1423 while ($data = mysqli_fetch_array($q)) {
1424 return $data[$fetch];
1425 }
1426}
1427
1428$_SYSTEM_DEBUG = array_table('Configure', false, 'DEBUG') == 0 ? false : true;
1429
1430# -----------------------------------------
1431# Set Locale for date function
1432# -----------------------------------------
1433setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese');
1434
1435# -----------------------------------------
1436# Bug fix erros de caracteres na header
1437# -----------------------------------------
1438ini_set('default_charset', 'UTF-8');
1439
1440# -----------------------------------------
1441# Timezone
1442# -----------------------------------------
1443date_default_timezone_set('{$_POST['timezone']}');
1444
1445/**
1446 * Configuration for: Base URL
1447 * This is the base url of our app. if you go live with your app, put your full domain name here.
1448 * if you are using a (different) port, then put this in here, like http://mydomain:8888/subfolder/
1449 * Note: The trailing slash is important!
1450 */
1451define('URL', array_table('Configure', false, 'url'));
1452
1453
1454# -----------------------------------------
1455# account type that is not accessible to other users when you add a sales service.
1456# is used to checked the combobox in Mov/service
1457# -----------------------------------------
1458define('ACCOUNT_TYPE_FOR_SALLER', array_table('Configure', false, 'ACCOUNT_TYPE_FOR_SALLER'));
1459# -----------------------------------------
1460# status comission close day
1461# value boolean
1462# -----------------------------------------
1463define('STATUS_DAY_CLOSE', array_table('Configure', false, 'STATUS_DAY_CLOSE'));
1464
1465# -----------------------------------------
1466# day that will close the monthly commission.
1467# used to organize committees
1468# -----------------------------------------
1469define('DAY_CLOSE_COMISSION', array_table('Configure', FALSE, 'DAY_CLOSE_COMISSION'));
1470
1471/**
1472 * demonstration mode, if true no one can change and add users also can not change
1473 * user profile, settings menu, global, access and receipts.
1474 */
1475define('DEMOSTRATION', FALSE);
1476
1477/**
1478 * Versão mÃnima do PHP para rodar a aplicação
1479 * veja a lista dos recursos adicionados, editado e alterados do PHP http://pt.wikipedia.org/wiki/PHP
1480 *
1481 */
1482define('MIN_PHP_VERSION', '5.4.3');
1483
1484
1485/**
1486 * Configuration for: Folders
1487 * Here you define where your folders are. Unless you have renamed them, there's no need to change this.
1488 */
1489define('LIBS_PATH', 'application/libs/');
1490define('LIBS_DEV_PATH', 'application/libs/Developer/');
1491define('LIBS_DEV_PATH_DASHBOARD', 'application/libs/Dashboard/');
1492define('CONTROLLER_PATH', 'application/controllers/');
1493define('MODELS_PATH', 'application/models/');
1494define('VIEWS_PATH', 'application/views/');
1495define('DS', DIRECTORY_SEPARATOR);
1496// don't forget to make this folder writable via chmod 775 or 777 (?)
1497// the slash at the end is VERY important!
1498define('AVATAR_PATH', 'public/avatars/');
1499
1500/**
1501 * Configuration for: Additional login providers: Facebook
1502 * Self-explaining. The FACEBOOK_LOGIN_PATH is the controller-action where the user is redirected to after getting
1503 * authenticated via Facebook. Leave it like that unless you know exactly what you do.
1504 */
1505define('FACEBOOK_LOGIN', false);
1506define('FACEBOOK_LOGIN_APP_ID', '');
1507define('FACEBOOK_LOGIN_APP_SECRET', '');
1508define('FACEBOOK_LOGIN_PATH', 'login/loginWithFacebook');
1509define('FACEBOOK_REGISTER_PATH', 'login/registerWithFacebook');
1510
1511/**
1512 * Configuration for: Avatars/Gravatar support
1513 * Set to true if you want to use "Gravatar(s)", a service that automatically gets avatar pictures via using email
1514 * addresses of users by requesting images from the gravatar.com API. Set to false to use own locally saved avatars.
1515 * AVATAR_SIZE set the pixel size of avatars/gravatars (will be 44x44 by default). Avatars are always squares.
1516 * AVATAR_DEFAULT_IMAGE is the default image in public/avatars/
1517 */
1518define('USE_GRAVATAR', true);
1519define('AVATAR_SIZE', 44);
1520define('AVATAR_JPEG_QUALITY', 85);
1521define('AVATAR_DEFAULT_IMAGE', 'default.jpg');
1522
1523/**
1524 * Configuration for: Cookies
1525 * Please note: The COOKIE_DOMAIN needs the domain where your app is,
1526 * in a format like this: .mydomain.com
1527 * Note the . in front of the domain. No www, no http, no slash here!
1528 * For local development .127.0.0.1 is fine, but when deploying you should
1529 * change this to your real domain, like '.mydomain.com' ! The leading dot makes the cookie available for
1530 * sub-domains too.
1531 * @see http://stackoverflow.com/q/9618217/1114320
1532 * @see php.net/manual/en/function.setcookie.php
1533 */
1534// 1209600 seconds = 2 weeks
1535define('COOKIE_RUNTIME', array_table('Configure', false, 'COOKIE_RUNTIME'));
1536// the domain where the cookie is valid for, for local development ".127.0.0.1" and ".localhost" will work
1537// IMPORTANT: always put a dot in front of the domain, like ".mydomain.com" !
1538define('COOKIE_DOMAIN', array_table('Configure', false, 'COOKIE_DOMAIN'));
1539
1540
1541/**
1542 * Interface used for tool live brandswich
1543 */
1544define('INTERFACE_NETWORK', array_table('Configure', false, 'INTERFACE'));
1545
1546
1547/**
1548 * Configuration for: Hashing strength
1549 * This is the place where you define the strength of your password hashing/salting
1550 *
1551 * To make password encryption very safe and future-proof, the PHP 5.5 hashing/salting functions
1552 * come with a clever so called COST FACTOR. This number defines the base-2 logarithm of the rounds of hashing,
1553 * something like 2^12 if your cost factor is 12. By the way, 2^12 would be 4096 rounds of hashing, doubling the
1554 * round with each increase of the cost factor and therefore doubling the CPU power it needs.
1555 * Currently, in 2013, the developers of this functions have chosen a cost factor of 10, which fits most standard
1556 * server setups. When time goes by and server power becomes much more powerful, it might be useful to increase
1557 * the cost factor, to make the password hashing one step more secure. Have a look here
1558 * (@see https://github.com/panique/php-login/wiki/Which-hashing-&-salting-algorithm-should-be-used-%3F)
1559 * in the BLOWFISH benchmark table to get an idea how this factor behaves. For most people this is irrelevant,
1560 * but after some years this might be very very useful to keep the encryption of your database up to date.
1561 *
1562 * Remember: Every time a user registers or tries to log in (!) this calculation will be done.
1563 * Don't change this if you don't know what you do.
1564 *
1565 * To get more information about the best cost factor please have a look here
1566 * @see http://stackoverflow.com/q/4443476/1114320
1567 */
1568// the hash cost factor, PHP's internal default is 10. You can leave this line
1569// commented out until you need another factor then 10.
1570define("HASH_COST_FACTOR", "10");
1571
1572/**
1573 * Configuration for: Email server credentials
1574 *
1575 * Here you can define how you want to send emails.
1576 * If you have successfully set up a mail server on your linux server and you know
1577 * what you do, then you can skip this section. Otherwise please set EMAIL_USE_SMTP to true
1578 * and fill in your SMTP provider account data.
1579 *
1580 * An example setup for using gmail.com [Google Mail] as email sending service,
1581 * works perfectly in August 2013. Change the "xxx" to your needs.
1582 * Please note that there are several issues with gmail, like gmail will block your server
1583 * for "spam" reasons or you'll have a daily sending limit. See the readme.md for more info.
1584 *
1585 * define("PHPMAILER_DEBUG_MODE", 0);
1586 * define("EMAIL_USE_SMTP", true);
1587 * define("EMAIL_SMTP_HOST", 'ssl://smtp.gmail.com');
1588 * define("EMAIL_SMTP_AUTH", true);
1589 * define("EMAIL_SMTP_USERNAME", 'xxxxxxxxxx@gmail.com');
1590 * define("EMAIL_SMTP_PASSWORD", 'xxxxxxxxxxxxxxxxxxxx');
1591 * define("EMAIL_SMTP_PORT", 465);
1592 * define("EMAIL_SMTP_ENCRYPTION", 'ssl');
1593 *
1594 * It's really recommended to use SMTP!
1595 */
1596// Options: 0 = off, 1 = commands, 2 = commands and data, perfect to see SMTP errors, see the PHPMailer manual for more
1597define("PHPMAILER_DEBUG_MODE", 0);
1598// use SMTP or basic mail() ? SMTP is strongly recommended
1599define("EMAIL_USE_SMTP", true);
1600// name of your host
1601define("EMAIL_SMTP_HOST", '');
1602// leave this true until your SMTP can be used without login
1603define("EMAIL_SMTP_AUTH", true);
1604// SMTP provider username
1605define("EMAIL_SMTP_USERNAME", '');
1606// SMTP provider password
1607define("EMAIL_SMTP_PASSWORD", '');
1608// SMTP provider port
1609define("EMAIL_SMTP_PORT", 465);
1610// SMTP encryption, usually SMTP providers use "tls" or "ssl", for details see the PHPMailer manual
1611define("EMAIL_SMTP_ENCRYPTION", 'ssl');
1612
1613/**
1614 * Configuration for: Email content data
1615 *
1616 * php-login uses the PHPMailer library, please have a look here if you want to add more
1617 * config stuff: @see https://github.com/PHPMailer/PHPMailer
1618 *
1619 * As email sending within your project needs some setting, you can do this here:
1620 *
1621 * Absolute URL to password reset action, necessary for email password reset links
1622 * define("EMAIL_PASSWORD_RESET_URL", "http://127.0.0.1/php-login/4-full-mvc-framework/login/passwordReset");
1623 * define("EMAIL_PASSWORD_RESET_FROM_EMAIL", "noreply@example.com");
1624 * define("EMAIL_PASSWORD_RESET_FROM_NAME", "My Project");
1625 * define("EMAIL_PASSWORD_RESET_SUBJECT", "Password reset for PROJECT XY");
1626 * define("EMAIL_PASSWORD_RESET_CONTENT", "Please click on this link to reset your password:");
1627 *
1628 * absolute URL to verification action, necessary for email verification links
1629 * define("EMAIL_VERIFICATION_URL", "http://127.0.0.1/php-login/4-full-mvc-framework/login/verify/");
1630 * define("EMAIL_VERIFICATION_FROM_EMAIL", "noreply@example.com");
1631 * define("EMAIL_VERIFICATION_FROM_NAME", "My Project");
1632 * define("EMAIL_VERIFICATION_SUBJECT", "Account Activation for PROJECT XY");
1633 * define("EMAIL_VERIFICATION_CONTENT", "Please click on this link to activate your account:");
1634 */
1635define("EMAIL_PASSWORD_RESET_URL", URL . "login/verifypasswordreset");
1636define("EMAIL_PASSWORD_RESET_FROM_EMAIL", "no-reply@example.com");
1637define("EMAIL_PASSWORD_RESET_FROM_NAME", "My Project");
1638define("EMAIL_PASSWORD_RESET_SUBJECT", "Password reset for PROJECT XY");
1639define("EMAIL_PASSWORD_RESET_CONTENT", "Please click on this link to reset your password: ");
1640
1641define("EMAIL_VERIFICATION_URL", URL . "login/verify");
1642define("EMAIL_VERIFICATION_FROM_EMAIL", "no-reply@example.com");
1643define("EMAIL_VERIFICATION_FROM_NAME", "My Project");
1644define("EMAIL_VERIFICATION_SUBJECT", "Account activation for PROJECT XY");
1645define("EMAIL_VERIFICATION_CONTENT", "Please click on this link to activate your account: ");
1646
1647/**
1648 * Configuration for: Error messages and notices
1649 *
1650 * In this project, the error messages, notices etc are all-together called "feedback".
1651 */
1652define("FEEDBACK_UNKNOWN_ERROR", "Ocorreu um erro desconhecido!");
1653define("FEEDBACK_PASSWORD_WRONG_3_TIMES", "Você digitou uma senha errada 3 ou mais vezes. Por favor, aguarde 30 segundos para tentar novamente.");
1654define("FEEDBACK_ACCOUNT_NOT_ACTIVATED_YET", "A sua conta ainda não está ativada. Por favor, clique no link de confirmação no e-mail.");
1655define("FEEDBACK_PASSWORD_WRONG", "Senha estava errada.");
1656define("FEEDBACK_USER_DOES_NOT_EXIST", "Este usuário não existe.");
1657// The "login failed"-message is a security improved feedback that doesn't show a potential attacker if the user exists or not
1658define("FEEDBACK_LOGIN_FAILED", "Falha no login.");
1659define("FEEDBACK_USERNAME_FIELD_EMPTY", "Campo Nome de Usuário vazio.");
1660define("FEEDBACK_PASSWORD_FIELD_EMPTY", "Campo Senha estava vazio.");
1661define("FEEDBACK_EMAIL_FIELD_EMPTY", "E-mail e senhas campos estavam vazios.");
1662define("FEEDBACK_EMAIL_AND_PASSWORD_FIELDS_EMPTY", "Email campo estava vazio.");
1663define("FEEDBACK_USERNAME_SAME_AS_OLD_ONE", "Desculpe, esse nome é o mesmo que o seu atual. Por favor, escolha outro.");
1664define("FEEDBACK_USERNAME_ALREADY_TAKEN", "Desculpe, esse nome de usuário já está tomada. Por favor, escolha outro.");
1665define("FEEDBACK_USER_EMAIL_ALREADY_TAKEN", "Desculpe, esse e-mail já está em uso. Por favor, escolha outro.");
1666define("FEEDBACK_USERNAME_CHANGE_SUCCESSFUL", "Seu nome de usuário foi alterado com sucesso.");
1667define("FEEDBACK_USERNAME_AND_PASSWORD_FIELD_EMPTY", "Nome de usuário e senha campos estão vazios.");
1668define("FEEDBACK_USERNAME_DOES_NOT_FIT_PATTERN", "Usuário não se encaixa no esquema username: apenas AZ e números são permitidos, 2-64 caracteres.");
1669define("FEEDBACK_EMAIL_DOES_NOT_FIT_PATTERN", "Desculpe, seu e-mail escolhido não se encaixam no padrão de nomenclatura e-mail.");
1670define("FEEDBACK_EMAIL_SAME_AS_OLD_ONE", "Desculpe, esse endereço de e-mail é o mesmo que o seu atual. Por favor, escolha outro.");
1671define("FEEDBACK_EMAIL_CHANGE_SUCCESSFUL", "O seu endereço de e-mail foi alterado com sucesso.");
1672define("FEEDBACK_CAPTCHA_WRONG", "Os caracteres digitados de segurança captcha estavam errados.");
1673define("FEEDBACK_PASSWORD_REPEAT_WRONG", "Senha e senha repetição não são os mesmos.");
1674define("FEEDBACK_PASSWORD_TOO_SHORT", "Senha tem um comprimento mÃnimo de 6 caracteres.");
1675define("FEEDBACK_USERNAME_TOO_SHORT_OR_TOO_LONG", "Nome de usuário não pode ser menor que 2 ou mais de 64 caracteres.");
1676define("FEEDBACK_EMAIL_TOO_LONG", "E-mail não poderá ser maior que 64 caracteres.");
1677define("FEEDBACK_ACCOUNT_SUCCESSFULLY_CREATED", "Sua conta foi criada com sucesso e nós enviou um e-mail. Por favor, clique no link de verificação dentro desse e-mail.");
1678define("FEEDBACK_VERIFICATION_MAIL_SENDING_FAILED", "Desculpe, mas não poderia enviar-lhe um e-mail de verificação. Sua conta não foi criada.");
1679define("FEEDBACK_ACCOUNT_CREATION_FAILED", "Desculpe, seu registro falhou. Por favor, volte e tente novamente.");
1680define("FEEDBACK_VERIFICATION_MAIL_SENDING_ERROR", "Verificação de e-mail não pôde ser enviado devido a: ");
1681define("FEEDBACK_VERIFICATION_MAIL_SENDING_SUCCESSFUL", "Um e-mail de verificação foi enviada com sucesso.");
1682define("FEEDBACK_ACCOUNT_ACTIVATION_SUCCESSFUL", "A ativação foi bem sucedida! Agora você pode logar");
1683define("FEEDBACK_ACCOUNT_ACTIVATION_FAILED", "Desculpe, nenhuma combinação de código de id / verificação aqui ...");
1684define("FEEDBACK_AVATAR_UPLOAD_SUCCESSFUL", "Avatar foi enviado bem sucedido.");
1685define("FEEDBACK_AVATAR_UPLOAD_WRONG_TYPE", "Apenas arquivos JPEG e PNG são suportados.");
1686define("FEEDBACK_AVATAR_UPLOAD_TOO_SMALL", "Largura / altura do arquivo de origem Avatar é muito pequeno. Precisa ser 100x100 pixels mÃnimo.");
1687define("FEEDBACK_AVATAR_UPLOAD_TOO_BIG", "Arquivo de origem Avatar é muito grande. 5 Megabyte é o máximo.");
1688define("FEEDBACK_AVATAR_FOLDER_DOES_NOT_EXIST_OR_NOT_WRITABLE", "pasta Avatar não existe ou não é gravável. Por favor, altere esta via chmod 775 ou 777.");
1689define("FEEDBACK_AVATAR_IMAGE_UPLOAD_FAILED", "Algo deu errado com o upload da imagem.");
1690define("FEEDBACK_PASSWORD_RESET_TOKEN_FAIL", "Não foi possÃvel gravar token para banco de dados.");
1691define("FEEDBACK_PASSWORD_RESET_TOKEN_MISSING", "Nenhuma senha sinal de reset.");
1692define("FEEDBACK_PASSWORD_RESET_MAIL_SENDING_ERROR", "Redefinição de senha e-mail não pôde ser enviado devido a: ");
1693define("FEEDBACK_PASSWORD_RESET_MAIL_SENDING_SUCCESSFUL", "A redefinição de senha de e-mail foi enviado com sucesso.");
1694define("FEEDBACK_PASSWORD_RESET_LINK_EXPIRED", "Seu link de redefinição expirou. Por favor, use o link de redefinição de dentro de uma hora.");
1695define("FEEDBACK_PASSWORD_RESET_COMBINATION_DOES_NOT_EXIST", "Combinação código Nome de Usuário / Verificação não existe.");
1696define("FEEDBACK_PASSWORD_RESET_LINK_VALID", "Redefinição de senha link de validação é válido. Por favor, altere a senha agora.");
1697define("FEEDBACK_PASSWORD_CHANGE_SUCCESSFUL", "Senha alterada com sucesso.");
1698define("FEEDBACK_PASSWORD_CHANGE_FAILED", "Desculpe, sua mudança de senha falhou.");
1699define("FEEDBACK_ACCOUNT_UPGRADE_SUCCESSFUL", "Conta atualização foi bem sucedida.");
1700define("FEEDBACK_ACCOUNT_UPGRADE_FAILED", "Conta atualização falhou.");
1701define("FEEDBACK_ACCOUNT_DOWNGRADE_SUCCESSFUL", "Conta rebaixamento foi bem sucedida.");
1702define("FEEDBACK_ACCOUNT_DOWNGRADE_FAILED", "Rebaixamento Conta falhou.");
1703define("FEEDBACK_NOTE_CREATION_FAILED", "Nota criação falhou.");
1704define("FEEDBACK_NOTE_EDITING_FAILED", "Edição Nota falhou.");
1705define("FEEDBACK_NOTE_DELETION_FAILED", "Nota exclusão falhou.");
1706define("FEEDBACK_COOKIE_INVALID", "Seu lembrar-me-cookie é inválido.");
1707define("FEEDBACK_COOKIE_LOGIN_SUCCESSFUL", "Você foi registrado com sucesso em via a lembrar-me-cookie.");
1708define("FEEDBACK_FACEBOOK_LOGIN_NOT_REGISTERED", "Desculpe, você não tem uma conta aqui. Por favor, registre-se primeiro.");
1709define("FEEDBACK_FACEBOOK_EMAIL_NEEDED", "Desculpe, mas você precisa nos permitem ver o seu endereço de e-mail para se cadastrar.");
1710define("FEEDBACK_FACEBOOK_UID_ALREADY_EXISTS", "Desculpe, mas você já se registrou aqui (seu Facebook ID existe em nosso banco de dados).");
1711define("FEEDBACK_FACEBOOK_EMAIL_ALREADY_EXISTS", "Desculpe, mas você já se registrou aqui (seu e-mail Facebook existe em nosso banco de dados).");
1712define("FEEDBACK_FACEBOOK_USERNAME_ALREADY_EXISTS", "Desculpe, mas você já se registrou aqui (seu nome de usuário do Facebook existe em nosso banco de dados).");
1713define("FEEDBACK_FACEBOOK_REGISTER_SUCCESSFUL", "Você foi registrado com êxito com o Facebook.");
1714define("FEEDBACK_FACEBOOK_OFFLINE", "Nós não poderia alcançar os servidores do Facebook. Talvez Facebook está offline (que realmente acontece às vezes).");
1715
1716
1717// Português Brasileiro Paginação
1718define('PAGINATION_TEXT_DB_NAME', 'Não foi possível conectar ao banco de dados: ');
1719define('PAGINATION_TEXT_ERRO_QUERY', 'Erro: Tipo de consulta: ');
1720define('PAGINATION_TEXT_ERRO_TYPE_QUERY', 'Erro na consulta: ');
1721define('PAGINATION_TEXT_BEFORE', 'Anterior');
1722define('PAGINATION_TEXT_AFTER', 'Próximo');
1723
1724// Settings Web Site
1725
1726
1727/**
1728 * URL logo web site
1729 */
1730define('WEB_SITE_LOGO', array_table('Configure', false, 'LOGO'));
1731
1732/**
1733 * Favicon of site
1734 * use false for disable
1735 */
1736define('WEB_SITE_CEO_FAVOICON', array_table('Configure', false, 'FAVOICON'));
1737
1738
1739/**
1740 * keywords site
1741 * use , for separate the words
1742 */
1743define('WEB_SITE_CEO_NAME', array_table('Configure', false, 'NAME'));
1744
1745
1746/**
1747 * System Debug
1748 * if it is as false when there is an error interrupts the task if true shows the error as Exception
1749 */
1750define('SYSTEM_DEBUG', $_SYSTEM_DEBUG);
1751
1752
1753
1754/**
1755 * Sustem preview mode
1756 * if this application are using a host, the database values autofill for graphs
1757 * @Boolean
1758 */
1759define('SYSTEM_PREVIEW_MODE', false);
1760
1761/**
1762 * Mail configuration
1763 */
1764define('MAIL_AUTH', array_table('ConfigureMail', false, 'AUTH'));
1765define('MAIL_SMTP', array_table('ConfigureMail', false, 'SMTP'));
1766define('MAIL_SMTP_SECURE', array_table('ConfigureMail', false, 'SMTP_SECURE'));
1767define('MAIL_USER', array_table('ConfigureMail', false, 'USER'));
1768define('MAIL_PASS', array_table('ConfigureMail', false, 'PASS'));
1769define('MAIL_PORT', array_table('ConfigureMail', false, 'PORT'));
1770define('MAIL_CC', array_table('ConfigureMail', false, 'CC'));
1771define('MAIL_BCC', array_table('ConfigureMail', false, 'BCC'));
1772define('MAIL_HTML', array_table('ConfigureMail', false, 'HTML'));
1773define('MAIL_BUTTON_SIGNATURE', array_table('ConfigureMail', false, 'BUTTON_SIGNATURE'));
1774define('MAIL_TOP_SIGNATURE', array_table('ConfigureMail', false, 'TOP_SIGNATURE'));
1775
1776EOFPAGE;
1777 }
1778
1779 /**
1780 * Convert Special Char
1781 * @param string $string
1782 * @return string
1783 */
1784 private function RevertHTML($string) {
1785 foreach ($this->Rules as $k => $v) {
1786 $string = str_replace($k, $v, $string);
1787 }
1788 return $string;
1789 }
1790
1791 /**
1792 * Create an HTML for step 1
1793 * @access protected
1794 * @return HTML
1795 */
1796 protected function HTMLStep1() {
1797 $html = new DOMDocument();
1798 $html->loadHTMLFile("Pages/step1.xml");
1799 $html->preserveWhiteSpace = false;
1800 $html->formatOutput = true;
1801
1802 $html->getElementById('logo')->nodeValue = sprintf(LOGO, $this->logo, $this->link, $this->name);
1803 $html->getElementsByTagName('title')->item(0)->nodeValue = sprintf(STEP1_TITLETAG, $this->name);
1804 $html->getElementById('title')->nodeValue = sprintf(STEP1_TITLE, $this->name);
1805 $html->getElementById('LIST1')->nodeValue = STEP1_LIST1;
1806 $html->getElementById('LIST2')->nodeValue = STEP1_LIST2;
1807 $html->getElementById('LIST3')->nodeValue = STEP1_LIST3;
1808 $html->getElementById('LIST4')->nodeValue = STEP1_LIST4;
1809 $html->getElementById('txt1')->nodeValue = sprintf(STEP1_TEXT1, $this->file, $this->file, $this->file);
1810 $html->getElementById('txt2')->nodeValue = STEP1_TEXT2;
1811 $html->getElementById('step_1_buttom')->nodeValue = STEP1_BUTTOM;
1812
1813 return $this->RevertHTML($html->saveHTML());
1814 }
1815
1816 /**
1817 * Make timezone
1818 * @return String
1819 */
1820 private function MakeTZ() {
1821 $zones = timezone_identifiers_list();
1822 $locales = array(
1823 'Africa',
1824 'America',
1825 'Antarctica',
1826 'Arctic',
1827 'Asia',
1828 'Atlantic',
1829 'Australia',
1830 'Europe',
1831 'Indian',
1832 'Pacific',
1833 );
1834
1835 foreach ($zones as $zone) {
1836 $zone = explode('/', $zone); // 0 => Continent, 1 => City
1837 // Only use "friendly" continent names
1838 if ($zone[0] == 'Africa' || $zone[0] == 'America' || $zone[0] == 'Antarctica' || $zone[0] == 'Arctic' || $zone[0] == 'Asia' || $zone[0] == 'Atlantic' || $zone[0] == 'Australia' || $zone[0] == 'Europe' || $zone[0] == 'Indian' || $zone[0] == 'Pacific') {
1839 if (isset($zone[1]) != '') {
1840 $locations[$zone[0]][$zone[0] . '/' . $zone[1]] = str_replace('_', ' ', $zone[1]); // Creates array(DateTimeZone => 'Friendly name')
1841 }
1842 }
1843 }
1844
1845 $result = '<select id="e1" class="populate" style="width: 100%" name="timezone">';
1846 foreach ($locales as $v) {
1847 $result.= '<optgroup label="' . $v . '">';
1848 foreach ($locations[$v] as $value) {
1849 $result.= '<option value="' . $v . '/' . str_replace(" ", "_", $value) . '">' . $v . '/' . $value . '</option>';
1850 }
1851 $result.= '</optgroup>';
1852 }
1853 $result.= '</select>';
1854 return $result;
1855 }
1856
1857 /**
1858 * Create an HTML for step 2
1859 * @access protected
1860 * @return HTML
1861 */
1862 protected function HTMLStep2() {
1863 $html = new DOMDocument();
1864 $html->loadHTMLFile("Pages/step2.xml");
1865 $html->preserveWhiteSpace = false;
1866 $html->formatOutput = true;
1867 $html->getElementById('logo')->nodeValue = sprintf(LOGO, $this->logo, $this->link, $this->name);
1868 $html->getElementsByTagName('title')->item(0)->nodeValue = sprintf(STEP1_TITLETAG, $this->name);
1869
1870 $html->getElementById('STEP2_TEXT1')->nodeValue = STEP2_TEXT1;
1871
1872 $html->getElementById('LIST1')->nodeValue = STEP2_LIST1;
1873 $html->getElementById('DLIST1')->nodeValue = sprintf(STEP2_DLIST1, $this->name);
1874
1875 $html->getElementById('LIST2')->nodeValue = STEP2_LIST2;
1876 $html->getElementById('DLIST2')->nodeValue = STEP2_DLIST2;
1877
1878 $html->getElementById('LIST3')->nodeValue = STEP2_LIST3;
1879 $html->getElementById('DLIST3')->nodeValue = STEP2_DLIST3;
1880
1881 $html->getElementById('LIST3')->nodeValue = STEP2_LIST3;
1882 $html->getElementById('DLIST3')->nodeValue = STEP2_DLIST3;
1883
1884 $html->getElementById('LIST4')->nodeValue = STEP2_LIST4;
1885 $html->getElementById('DLIST4')->nodeValue = STEP2_DLIST4;
1886
1887
1888 $html->getElementById('field5')->nodeValue = $this->MakeTZ();
1889
1890 $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
1891 $url = str_replace("application/_installation/setup-config.php?step=1", "", $actual_link);
1892
1893
1894 $u = $html->getElementById('url');
1895
1896 $u->setAttribute('value', $url);
1897
1898
1899
1900
1901 $input = $html->getElementById('send');
1902 $input->removeAttribute('value');
1903 $input->setAttribute('value', STEP2_BUTTOM);
1904
1905
1906
1907 return $this->RevertHTML($html->saveHTML());
1908 }
1909
1910 /**
1911 * Create an HTML when it is not possible to connect to the database
1912 * @access protected
1913 * @return type
1914 */
1915 protected function HTMLErroConnection() {
1916 $html = new DOMDocument();
1917 @$html->loadHTMLFile("Pages/ErroConnection.xml");
1918 $html->preserveWhiteSpace = false;
1919 $html->formatOutput = true;
1920
1921 $html->getElementsByTagName('title')->item(0)->nodeValue = sprintf(STEP1_TITLETAG, $this->name);
1922
1923 $html->getElementById('TEXT1')->nodeValue = ERRO_CONNETION_TEXT1;
1924 $html->getElementById('TEXT2')->nodeValue = ERRO_CONNETION_TEXT2;
1925 $html->getElementById('TEXT3')->nodeValue = ERRO_CONNETION_TEXT3;
1926 $html->getElementById('TEXT4')->nodeValue = ERRO_CONNETION_TEXT4;
1927 $html->getElementById('TEXT5')->nodeValue = ERRO_CONNETION_TEXT5;
1928 $html->getElementById('TEXT6')->nodeValue = ERRO_CONNETION_TEXT6;
1929 $html->getElementById('buttom')->nodeValue = ERRO_CONNETION_BUTTOM;
1930
1931 return $this->RevertHTML($html->saveHTML());
1932 }
1933
1934 /**
1935 * create an HTML when the file was created successfully
1936 * @access protected
1937 * @return HTML
1938 */
1939 protected function HTMLSucessCreatedFileConfig() {
1940 $html = new DOMDocument();
1941 $html->loadHTMLFile("Pages/SucessCreated.xml");
1942 $html->preserveWhiteSpace = false;
1943 $html->formatOutput = true;
1944
1945 $html->getElementById('logo')->nodeValue = sprintf(LOGO, $this->logo, $this->link, $this->name);
1946 $html->getElementsByTagName('title')->item(0)->nodeValue = sprintf(STEP1_TITLETAG, $this->name);
1947
1948 $html->getElementById('text')->nodeValue = sprintf(SUCCESS_TEXT, $this->name);
1949
1950 $html->getElementById('buttom')->nodeValue = SUCCESS_BUTTOM;
1951
1952 return $this->RevertHTML($html->saveHTML());
1953 }
1954
1955 /**
1956 * create an HTML when some error occurs
1957 * @access protected
1958 * @return HTML
1959 */
1960 protected function HTMLErroUnknow() {
1961 $html = new DOMDocument();
1962 $html->loadHTMLFile("Pages/ErroUnknow.xml");
1963 $html->preserveWhiteSpace = false;
1964 $html->formatOutput = true;
1965
1966 $html->getElementById('logo')->nodeValue = sprintf(LOGO, $this->logo, $this->link, $this->name);
1967 $html->getElementsByTagName('title')->item(0)->nodeValue = sprintf(STEP1_TITLETAG, $this->name);
1968
1969 $html->getElementById('ERROUNKNOW_TEXT1')->nodeValue = sprintf(ERROUNKNOW_TEXT1, $this->file);
1970 $html->getElementById('ERROUNKNOW_TEXT2')->nodeValue = sprintf(ERROUNKNOW_TEXT2, $this->file);
1971 $html->getElementById('ERROUNKNOW_TEXT3')->nodeValue = ERROUNKNOW_TEXT3;
1972
1973 $html->getElementById('wp-config')->nodeValue = $this->FileGenerate($_POST);
1974
1975 $html->getElementById('buttom')->nodeValue = SUCCESS_BUTTOM;
1976
1977 return $this->RevertHTML($html->saveHTML());
1978 }
1979
1980}