continuacion del codigo controlador
Código PHP:
Ver original// datos para el mapa de google
$json_info_content = array();
if (!empty($google_map)) { foreach ($google_map AS $item) {
$item->image = val_image($item->image);
array_push($json_markers, array($item->adress . ', ' . $item->name, (double
) $item->coordinate1, (double
) $item->coordinate2));
$imageTogoogle = str_replace(site_url
() . 'uploads/default/' . $moduleName . '/', "", $item->image);
array_push($json_info_content, array('image' => $imageTogoogle, 'adress' => $item->adress, 'title' => $item->name, 'moduleName' => $moduleName, 'schedule' => $item->schedule, 'description' => $item->description));
}
}
// mandamos los puntos
// sacamos solo el nombre de la imagen
// mandamos los datos para el modal dentro del mapa
}
$form = $this->db->where('id', 1)->get('others_conf_form_status')->row();
$this->template
->append_js('module::google_maps.js')
->set('form', $form)
->set('json_info_content', $json_info_content)
->set('json_markers', $json_markers)
->set('contact_us', $contact_us)
->set('selectGoogleMaps', $selectGoogleMaps)
->set('emails_area', $emails_area)
->build('contact_us_front');
}
/*
* Enviar correo
*/
function send() {
$this->form_validation->set_rules('name', 'Nombre y Apellido', 'required|trim|max_length[100]');
$this->form_validation->set_rules('email', 'Correo', 'required|trim|valid_email|max_length[100]');
$this->form_validation->set_rules('phone', 'Teléfono', 'trim|max_length[30]');
$this->form_validation->set_rules('cell', 'Celular', 'trim|max_length[30]');
$this->form_validation->set_rules('company', 'Empresa/Organización', 'trim|max_length[100]');
$this->form_validation->set_rules('message', 'Mensaje', 'required|trim|max_length[455]');
$statusJson = 'error';
$msgJson = 'Por favor intenta de mas tarde';
if ($this->form_validation->run() === TRUE) {
$post = (object) $this->input->post(null);
$email = $this->db->where('id', $post->id_email_area)->get('contact_us_emails_area')->row();
// si el correo viene separado por ,
$email = $email->email;
if (strpos($email, ',') !== false) { }
}
'name' => $post->name,
'email' => $post->email,
'phone' => $post->phone,
'cell' => $post->cell,
'company' => $post->company,
'city' => $post->city,
'message' => $post->message,
'cotizacion' => $post->cotizacion,
'date' => date('Y-m-d H:i:s'), 'lang' => $this->lang_code
);