Code Duplication    Length = 23-25 lines in 3 locations

app/Controller/BannerController.php 1 location

@@ 34-56 (lines=23) @@
31
		$this->layout = 'wadmin';
32
	}
33
34
	public function editar_cadastro($id) {
35
		$this->loadModel('CategoriaBanner');
36
		
37
		$this->set('categorias', $this->CategoriaBanner->find('all', 
38
				array('conditions' => 
39
					array('ativo' => 1,
40
						  'usuario_id' => $this->instancia
41
					)
42
				)
43
			)
44
		);	
45
46
		$this->set('banner', $this->Banner->find('all', 
47
				array('conditions' => 
48
					array('ativo' => 1,
49
						  'id' => $id
50
					)
51
				)
52
			)[0]
53
		);
54
55
		$this->layout = 'wadmin';
56
	}
57
58
	public function s_editar_cadastro($id) {
59
		$dados = $this->request->data('dados');

app/Controller/VendaController.php 2 locations

@@ 9-33 (lines=25) @@
6
7
class VendaController extends AppController {
8
9
	public function pdv() {
10
		$this->layout = 'wadmin';
11
12
		$this->loadModel('Produto');
13
14
		$this->set('produtos', $this->Produto->find('all',
15
				array('conditions' =>
16
					array('ativo' => 1,
17
						  'id_usuario' => $this->instancia
18
					)
19
				)
20
			)
21
		);
22
23
		$this->loadModel('Cliente');
24
25
		$this->set('clientes', $this->Cliente->find('all',
26
				array('conditions' =>
27
					array('ativo' => 1,
28
						  'id_usuario' => $this->instancia
29
					)
30
				)
31
			)
32
		);
33
	}
34
35
	public function recuperar_dados_venda_ajax() {
36
		$this->layout = 'ajax';
@@ 72-96 (lines=25) @@
69
		);
70
	}
71
72
	public function adicionar_cadastro() {
73
		$this->layout = 'wadmin';
74
75
		$this->loadModel('Cliente');
76
77
		$this->set('clientes', $this->Cliente->find('all',
78
				array('conditions' =>
79
					array('ativo' => 1,
80
						  'id_usuario' => $this->instancia
81
					)
82
				)
83
			)
84
		);
85
86
		$this->loadModel('Produto');
87
88
		$this->set('produtos', $this->Produto->find('all',
89
				array('conditions' =>
90
					array('ativo' => 1,
91
						  'id_usuario' => $this->instancia
92
					)
93
				)
94
			)
95
		);
96
	}
97
98
	public function s_adicionar_cadastro() {
99
		$dados_venda 	  = $this->request->data('venda');