Guest User

Untitled

a guest
May 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.19 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="enquiry_send_massage" style="display:none;">
  22. <div class="callout-box callout-box2 clearfix">
  23. <div class="callout-content">
  24. <h2><?php _e('Query successfully submit','weblizar'); ?></h2>
  25. </div>
  26. </div>
  27. </div>
  28. <div id="weblizar_form">
  29. <form role="form" method="POST" action="#">
  30. <div class="enigma_form_group">
  31. <label for="exampleInputEmail1"><?php _e('Name','weblizar'); ?><small>*</small></label>
  32. <input type="name" name="user_name" id="user_name" class="enigma_con_input_control">
  33. <span id="contact_name_error" style="display:none;color:red;"><?php _e('Fill your name','weblizar'); ?></span>
  34. </div>
  35. <div class="enigma_form_group">
  36. <label for="exampleInputPassword1"><?php _e('Email','weblizar'); ?><small>*</small></label>
  37. <input type="email" id="user_email" name="user_email" class="enigma_con_input_control">
  38. <span id="contact_email_error" style="display:none;color:red;"><?php _e('Fill your email','weblizar'); ?></span>
  39. </div>
  40.  
  41. <div class="enigma_form_group">
  42. <label for="exampleInputPassword1"><?php _e('Message','weblizar'); ?></label>
  43. <textarea class="enigma_con_textarea_control" name="user_message" rows="5"></textarea>
  44. <span id="contact_user_massage_error" style="display:none;color:red;"><?php _e('Fill your Text massage','weblizar'); ?></span>
  45. </div>
  46.  
  47. <div class="enigma_form_group">
  48. <label for="exampleInputPassword1"><?php _e('GDPR Agreement','weblizar'); ?></label><br>
  49. <input type="checkbox" name="data_protection" value="data_protection" required> I consent to having this website store my submitted information so they can respond to my inquiry <br>
  50. <span id="contact_user_massage_error1" style="display:none;color:red;"><?php _e('Please select','weblizar'); ?></span>
  51. </div>
  52.  
  53. <button class="enigma_send_button" type="submit" name="query_submit" id="query_submit"><?php _e('Send Message','weblizar'); ?></button>
  54. </form>
  55. </div>
  56.  
  57. </div>
  58. <?php
  59. if(isset($_POST['query_submit']))
  60. { if($_POST['user_name']==''){
  61. echo "<script>jQuery('#contact_name_error').show();</script>";
  62. } else
  63. if($_POST['data_protection']=='') {
  64. echo "<script>jQuery('#contact_user_massage_error1').show();</script>";
  65. } else
  66. if($_POST['user_email']=='') {
  67. echo "<script>jQuery('#contact_email_error').show();</script>";
  68. } else
  69. if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $_POST['user_email'])) {
  70. echo "<script>jQuery('#contact_email_error').show();</script>";
  71. } else
  72. if($_POST['user_message'] ==''){
  73. echo "<script>jQuery('#contact_user_massage_error').show();</script>";
  74. }
  75. else
  76. { $email = get_option('admin_email');
  77. $subject = "You have new enquiry form".get_option("blogname");
  78. $massage = stripslashes(trim($_POST['user_message']))."Message sent from Name:" . trim($_POST['user_name']). "<br>Email :". trim($_POST['user_email']);
  79. $headers = "From: ".trim($_POST['user_name'])." <".trim($_POST['user_email']).">\r\nReply-To:".trim($_POST['user_email']);
  80. $enquerysend =wp_mail( $email, $subject, $massage, $headers);
  81.  
  82. echo "<script>jQuery('#weblizar_form').hide();</script>";
  83. echo "<script>jQuery('#enquiry_send_massage').show();</script>";
  84. }
  85. }
  86. ?>
  87. <div class="col-md-6 enigma_contact_info">
  88. <ul><?php if($wl_theme_options['phone_number_text']!='') { ?>
  89. <li>
  90. <i class="fa fa-phone"></i><span class="text">
  91. <span class="desc"><?php echo $wl_theme_options['phone_number_text']; ?></span>
  92. <?php if($wl_theme_options['contact_phone_no']!='') { echo _e($wl_theme_options['contact_phone_no'],'weblizar');} ?>
  93. </span>
  94. </li>
  95. <?php }
  96. if($wl_theme_options['general_info_text'] !='') { ?>
  97. <li>
  98. <i class="fa fa-envelope"></i><span class="text">
  99. <span class="desc"><?php echo $wl_theme_options['general_info_text']; ?></span>
  100. <?php if($wl_theme_options['contact_email']!='') { echo _e($wl_theme_options['contact_email'],'weblizar'); }?>
  101. </span>
  102. </li>
  103. <?php }
  104. if($wl_theme_options['work_time_text'] !='') { ?>
  105. <li>
  106. <i class="fa fa-clock-o"></i><span class="text">
  107. <span class="desc"><?php echo $wl_theme_options['work_time_text']; ?></span>
  108. <?php if($wl_theme_options['work_time']!='') { echo _e($wl_theme_options['work_time'],'weblizar');} ?>
  109. </span>
  110. </li>
  111. <?php }
  112. if($wl_theme_options['where_we_are_text'] !='') { ?>
  113. <li>
  114. <i class="fa fa-map-marker"></i><span class="text">
  115. <span class="desc"><?php echo $wl_theme_options['where_we_are_text']; ?></span>
  116. <?php if($wl_theme_options['contact_address']!='') { echo _e($wl_theme_options['contact_address'],'weblizar');} ?>
  117. </span>
  118. </li>
  119. <?php } ?>
  120. </ul>
  121. </div>
  122. </div>
  123. </div> <!-- container div end here -->
  124. <?php if($wl_theme_options['google_map_on_contact']=='on') {
  125. $google_maps = $wl_theme_options['google_maps'] . "&amp;t=m&amp;z=9&amp;output=embed";
  126. ?>
  127. <div class="enigma_google_map">
  128. <iframe width="100%" scrolling="no" height="500" frameborder="0" src="<?php echo $google_maps; ?>" marginwidth="0" marginheight="0"></iframe>
  129. </div>
  130. <?php } ?>
  131.  
  132. </div> <!-- contact area div end here -->
  133. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment