$obj->setDireccion($_POST['direccion']); $band = $obj->guardar(); $proxTimeStamp = strtotime('+' . $tiempo . ' minutes', strtotime("now")); $nuevaFecha = date("Y-m-d H:i:s", $proxTimeStamp); } echo json_encode(array("band" => $band, "proxima" => $nuevaFecha, "proximoTimeStamp" => $proxTimeStamp, "proximo" => $tiempo * 1000 * 60, "aux" => strtotime("now"))); break; case 'reportarViaEMail': $db = TBase::conectaDB(); $email = new TMail(); $usuario = new TUsuario(); $reporte = new TReporte($_GET['reporte']); $email->setTema(utf8_decode("Reporte de ubicación")); $rs = $db->Execute("select * from usuario where idTipo = 1" . ($_GET['usuario'] == '' ? '' : " and idUsuario = " . $_GET['usuario'])); $img = "temporal/img.jpg"; file_put_contents($img, file_get_contents("https://maps.googleapis.com/maps/api/staticmap?center=" . $reporte->getLatitud() . "," . $reporte->getLongitud() . "&zoom=16&size=300x250&format=JPG&markers=color:green|label:M|" . $reporte->getLatitud() . "," . $reporte->getLongitud() . "")); $documento = ""; while (!$rs->EOF) { $email->setDestino($rs->fields['email'], utf8_decode($rs->fiels['nombre'])); $documento .= " " . $rs->fields['email']; $datos = array(); $usuario->setId($rs->fields['idUsuario']); $datos['nombreCompleto'] = $usuario->getNombre(); $usuario->setId($reporte->getIdUsuario()); $datos['nombreCompletoReportado'] = $usuario->getNombre(); $datos['Latitud'] = $reporte->getLatitud(); $datos['Longitud'] = $reporte->getLongitud(); $datos['Fecha'] = $reporte->getFecha(); $datos['Direccion'] = $reporte->getDireccion(); $datos['comentario1'] = $reporte->getCampo1(); $datos['comentario2'] = $reporte->getCampo2();