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

class Web extends MY_Controller {
	function __construct()
	{
		parent::__construct();
		$this->load->model(array('Images_model', 'Works_model', 'Team_model'));
		$this->load->helper(array('form','html'));
	}
	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{	
		$data['head']=$this->top_template();
		$data['footer']=$this->bottom_template();
		$data['header']=$this->header();
		$data['services']=$this->services();
		$data['portfolio']=$this->portfolio();
		$data['about']=$this->about();
		$data['team']=$this->team();
		$data['clients']=$this->clients();
		$data['contact']=$this->contact();
	
		$this->load->view('view_main',$data);
	}

	public function email(){

		if ($_POST['submit_contact']) {
			$this->load->library('form_validation');
			// Validation Rules
			$config_validation = array(
	               array(
	                     'field'   => 'email', 
	                     'label'   => 'Email', 
	                     'rules'   => 'trim|required|valid_email'
	                  ),
	               array(
	                     'field'   => 'name', 
	                     'label'   => 'Name', 
	                     'rules'   => 'trim|required'
	                  ),
	               array(
	                     'field'   => 'location', 
	                     'label'   => 'Location', 
	                     'rules'   => 'trim|required'
	                  ),   
	               array(
	                     'field'   => 'message', 
	                     'label'   => 'Message', 
	                     'rules'   => 'required'
	                  )
	        );
			$this->form_validation->set_rules($config_validation);
			$this->form_validation->set_error_delimiters('<div class="alert alert-danger" style="background:none; 
  border:none" >', '</div>');
			// Check to see if validation OR upload failed
			if ($this->form_validation->run() == FALSE){
				
				$this->index();
			}
			else{
				// Fix for date and time
				date_default_timezone_set('America/Argentina/Buenos_Aires');
				// Get data from Form
				$data['email']=$this->input->post('email');
				$data['name']=$this->input->post('name');
				$data['location']=$this->input->post('location');
				$data['message']=$this->input->post('message');
				// Update client data to DB
				$this->load->model('Clients_model');
				$this->Clients_model->set_client($data['email'],$data['name'], $data['location']);
				
				// email config params
				$config = array('protocol' => 'smtp',
							'smtp_host' => 'smtp.mandrillapp.com',
							'smtp_port' => 587,
							'smtp_user' => '<EMAIL>',
							'smtp_pass' => '<PASSWORD>'<commit_msg>EMAIL - updates mail port for sending email.port 587 was blocked by bluehost so used port 25 instead.<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Web extends MY_Controller {
	function __construct()
	{
		parent::__construct();
		$this->load->model(array('Images_model', 'Works_model', 'Team_model'));
		$this->load->helper(array('form','html'));
	}
	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{	
		$data['head']=$this->top_template();
		$data['footer']=$this->bottom_template();
		$data['header']=$this->header();
		$data['services']=$this->services();
		$data['portfolio']=$this->portfolio();
		$data['about']=$this->about();
		$data['team']=$this->team();
		$data['clients']=$this->clients();
		$data['contact']=$this->contact();
	
		$this->load->view('view_main',$data);
	}

	public function email(){

		if ($_POST['submit_contact']) {
			$this->load->library('form_validation');
			// Validation Rules
			$config_validation = array(
	               array(
	                     'field'   => 'email', 
	                     'label'   => 'Email', 
	                     'rules'   => 'trim|required|valid_email'
	                  ),
	               array(
	                     'field'   => 'name', 
	                     'label'   => 'Name', 
	                     'rules'   => 'trim|required'
	                  ),
	               array(
	                     'field'   => 'location', 
	                     'label'   => 'Location', 
	                     'rules'   => 'trim|required'
	                  ),   
	               array(
	                     'field'   => 'message', 
	                     'label'   => 'Message', 
	                     'rules'   => 'required'
	                  )
	        );
			$this->form_validation->set_rules($config_validation);
			$this->form_validation->set_error_delimiters('<div class="alert alert-danger" style="background:none; 
  border:none" >', '</div>');
			// Check to see if validation OR upload failed
			if ($this->form_validation->run() == FALSE){
				
				$this->index();
			}
			else{
				// Fix for date and time
				date_default_timezone_set('America/Argentina/Buenos_Aires');
				// Get data from Form
				$data['email']=$this->input->post('email');
				$data['name']=$this->input->post('name');
				$data['location']=$this->input->post('location');
				$data['message']=$this->input->post('message');
				// Update client data to DB
				$this->load->model('Clients_model');
				$this->Clients_model->set_client($data['email'],$data['name'], $data['location']);
				
				// email config params
				$config = array('protocol' => 'smtp',
							'smtp_host' => 'smtp.mandrillapp.com',
							'smtp_port' => 25,
							'smtp_user' => '<EMAIL>',
							'smtp_pass' => '<PASSWORD>'
{'fraction_non_alphanumeric': 0.18101167315175098, 'fraction_numerical': 0.0015564202334630351, 'mean_word_length': 2.3072568193515184, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4204233', 'n_tokens_mistral': 2252, 'n_tokens_neox': 1885, 'n_words': 357}