|
Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/vajra.id/public_html/application/controllers/ |
Upload File : |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Contact extends Public_Controller {
function __construct() {
parent::__construct();
}
public function submit_message() {
//test if ajax call to prevent direct access
if (!$this->input->is_ajax_request()) {
exit('No direct script access allowed');
}
$name=$this->input->post('name');
$email=$this->input->post('email');
$message=$this->input->post('message');
//get website data
$this->db->select('logo, from_email, website_name, email_smtp_host, email_smtp_port, email_smtp_password, email_smtp')->from('configuration')->where('id_configuration', 1);
$website_data = $this->db->get()->row();
$data['logo'] = $website_data->logo;
$data['website_name'] = $website_data->website_name;
$this->load->model('configuration_m');
$data['emails'] = $this->configuration_m->get_emails();
$data['bank'] = $this->configuration_m->get_bank();
$data['title'] = 'Contact Us';
$myMessage = '<html><body>';
$myMessage .= '<table style="border-color: #666;" cellpadding="10">';
$myMessage .= "<tr><td><strong>Name : </strong> </td><td>" . $name . "</td></tr>";
$myMessage .= "<tr><td><strong>Email : </strong> </td><td>" . $email . "</td></tr>";
$myMessage .= "<tr><td><strong>Message : </strong> </td><td>" . $message . "</td></tr>";
$myMessage .= "</table>";
$myMessage .= "<p>Thanks.</p>";
$myMessage .= "</body></html>";
// send email
$email_data['email'] = $data['emails']->from_email;
// $email_data['customer_email'] = 'bakrisea@gmail.com';
$email_data['subject'] = 'Business Enquiry';
$this->send_email($myMessage, $email_data, true);
// var_dump($this->email->print_debugger()); exit();
// end email
$data='test';
echo json_encode($data);
}
}