@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class HomeController extends AppController{ |
|
| 3 | +class HomeController extends AppController { |
|
| 4 | 4 | |
| 5 | - public function beforeFilter(){ |
|
| 5 | + public function beforeFilter() { |
|
| 6 | 6 | return true; |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | - function index(){ |
|
| 9 | + function index() { |
|
| 10 | 10 | $this->layout = 'winners'; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | - function servicos(){ |
|
| 13 | + function servicos() { |
|
| 14 | 14 | $this->layout = 'servicos'; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | $dados = $this->request->data('dados'); |
| 24 | 24 | |
| 25 | 25 | // Check for empty fields |
| 26 | - if(empty($dados['name']) || |
|
| 27 | - empty($dados['email']) || |
|
| 28 | - empty($dados['message']) || |
|
| 29 | - !filter_var($dados['email'], FILTER_VALIDATE_EMAIL)) { |
|
| 26 | + if (empty($dados['name']) || |
|
| 27 | + empty($dados['email']) || |
|
| 28 | + empty($dados['message']) || |
|
| 29 | + ! filter_var($dados['email'], FILTER_VALIDATE_EMAIL)) { |
|
| 30 | 30 | $this->Session->setFlash('Você deve preencher todos os dados!'); |
| 31 | 31 | return $this->redirect('/'); |
| 32 | 32 | } |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | $email_body = "Mensagem site: ".$message; |
| 42 | 42 | $headers = "From: [email protected]\n"; // This is the email address the generated message will be from. We recommend using something like [email protected]. |
| 43 | 43 | $headers .= "Reply-To: $email_address"; |
| 44 | - mail($to,$email_subject,$email_body,$headers); |
|
| 44 | + mail($to, $email_subject, $email_body, $headers); |
|
| 45 | 45 | //resposta automatica ao cliente |
| 46 | 46 | $to = $email_address; |
| 47 | 47 | $email_subject = '[email protected]'; |
| 48 | 48 | $email_body = "A sua mensagem foi recebida, em breve responderemos"; |
| 49 | 49 | $headers = "From: [email protected]\n"; // This is the email address the generated message will be from. We recommend using something like [email protected]. |
| 50 | 50 | $headers .= "Reply-To: $email_address"; |
| 51 | - mail($to,$email_subject,$email_body,$headers); |
|
| 51 | + mail($to, $email_subject, $email_body, $headers); |
|
| 52 | 52 | |
| 53 | 53 | $this->Session->setFlash('Seu e-mail foi enviado com sucesso em breve responderemos!'); |
| 54 | 54 | return $this->redirect('/'); |