este es el controlador del primer formulario contact_us.php
Código PHP:
Ver original<?php
defined('BASEPATH') OR
exit('No direct script access allowed');
class Contact_Us extends Public_Controller {
public function __construct() {
parent::__construct();
'contact_us_m',
'contact_us_emails_m',
'google_map_model',
'google_map_category_model'
);
$this->load->model($models);
$this->lang->load('language');
$this->template
->append_js('module::jquery_validate.js')
->append_js('module::formvalidate.js');
// idioma
$this->lang_code = $this->session->userdata('lang_code');
if (empty($this->lang_code)) { $this->session->set_userdata(array('lang_code' => 'es')); $this->lang_code = $this->session->userdata('lang_code');
}
}
// -----------------------------------------------------------------
public function index() {
// Datos de Contacto
$_contact_us = $this->contact_us_m->where('lang', $this->lang_code)->get_all();
if (count($_contact_us) > 0) { $contact_us = $_contact_us[0];
}
$emails_area = $this->contact_us_m->sqlFormSelect('contact_us_emails_area', 'id', ($this->lang_code == 'es' ? 'title' : 'title_en'),
FALSE, null, null, $this->lang_code);
$json_info_content = array();
$selectGoogleMaps = $this->contact_us_m->sqlFormSelect('google_map_categories', 'id', 'title', FALSE, 'outstanding', '1', $this->lang_code);
$moduleName = 'google_maps';
if (!empty($selectGoogleMaps)) { foreach ($selectGoogleMaps AS $item => $value) {
$idCategory = $item;
break;
}
$google_map = $this->db
->select('*')
->from('google_maps AS gm')
->join('google_maps_categories AS gc', 'gc.google_map_id = gm.id', 'left') ->where('gc.category_id', $idCategory)
->get()->result();