Created
September 4, 2012 23:48
-
-
Save anonymous/3628185 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // unit test | |
| class TestController extends AppController { | |
| var $name = 'Test'; | |
| var $helpers = array('Html', 'Ajax', 'Form', 'Javascript', 'Validanguage', 'Cache', 'Session', 'Fck'); | |
| var $components = array('Validation', 'Auth', 'RequestHandler', 'Cookie', 'Session', 'Email', 'Upload'); | |
| var $uses = array("CmsPage", "Websetting"); | |
| function beforeFilter() { | |
| parent::beforeFilter(); | |
| $this->Auth->allow('index', | |
| '__sendContactUsEmail', 'show_captcha', 'captcha_play', 'reloadcapcha'); | |
| } | |
| function __sendContactUsEmail($userData) { | |
| $Websetting = $this->Websetting->find('first', array('conditions' => array('Websetting.id' => 1), 'fields' => "*")); | |
| $contactUsEmail = $Websetting['Websetting']['contact_us_email']; | |
| $this->Email->to = $contactUsEmail; | |
| $this->Email->subject = 'New Contact Request'; | |
| $this->Email->from = $userData['email']; | |
| $this->Email->sendAs = 'html'; | |
| $this->set('name', $userData['name']); | |
| $this->set('email', $userData['email']); | |
| $this->set('message', $userData['message']); | |
| $this->Email->template = 'contact_us'; | |
| if ($this->Email->send()) { | |
| return "Success"; | |
| } else { | |
| return "Failure"; | |
| } | |
| } | |
| function index($id = NULL) { | |
| echo "test"; | |
| $Order = $this->Order->find('first', array( | |
| 'conditions' => array('Order.id' =>'8'), | |
| 'limit' =>1, | |
| 'fields' => "*")); | |
| print_r($Order); | |
| exit; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment