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/rabbithabit.com/public_html/application/controllers/ |
Upload File : |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class About extends Public_Controller { function __construct() { parent::__construct(); $this->load->library('form_validation'); } public function index() { //get website name $website_name = $this->db->select('website_name')->from('configuration')->where('id_configuration', 1)->get()->row()->website_name; $data['about'] = $this->db->get_where("about_us",array( "id"=>1 ))->row_array(); if(empty($data['about']['meta_title'])) { $this->data_header['browser_title'] = 'Tentang Kami - ' . $website_name; } else { $this->data_header['browser_title'] = $data['about']['meta_title']; } if(empty($data['about']['meta_description'])) { $this->data_header['meta_description'] = 'Tentang Kami - ' . $website_name; } else { $this->data_header['meta_description'] = $data['about']['meta_description']; } $this->load->view("themes/$this->theme_no/header", $this->data_header); $this->load->view("themes/$this->theme_no/about",$data); $this->load->view("themes/$this->theme_no/footer", $this->data_footer); } public function business_enquiry_confirmation() { if (!isset($_POST['business_enquiry_confirmation'])) { redirect('contact'); } $inp_name = $this->input->post('inp_name'); $inp_email = $this->input->post('inp_email'); $inp_phone = $this->input->post('inp_phone'); $inp_companyname = $this->input->post('inp_companyname'); $inp_companyaddress = $this->input->post('inp_companyaddress'); $inp_project = $this->input->post('inp_project'); //validation in action $config = array( array( 'field' => 'inp_name', 'label' => 'Name', 'rules' => 'trim|required' ), array( 'field' => 'inp_email', 'label' => 'Email Address', 'rules' => 'trim|required' ), array( 'field' => 'inp_phone', 'label' => 'Phone Number', 'rules' => 'trim|required' ), array( 'field' => 'inp_companyname', 'label' => 'Company Name', 'rules' => 'trim|required' ), array( 'field' => 'inp_companyaddress', 'label' => 'Company Address', 'rules' => 'trim|required' ), array( 'field' => 'inp_project', 'label' => 'Project Details', 'rules' => 'trim|required' ), ); $this->form_validation->set_rules($config); $this->form_validation->set_error_delimiters('<div class="error">', '</div>'); if($this->form_validation->run($this) == FALSE) { $data_header['page_title'] = 'About Us'; $this->db->select('website_name')->from('configuration')->where('id_configuration', 1); $website_name = $this->db->get()->row(); $this->data_header['browser_title'] = ucwords($website_name->website_name) . ' - My Account'; $this->data_header['meta_description'] = ucwords($website_name->website_name) . ' - My Account'; //LOAD LANGUAGE FILES // if($this->session->userdata('site_lang') == 'english') { // $this->lang->load('contact', 'english'); // } else { // $this->lang->load('contact', 'indonesian'); // } $this->load->view("themes/$this->theme_no/header", $this->data_header); $this->load->view("themes/$this->theme_no/contact"); $this->load->view("themes/$this->theme_no/footer", $this->data_footer); }else { //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'] = 'About Us'; $myMessage = '<html><body>'; $myMessage .= '<table style="border-color: #666;" cellpadding="10">'; $myMessage .= "<tr><td><strong>Name:</strong> </td><td>" . $inp_name . "</td></tr>"; $myMessage .= "<tr><td><strong>Email Address:</strong> </td><td>" . $inp_email . "</td></tr>"; $myMessage .= "<tr><td><strong>Phone Number:</strong> </td><td>" . $inp_phone . "</td></tr>"; $myMessage .= "<tr><td><strong>Company Name:</strong> </td><td>" . $inp_companyname . "</td></tr>"; $myMessage .= "<tr><td><strong>Company Address:</strong> </td><td>" . $inp_companyaddress . "</td></tr>"; $myMessage .= "<tr><td><strong>Project Details:</strong> </td><td>" . $inp_project . "</td></tr>"; $myMessage .= "</table>"; $myMessage .= "<p>Thanks.</p>"; $myMessage .= "</body></html>"; // send email $email_data['email'] = $data['emails']->from_email; // $email_data['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 $this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:10px; padding:5px; font-weight:bold;">Business Enquiry Successfully Sent. We will check your Business Enquiry.</p>'); redirect('contact'); } } }