@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | $this->EnderecoClienteCadastro->save($endereco); |
35 | 35 | |
36 | 36 | $this->Session->setFlash('Cliente salvo com sucesso!'); |
37 | - return $this->redirect('/cliente/listar_cadastros'); |
|
37 | + return $this->redirect('/cliente/listar_cadastros'); |
|
38 | 38 | } else { |
39 | 39 | $this->Session->setFlash('Ocorreu um erro ao salva o cliente!'); |
40 | - return $this->redirect('/cliente/listar_cadastros'); |
|
40 | + return $this->redirect('/cliente/listar_cadastros'); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -89,16 +89,16 @@ discard block |
||
89 | 89 | |
90 | 90 | if ($this->Cliente->save($dados)) { |
91 | 91 | $this->Session->setFlash('Cliente editado com sucesso!'); |
92 | - return $this->redirect('/cliente/listar_cadastros'); |
|
92 | + return $this->redirect('/cliente/listar_cadastros'); |
|
93 | 93 | } else { |
94 | 94 | $this->Session->setFlash('Ocorreu um erro ao editar o cliente!'); |
95 | - return $this->redirect('/cliente/listar_cadastros'); |
|
95 | + return $this->redirect('/cliente/listar_cadastros'); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
99 | 99 | function exportar_clientes() { |
100 | - $this->layout = 'ajax'; |
|
101 | - $this->set('event', $this->Cliente->find('all')); |
|
100 | + $this->layout = 'ajax'; |
|
101 | + $this->set('event', $this->Cliente->find('all')); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | function listar_pedidos($id) { |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | |
12 | 12 | $query = array ( |
13 | 13 | 'joins' => array( |
14 | - array( |
|
15 | - 'table' => 'produtos', |
|
16 | - 'alias' => 'Produto', |
|
17 | - 'type' => 'LEFT', |
|
18 | - 'conditions' => array( |
|
19 | - 'AviseMe.produto_id = Produto.id', |
|
20 | - ), |
|
21 | - ) |
|
14 | + array( |
|
15 | + 'table' => 'produtos', |
|
16 | + 'alias' => 'Produto', |
|
17 | + 'type' => 'LEFT', |
|
18 | + 'conditions' => array( |
|
19 | + 'AviseMe.produto_id = Produto.id', |
|
20 | + ), |
|
21 | + ) |
|
22 | 22 | ), |
23 | - 'conditions' => array('AviseMe.ativo' => 1, 'AviseMe.usuario_id' => $this->instancia), |
|
24 | - 'fields' => array('Produto.nome, AviseMe.email, AviseMe.id, Produto.id'), |
|
23 | + 'conditions' => array('AviseMe.ativo' => 1, 'AviseMe.usuario_id' => $this->instancia), |
|
24 | + 'fields' => array('Produto.nome, AviseMe.email, AviseMe.id, Produto.id'), |
|
25 | 25 | ); |
26 | 26 | |
27 | 27 | $cadastros = $this->AviseMe->find('all', $query); |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * @return boolean |
|
52 | - * Cadastra as informações |
|
53 | - **/ |
|
51 | + * @return boolean |
|
52 | + * Cadastra as informações |
|
53 | + **/ |
|
54 | 54 | public function cadastrar_avise_me() |
55 | 55 | { |
56 | 56 | try |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | { |
10 | 10 | $this->loadModel('AviseMe'); |
11 | 11 | |
12 | - $query = array ( |
|
12 | + $query = array( |
|
13 | 13 | 'joins' => array( |
14 | 14 | array( |
15 | 15 | 'table' => 'produtos', |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | |
38 | 38 | $id = $this->request->data('id'); |
39 | 39 | |
40 | - $dados = array ('ativo' => '0'); |
|
41 | - $parametros = array ('id' => $id); |
|
40 | + $dados = array('ativo' => '0'); |
|
41 | + $parametros = array('id' => $id); |
|
42 | 42 | |
43 | 43 | if ($this->AviseMe->updateAll($dados, $parametros)) { |
44 | 44 | echo json_encode(true); |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | |
60 | 60 | $this->AviseMe->set($this->request->data); |
61 | 61 | |
62 | - if (!$this->AviseMe->validates()) |
|
62 | + if ( ! $this->AviseMe->validates()) |
|
63 | 63 | { |
64 | 64 | return $this->AviseMe->validationErrors; |
65 | 65 | } |
66 | 66 | |
67 | - if (!$this->AviseMe->save($this->request->data)) |
|
67 | + if ( ! $this->AviseMe->save($this->request->data)) |
|
68 | 68 | { |
69 | 69 | return false; |
70 | 70 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ->subject('Produto Aviso'); |
100 | 100 | |
101 | 101 | $mensagem = ' |
102 | - <p><strong>Nome</strong>: '. $produto[0]['Produto']['nome'] .'</p> |
|
102 | + <p><strong>Nome</strong>: '. $produto[0]['Produto']['nome'].'</p> |
|
103 | 103 | '; |
104 | 104 | |
105 | 105 | if ($email->send($mensagem)) { |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | |
19 | 19 | public function cancelar($id_venda, $id_cliente) { |
20 | 20 | $response = $this->LancamentoVenda->find('first', array( |
21 | - 'conditions' => array( |
|
22 | - 'LancamentoVenda.venda_id' => $id_venda |
|
23 | - ) |
|
24 | - ) |
|
25 | - ); |
|
21 | + 'conditions' => array( |
|
22 | + 'LancamentoVenda.venda_id' => $id_venda |
|
23 | + ) |
|
24 | + ) |
|
25 | + ); |
|
26 | 26 | |
27 | 27 | $this->LancamentoVenda->id = $response['LancamentoVenda']['id']; |
28 | 28 | |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | |
42 | 42 | public function aprovar($id_venda, $id_cliente) { |
43 | 43 | $response = $this->LancamentoVenda->find('first', array( |
44 | - 'conditions' => array( |
|
45 | - 'LancamentoVenda.venda_id' => $id_venda |
|
46 | - ) |
|
47 | - ) |
|
48 | - ); |
|
44 | + 'conditions' => array( |
|
45 | + 'LancamentoVenda.venda_id' => $id_venda |
|
46 | + ) |
|
47 | + ) |
|
48 | + ); |
|
49 | 49 | |
50 | 50 | $this->LancamentoVenda->id = $response['LancamentoVenda']['id']; |
51 | 51 |
@@ -2,11 +2,11 @@ |
||
2 | 2 | |
3 | 3 | class LancamentoVenda extends AppModel { |
4 | 4 | |
5 | - public $hasOne = 'Venda'; |
|
6 | - public $hasMany = array( |
|
7 | - 'Venda' => array( |
|
8 | - 'className' => 'Venda' |
|
9 | - ) |
|
10 | - ); |
|
5 | + public $hasOne = 'Venda'; |
|
6 | + public $hasMany = array( |
|
7 | + 'Venda' => array( |
|
8 | + 'className' => 'Venda' |
|
9 | + ) |
|
10 | + ); |
|
11 | 11 | |
12 | 12 | } |
13 | 13 | \ No newline at end of file |