@@ -8,22 +8,22 @@ |
||
| 8 | 8 | |
| 9 | 9 | $_SESSION['information'] = $dominio; |
| 10 | 10 | |
| 11 | -Router::connect('/addCart', array('controller' => $dominio['controller'], 'action' => 'addCart')); |
|
| 11 | +Router::connect('/addCart', array('controller' => $dominio['controller'], 'action' => 'addCart')); |
|
| 12 | 12 | |
| 13 | -Router::connect('/clearCart', array('controller' => $dominio['controller'], 'action' => 'clearCart')); |
|
| 13 | +Router::connect('/clearCart', array('controller' => $dominio['controller'], 'action' => 'clearCart')); |
|
| 14 | 14 | |
| 15 | -Router::connect('/cart', array('controller' => $dominio['controller'], 'action' => 'cart')); |
|
| 15 | +Router::connect('/cart', array('controller' => $dominio['controller'], 'action' => 'cart')); |
|
| 16 | 16 | |
| 17 | -Router::connect('/checkout', array('controller' => $dominio['controller'], 'action' => 'checkout')); |
|
| 17 | +Router::connect('/checkout', array('controller' => $dominio['controller'], 'action' => 'checkout')); |
|
| 18 | 18 | |
| 19 | -Router::connect('/payment', array('controller' => $dominio['controller'], 'action' => 'payment')); |
|
| 19 | +Router::connect('/payment', array('controller' => $dominio['controller'], 'action' => 'payment')); |
|
| 20 | 20 | |
| 21 | -Router::connect('/category/:id/:nome', array('controller' => $dominio['controller'], 'action' => 'category')); |
|
| 21 | +Router::connect('/category/:id/:nome', array('controller' => $dominio['controller'], 'action' => 'category')); |
|
| 22 | 22 | |
| 23 | -Router::connect('/removeProductCart/:id', array('controller' => $dominio['controller'], 'action' => 'removeProductCart')); |
|
| 23 | +Router::connect('/removeProductCart/:id', array('controller' => $dominio['controller'], 'action' => 'removeProductCart')); |
|
| 24 | 24 | |
| 25 | -Router::connect('/product/:id', array('controller' => $dominio['controller'], 'action' => 'product')); |
|
| 25 | +Router::connect('/product/:id', array('controller' => $dominio['controller'], 'action' => 'product')); |
|
| 26 | 26 | |
| 27 | -require CAKE . 'Config' . DS . 'routes.php'; |
|
| 27 | +require CAKE.'Config'.DS.'routes.php'; |
|
| 28 | 28 | |
| 29 | 29 | CakePlugin::routes(); |
| 30 | 30 | \ No newline at end of file |
@@ -48,12 +48,12 @@ discard block |
||
| 48 | 48 | * Load the CakePHP default routes. Only remove this if you do not want to use |
| 49 | 49 | * the built-in default routes. |
| 50 | 50 | */ |
| 51 | - require CAKE . 'Config' . DS . 'routes.php'; |
|
| 51 | + require CAKE.'Config'.DS.'routes.php'; |
|
| 52 | 52 | /** |
| 53 | 53 | * Função para verificar se o dominio pentece ao site, caso não pertença redireciona ao site correto |
| 54 | 54 | */ |
| 55 | 55 | function verificar_dominio() { |
| 56 | - $dominiosWinners = array ( |
|
| 56 | + $dominiosWinners = array( |
|
| 57 | 57 | 'winners.local', |
| 58 | 58 | 'blog.winnersdesenvolvimento.com.br', |
| 59 | 59 | 'ciawn.com.br', |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | exit(); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $caminho = APP . 'Config/Domain/' . $varDominio . '.php'; |
|
| 90 | - if (!file_exists($caminho)) |
|
| 89 | + $caminho = APP.'Config/Domain/'.$varDominio.'.php'; |
|
| 90 | + if ( ! file_exists($caminho)) |
|
| 91 | 91 | { |
| 92 | 92 | $retorno['is_winners'] = true; |
| 93 | 93 | return $retorno; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $retorno['is_winners'] = false; |
| 99 | 99 | $retorno['id_usuario'] = $dominio['id_usuario']; |
| 100 | 100 | $retorno['controller'] = $dominio['controller']; |
| 101 | - $retorno['funcao'] = $dominio['funcao']; |
|
| 101 | + $retorno['funcao'] = $dominio['funcao']; |
|
| 102 | 102 | |
| 103 | 103 | return $retorno; |
| 104 | 104 | } |
@@ -18,17 +18,17 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | $ds = DIRECTORY_SEPARATOR; |
| 21 | -$dispatcher = 'Cake' . $ds . 'Console' . $ds . 'ShellDispatcher.php'; |
|
| 21 | +$dispatcher = 'Cake'.$ds.'Console'.$ds.'ShellDispatcher.php'; |
|
| 22 | 22 | |
| 23 | 23 | if (function_exists('ini_set')) { |
| 24 | 24 | $root = dirname(dirname(dirname(__FILE__))); |
| 25 | 25 | |
| 26 | 26 | // the following line differs from its sibling |
| 27 | 27 | // /lib/Cake/Console/Templates/skel/Console/cake.php |
| 28 | - ini_set('include_path', $root . $ds . 'lib' . PATH_SEPARATOR . ini_get('include_path')); |
|
| 28 | + ini_set('include_path', $root.$ds.'lib'.PATH_SEPARATOR.ini_get('include_path')); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | -if (!include $dispatcher) { |
|
| 31 | +if ( ! include $dispatcher) { |
|
| 32 | 32 | trigger_error('Could not locate CakePHP core files.', E_USER_ERROR); |
| 33 | 33 | } |
| 34 | 34 | unset($paths, $path, $dispatcher, $root, $ds); |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class AdminController extends AppController{ |
|
| 3 | +class AdminController extends AppController { |
|
| 4 | 4 | |
| 5 | - public function beforeFilter(){ |
|
| 5 | + public function beforeFilter() { |
|
| 6 | 6 | return true; |
| 7 | 7 | } |
| 8 | 8 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * Toda vez que determinado controller não precisa de verificação de acesso o |
| 24 | 24 | * o mesmo precisa ter essa função rescrita somente com um return true |
| 25 | 25 | */ |
| 26 | - public function beforeFilter(){ |
|
| 26 | + public function beforeFilter() { |
|
| 27 | 27 | if ($this->debug) { |
| 28 | 28 | return true; |
| 29 | 29 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | public function verificar_acesso_admin() { |
| 103 | 103 | $verificar = $this->Session->read('Admin.logado'); |
| 104 | - if (!$verificar) { |
|
| 104 | + if ( ! $verificar) { |
|
| 105 | 105 | $this->Session->setFlash('Você não possui acesso a está área do sistema'); |
| 106 | 106 | $this->redirect('/admin/login'); |
| 107 | 107 | } |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | public function s_editar_cadastro($id) { |
| 59 | 59 | $dados = $this->request->data('dados'); |
| 60 | 60 | |
| 61 | - $image = $_FILES['imagem']; |
|
| 61 | + $image = $_FILES['imagem']; |
|
| 62 | 62 | |
| 63 | - if (!empty($image['name'])) { |
|
| 63 | + if ( ! empty($image['name'])) { |
|
| 64 | 64 | $retorno = $this->uploadImage($image); |
| 65 | 65 | |
| 66 | - if (!$retorno['status']) |
|
| 66 | + if ( ! $retorno['status']) |
|
| 67 | 67 | $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
| 68 | 68 | |
| 69 | 69 | $dados['imagem'] = $retorno['nome']; |
@@ -76,10 +76,10 @@ discard block |
||
| 76 | 76 | $this->Banner->id = $id; |
| 77 | 77 | |
| 78 | 78 | if ($this->Banner->save($dados)) { |
| 79 | - $this->Session->setFlash('Banner editado com sucesso!','default','good'); |
|
| 79 | + $this->Session->setFlash('Banner editado com sucesso!', 'default', 'good'); |
|
| 80 | 80 | return $this->redirect('/banner/listar_cadastros'); |
| 81 | 81 | } else { |
| 82 | - $this->Session->setFlash('Ocorreu um erro ao editar o Banner!','default','good'); |
|
| 82 | + $this->Session->setFlash('Ocorreu um erro ao editar o Banner!', 'default', 'good'); |
|
| 83 | 83 | return $this->redirect('/banner/listar_cadastros'); |
| 84 | 84 | } |
| 85 | 85 | } |
@@ -91,14 +91,14 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $retorno = $this->uploadImage($image); |
| 93 | 93 | |
| 94 | - if (!$retorno['status']) |
|
| 94 | + if ( ! $retorno['status']) |
|
| 95 | 95 | $this->Session->setFlash('Não foi possivel salvar a imagem tente novamente'); |
| 96 | 96 | |
| 97 | 97 | $dados['src'] = $retorno['nome']; |
| 98 | 98 | $dados['usuario_id'] = $this->instancia; |
| 99 | 99 | $dados['ativo'] = 1; |
| 100 | 100 | |
| 101 | - if($this->Banner->save($dados)) { |
|
| 101 | + if ($this->Banner->save($dados)) { |
|
| 102 | 102 | $this->Session->setFlash('Banner salvo com sucesso!'); |
| 103 | 103 | return $this->redirect('/banner/listar_cadastros'); |
| 104 | 104 | } else { |
@@ -109,12 +109,12 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | public function uploadImage(&$image) { |
| 111 | 111 | $type = substr($image['name'], -4); |
| 112 | - $nameImage = uniqid() . md5($image['name']) . $type; |
|
| 113 | - $dir = APP . 'webroot/uploads/banner/imagens/'; |
|
| 112 | + $nameImage = uniqid().md5($image['name']).$type; |
|
| 113 | + $dir = APP.'webroot/uploads/banner/imagens/'; |
|
| 114 | 114 | |
| 115 | - $returnUpload = move_uploaded_file($image['tmp_name'], $dir . $nameImage); |
|
| 115 | + $returnUpload = move_uploaded_file($image['tmp_name'], $dir.$nameImage); |
|
| 116 | 116 | |
| 117 | - if (!$returnUpload) |
|
| 117 | + if ( ! $returnUpload) |
|
| 118 | 118 | return array('nome' => null, 'status' => false); |
| 119 | 119 | |
| 120 | 120 | return array('nome' => $nameImage, 'status' => true); |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $id = $this->request->data('id'); |
| 127 | 127 | |
| 128 | - $dados = array ('ativo' => '0'); |
|
| 129 | - $parametros = array ('id' => $id); |
|
| 128 | + $dados = array('ativo' => '0'); |
|
| 129 | + $parametros = array('id' => $id); |
|
| 130 | 130 | |
| 131 | 131 | if ($this->Banner->updateAll($dados, $parametros)) { |
| 132 | 132 | echo json_encode(true); |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | $dados['usuario_id'] = $this->instancia; |
| 31 | 31 | |
| 32 | 32 | if ($this->Categoria->save($dados)) { |
| 33 | - $this->Session->setFlash('Categoria criada com Sucesso!','default','good'); |
|
| 33 | + $this->Session->setFlash('Categoria criada com Sucesso!', 'default', 'good'); |
|
| 34 | 34 | return $this->redirect('/categoria/listar_cadastros'); |
| 35 | 35 | } else { |
| 36 | - $this->Session->setFlash('Erro ao criar a categoria!','default','good'); |
|
| 36 | + $this->Session->setFlash('Erro ao criar a categoria!', 'default', 'good'); |
|
| 37 | 37 | return $this->redirect('/categoria/listar_cadastros'); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $categoria = $this->Categoria->find('first', |
| 45 | 45 | array('conditions' => |
| 46 | - array( 'id' => $id ) |
|
| 46 | + array('id' => $id) |
|
| 47 | 47 | ) |
| 48 | 48 | ); |
| 49 | 49 | |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | $this->Categoria->id = $id; |
| 61 | 61 | |
| 62 | 62 | if ($this->Categoria->save($dados)) { |
| 63 | - $this->Session->setFlash('Categoria editada com Sucesso!','default','good'); |
|
| 63 | + $this->Session->setFlash('Categoria editada com Sucesso!', 'default', 'good'); |
|
| 64 | 64 | return $this->redirect('/categoria/listar_cadastros'); |
| 65 | 65 | } else { |
| 66 | - $this->Session->setFlash('Erro ao editar a categoria!','default','good'); |
|
| 66 | + $this->Session->setFlash('Erro ao editar a categoria!', 'default', 'good'); |
|
| 67 | 67 | return $this->redirect('/categoria/listar_cadastros'); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -75,14 +75,14 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | $id = $this->request->data('id'); |
| 77 | 77 | |
| 78 | - $dados = array ('ativo' => '0'); |
|
| 79 | - $parametros = array ('id' => $id); |
|
| 78 | + $dados = array('ativo' => '0'); |
|
| 79 | + $parametros = array('id' => $id); |
|
| 80 | 80 | |
| 81 | 81 | if ($this->Categoria->updateAll($dados, $parametros)) { |
| 82 | - $this->Session->setFlash('Categoria excluida com Sucesso!','default','good'); |
|
| 82 | + $this->Session->setFlash('Categoria excluida com Sucesso!', 'default', 'good'); |
|
| 83 | 83 | echo json_encode(true); |
| 84 | 84 | } else { |
| 85 | - $this->Session->setFlash('Erro ao excluir categoria!','default','good'); |
|
| 85 | + $this->Session->setFlash('Erro ao excluir categoria!', 'default', 'good'); |
|
| 86 | 86 | echo json_encode(false); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class ClienteController extends AppController{ |
|
| 3 | +class ClienteController extends AppController { |
|
| 4 | 4 | // public $helpers = array('Excel'); |
| 5 | 5 | |
| 6 | 6 | function home() { |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | if ($this->Cliente->save($dados)) { |
| 25 | 25 | $endereco['id_usuario'] = $this->instancia; |
| 26 | 26 | $endereco['id_cliente'] = $this->Cliente->id; |
| 27 | - $endereco['ativo'] = 1; |
|
| 27 | + $endereco['ativo'] = 1; |
|
| 28 | 28 | |
| 29 | 29 | $this->loadModel('EnderecoClienteCadastro'); |
| 30 | 30 | $this->EnderecoClienteCadastro->save($endereco); |
@@ -42,10 +42,10 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $id = $this->request->data('id'); |
| 44 | 44 | |
| 45 | - $dados = array ('ativo' => '0'); |
|
| 46 | - $parametros = array ('id' => $id); |
|
| 45 | + $dados = array('ativo' => '0'); |
|
| 46 | + $parametros = array('id' => $id); |
|
| 47 | 47 | |
| 48 | - if ($this->Cliente->updateAll($dados,$parametros)) { |
|
| 48 | + if ($this->Cliente->updateAll($dados, $parametros)) { |
|
| 49 | 49 | echo json_encode(true); |
| 50 | 50 | } else { |
| 51 | 51 | echo json_encode(false); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class AuthComponent extends Component{ |
|
| 3 | +class AuthComponent extends Component { |
|
| 4 | 4 | function doComplexOperation($amount1, $amount2) { |
| 5 | 5 | return $amount1 + $amount2; |
| 6 | 6 | } |