| @@ 14-38 (lines=25) @@ | ||
| 11 | ||
| 12 | class VendaController extends AppController { |
|
| 13 | ||
| 14 | public function pdv() { |
|
| 15 | $this->layout = 'wadmin'; |
|
| 16 | ||
| 17 | $this->loadModel('Produto'); |
|
| 18 | ||
| 19 | $this->set('produtos', $this->Produto->find('all', |
|
| 20 | array('conditions' => |
|
| 21 | array('ativo' => 1, |
|
| 22 | 'id_usuario' => $this->instancia |
|
| 23 | ) |
|
| 24 | ) |
|
| 25 | ) |
|
| 26 | ); |
|
| 27 | ||
| 28 | $this->loadModel('Cliente'); |
|
| 29 | ||
| 30 | $this->set('clientes', $this->Cliente->find('all', |
|
| 31 | array('conditions' => |
|
| 32 | array('ativo' => 1, |
|
| 33 | 'id_usuario' => $this->instancia |
|
| 34 | ) |
|
| 35 | ) |
|
| 36 | ) |
|
| 37 | ); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function recuperar_dados_venda_ajax() { |
|
| 41 | $this->layout = 'ajax'; |
|
| @@ 36-58 (lines=23) @@ | ||
| 33 | $this->layout = 'wadmin'; |
|
| 34 | } |
|
| 35 | ||
| 36 | public function editar_cadastro($id) { |
|
| 37 | $this->loadModel('CategoriaBanner'); |
|
| 38 | ||
| 39 | $this->set('categorias', $this->CategoriaBanner->find('all', |
|
| 40 | array('conditions' => |
|
| 41 | array('ativo' => 1, |
|
| 42 | 'usuario_id' => $this->instancia |
|
| 43 | ) |
|
| 44 | ) |
|
| 45 | ) |
|
| 46 | ); |
|
| 47 | ||
| 48 | $this->set('banner', $this->Banner->find('all', |
|
| 49 | array('conditions' => |
|
| 50 | array('ativo' => 1, |
|
| 51 | 'id' => $id |
|
| 52 | ) |
|
| 53 | ) |
|
| 54 | )[0] |
|
| 55 | ); |
|
| 56 | ||
| 57 | $this->layout = 'wadmin'; |
|
| 58 | } |
|
| 59 | ||
| 60 | public function s_editar_cadastro($id) { |
|
| 61 | $dados = $this->request->data('dados'); |
|