final del controlador
Código PHP:
Ver originalpublic function multiple_poins() {
$json_info_content = array(); $statusJson = 'error';
$msgJson = 'Ocurrio un error al cargar los datos de google, porfavor intente más tarde';
if (isset($_POST['idcategory'])) { $idCategory = $_POST['idcategory'];
$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)
//->limit($pagination['limit'], $pagination['offset'])
->get()->result();
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/' . $this->moduleName . '/', "", $item->image);
array_push($json_info_content, array('image' => $imageTogoogle, 'adress' => $item->adress, 'title' => $item->name, 'moduleName' => $this->moduleName, 'schedule' => $item->schedule, 'description' => $item->description)); }
}
$statusJson = '';
$msgJson = 'datos de google cargados correctamente';
}
// mandamos los puntos
// mandamos los datos para el modal dentro del mapa
echo json_encode(array('status' => $statusJson, 'msg' => $msgJson, 'json_markers' => $json_markers, 'json_info_content' => $json_info_content)); }
/**
* Send an email
*
* @param array $comment The comment data.
* @param array $entry The entry data.
* @return boolean
*/
private function send_email_to_user($data, $admin_email) {
$this->load->library('email');
$this->load->library('user_agent');
return Events
::trigger('email', array( 'name' => $data['name'],
'email' => $data['email'],
'phone' => $data['phone'],
'company' => $data['company'],
'city' => $data['city'],
'products' => $products,
'message' => $data['message'],
'cotizacion' => $data['cotizacion'],
'slug' => 'contact',
'to' => Settings::get('contact_email'),
), 'array');
}
}