darshan_saroya

contact-us.php

Mar 11th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.55 KB | None | 0 0
  1. <?php
  2. // Template Name: contact-us
  3.  get_header();
  4.  get_template_part('breadcrums');  ?>
  5.  
  6.  <?php  $wl_theme_options=get_option('enigma_options_pro');  ?>
  7.  <div class="enigma_contact_area">
  8.     <div class="container">
  9.         <div class="row enigma_cotact_form_div">
  10.             <div class="col-md-12">
  11.                 <div class="enigma_heading_title">
  12.                 <?php if($wl_theme_options['contact_heading']!='') {  
  13.                     echo "<h3>".$wl_theme_options['contact_heading']."</h3>";
  14.                 }
  15.                 if($wl_theme_options['contact_description']!='') { ?>
  16.                     <p class="sub-title"><?php echo $wl_theme_options['contact_description']; ?></p>   
  17.                 <?php } ?>
  18.                 </div>
  19.             </div>         
  20.             <div class="col-md-6 enigma_contact_form_fields">
  21.                 <div id="weblizar_form">
  22.                     <form role="form" method="POST"  action="#">   
  23.                         <div class="enigma_form_group">
  24.                             <label for="exampleInputEmail1"><?php _e('Name','weblizar'); ?><small>*</small></label>
  25.                             <input type="name" name="user_name" id="user_name" class="enigma_con_input_control">
  26.                             <span id="contact_name_error" style="display:none;color:red;"><?php _e('Fill your name','weblizar'); ?></span>
  27.                         </div>
  28.                         <div class="enigma_form_group">
  29.                             <label for="exampleInputPassword1"><?php _e('Email','weblizar'); ?><small>*</small></label>
  30.                             <input type="email" id="user_email" name="user_email" class="enigma_con_input_control">
  31.                             <span id="contact_email_error" style="display:none;color:red;"><?php _e('Fill your email','weblizar'); ?></span>
  32.                         </div>
  33.                        
  34.                         <div class="enigma_form_group">
  35.                             <label for="exampleInputPassword1"><?php _e('Nachricht','weblizar'); ?></label>
  36.                             <textarea class="enigma_con_textarea_control" name="user_message"  rows="5"></textarea>
  37.                             <span id="contact_user_massage_error" style="display:none;color:red;"><?php _e('Fill your Text massage','weblizar'); ?></span>
  38.                         </div>
  39.                         <button class="enigma_send_button" type="submit" name="query_submit" id="query_submit"><?php _e('Nachricht Senden','weblizar'); ?></button>
  40.                     </form>
  41.                 </div>
  42.                 <div id="enquiry_send_massage" style="display:none;">
  43.                     <div class="callout-box callout-box2 clearfix">
  44.                         <div class="callout-content">
  45.                             <h2><?php _e('Anfrage erfogreich übermittelt','weblizar'); ?></h2>                        
  46.                         </div>    
  47.                     </div>
  48.                 </div>
  49.             </div>
  50.             <?php
  51.                 if(isset($_POST['query_submit']))
  52.                 {   if($_POST['user_name']==''){   
  53.                         echo "<script>jQuery('#contact_name_error').show();</script>";
  54.                     } else
  55.                     if($_POST['user_email']=='') {
  56.                         echo "<script>jQuery('#contact_email_error').show();</script>";
  57.                     } else
  58.                     if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $_POST['user_email'])) {                            
  59.                         echo "<script>jQuery('#contact_email_error').show();</script>";
  60.                     } else 
  61.                     if($_POST['user_message'] ==''){                           
  62.                         echo "<script>jQuery('#contact_user_massage_error').show();</script>";
  63.                     }
  64.                     else
  65.                     {   $email = get_option('admin_email');
  66.                         $subject = "You have new enquiry  form".get_option("blogname");
  67.                         $massage =  stripslashes(trim($_POST['user_message']))."Message sent from  Name:" . trim($_POST['user_name']). "<br>Email :". trim($_POST['user_email']);
  68.                         $headers = "From: ".trim($_POST['user_name'])." <".trim($_POST['user_email']).">\r\nReply-To:".trim($_POST['user_email']);                         
  69.                         $enquerysend =wp_mail( $email, $subject, $massage, $headers);
  70.                        
  71.                         echo "<script>jQuery('#weblizar_form').hide();</script>";
  72.                         echo "<script>jQuery('#enquiry_send_massage').show();</script>";   
  73.                     }
  74.                 }
  75.             ?>
  76.             <div class="col-md-6 enigma_contact_info">
  77.                 <ul><?php if($wl_theme_options['phone_number_text']!='') {  ?>
  78.                     <li>
  79.                         <i class="fa fa-phone"></i><span class="text">
  80.                         <span class="desc"><?php echo $wl_theme_options['phone_number_text']; ?></span>
  81.                         <?php if($wl_theme_options['contact_phone_no']!='') { echo $wl_theme_options['contact_phone_no'];  } ?>
  82.                         </span>
  83.                     </li>
  84.                     <?php }
  85.                     if($wl_theme_options['general_info_text'] !='') {  ?>
  86.                     <li>
  87.                         <i class="fa fa-envelope"></i><span class="text">
  88.                         <span class="desc"><?php echo $wl_theme_options['general_info_text']; ?></span>
  89.                         <?php if($wl_theme_options['contact_email']!='') { echo $wl_theme_options['contact_email'];  } ?>
  90.                         </span>
  91.                     </li>
  92.                     <?php }
  93.                     if($wl_theme_options['work_time_text'] !='') {  ?>
  94.                     <li>
  95.                         <i class="fa fa-clock-o"></i><span class="text">
  96.                         <span class="desc"><?php echo $wl_theme_options['work_time_text']; ?></span>
  97.                         <?php if($wl_theme_options['work_time']!='') { echo $wl_theme_options['work_time'];  } ?>
  98.                         </span>
  99.                     </li>
  100.                     <?php }
  101.                     if($wl_theme_options['where_we_are_text'] !='') {  ?>                  
  102.                     <li>
  103.                         <i class="fa fa-map-marker"></i><span class="text">
  104.                         <span class="desc"><?php echo $wl_theme_options['where_we_are_text']; ?></span>
  105.                         <?php if($wl_theme_options['contact_address']!='') { echo $wl_theme_options['contact_address'];  } ?>
  106.                         </span>
  107.                     </li>
  108.                     <?php } ?>                 
  109.                 </ul>
  110.             </div>         
  111.         </div>
  112.     </div> <!-- container div end here -->
  113.     <?php if($wl_theme_options['google_map_on_contact']=='on') {
  114.         $google_maps = $wl_theme_options['google_maps'] . "&amp;t=m&amp;z=9&amp;output=embed";
  115.         ?>
  116.     <div class="enigma_google_map">        
  117.         <iframe width="100%" scrolling="no" height="500" frameborder="0" src="<?php echo $google_maps; ?>" marginwidth="0" marginheight="0"></iframe>  
  118.     </div>
  119.     <?php } ?>
  120.    
  121. </div> <!-- contact area div end here -->
  122.    
  123.    
  124.    
  125.  <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment