@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | class ConsultaController extends AppController { |
4 | 4 | |
5 | - public function listar_cadastros(){ |
|
5 | + public function listar_cadastros() { |
|
6 | 6 | $this->loadModel('Consulta'); |
7 | 7 | $consultas = $this->Consulta->find('all', |
8 | 8 | array('conditions' => |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | $id = $this->request->data('id'); |
22 | 22 | $this->loadModel('Consulta'); |
23 | 23 | |
24 | - $dados = array ('ativo' => '0'); |
|
25 | - $parametros = array ('id' => $id); |
|
24 | + $dados = array('ativo' => '0'); |
|
25 | + $parametros = array('id' => $id); |
|
26 | 26 | |
27 | - if ($this->Consulta->updateAll($dados,$parametros)) { |
|
27 | + if ($this->Consulta->updateAll($dados, $parametros)) { |
|
28 | 28 | echo json_encode(true); |
29 | 29 | } else { |
30 | 30 | echo json_encode(false); |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | |
32 | 32 | if ($this->Cupom->save($dados)) { |
33 | 33 | $this->Session->setFlash('Cupom criado com sucesso!'); |
34 | - return $this->redirect('/cupom/listar_cadastros'); |
|
34 | + return $this->redirect('/cupom/listar_cadastros'); |
|
35 | 35 | } else { |
36 | 36 | $this->Session->setFlash('Ocorreu algum erro ao criar o cupom!'); |
37 | - return $this->redirect('/cupom/listar_cadastros'); |
|
37 | + return $this->redirect('/cupom/listar_cadastros'); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | |
63 | 63 | if ($this->Cupom->save($dados)) { |
64 | 64 | $this->Session->setFlash('Cupom editado com sucesso!'); |
65 | - return $this->redirect('/cupom/listar_cadastros'); |
|
65 | + return $this->redirect('/cupom/listar_cadastros'); |
|
66 | 66 | } else { |
67 | 67 | $this->Session->setFlash('Ocorreu algum erro ao editar o cupom!'); |
68 | - return $this->redirect('/cupom/listar_cadastros'); |
|
68 | + return $this->redirect('/cupom/listar_cadastros'); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -77,19 +77,19 @@ discard block |
||
77 | 77 | |
78 | 78 | if ($this->Cupom->save($dados)) { |
79 | 79 | $this->Session->setFlash('Cupom excluido com sucesso!'); |
80 | - return $this->redirect('/cupom/listar_cadastros'); |
|
80 | + return $this->redirect('/cupom/listar_cadastros'); |
|
81 | 81 | } else { |
82 | 82 | $this->Session->setFlash('Ocorreu algum erro ao excluir o cupom!'); |
83 | - return $this->redirect('/cupom/listar_cadastros'); |
|
83 | + return $this->redirect('/cupom/listar_cadastros'); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | 87 | |
88 | 88 | /** |
89 | - * @param nome cupom |
|
90 | - * @param usuario id |
|
91 | - * @return false ou o array com os dados do cupom |
|
92 | - **/ |
|
89 | + * @param nome cupom |
|
90 | + * @param usuario id |
|
91 | + * @return false ou o array com os dados do cupom |
|
92 | + **/ |
|
93 | 93 | public function procurar_cupom($nome_cupom, $usuario_id) |
94 | 94 | { |
95 | 95 | if (empty($nome_cupom) && !isset($nome_cupom)) |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
119 | - * @param valor original float |
|
120 | - * @return float com o valor final ja considerando o valor do cupom |
|
121 | - **/ |
|
119 | + * @param valor original float |
|
120 | + * @return float com o valor final ja considerando o valor do cupom |
|
121 | + **/ |
|
122 | 122 | public function calcular_desconto_cupom($valor_original, $valor_desconto_cupom, $tipo_cupom) |
123 | 123 | { |
124 | 124 | if (empty($valor_original) && !isset($valor_original)) |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
143 | - * @param $cupom String nome do cupom a ser utilizado |
|
144 | - * @param $valor float com o valor original da venda |
|
145 | - * @return $novo_valor float com o novo valor da venda |
|
146 | - **/ |
|
143 | + * @param $cupom String nome do cupom a ser utilizado |
|
144 | + * @param $valor float com o valor original da venda |
|
145 | + * @return $novo_valor float com o novo valor da venda |
|
146 | + **/ |
|
147 | 147 | public function utilizar_cupom($cupom, $valor_original, $usuario_id) |
148 | 148 | { |
149 | 149 | if (empty($cupom) && !isset($cupom)) |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | **/ |
93 | 93 | public function procurar_cupom($nome_cupom, $usuario_id) |
94 | 94 | { |
95 | - if (empty($nome_cupom) && !isset($nome_cupom)) |
|
95 | + if (empty($nome_cupom) && ! isset($nome_cupom)) |
|
96 | 96 | { |
97 | 97 | return false; |
98 | 98 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | **/ |
122 | 122 | public function calcular_desconto_cupom($valor_original, $valor_desconto_cupom, $tipo_cupom) |
123 | 123 | { |
124 | - if (empty($valor_original) && !isset($valor_original)) |
|
124 | + if (empty($valor_original) && ! isset($valor_original)) |
|
125 | 125 | { |
126 | 126 | return false; |
127 | 127 | } |
@@ -146,14 +146,14 @@ discard block |
||
146 | 146 | **/ |
147 | 147 | public function utilizar_cupom($cupom, $valor_original, $usuario_id) |
148 | 148 | { |
149 | - if (empty($cupom) && !isset($cupom)) |
|
149 | + if (empty($cupom) && ! isset($cupom)) |
|
150 | 150 | { |
151 | 151 | return false; |
152 | 152 | } |
153 | 153 | |
154 | 154 | $cupom = $this->procurar_cupom($cupom, $usuario_id); |
155 | 155 | |
156 | - if (!$cupom) |
|
156 | + if ( ! $cupom) |
|
157 | 157 | { |
158 | 158 | return false; |
159 | 159 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class DashboardController extends AppController{ |
|
3 | +class DashboardController extends AppController { |
|
4 | 4 | |
5 | 5 | function home() { |
6 | 6 | $pagamento = $this->verificar_pagamento(); |
@@ -5,46 +5,46 @@ |
||
5 | 5 | public function __construct(); |
6 | 6 | |
7 | 7 | /** |
8 | - * @return void |
|
9 | - * @param String $token |
|
10 | - **/ |
|
8 | + * @return void |
|
9 | + * @param String $token |
|
10 | + **/ |
|
11 | 11 | public function setToken($token); |
12 | 12 | |
13 | 13 | /** |
14 | - * @return void |
|
15 | - * @param String $email |
|
16 | - **/ |
|
14 | + * @return void |
|
15 | + * @param String $email |
|
16 | + **/ |
|
17 | 17 | public function setEmail($email); |
18 | 18 | |
19 | 19 | /** |
20 | - * @return String $token |
|
21 | - **/ |
|
20 | + * @return String $token |
|
21 | + **/ |
|
22 | 22 | public function getToken(); |
23 | 23 | |
24 | 24 | /** |
25 | - * @return String $email |
|
26 | - **/ |
|
25 | + * @return String $email |
|
26 | + **/ |
|
27 | 27 | public function getEmail(); |
28 | 28 | |
29 | 29 | /** |
30 | - * @return void |
|
31 | - * @param Array $produtos |
|
32 | - **/ |
|
30 | + * @return void |
|
31 | + * @param Array $produtos |
|
32 | + **/ |
|
33 | 33 | public function setProdutos($produtos); |
34 | 34 | |
35 | 35 | /** |
36 | - * @return Array $produto |
|
37 | - **/ |
|
36 | + * @return Array $produto |
|
37 | + **/ |
|
38 | 38 | public function getProdutos(); |
39 | 39 | |
40 | 40 | /** |
41 | - * @param Array Produtos a serem adicionados |
|
42 | - **/ |
|
41 | + * @param Array Produtos a serem adicionados |
|
42 | + **/ |
|
43 | 43 | public function adicionarProdutosGateway(); |
44 | 44 | |
45 | 45 | /** |
46 | - * @param Array Andress/Endeço do cliente |
|
47 | - **/ |
|
46 | + * @param Array Andress/Endeço do cliente |
|
47 | + **/ |
|
48 | 48 | public function setEnderecoClienteGateway(); |
49 | 49 | |
50 | 50 | public function setCliente($cliente); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -interface GatewayInterface{ |
|
3 | +interface GatewayInterface { |
|
4 | 4 | |
5 | 5 | public function __construct(); |
6 | 6 |
@@ -30,10 +30,10 @@ |
||
30 | 30 | |
31 | 31 | if ($this->Hieraquia->save($dados)) { |
32 | 32 | $this->Session->setFlash('Hieraquia salva com sucesso!'); |
33 | - return $this->redirect('/hieraquia/listar_cadastros'); |
|
33 | + return $this->redirect('/hieraquia/listar_cadastros'); |
|
34 | 34 | } else { |
35 | 35 | $this->Session->setFlash('Ocorreu um erro ao salva o produto!'); |
36 | - return $this->redirect('/hieraquia/listar_cadastros'); |
|
36 | + return $this->redirect('/hieraquia/listar_cadastros'); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | empty($dados['message']) || |
26 | 26 | !filter_var($dados['email'],FILTER_VALIDATE_EMAIL)){ |
27 | 27 | $this->Session->setFlash('Você deve preencher todos os dados!'); |
28 | - return $this->redirect('/'); |
|
28 | + return $this->redirect('/'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | $name = $dados['name']; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | mail($to,$email_subject,$email_body,$headers); |
49 | 49 | |
50 | 50 | $this->Session->setFlash('Seu e-mail foi enviado com sucesso em breve responderemos!'); |
51 | - return $this->redirect('/'); |
|
51 | + return $this->redirect('/'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function sendmail() { |
@@ -1,28 +1,28 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class HomeController extends AppController{ |
|
3 | +class HomeController extends AppController { |
|
4 | 4 | |
5 | - public function beforeFilter(){ |
|
5 | + public function beforeFilter() { |
|
6 | 6 | return true; |
7 | 7 | } |
8 | 8 | |
9 | - function index(){ |
|
9 | + function index() { |
|
10 | 10 | $this->layout = 'winners'; |
11 | 11 | } |
12 | 12 | |
13 | - function servicos(){ |
|
13 | + function servicos() { |
|
14 | 14 | $this->layout = 'winners'; |
15 | 15 | } |
16 | 16 | |
17 | - function contact(){ |
|
17 | + function contact() { |
|
18 | 18 | $this->layout = 'winners'; |
19 | 19 | } |
20 | 20 | |
21 | - function timeline(){ |
|
21 | + function timeline() { |
|
22 | 22 | $this->layout = 'winners'; |
23 | 23 | } |
24 | 24 | |
25 | - function developers(){ |
|
25 | + function developers() { |
|
26 | 26 | $this->layout = 'winners'; |
27 | 27 | } |
28 | 28 | |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | $dados = $this->request->data('dados'); |
37 | 37 | |
38 | 38 | // Check for empty fields |
39 | - if(empty($dados['name']) || |
|
40 | - empty($dados['email']) || |
|
41 | - empty($dados['message']) || |
|
42 | - !filter_var($dados['email'], FILTER_VALIDATE_EMAIL)) { |
|
39 | + if (empty($dados['name']) || |
|
40 | + empty($dados['email']) || |
|
41 | + empty($dados['message']) || |
|
42 | + ! filter_var($dados['email'], FILTER_VALIDATE_EMAIL)) { |
|
43 | 43 | $this->Session->setFlash('Você deve preencher todos os dados!'); |
44 | 44 | return $this->redirect('/'); |
45 | 45 | } |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | $email_body = "Mensagem site: ".$message; |
55 | 55 | $headers = "From: [email protected]\n"; // This is the email address the generated message will be from. We recommend using something like [email protected]. |
56 | 56 | $headers .= "Reply-To: $email_address"; |
57 | - mail($to,$email_subject,$email_body,$headers); |
|
57 | + mail($to, $email_subject, $email_body, $headers); |
|
58 | 58 | //resposta automatica ao cliente |
59 | 59 | $to = $email_address; |
60 | 60 | $email_subject = '[email protected]'; |
61 | 61 | $email_body = "A sua mensagem foi recebida, em breve responderemos"; |
62 | 62 | $headers = "From: [email protected]\n"; // This is the email address the generated message will be from. We recommend using something like [email protected]. |
63 | 63 | $headers .= "Reply-To: $email_address"; |
64 | - mail($to,$email_subject,$email_body,$headers); |
|
64 | + mail($to, $email_subject, $email_body, $headers); |
|
65 | 65 | |
66 | 66 | $this->Session->setFlash('Seu e-mail foi enviado com sucesso em breve responderemos!'); |
67 | 67 | return $this->redirect('/'); |
@@ -6,7 +6,7 @@ |
||
6 | 6 | $lancamento['venda_id'] = $id_venda; |
7 | 7 | $lancamento['valor_pago'] = $valor_total; |
8 | 8 | $lancamento['data_pgt'] = date('Y-m-d'); |
9 | - $lancamento['ativo'] = 1; |
|
9 | + $lancamento['ativo'] = 1; |
|
10 | 10 | $lancamento['usuario_id'] = $this->instancia; |
11 | 11 | |
12 | 12 | $this->LancamentoVenda->save($lancamento); |
@@ -26,10 +26,10 @@ |
||
26 | 26 | |
27 | 27 | if ($this->Newsletter->save($dados)) { |
28 | 28 | $this->Session->setFlash('Cadastro de newsletter excluido com sucesso!'); |
29 | - return $this->redirect('/newsletter/listar_cadastros'); |
|
29 | + return $this->redirect('/newsletter/listar_cadastros'); |
|
30 | 30 | } else { |
31 | 31 | $this->Session->setFlash('Ocorreu algum erro ao excluir o cadastro de newsletter!'); |
32 | - return $this->redirect('/newsletter/listar_cadastros'); |
|
32 | + return $this->redirect('/newsletter/listar_cadastros'); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | if ($_FILES['nota']['type'] != "text/xml") { |
20 | 20 | $this->Session->setFlash('O arquivo deve ser do tipo xml! ', 'default'); |
21 | - return $this->redirect('/nfe/gerar_danfe'); |
|
21 | + return $this->redirect('/nfe/gerar_danfe'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | $arq = $_FILES["nota"]["tmp_name"]; |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | debug($nfe->autoriza($sNFe, $lote, $aResp)); |
53 | 53 | //enviar o lote |
54 | 54 | if ($resp = $nfe->autoriza($sNFe, $lote, $aResp)) { |
55 | - if ($aResp['bStat']) { |
|
56 | - echo "Numero do Recibo : " . $aResp['nRec'] .", use este numero para obter o protocolo ou informações de erro no xml com testaRecibo.php."; |
|
57 | - } else { |
|
58 | - echo "Houve erro !! $nfe->errMsg"; |
|
59 | - } |
|
55 | + if ($aResp['bStat']) { |
|
56 | + echo "Numero do Recibo : " . $aResp['nRec'] .", use este numero para obter o protocolo ou informações de erro no xml com testaRecibo.php."; |
|
57 | + } else { |
|
58 | + echo "Houve erro !! $nfe->errMsg"; |
|
59 | + } |
|
60 | 60 | } else { |
61 | - echo "houve erro !! $nfe->errMsg"; |
|
61 | + echo "houve erro !! $nfe->errMsg"; |
|
62 | 62 | } |
63 | 63 | debug($nfe); |
64 | 64 | echo '<BR><BR><h1>DEBUG DA COMUNICAÇÕO SOAP</h1><BR><BR>'; |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | class NfeController extends AppController { |
4 | 4 | |
5 | - public function beforeFilter(){ |
|
5 | + public function beforeFilter() { |
|
6 | 6 | return true; |
7 | 7 | } |
8 | 8 | |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | |
24 | 24 | $arq = $_FILES["nota"]["tmp_name"]; |
25 | 25 | |
26 | - if ( is_file($arq) ){ |
|
26 | + if (is_file($arq)) { |
|
27 | 27 | $docxml = file_get_contents($arq); |
28 | - $danfe = new DanfeNFePHP($docxml, 'P', 'A4','../images/logo.jpg','I',''); |
|
28 | + $danfe = new DanfeNFePHP($docxml, 'P', 'A4', '../images/logo.jpg', 'I', ''); |
|
29 | 29 | $id = $danfe->montaDANFE(); |
30 | - $imprime_danfe = $danfe->printDANFE($id . '.pdf','I'); |
|
30 | + $imprime_danfe = $danfe->printDANFE($id.'.pdf', 'I'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | unlink($arq); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | //use isso, este é o modo manual voce tem mais controle sobre o que acontece |
45 | 45 | $filename = 'nfephp/exemplos/xml/11101284613439000180550010000004881093997017-nfe.xml'; |
46 | 46 | //obter um numero de lote |
47 | - $lote = substr(str_replace(',', '', number_format(microtime(true)*1000000, 0)), 0, 15); |
|
47 | + $lote = substr(str_replace(',', '', number_format(microtime(true) * 1000000, 0)), 0, 15); |
|
48 | 48 | // montar o array com a NFe |
49 | 49 | $sNFe = file_get_contents($filename); |
50 | 50 | //array vazio passado como referencia |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | //enviar o lote |
54 | 54 | if ($resp = $nfe->autoriza($sNFe, $lote, $aResp)) { |
55 | 55 | if ($aResp['bStat']) { |
56 | - echo "Numero do Recibo : " . $aResp['nRec'] .", use este numero para obter o protocolo ou informações de erro no xml com testaRecibo.php."; |
|
56 | + echo "Numero do Recibo : ".$aResp['nRec'].", use este numero para obter o protocolo ou informações de erro no xml com testaRecibo.php."; |
|
57 | 57 | } else { |
58 | 58 | echo "Houve erro !! $nfe->errMsg"; |
59 | 59 | } |