darshan_saroya

contact-three.php

Mar 11th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.94 KB | None | 0 0
  1. <?php //Template Name: Contact Page-3
  2. get_header();
  3. get_template_part('weblizar','breadcrumbs');
  4. $wl_theme_options = chronicle_contact_options();  ?>
  5. <div class="container">
  6.     <div class="content_fullwidth lessmar">    
  7.       <div class="two_third">      
  8.         <?php the_post();
  9.         the_content();?>
  10.         <br /><br />        
  11.         <div class="cforms">        
  12.         <form action="#" method="POST" id="weblizar_form" class="sky-form">
  13.           <header><?php _e('Formulário de ','weblizar') ;?> <strong><?php _e('Contato','weblizar') ;?></strong></header>
  14.           <fieldset>
  15.             <div class="row">
  16.               <section class="col col-6">
  17.                 <label class="label"><?php _e('Nome','weblizar');?></label>
  18.                 <label class="input"> <i class="icon-append icon-user"></i>
  19.                   <input type="text" name="user_name" id="user_name">
  20.                 </label>
  21.                 <span id="contact_name_error" style="display:none;"><?php _e('Por favor, preencha com seu nome','weblizar'); ?></span>
  22.               </section>
  23.               <section class="col col-6">
  24.                 <label class="label"><?php _e('E-mail','weblizar');?></label>
  25.                 <label class="input"> <i class="icon-append icon-envelope-alt"></i>
  26.                   <input type="email" name="user_email" id="user_email">
  27.                 </label>
  28.                 <span id="contact_email_error" style="display:none;"><?php _e('Por favor, preencha com seu e-mail','weblizar'); ?></span>
  29.               </section>
  30.             </div>
  31.             <section>
  32.               <label class="label"><?php _e('Assunto','weblizar');?></label>
  33.               <label class="input"> <i class="icon-append icon-tag"></i>
  34.                 <input type="text" name="subject" id="subject">
  35.               </label>
  36.             </section>
  37.             <section>
  38.               <label class="label"><?php _e('Mensagem','weblizar');?></label>
  39.               <label class="textarea"> <i class="icon-append icon-comment"></i>
  40.                 <textarea rows="4" name="user_message" id="user_message"></textarea>
  41.               </label>
  42.               <span id="contact_user_massage_error" style="display:none;"><?php _e('Por favor, escreva sua mensagem','weblizar'); ?></span>
  43.             </section>         
  44.           </fieldset>
  45.           <footer>
  46.             <button name="query_submit" id="query_submit" type="submit" class="button"><?php _e('Enviar Mensagem','weblizar');?></button>
  47.           </footer>        
  48.         </form>
  49.         <div id="enquiry_send_massage" class="message" style="display:none;">
  50.             <p><?php _e('Your message was successfully sent!','weblizar');?></p>
  51.          </div>
  52.         </div>     
  53.       </div>      
  54.       <?php if(isset($_POST['query_submit']))
  55.             {   if($_POST['user_name']==''){   
  56.             echo "<script>jQuery('#contact_name_error').show();</script>";
  57.             } else
  58.             if($_POST['user_email']=='') {
  59.             echo "<script>jQuery('#contact_email_error').show();</script>";
  60.             } else
  61.             if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $_POST['user_email'])) {                            
  62.                 echo "<script>jQuery('#contact_email_error').show();</script>";
  63.             } else 
  64.             if($_POST['user_message'] ==''){                           
  65.                 echo "<script>jQuery('#contact_user_massage_error').show();</script>";
  66.             }
  67.             else
  68.             {   $email = get_option('admin_email');
  69.                
  70.                 $multiple_to_recipients = array($email,'recipient2@foo.example.com');
  71.                 $subject = "You have new enquiry  form".get_option("blogname");
  72.                 $massage =  stripslashes(trim($_POST['user_message']))."<br>Message sent from  <br> Name:" . trim($_POST['user_name']). "<br>Email :". trim($_POST['user_email']);
  73.                 $headers = "From: ".trim($_POST['user_name'])." <".trim($_POST['user_email']).">\r\nReply-To:".trim($_POST['user_email']);                         
  74.                 add_filter( 'wp_mail_content_type', 'wl_html_content_type' );
  75.                 function wl_html_content_type() {
  76.                 return 'text/html';
  77.                 }
  78.                 $enquerysend =wp_mail( $multiple_to_recipients, $subject, $massage, $headers);
  79.                 echo "<script>jQuery('#weblizar_form').hide();</script>";
  80.                 echo "<script>jQuery('#enquiry_send_massage').show();</script>";   
  81.             }
  82.         }
  83.     ?>
  84.     <div class="one_third last">      
  85.         <div class="address_info two">
  86.         <?php if($wl_theme_options['contact_heading'] !='') { ?>
  87.         <h4><?php echo $wl_theme_options['contact_heading']; ?></h4>
  88.         <?php } ?>
  89.           <ul>
  90.             <li><?php
  91.             if($wl_theme_options['contact_address_text'] !='') {
  92.             echo $wl_theme_options['contact_address_text']; ?> <br />
  93.             <?php }
  94.             if($wl_theme_options['contact_address'] !='') {
  95.               echo $wl_theme_options['contact_address']; ?><br />
  96.               <?php }
  97.               if($wl_theme_options['contact_phone_no'] !='') {
  98.               echo $wl_theme_options['phone_number_text']; ?>: <?php echo $wl_theme_options['contact_phone_no']; ?><br />
  99.               <?php
  100.               }
  101.               if($wl_theme_options['fax_number'] !='') {
  102.               echo $wl_theme_options['fax_number_text']; ?>: <?php echo $wl_theme_options['fax_number']; ?><br />
  103.               <?php
  104.               }
  105.               if($wl_theme_options['contact_email'] !='') {
  106.               echo $wl_theme_options['contact_email_text']; ?>: <a href="mailto:<?php echo $wl_theme_options['contact_email']; ?>"><?php echo $wl_theme_options['contact_email']; ?></a><br />
  107.               <?php
  108.               }
  109.               if($wl_theme_options['website_address'] !='') {
  110.               echo $wl_theme_options['website_address_text']; ?>: <a href="<?php echo $wl_theme_options['website_address']; ?>"><?php echo $wl_theme_options['website_address']; ?></a>
  111.               <?php } ?>
  112.               </li>
  113.           </ul>
  114.         </div>     
  115.     </div>
  116.     <?php if($wl_theme_options['google_map_on_contact'] =='on' ) { ?>
  117.     <div class="one_full">
  118.         <iframe class="google-map2" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<?php echo $wl_theme_options['google_maps']; ?>"></iframe><br />
  119.     </div>
  120.     <?php } ?>
  121.     </div>    
  122. </div><!-- end content area -->
  123. <div class="margin_top5"></div>
  124. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment