<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Contactus extends CI_Controller {
	public function __construct()
        {
                parent::__construct();

		$this->load->database();
		$this->load->model('Datamodel');
		$this->load->helper(array('form', 'url'));
        }



	public function index()
	{
		$data['seo'] = $this->Datamodel->get_seo_contactus(); 
		$this->load->view('contactus.php',$data);
	}


  public function send() {
      
         $this->load->helper('form');
        
       
        $subject = 'Enquiry from Website' . $this->input->post('name') .  
        date("Y/m/d");
        $message = '<table width="100%" border="0" cellpadding="3">
              <tr>
                <td>Name</td>
                <td>' . $this->input->post('name') . '</td>
              </tr>
			
			    <tr>
                <td>Phone</td>
                <td>' . $this->input->post('phone') . '</td>
              </tr>
              
  		
			  <tr>
                <td>Email</td>
                <td>' . $this->input->post('email') . '</td>
              </tr>
              
              			    
		<tr>
                <td>Message</td>
                <td>' . $this->input->post('comment') . '</td>
              </tr>

			 
            </table>';

      $this->load->library('email');
        $config['charset'] = 'iso-8859-1';
        $config['mailtype'] = 'html';
        $this->email->initialize($config);
        $this->email->from($this->input->post('email'), $this->input->post('name'));
        $this->email->to('kreatzpromotions010@gmail.com');
        // $this->email->cc($admission_email_3);
        $this->email->subject($subject);
        $this->email->message($message);
        @$this->email->send();
    }


} //main loop