$valor){ echo $campo.': '.$valor.'
'; } */ ////***** function multi_attach_mail($to, $subject, $message, $senderMail, $senderName, $files) { $from = $senderName . " <" . $senderMail . ">"; $headers = "From: $from"; // boundary $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; // headers for attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; // multipart boundary $message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; // preparing attachments if (count($files) > 0) { for ($i = 0; $i < count($files); $i++) { if (is_file($files[$i])) { $message .= "--{$mime_boundary}\n"; $fp = @fopen($files[$i], "rb"); $data = @fread($fp, filesize($files[$i])); @fclose($fp); $data = chunk_split(base64_encode($data)); $message .= "Content-Type: application/octet-stream; name=\"" . basename($files[$i]) . "\"\n" . "Content-Description: " . basename($files[$i]) . "\n" . "Content-Disposition: attachment;\n" . " filename=\"" . basename($files[$i]) . "\"; size=" . filesize($files[$i]) . ";\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n"; } } } $message .= "--{$mime_boundary}--"; $returnpath = "-f" . $senderMail; //send email $mail = @mail($to, $subject, $message, $headers, $returnpath); //function return true, if email sent, otherwise return fasle if ($mail) { return TRUE; } else { return FALSE; } } ///***** //// CAMBIAR DE CLAVE $n = rand(1, 10000); $clave_actualizada = ''; $mensaje = ''; if (isset($_GET['newpassword']) and $_GET['newpassword'] == 'si' and !isset($_POST['accion'])) { $i = $_GET['i']; $i2 = $_GET['i2']; $i3 = md5($i . 'U$.j6yT'); $e = $_GET['e']; $np = $_GET['np']; if ($i2 == $i3) { $Insertar = "UPDATE usuarios SET clave='$np' WHERE email='$e' and id='$i'"; mysqli_query($conn, $Insertar); $mensaje = 'La Clave fue cambiada, ya puede utilizarla!'; $_GET['newpassword'] = 'no'; $clave_actualizada = 'si'; } } //// FIN DE CAMBIAR LA CLAVE /// INGRESAR if ($_POST['accion'] == 'ingresar') { $email = addslashes($_POST['email']); //evita injection $pass = md5($_POST['clave']); /// //echo $BaseDatos.'+'; $ruser = mysqli_query($conn, "select * from usuarios Where email='$email' and clave='$pass' Limit 1") or die(mysqli_error($conn)); $rowuser = mysqli_fetch_array($ruser); //echo 'X'; if ($rowuser['id'] == '') { $mensaje = 'email o clave incorrectas'; } else if ($rowuser['activo'] == 'no') { $mensaje = 'Su acceso a la aplicación ya no esta activa'; } else if ($rowuser['tipo'] == 'Administrador') { $_SESSION['administrador'] = 'si'; $_SESSION['name'] = $rowuser['nombre']; $_SESSION['user_id'] = $rowuser['id']; $_SESSION['empresa_id'] = $rowuser['empresa_id']; } else if ($rowuser['tipo'] == 'digitador') { $_SESSION['administrador'] = ''; $_SESSION['digitador'] = 'si'; $_SESSION['adminx'] = 'si'; $_SESSION['name'] = $rowuser['nombre']; $_SESSION['user_id'] = $rowuser['id']; $_SESSION['empresa_id'] = $rowuser['empresa_id']; /// // Establecer una cookie con dominio y ruta específicos $cookieValue = $hoy; $cookieDomain = "metricaurbana.cityciudad.com"; // Reemplaza con tu dominio $cookiePath = "/"; // Reemplaza con la ruta de tu página setcookie("adminx", $cookieValue, time() + (3600*12), $cookiePath, $cookieDomain, false, true); } else if ($rowuser['tipo'] == 'Hotel' or $rowuser['tipo'] == 'Agencia' or $rowuser['tipo'] == 'Salón') { // $_SESSION['administrador'] = ''; $_SESSION['otro_usuario'] = $rowuser['tipo']; $_SESSION['razon_social'] = $rowuser['razon_social']; $_SESSION['name'] = $rowuser['nombre']; $_SESSION['user_id'] = $rowuser['id']; $_SESSION['empresa_id'] = $rowuser['empresa_id']; } else { $mensaje = 'No tienes acceso a esta aplicación'; } } /// FIN DE INGRESAR //echo '127*'; //// RECORDAR CLAVE if ($_POST['accion'] == 'recordar') { //echo 'B'; /// consultamos para saber si este correo esta registrado $nuevo_email = $_POST['email']; //echo "
select * from usuarios Where email='$nuevo_email'
"; $re = mysqli_query($conn, "select * from usuarios Where email='$nuevo_email' Limit 1") or die(mysqli_error($conn)); $rowe = mysqli_fetch_array($re); //echo 'C'; //echo mysqli_num_rows($re).'//'.mysqli_num_rows($re2).'
'; if ($rowe['id'] == '') { $mensaje = 'El email ' . $nuevo_email . ' no esta registrado en nuestro sistema'; } else if ($rowe['activo'] == 'no') { $mensaje = 'Tu acceso no esta activo'; } else { // actualizamos con la nueva clave $clave = $_POST['clave']; $nueva_clave = md5($clave); $user = $rowe['contacto']; $id = $rowe['id']; $id2 = md5($rowe['id'] . 'U$.j6yT'); /// //// se envia un correo para confirmacion del cambio $contenido = '' . $user . '

Se ha recibido su solicitud para asignar una nueva clave de acceso a nuestro sistema. Para ejecutar la solicitud por favor haga click en este vinculo:
Realizar Cambio de Clave

Email: ' . $nuevo_email . '
Nueva Clave: ' . $clave . '

'; $subjet = 'Metrica Urbana: Nueva Clave de Acceso'; ///+++ $my_file = ''; // puede ser cualquier formato $my_path = ''; $my_name = "Metrica Urbana"; $my_mail = "soporte@metricaurbana.cityciudad.com"; $my_replyto = "soporte@metricaurbana.cityciudad.com"; $asunto = $subjet; ob_start(); include("mail.php"); $html = ob_get_contents(); ob_end_clean(); $my_message = $html; //echo $my_message.'


'; //echo $nuevo_email; /* if($rowfts['foto_id']==10){ mail_attachment($my_file, $my_path, $email, $my_mail, $my_name, $my_replyto, $asunto, $my_message); } */ //mail_attachment($my_file, $my_path, $email, $my_mail, $my_name, $my_replyto, $asunto, $my_message); /////////////++++++++++ $files = array(); //$files[] =''; //$send_email = multi_attach_mail($nuevo_email,$asunto,$html,$my_mail,$my_name,$files); $cabeceras = 'MIME-Version: 1.0' . "\r\n"; $cabeceras .= 'Content-type: text/html; charset=utf-8' . "\r\n"; $cabeceras .= 'From: Metrica Urbana'; $send_email = mail($nuevo_email, $asunto, $html, $cabeceras); //if(mail_attachment($my_file, $my_path, $nuevo_email, $my_mail, $my_name, $my_replyto, $asunto, $my_message)){ //print message after email sent //echo $send_email?"Mail Sent":" Mail not SEND"; if ($send_email == true) { $mensaje = 'Para realizar el cambio, siga las instrucciones que le hemos enviado a su correo ' . $nuevo_email . '
(puede llegar como correo no deseado)'; } else { $mensaje = 'No se pudo enviar el correo de verificación. Intentelo de Nuevo, por favor'; } } } //// FIN DE SOLICITUD RECORDAR DE CLAVE /// para borrar un item del menu en las estaciones dejar la fecha de actualizacion en CERO ?> Metrica Urbana

No tiene Clave? la Olvidó? Panel de ingreso
Usuario:
Mis Datos
Estadísticas
Accesos
" onClick="cargar('Mi Reporte');"> Mi Reporte
*/ } ?>
*-