Advertisement
Am2016

formClubPremier

Mar 1st, 2016
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 10.26 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="es" class="no-js">
  3. <head>
  4.         <meta charset="UTF-8"/>
  5.         <title>Club Premier
  6.                 | Aeromexico</title>       
  7.         <meta name="description" content=""/>
  8.         <meta name="viewport" content="width=device-width">
  9.         <meta name="keywords" content=""/>
  10.         <meta property="og:type" content="website"/>
  11.         <meta property="og:url" content="http://www.aeromexico.com/es/mx/acreditaciones-kmp/"/>
  12.         <meta property="og:site_name" content="aeromexico"/>
  13.         <meta property="og:description" content=""/>
  14.         <meta property="og:locale" content="es_MX"/>
  15.         <meta property="og:image" content="http://www.aeromexico.com/.galleries/aeromexico-trip.jpg"/>
  16.         <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  17.         <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
  18.         <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  19.         <script src="http://www.vuela.aeromexico.com/forms/templates/parsley.es.js"></script>
  20.         <script src="//cdnjs.cloudflare.com/ajax/libs/parsley.js/2.0.2/parsley.min.js"></script>
  21.         <link rel="stylesheet" href="https://www.aeromexico.com/export/system/modules/com.aeromexico.bootstrap.basics/resources/css/main.min.css" type="text/css"></link>
  22.     <script>
  23.       $(function() {
  24.         $('#emailform').parsley();
  25.         $(".datepicker" ).datepicker({ minDate: "-7M", maxDate: "0" });
  26.         $("#error").delay(4000).hide(1500);
  27.         $(".success").delay(4000).hide(1500);
  28.       });
  29.   </script>
  30.   <style type="text/css">
  31.   .ui-datepicker-title, .ui-datepicker-year{color:#555 !important;}
  32.   .error {background: #fbdede; width: 80%; margin:10px auto; height:40px;border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;color:#b60000;text-align:center;padding:10px 0 0 0;}
  33.   .success {background: #deffc3; width: 80%; margin:10px auto; height:40px;border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;color:#005538;text-align:center;padding:10px 0 0 0;}
  34.   .hide{display:none;}
  35.   #recaptcha_widget_div{margin:0 auto;width:318px;}
  36.     ul.parsley-errors-list{
  37.         margin:0;
  38.         padding:0;
  39.     }
  40.     ul.parsley-errors-list li{
  41.         background: #fbdede;
  42.         height:15px;
  43.         width: 80%;
  44.         margin:0 0 0 5px;
  45.         padding:0;
  46.         list-style-type: none;
  47.         color: #CC0000;
  48.         font-weight:bold;
  49.         font-size:12px;
  50.         border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;
  51.         text-indent:5px;
  52.     }
  53.   </style>
  54. <body>
  55. <?php
  56. require_once(__DIR__ . '/recaptchalib.php');
  57. require_once(__DIR__ .'/phpmailer/class.phpmailer.php');
  58. require_once(__DIR__ .'/phpmailer/class.smtp.php');
  59.     $valid = true;
  60.     $errors = array();
  61.     $captchaerror = null;
  62.     $config = include(__DIR__ . '/config.php');
  63.     $contact = array(
  64.             'InputField-1' => null,
  65.             'InputField-2' => null,
  66.             'InputField-3' => null,
  67.             'InputField-4' => null,
  68.             'InputField-5' => null,
  69.             'InputField-6' => null,
  70.             'InputField-7' => null
  71.     );
  72.  
  73.         if (isset($_POST['recaptcha_challenge_field'],$_POST['recaptcha_response_field'])) {
  74.             $resp = recaptcha_check_answer(
  75.             $config['recaptcha']['privatekey'],
  76.             $_SERVER["REMOTE_ADDR"],
  77.             $_POST["recaptcha_challenge_field"],
  78.             $_POST["recaptcha_response_field"]
  79.             );
  80.  
  81.             if (!$resp->is_valid) {
  82.                 $captchaerror = $resp->error;
  83.                 $valid = false;
  84.                 $errors['captcha'] = "El texto del captcha no coincide";
  85.         }
  86.        
  87.         $contact = filter_input_array(INPUT_POST, array(
  88.             'InputField-1'   => FILTER_SANITIZE_STRING,
  89.             'InputField-2' => FILTER_SANITIZE_STRING,
  90.             'InputField-3' => FILTER_SANITIZE_STRING,
  91.             'InputField-4' => FILTER_SANITIZE_STRING,
  92.             'InputField-5' => FILTER_SANITIZE_STRING,
  93.             'InputField-6' => FILTER_SANITIZE_STRING,
  94.             'InputField-7' => FILTER_SANITIZE_STRING
  95.  
  96.         ), true);
  97.         // Aquí se deberían validar los datos ingresados por el usuario
  98.         if (empty($_POST['InputField-1']) || empty($_POST['InputField-2']) || empty($_POST['InputField-3']) || empty($_POST['InputField-4'])) {
  99.             $valid = false;
  100.             $errors[] = "Ocurrió un error. Existen campos vacíos y el formulario no ha podido ser envíado.";
  101.         }
  102.         if($valid){
  103.             $destinatario = "premier@aeromexico.com.mx";
  104.             $asunto = "Formulario Club Premier";
  105.             $remitente ="amsender@aeromexico.com";
  106.  
  107.             // Create the mail
  108.             $mail = new PHPMailer();
  109.             $mail->IsSMTP();
  110.             $mail->SMTPAuth = true;
  111.             $mail->SMTPSecure = "ssl";
  112.             $mail->Host = "smtp.gmail.com";
  113.             $mail->Port = 465;
  114.             //indico un usuario / clave de un usuario de gmail
  115.             $mail->Username = $config['mail']['username'];
  116.             $mail->Password = $config['mail']['password'];
  117.             $mail->Subject = $asunto;
  118.             $mail->setFrom($remitente, 'Aeromexico');
  119.             $mail->AddAddress($destinatario, "");
  120.             $mail->IsHTML(true);
  121.             $body = "<h2>Club Premier</h2><br/>
  122.             <p>Nombre: " . $_POST["InputField-1"] . "</p>
  123.             <p>Apellido: " . $_POST["InputField-2"] . "</p>
  124.             <p>Email: " . $_POST["InputField-3"] . "</p>
  125.             <p>Clave de larga distancia: " . $_POST["InputField-4"] . "</p>
  126.             <p>Teléfono: " . $_POST["InputField-5"] . "</p>
  127.             <p>Número de cuenta: " . $_POST["InputField-6"] . "</p>
  128.             <p>Mensaje: " . $_POST["InputField-7"] . "</p><br/>";
  129.             $mail->Body = $body;
  130.  
  131.             // Create the mail transport
  132.             if($mail->Send()) {
  133.                 echo "<div class='success'>Gracias por llenar el formulario. Se ha enviado correctamente.</div>";              
  134.                 } else {
  135.                 echo "Error al enviar el mensaje: " . $mail->ErrorInfo;
  136.             }
  137.  
  138.         }
  139.     }
  140. ?>  
  141. <h2 style="text-align:center;">CLUB PREMIER</h2>
  142. <p>Si requieres ayuda inmediata o tienes cualquier duda respecto a <strong>Club Premier</strong>, por favor comunícate a nuestro al <strong>Centro de Atención Telefónica Club Premier</strong> en el <strong>1519 4040</strong> desde la Ciudad de México o del interior de la república en el <strong>01 800 5 PREMIER (7736437)</strong>.</p>
  143. <p>Si te encuentras fuera de México comunícate con nosotros en los siguientes números telefónicos:</p>
  144. <p><strong>Argentina</strong> 0800 888 2276</p>
  145. <p><strong>Chile</strong> 800 400 239</p>
  146. <p><strong>Brasil</strong> 0800 891 7512</p>
  147. <p><strong>Estados Unidos</strong> (1) 855 412 2650</p>
  148. <p><strong>España</strong> 900 995 282 (Llamada sin costo)</p>
  149. <p>Horarios de atención de lunes a domingo de 08:00 a 22:00 hrs. (horario de la Ciudad de México) world clock o vía correo electrónico a <a href="mailto:soporte@clubpremier.com">soporte@clubpremier.com</a></p> </div>
  150. <div id="info" class="content">
  151. <form class="form-horizontal" id="emailform" action="<?php echo $_SERVER['PHP_SELF']; ?>"
  152.     method="post" >
  153. <?php if (!$valid): ?>
  154.     <div id="error">
  155.         <?php  foreach($errors as $message):?>
  156.             <div class ="error"><?php echo htmlspecialchars($message); ?></div>
  157.         <?php  endforeach; ?>
  158.     </div>
  159. <?php  endif; ?>
  160. <div class="webform_wrapper">
  161.     <div class="form-group">
  162.     <label class="col-sm-4 text-right" for="InputField-1">Nombre*</label>
  163. <div class="col-sm-5">
  164.     <input type="text" name="InputField-1" value="<?php echo htmlspecialchars($contact['InputField-1']);?>"
  165.             id="InputField-1"
  166.         class="form-control"
  167.             placeholder="Escribe tu nombre" required data-parsley-required-message="Éste es un campo requerido."
  168.         />
  169. </div>
  170.     </div>  <div class="form-group">
  171.     <label class="col-sm-4 text-right" for="InputField-2">Apellido*</label>
  172. <div class="col-sm-5">
  173.     <input type="text" name="InputField-2" value="<?php echo htmlspecialchars($contact['InputField-2']);?>"
  174.             id="InputField-2"
  175.         class="form-control"
  176.             placeholder="Escribe tu apellido" required data-parsley-required-message="Éste es un campo requerido."
  177.         />
  178. </div>
  179.     </div>  <div class="form-group">
  180.     <label class="col-sm-4 text-right" for="InputField-3">Email*</label>
  181. <div class="col-sm-5">
  182.     <input type="text" name="InputField-3" data-parsley-type="email" value="<?php echo htmlspecialchars($contact['InputField-3']);?>"
  183.             id="InputField-3"
  184.         class="form-control"
  185.             placeholder="Escribe tu email"  data-parsley-type-message="Éste debe ser un correo válido." data-parsley-required-message="Éste es un campo requerido."  required
  186.         />
  187. </div>
  188.     </div>  <div class="form-group">
  189.     <label class="col-sm-4 text-right" for="InputField-4">Clave de larga distancia*</label>
  190. <div class="col-sm-5">
  191.     <input type="text" name="InputField-4" value="<?php echo htmlspecialchars($contact['InputField-4']);?>"
  192.             id="InputField-4"
  193.         class="form-control"
  194.             placeholder="Escribe clave de larga distancia" required data-parsley-required-message="Éste es un campo requerido."
  195.         />
  196. </div>
  197.     </div>  <div class="form-group">
  198.     <label class="col-sm-4 text-right" for="InputField-5">Teléfono</label>
  199. <div class="col-sm-5">
  200.     <input type="text" name="InputField-5" value=<?php echo htmlspecialchars($contact['InputField-5']);?>""
  201.             id="InputField-5"
  202.         class="form-control"
  203.             placeholder="Escribe teléfono"
  204.         />
  205. </div>
  206.     </div>  <div class="form-group">
  207.     <label class="col-sm-4 text-right" for="InputField-6">Número de cuenta</label>
  208. <div class="col-sm-5">
  209.     <input type="text" name="InputField-6" value="<?php echo htmlspecialchars($contact['InputField-6']);?>"
  210.             id="InputField-6"
  211.         class="form-control"
  212.             placeholder="Escribe Numero de cuenta"
  213.         />
  214. </div>
  215.     </div>  <div class="form-group">
  216.     <label class="col-sm-4 text-right" for="InputField-7">Mensaje</label>
  217. <div class="col-sm-5">
  218.     <textarea class="form-control" cols="5" rows="5" name="InputField-7" id="InputField-7"  maxlength="1700" value="<?php echo htmlspecialchars($contact['InputField-7']);?>"></textarea>
  219. </div>
  220.     </div> 
  221. <div class="col-sm-12 text-justify captcha">
  222.     <?php echo recaptcha_get_html($config['recaptcha']['publickey'], $captchaerror); ?>
  223. </div>
  224.  
  225.     <div class="col-sm-12 text-center">
  226.         <p>Todos los campos marcados con un asterisco (*) son obligatorios.</p>
  227.     </div>
  228.     <div class="form-group text-center">
  229.         <input type="submit" value="Enviar" class="btn b-sky formbutton submitbutton" id="submit" name="submit" />  
  230.         <input type="reset" value="Limpiar formulario" class="btn b-gray formbutton resetbutton" />
  231.     </div>
  232. </div></form></div>
  233.  
  234. <div class="col-sm-12 text-justify">
  235.     <p>En caso de encontrarte en <strong>Europa</strong>, favor de escribir a <a href="mailto:helpdeskeuropa@clubpremier.com" target="_self">helpdeskeuropa@clubpremier.com</a> donde todas tus dudas serán atendidas.</p>
  236. </div>
  237.  
  238. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement