![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
26/11/2016, 00:20
|
![Avatar de Jose_A](http://static.forosdelweb.com/customavatars/avatar570486_1.gif) | | | Fecha de Ingreso: mayo-2015 Ubicación: México, Sonora.
Mensajes: 180
Antigüedad: 9 años, 8 meses Puntos: 0 | |
Respuesta: Ocultar Toda la información en caso específco
Código:
else{
$fact_nombre=$_POST["fact_nombre"];
$fact_calle=$_POST["fact_calle"];
$fact_numero=$_POST["fact_numero"];
$fact_colonia=$_POST["fact_colonia"];
$fact_cp=$_POST["fact_cp"];
$fact_municipio=$_POST["fact_municipio"];
$fact_estado=$_POST["fact_estado"];
$fact_rfc=$_POST["fact_rfc"];
$fact_email=$_POST["fact_email"];
$fact_pais=$_POST["fact_pais"];
$nombre = ucwords($_POST["Nombre"]);
$apellidoP = ucwords($_POST["ApellidoP"]);
$apellidoM = ucwords($_POST["ApellidoM"]);
$institucion = ucwords($_POST["Institucion"]);
$rol = $_POST["rol"];
if(isset($_POST["estudiante"])){
$estudiante=$_POST["estudiante"];
}else{
$estudiante="0";
}
if(isset($_POST["becado"])){
$becado=$_POST["becado"];
}else{
$becado="0";
}
/*
if($estudiante=="1"){
$estudiante="true";
}else{
$estudiante="false";
}
if($becado=="1"){
$becado="true";
}else{
$becado="false";
}
*/
if(isset($_POST["option1"])){
$op1 = $_POST["option1"];
}else{
$op1="";
}
$email=$_POST["email"];
echo $bandera;
//echo 'éxito... ' . $mysqli->host_info . "<br>";
//$tabla=$mysqli->query("select max(id) FROM asistente");
mysqli_set_charset($mysqli,'utf8');
$tabla=$mysqli->query("select year from semana where activado=1");
$activado=$tabla->fetch_array()[0];
$tabla=$mysqli->query("select count(year) FROM asistente where year= '".$activado."'");
//printf($tabla->num_rows);
/*if ($tabla->num_rows > 0) {
// output data of each row
while($row = $tabla->fetch_array()) {
$id=$row[0]+1;
}
} else {
$id=1;
}*/
$row = $tabla->fetch_array();
$id=$row[0]+1;
$folio=$activado; //Incrementamos el folio en la version dos.
$folio.="-";
$folio.=substr($nombre,0,1);
$folio.=substr($apellidoP,0,1);
$folio.=substr($apellidoM,0,1);
$folio.="-";
$folio.=rand(1000,9999);
$folio.="-";
$folio.=$id;
$nombre=$mysqli->real_escape_string($nombre);
$apellidoP=$mysqli->real_escape_string($apellidoP);
$apellidoM=$mysqli->real_escape_string($apellidoM);
$institucion=$mysqli->real_escape_string($institucion);
$rol=$mysqli->real_escape_string($rol);
$folio=$mysqli->real_escape_string($folio);
$email=$mysqli->real_escape_string($email);
if(empty($_FILES["rutaIMGcred"]['name'])){
$target_file="null";
}
else{
include "uploadCred.php";
}
if($becado==1){
$verificacionNueva=1;
}else{
$verificacionNueva=4;
}
$tabla=$mysqli->query("insert into asistente (nombre,apellidoPaterno,apellidoMaterno,institucion,tipo,folio,email,verificacion,rutaImagenPago,estudiante,becado,factura,rutaImagenCredencial,year) values('".htmlentities($nombre)."','".htmlentities($apellidoP)."','".htmlentities($apellidoM)."','".htmlentities($institucion)."','".$rol."','".$folio."','".htmlentities($email)."','".$verificacionNueva."','null','".$estudiante."','".$becado."',1,'".$target_file."','".$cursoActivo."')");
foreach ($op1 as $i){
$tabla=$mysqli->query("insert into curso_asistente (claveCurso, idUsuario, inscrito) values ('".$i."','".$folio."',0)");
//$table=$mysqli->query("update cursos set Cupo = Cupo-1 where idCurso ='".$i."'");
}
$fact_nombre=$mysqli->real_escape_string($fact_nombre);
$fact_calle=$mysqli->real_escape_string($fact_calle);
$fact_numero=$mysqli->real_escape_string($fact_numero);
$fact_colonia=$mysqli->real_escape_string($fact_colonia);
$fact_cp=$mysqli->real_escape_string($fact_cp);
$fact_municipio=$mysqli->real_escape_string($fact_municipio);
$fact_estado=$mysqli->real_escape_string($fact_estado);
$fact_rfc=$mysqli->real_escape_string($fact_rfc);
$fact_email=$mysqli->real_escape_string($fact_email);
$fact_pais=$mysqli->real_escape_string($fact_pais);
if(isset($_POST["desglosado"])){
$fact_desglosado=$_POST["desglosado"];
}else{
$fact_desglosado="0";
}
/*
if($fact_desglosado=="1"){
$fact_desglosado="Si";
}else{
$fact_desglosado="No";
}
*/
$tabla=$mysqli->query("insert into factura (nombre,calle,numero,colonia,cp,municipio,estado,rfc,idUsuario,emailFactura,pais,ivaDesglosado,verificacion) values ('".htmlentities($fact_nombre)."','".htmlentities($fact_calle)."','".htmlentities($fact_numero)."','".htmlentities($fact_colonia)."','".htmlentities($fact_cp)."','".htmlentities($fact_municipio)."','".htmlentities($fact_estado)."','".htmlentities($fact_rfc)."','".htmlentities($folio)."','".htmlentities($fact_email)."','".htmlentities($fact_pais)."','".$fact_desglosado."',4)");
$mysqli->close();
include "config.php";
require 'class.phpmailer.php';
$mail = new PHPMailer();
//Luego tenemos que iniciar la validación por SMTP:
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $host; // SMTP a utilizar. Por ej. smtp.elserver.com
$mail->Username = $Username; // Correo completo a utilizar
$mail->Password = $password; // Contraseña
$mail->Port = $port; // Puerto a utilizar
$mail->SMTPSecure = $smtpSecure;
//Con estas pocas líneas iniciamos una conexión con el SMTP. Lo que ahora deberíamos hacer, es configurar el mensaje a enviar, el //From, etc.
//$mail->From = "[email protected]"; // Desde donde enviamos (Para mostrar)
$mail->FromName = $fromName;
//Estas dos líneas, cumplirían la función de encabezado (En mail() usado de esta forma: “From: Nombre <[email protected]>”) de //correo.
$mail->AddAddress($email); // Esta es la dirección a donde enviamos
$mail->IsHTML(true); // El correo se envía como HTML
$mail->Subject = "Registro a la SNIDM - Universidad de Sonora"; // Este es el titulo del email.
$body = "<strong> Hola ".htmlentities($nombre).",<br><br>
Recuerda que aún NO completas tu inscripción a la Semana Nacional de Investigación y Docencia en Matemáticas.
<br>Debes enviar tu comprobante de pago y esperar el correo de confirmación por parte del Comité Organizador.</strong><br><br>";
$body .= "<span><strong>Cursos Seleccionados:</strong></span><br>";
$cursoSelec = $mysqli->query("select curso.nombreCurso from curso
inner join curso_asistente on curso.idCurso = curso_asistente.idCurso
where idUsuario='".$id."'");
$body .= "<strong>Datos Bancarios para realizar el pago:</strong><br>";
$body .= "<strong>Nombre: </strong> Universidad de Sonora<br>";
$body .= "<strong>Número de cuenta</strong>: 6-550-17-89-3-98<br>";
$body .= "<strong>Banco</strong>: Santander <br>";
$body .= "<strong>CLABE interbancaria</strong>: 014760655017893981<br><br>";
$body .= "<strong>Datos De registro:</strong><br>";
$body .= "<strong>Folio</strong>:".$folio."<br>";
$body .= "<strong>Nombre:</strong>".htmlentities($nombre)." ".htmlentities($apellidoP)." ".htmlentities($apellidoM)."<br>";
$body .= "<strong>Registrado como:</strong>".$rol."<br>";
$body .= "<strong>Institución</strong>:".htmlentities($institucion)."<br><br>";
$body .= "<strong>Datos De Facturación:</strong><br>";
$body .= "<strong>Nombre</strong>:".htmlentities($fact_nombre)."<br>";
$body .= "<strong>Calle</strong>:".htmlentities($fact_calle)."<br>";
$body .= "<strong>Número</strong>:".htmlentities($fact_numero)."<br>";
$body .= "<strong>Colonia</strong>:".htmlentities($fact_colonia)."<br>";
$body .= "<strong>C.P.</strong>:".htmlentities($fact_cp)."<br>";
$body .= "<strong>Municipio</strong>:".htmlentities($fact_municipio)."<br>";
$body .= "<strong>Estado</strong>:".htmlentities($fact_estado)."<br>";
$body .= "<strong>País</strong>:".htmlentities($fact_pais)."<br>";
$body .= "<strong>R.F.C</strong>:".htmlentities($fact_rfc)."<br>";
$body .= "<strong>Iva desglosado: </strong>".htmlentities($fact_desglosado)."<br>";
$body .= "<strong>E-mail</strong>:".htmlentities($fact_email)."<br><br>";
$body .= "<span>Para cualquier consulta o correcion comunicarse a [email protected]</span><br><br><br><br>";
<p style='font-size:10px;'>Las opiniones expresadas en este correo electrónico deberán ser confirmadas por escrito y firmadas por el remitente para tener validez legal, por lo que el correo electrónico no es el medio apropiado para emitir opiniones o recomendaciones formales.</p><br>";
$mail->Body = $body; // Mensaje a enviar
$exito = $mail->Send(); // Envía el correo.
//También podríamos agregar simples verificaciones para saber si se envió:
if($exito){
echo true;
echo "Se envio";
}else{
echo $mail->ErrorInfo;
}
header("Location:succes.php?folio=".$folio);
}
?>
|