Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/09/2015, 14:30
Avatar de joseherran
joseherran
 
Fecha de Ingreso: septiembre-2015
Ubicación: cali valle
Mensajes: 23
Antigüedad: 8 años, 8 meses
Puntos: 0
Respuesta: formulario validación Jquery y ajax

este es el controlador del primer formulario contact_us.php

Código PHP:
Ver original
  1. <?php
  2.  
  3. defined('BASEPATH') OR exit('No direct script access allowed');
  4.  
  5. class Contact_Us extends Public_Controller {
  6.  
  7.     public function __construct() {
  8.         parent::__construct();
  9.         $models = array(
  10.             'contact_us_m',
  11.             'contact_us_emails_m',
  12.             'google_map_model',
  13.             'google_map_category_model'
  14.         );
  15.  
  16.         $this->load->model($models);
  17.         $this->lang->load('language');
  18.         $this->template
  19.                 ->append_js('module::jquery_validate.js')
  20.                 ->append_js('module::formvalidate.js');
  21.  
  22.         // idioma
  23.         $this->lang_code = $this->session->userdata('lang_code');
  24.         if (empty($this->lang_code)) {
  25.             $this->session->set_userdata(array('lang_code' => 'es'));
  26.             $this->lang_code = $this->session->userdata('lang_code');
  27.         }
  28.     }
  29.  
  30.     // -----------------------------------------------------------------
  31.  
  32.  
  33.  
  34.     public function index() {
  35.         // Datos de Contacto
  36.         $_contact_us = $this->contact_us_m->where('lang', $this->lang_code)->get_all();
  37.         $contact_us = array();
  38.         if (count($_contact_us) > 0) {
  39.             $contact_us = $_contact_us[0];
  40.         }
  41.  
  42.         $emails_area = $this->contact_us_m->sqlFormSelect('contact_us_emails_area', 'id', ($this->lang_code == 'es' ? 'title' : 'title_en'),
  43.             FALSE, null, null, $this->lang_code);
  44.  
  45.         $json_info_content = array();
  46.         $json_markers = array();
  47.  
  48.         $selectGoogleMaps = $this->contact_us_m->sqlFormSelect('google_map_categories', 'id', 'title', FALSE, 'outstanding', '1', $this->lang_code);
  49.         $moduleName = 'google_maps';
  50.  
  51.         if (!empty($selectGoogleMaps)) {
  52.             foreach ($selectGoogleMaps AS $item => $value) {
  53.                 $idCategory = $item;
  54.                 break;
  55.             }
  56.  
  57.             $google_map = $this->db
  58.                             ->select('*')
  59.                             ->from('google_maps AS gm')
  60.                             ->join('google_maps_categories AS gc', 'gc.google_map_id = gm.id', 'left')
  61.                             ->where('gc.category_id', $idCategory)
  62.                             ->get()->result();