| @@ 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'); |
|
| @@ 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'; |
|
| @@ 73-97 (lines=25) @@ | ||
| 70 | ); |
|
| 71 | } |
|
| 72 | ||
| 73 | public function adicionar_cadastro() { |
|
| 74 | $this->layout = 'wadmin'; |
|
| 75 | ||
| 76 | $this->loadModel('Cliente'); |
|
| 77 | ||
| 78 | $this->set('clientes', $this->Cliente->find('all', |
|
| 79 | array('conditions' => |
|
| 80 | array('ativo' => 1, |
|
| 81 | 'id_usuario' => $this->instancia |
|
| 82 | ) |
|
| 83 | ) |
|
| 84 | ) |
|
| 85 | ); |
|
| 86 | ||
| 87 | $this->loadModel('Produto'); |
|
| 88 | ||
| 89 | $this->set('produtos', $this->Produto->find('all', |
|
| 90 | array('conditions' => |
|
| 91 | array('ativo' => 1, |
|
| 92 | 'id_usuario' => $this->instancia |
|
| 93 | ) |
|
| 94 | ) |
|
| 95 | ) |
|
| 96 | ); |
|
| 97 | } |
|
| 98 | ||
| 99 | public function s_adicionar_cadastro() { |
|
| 100 | $dados_venda = $this->request->data('venda'); |
|