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/kokohpondasi.co.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 index() { // browser title and meta details homepage $this->db->select('browser_title, meta_description, meta_keywords, website_icon')->from('configuration')->where('id_configuration', 1); $website_name = $this->db->get()->row(); $this->data_header['browser_title'] = 'Contact'; $this->data_header['meta_description'] = 'Contact'; $this->data_header['meta_keywords'] = 'Contact'; $this->data_header['website_icon'] = 'Contact'; $this->db->select('*'); $this->db->from('configuration'); $data['config'] = $this->db->get()->result(); foreach ($data['config'] as $item) { $this->data_header['image'] = $item->logo; $this->data_header['icon'] = $item->website_icon; $this->data['fax'] = $item->fax; $this->data['hp'] = $item->hp; $this->data['company_address'] = $item->company_address; $this->data_footer['twitter']= $item->twitter; $this->data_header['instagram']= $item->instagram; $this->data_header['facebook']= $item->facebook; $this->data_footer['website_name']= $item->website_name; } $this->load->view('template/header', $this->data_header); $this->load->view('contact',$this->data); $this->load->view('template/footer', $this->data_footer); } 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); } }