Advertisement
Guest User

contact-us.php

a guest
Nov 5th, 2015
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.68 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('Message','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('Send Message','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('Query successfully submit','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.                     <li>
  86.                         <i class="fa fa-fax"></i><span class="text">
  87.                         <span class="desc">FAX Number</span>+61 2 96670993</span>
  88.                     </li>
  89.                     <?php if($wl_theme_options['general_info_text'] !='') {  ?>
  90.                     <li>
  91.                         <i class="fa fa-envelope"></i><span class="text">
  92.                         <span class="desc"><?php echo $wl_theme_options['general_info_text']; ?></span>
  93.                         <?php if($wl_theme_options['contact_email']!='') { echo $wl_theme_options['contact_email'];  } ?>
  94.                         </span>
  95.                     </li>
  96.                     <?php }
  97.                     if($wl_theme_options['work_time_text'] !='') {  ?>
  98.                     <li>
  99.                         <i class="fa fa-clock-o"></i><span class="text">
  100.                         <span class="desc"><?php echo $wl_theme_options['work_time_text']; ?></span>
  101.                         <?php if($wl_theme_options['work_time']!='') { echo $wl_theme_options['work_time'];  } ?>
  102.                         </span>
  103.                     </li>
  104.                     <?php }
  105.                     if($wl_theme_options['where_we_are_text'] !='') {  ?>                  
  106.                     <li>
  107.                         <i class="fa fa-map-marker"></i><span class="text">
  108.                         <span class="desc"><?php echo $wl_theme_options['where_we_are_text']; ?></span>
  109.                         <?php if($wl_theme_options['contact_address']!='') { echo $wl_theme_options['contact_address'];  } ?>
  110.                         </span>
  111.                     </li>
  112.                     <?php } ?>                 
  113.                 </ul>
  114.             </div>         
  115.         </div>
  116.     </div> <!-- container div end here -->
  117.     <?php if($wl_theme_options['google_map_on_contact']=='on') {
  118.         $google_maps = $wl_theme_options['google_maps'] . "&amp;t=m&amp;z=9&amp;output=embed";
  119.         ?>
  120.     <div class="enigma_google_map">        
  121.         <iframe width="100%" scrolling="no" height="500" frameborder="0" src="<?php echo $google_maps; ?>" marginwidth="0" marginheight="0"></iframe>  
  122.     </div>
  123.     <?php } ?>
  124.    
  125. </div> <!-- contact area div end here -->
  126.    
  127.    
  128.    
  129.  <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement